<< 16-07-2018 >>

00:01:53*dktb36 joined #nim
00:02:25*dktb36 left #nim (#nim)
00:02:29*dktb36 joined #nim
00:08:19*dktb36 quit (Quit: Page closed)
00:14:16*stefanos82 quit (Quit: Quitting for now...)
00:14:30FromGitter<kayabaNerve> krux02: Selling of MC never really settled really ⏎ ⏎ HTC VIVE FTW
00:14:45FromGitter<kayabaNerve> BTW, I like :=
00:15:21FromGitter<kayabaNerve> It's explicit, doesn't interfere with anything, have an accidental way to be enabled... I don't get why it's so hated. Feel free to fill me in though
00:35:28*leorize quit (Ping timeout: 256 seconds)
00:44:45*thomasross joined #nim
01:15:59*BitPuffin quit (Remote host closed the connection)
01:24:25*find0x90 joined #nim
01:42:27*jamesroseman joined #nim
01:47:47*leorize joined #nim
01:55:29*leorize quit (Ping timeout: 260 seconds)
01:57:12*endragor joined #nim
02:01:52*find0x90 quit (Quit: find0x90)
02:05:59*find0x90 joined #nim
02:07:38*find0x90 quit (Client Quit)
02:40:45*vivus quit (Quit: Leaving)
03:09:21*dddddd quit (Remote host closed the connection)
03:12:10FromDiscord<2vg> Is it impossible for Nim's current GC to implement a lock free queue?
03:12:10FromDiscord<2vg> Have anyone implemented it?
03:24:57cornfeedhoboi am just getting started, so pardon the silly question, but what does the asterisk signify when defining an object? e.g. Foobar* = object
03:29:00cornfeedhobodoes it mean every attribute in the object is exported?
03:29:32FromGitter<Quelklef> My understanding is that I means that the object itself is exported
03:29:38FromGitter<Quelklef> field are also exported via `*`
03:29:53FromGitter<Quelklef> ```type MyObj* = object ⏎ exported*: int ⏎ hidden: int``` [https://gitter.im/nim-lang/Nim?at=5b4c113195e03e3d7b511bf5]
03:43:07FromGitter<Varriount> 2vg: Do you mean, does the GC use a lock-free queue, or can it support the use of a lock-free queue
03:44:52*benjikun joined #nim
03:45:23benjikunhttps://stackoverflow.com/questions/51354244/using-the-standard-module-parsexml-how-do-i-parse-xml-through-a-plain-strings
03:45:26benjikuncan anyone help me with this?
03:45:29benjikunnewbie
03:51:22*leorize joined #nim
03:59:40*rockcavera joined #nim
04:00:49CodeVanceI need to convert a cstring to a array of cuchar
04:01:53CodeVancekayabaNerve nimble install nimspice XP
04:02:06CodeVance@kayabaNerve
04:21:46FromDiscord<2vg> Varriount: can it support the use of a lock-free queue.
04:21:47FromDiscord<2vg> for example, msqueue
04:35:30*xylef joined #nim
04:45:01FromGitter<kayabaNerve> CodeVance: What's up with the ping?
04:45:23CodeVanceyou said you like :=
04:46:02FromGitter<kayabaNerve> Yeah. In Python. Do you also offer `while line := file.readLine():`?
04:46:22FromGitter<kayabaNerve> I've heard of nimspice. Macros to improve the language, right? Just like spice?
04:46:38FromGitter<kayabaNerve> And cstring to array of cuchar? Can't you cast the addr of string[0]
04:46:38CodeVancelike sugar
04:46:41CodeVancespice
04:47:34CodeVanceI'm not really familar with C but I'm guessing
04:48:07CodeVanceI'm trying to convert a font through using freetype and freeimage into a bitmap
04:48:17CodeVanceI still have a lot to learn :(
04:49:00*xylef quit (Quit: WeeChat 2.2)
04:49:20*donlzx quit (Remote host closed the connection)
04:49:43FromGitter<kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4c23e7c02eb83d7c7aae47]
04:49:54FromGitter<kayabaNerve> You do have to use ptr array but that compiles and prints e
04:51:59CodeVanceThe other thing is I can't cast it to a bound array
04:52:06CodeVanceI don't know the length beforehand
04:52:39FromGitter<kayabaNerve> array[0
04:53:21FromGitter<kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/Wallet/PrivateKey.nim#L24
04:53:24*Lord_Nightmare quit (Ping timeout: 260 seconds)
04:53:51FromGitter<kayabaNerve> https://github.com/kayabaNerve/Ember/blob/master/src/lib/RNG.nim#L5
04:54:08FromGitter<kayabaNerve> I mean, it's not memory safe... Maybe use a seq?
04:54:20FromGitter<CodeDoes> I don't care for memory safety
04:54:25FromGitter<kayabaNerve> DUN DUN DUN
04:54:31FromGitter<CodeDoes> What is memory safety?
04:54:36FromGitter<CodeDoes> Its a small program
04:54:43FromGitter<CodeDoes> It shouldn't have to matter
04:55:57FromGitter<CodeDoes> Thanks btw
04:56:53*donlzx joined #nim
05:00:14*Lord_Nightmare joined #nim
05:01:57*jamesroseman quit (Ping timeout: 240 seconds)
05:11:27*brainproxy quit (Ping timeout: 240 seconds)
05:22:08*nsf joined #nim
05:22:08*brainproxy joined #nim
05:33:37*jamesroseman joined #nim
05:38:38*jamesroseman quit (Ping timeout: 244 seconds)
05:40:01*xylef joined #nim
06:21:26FromGitter<alehander42> ah raww pointers :D
06:21:41FromGitter<kayabaNerve> @alehander42 so cute, right?
06:21:49FromGitter<kayabaNerve> Mine just threw a segfault!
06:21:56FromGitter<kayabaNerve> I hear it's normal at his age though
06:31:41*def- quit (Quit: -)
06:33:08*def- joined #nim
07:12:40*Vladar joined #nim
07:21:46*jamesroseman joined #nim
07:26:35*jamesroseman quit (Ping timeout: 240 seconds)
07:34:30*Amun_Ra quit (Quit: brb)
07:36:09*Amun_Ra joined #nim
07:55:58*PMunch joined #nim
08:04:32*ftsf joined #nim
08:04:42*ftsf quit (Client Quit)
08:39:53*ng0 joined #nim
09:01:12*jamesroseman joined #nim
09:06:32*jamesroseman quit (Ping timeout: 268 seconds)
09:11:31*Vladar quit (Quit: Leaving)
09:17:42*brainproxy quit (Read error: Connection reset by peer)
09:19:21*brainproxy joined #nim
09:20:58FromGitter<mratsim> @tim-st regarding your question for this https://github.com/status-im/nim-rocksdb/blob/840d470eb9f0bd8115d26ee66017d4bc20197c7e/rocksdb.nim#L138, I’m not sure, it suppose it depends if addr emptyString[0] now returns nil or not
09:23:03FromGitter<mratsim> @kaushalmodi for https://github.com/FedeOmoto/bignum I think the dev only passed c2nim on GMP include file. Alternatively you can use this: https://github.com/status-im/nim-decimal
09:27:22FromGitter<tim-st> @mratsim ok, I think line138 works, but not line122
09:39:33PMunchIs there a way to accept from 0..3 varargs but not more, with a compile-time check?
09:44:48FromGitter<tim-st> when you want a compileTime check I assume your varargs[T] can be static[varargs[T]] and then do a len check
09:44:59FromGitter<tim-st> with `when`
09:48:23*krux02 joined #nim
09:52:16FromGitter<tim-st> proc test(v: static[varargs[int]]) = ⏎ when v.len > 3: ⏎ ⏎ ```{.fatal: "v.len > 3".}``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5b4c6ad0866e0c6b15b05f0b]
09:53:00PMunchWell, I don't really need the information in it to be static
09:53:07PMunchOnly the count
09:55:58FromGitter<tim-st> Seems that varargs[T] cannot be static without `[t1, t2,...]` is it a bug?
09:58:36FromGitter<tim-st> yes: https://github.com/nim-lang/Nim/issues/1083
10:00:59FromGitter<mratsim> @PMunch: static: assert args.len > 3 or args.arity?
10:02:29FromGitter<tim-st> isnt `assert` checked at runtime?
10:02:41FromGitter<tim-st> yes, just tested t
10:02:43FromGitter<tim-st> *it
10:03:19FromGitter<tim-st> ah together with static it works
10:03:24FromGitter<tim-st> good to know :)
10:04:50PMunchmratsim, oh nice. Thanks
10:05:50PMunchHmm, I get I "Can't evaluate on compile-time" error
10:07:15FromGitter<mratsim> mmm, seems like arity doesn’t exist for varargs
10:07:40FromGitter<mratsim> and static requires everythign to be known at compile-time
10:08:20FromGitter<mratsim> also since varargs can also match seq, arity is not always known at compile-time
10:10:32FromGitter<mratsim> @PMunch you wrap that in a macro that accepts varargs\[untyped\] and do the count within the macro
10:12:22PMunchYeah that's what I was thinking as well
10:12:33PMunchI was just wondering if there was a built in way
10:12:59FromGitter<mratsim> —> Feature request ;) I would find that useful as well
10:14:57*xylef quit (Ping timeout: 240 seconds)
10:17:14FromGitter<tim-st> isnt static[varargs[T]] exactly the same as static[openArray[T]] ?
10:17:37FromGitter<mratsim> no, varargs can match foo(1, 2, 3, 4)
10:17:43FromGitter<tim-st> besides the way you call it
10:17:55FromGitter<tim-st> the docs say it's internally translated to an array
10:17:56FromGitter<Varriount> Also, varargs allows conversion procedures
10:18:42FromGitter<mratsim> yes AST wise it’s transformed into an array, or a pointer (if input was a seq)
10:19:07krux02I recommend to use openArray entirely, no varargs.
10:19:12FromGitter<tim-st> so if calling it like an array is ok `static[openArray[T]]` already works together with static assert
10:19:33krux02with openarray the conversion to an array is more visible
10:19:42FromGitter<tim-st> yes, think so too
10:19:48krux02the the syntax overhead is minimal
10:20:44krux02also, with openArray it is obvious how to pass a seq/array
10:24:22krux02Araq: can you merge gdb pretty printers now? https://github.com/nim-lang/Nim/pull/8263
10:24:24*BitPuffin joined #nim
10:24:44krux02I would like the have the gdb start script available on my other development branches as well.
10:28:05*stefanos82 joined #nim
10:44:03*xet7 joined #nim
10:49:21*jamesroseman joined #nim
10:53:57*jamesroseman quit (Ping timeout: 240 seconds)
10:57:00*ng0 quit (Quit: Alexa, when is the end of world?)
10:59:46*xylef joined #nim
11:04:15*dddddd joined #nim
11:05:17FromGitter<Varriount> krux02: Nice work on the GDB stuff! Any other improvements in the works?
11:14:09Araqkrux02: why would I merge it? you didn't fix what I remarked
11:19:33stefanos82Araq, out of curiosity: has anyone ever tested the generated code with a fuzzer to check how secured it is?
11:20:59Araqnot sure what that means.
11:21:15*nsf quit (Quit: WeeChat 2.1)
11:22:23stefanos82Araq: to check the security of the C or C++ code Nim generates.
11:22:31stefanos82for instance, with this program http://lcamtuf.coredump.cx/afl/
11:25:47*jamesroseman joined #nim
11:28:28krux02Araq: That is interesting I was sure I did make the change, but probably the push failed or something
11:30:30krux02Araq: one question to NI
11:30:35*jamesroseman quit (Ping timeout: 240 seconds)
11:31:52krux02yes NI is probably what long is in C
11:32:04krux02but int is still the name it is referred to in nim
11:32:35krux02I think the closed C type would be intptr_t but that is from stdint.h and it is optionally defined
11:36:06Araqah so there are Nim names
11:36:14Araqmaybe the code should say that then
11:36:19Araq*these are
11:38:33krux02Araq you have a point though. When I just say "this is an int" it might be confusing
11:38:40krux02because the type mapping isn't complete
11:38:49krux02many types are mapped, many are not
11:39:06krux02so it is always a mix of nim names and generated names in the C backend.
11:39:14krux02I just try to map to nim names where I can
11:39:59krux02but the int might be very confusing, because the same you you mixed it up, a person might mix up the type `int` that comes from the c namespace and the type `int` that comes from the nim namespace.
11:40:03PMunchHmm, just updated to the latest devel and I can't create global static variables any more?
11:40:27krux02PMunch, that is intended
11:40:29FromGitter<mratsim> like let foo {.compileTime.} = 1?
11:40:36PMunchI had a static: var that a macro added things to before a final macro did something with it. But now Nim just complains that it's not possible
11:40:40krux02it was discussed in the past to enable fast compilation (cache)
11:40:51*endragor quit (Remote host closed the connection)
11:40:58FromGitter<mratsim> @PMunch use var foo {.compileTime.} instead
11:41:08PMunchOh nice
11:41:17PMunchCan I do the same with types?
11:41:34PMunchNope..
11:41:35FromGitter<mratsim> types are always created at compile-time though
11:41:44FromGitter<mratsim> ah you mean type alias?
11:42:07krux02just changing the way how you create global static variables won't save you from the general change that global static variables are about to disappear from Nim
11:43:23PMunchYeah I have this: type defTuple = tuple[handler: NimNode, kind: NimNode]
11:43:29PMunchWhich before was in my static block
11:43:38krux02PMunch, why don't you use const and initialize it with a {.compileTime.} proc?
11:43:43FromGitter<mratsim> you can declare it outside
11:43:46PMunchI guess you won't be able to use it anyways..
11:43:56FromGitter<mratsim> you can
11:44:10PMunchkrux02, but why?
11:44:19PMunchAnd how can I make this macro still work then..
11:44:28krux02which macro?
11:44:50FromGitter<mratsim> I don’t mind changing static: var foo ==> var foo {.compileTime.} but global compile time variable are useful
11:45:12krux02I know they are useful
11:45:15FromGitter<mratsim> @PMunch, declare the type outside of the static block: https://github.com/mratsim/Arraymancer/blob/master/src/nn_dsl/dsl_types.nim#L14
11:45:36PMunchkrux02, a small macro I made to more easily create X event loops: http://ix.io/1hmP/
11:46:02PMunchhttp://ix.io/1hmP/Nim if you would like syntax highlighting
11:47:23FromGitter<mratsim> @PMunch, maybe you can find some inspiration here: https://github.com/status-im/nimbus/blob/4b5eada3222fbfa5780602b42ad27816990aca4d/nimbus/vm/interpreter_dispatch.nim#L18
11:47:35FromGitter<mratsim> it used to be a static block
11:49:25PMunchWell it works fine to just annotate my variable as compileTime, but if what krux02 says is true, and compile-time global variables won't be possible in the future it will completely break how the macro works..
11:51:22FromGitter<mratsim> I’d like more info on that as well. ⏎ ⏎ That would mean that Table\[Foo, NimNode\], tuple\[bar, baz: NimNode\] can only exist within a macro scope
11:51:48Araqnot true, read the RFC
11:52:04Araqbut you need to use the macrocache API
11:52:45*xylef quit (Ping timeout: 256 seconds)
11:55:13PMunchWhich one?
11:55:28FromGitter<mratsim> this I suppose: https://github.com/nim-lang/Nim/issues/7874#issuecomment-395686265
11:56:40*Vladar joined #nim
12:00:11*cspar joined #nim
12:00:25PMunchRight..
12:13:03krux02Araq: can you close this: https://github.com/nim-lang/Nim/issues/6528#issuecomment-405222296
12:13:18krux02I think it is clear the openArray won't become a concept in the near future
12:15:28*fvs` joined #nim
12:25:05PMunchHow do I set a compilation option in the nim.cfg?
12:34:22*floppydh joined #nim
12:36:28dom96Same way as you do on the command line
12:38:16PMunchI couldn't get it to work..
12:39:41PMunchnim.cfg(1, 21) Error: expected identifier, but got: :
12:40:03PMunchAnd nim.cfg is just a single line: -d:chronicles_sinks:textlines
12:40:56Araq -d:chronicles_sinks=textlines
12:42:31krux02Araq: what should I do for the gdb type map?
12:42:51krux02should I prefix the names with "nim::"?
12:43:31AraqI would prefix the C names with "c."
12:43:44Araqor without the dot, 'cint' is clear.
12:44:06krux02well I have no influence on the C names
12:44:18krux02I have only influence on the names for nim types
12:45:58PMunchAraq, nim.cfg(1, 21) Error: expected identifier, but got: =
12:46:46Araqwell either this is about debugging Nim code or it's about something else.
12:46:59Araqseems like it's about something else.
12:50:41krux02Araq: gdb is about debugging C programs, but it supports lots of other things for higher level languages, such as collections.
12:51:01krux02I lot of things could also be done with emitting the right kind of debug information
12:51:48krux02so gdb thinks all the time it is debugging a c program
12:52:24krux02and there are regular expressions for types that say, "ah! i know this type, it is a type defined in the Nim programming languages, and this is how it is called and these are the children"
12:56:57krux02but this type map is totally incomplete. Therefore it will always be a hybrid of types that are already properly mapped and types that a raw C type names
12:57:13krux02and I can asy, it is pretty good already.
13:03:32*endragor joined #nim
13:05:55FromGitter<alehander42> I have some logic that analyses with python c types and tries to construct a reps
13:06:04FromGitter<alehander42> Of the original nim type
13:06:20FromGitter<alehander42> Representation *
13:07:24krux02alehander42: I have that, too‽
13:07:58FromGitter<alehander42> Then why
13:08:09FromGitter<alehander42> Ops, phone gutter is hard
13:08:19FromGitter<alehander42> Gitter * ugh
13:08:43krux02then use irc
13:08:50krux02it's much better
13:08:57FromGitter<alehander42> Ok I was under the impression that you can't map some types
13:09:00FromGitter<alehander42> Back
13:09:13Yardanicokrux02, it's just that gitter website sucks on mobile devices
13:09:17krux02(I have no idea, I am just claiming)
13:09:23Araqkrux02: nim produces .ndi files
13:09:59FromGitter<narimiran> PMunch: no need for `-` in .cfg, you just need to have e.g. `define:"blas=cblas"`
13:10:00FromGitter<alehander42> Btw I remember nim could emit some info mapping hashes to signatures
13:10:16FromGitter<alehander42> And this was very useful for some debugging purposes
13:10:42krux02Araq: what are the ndi files doing?
13:11:00FromGitter<alehander42> Is it under a flag
13:11:18FromGitter<narimiran> i get why there isn't seq-unpacking, but can we have array-unpacking please?
13:11:35Yardanicoyou can write a simple macro, in fact I already have it :)
13:11:50Yardanicoit works for both seqs/arrays
13:11:54Yardanicoand tuples probably too
13:12:02FromGitter<narimiran> i'm still afraid of macros!
13:13:23Yardanicohttps://gist.github.com/Yardanico/b6fee43f6da8a3bbf0fe048063357115
13:13:52*jamesroseman joined #nim
13:14:21Araqhttp://www.codersnotes.com/notes/something-rotten-in-the-core/
13:14:22krux02Araq, I see, I just looked at the ndi file
13:14:28krux02looks usable
13:15:47krux02I am just not sure how I can gather all generated ndi files
13:15:57krux02it looks like the information is a bit scattered
13:17:14Araqnimcache/*.ndi
13:18:16Araqbut to answer your question, use 'system.int' then, that's clearly a Nim thing
13:18:57*jamesroseman quit (Ping timeout: 248 seconds)
13:18:59krux02Araq: i just did exactly that.
13:19:06krux02and thanks
13:19:30FromGitter<alehander42> @miran macros are easy, if you write the destructure
13:19:42FromGitter<alehander42> One youll start to love them
13:20:14PMunchThanks @narimiran, this works: define:"chronicles_sinks=textlines"
13:23:46FromGitter<narimiran> @alehander42 heh, i might take a dive into macros on my holidays....
13:24:42PMunchThey're quite addictive once you get started :P
13:30:05*Vladar quit (Quit: Leaving)
13:32:14FromGitter<tim-st> When I try to `spawn` a proc in a loop it tells me it's not gc safe, what's the definition of that?
13:32:40FromGitter<tim-st> (it opens files)
13:33:35Yardanicomaybe it accesses some global variables
13:33:37Yardanicomaybe it changes them
13:33:44*cspar quit (Ping timeout: 260 seconds)
13:34:14FromGitter<tim-st> I call a local proc dunno what goes on behind in stdlib
13:34:42FromGitter<tim-st> it seems `htmlparser.loadHtml` cannot be spawn
13:36:19*endragor quit (Remote host closed the connection)
13:37:39Araqtim-st: that's a stdlib bug then, I think
13:38:55FromGitter<tim-st> Are there any procs that never can be spawn?
13:38:58*mike_oalian joined #nim
13:39:22FromGitter<tim-st> the spawned proc openes a file, maybe this is not good
13:41:22krux02Araq: I think the gdb pretty printers are ready to merge
13:41:30krux02I will not use the ndi files for now.
13:41:38krux02That can be a later pull request.
13:41:41*Vladar joined #nim
13:42:35krux02And I think if if wouldn't be a better idea to put the ndi contend into a section of the binary, because the nimcache directory is not always available.
13:48:30*PMunch quit (Quit: Leaving)
13:52:58FromGitter<tim-st> the compiler says `htmlparser.untilElementEnd` is the root of the problem and not gc safe
13:59:42*nixfreak joined #nim
14:00:25nixfreakHas anyone created or no of decentralized apps made using nim ?
14:01:14Araqhttp://www.codersnotes.com/notes/command-and-vector-processors/
14:01:57Araqnixfreak: what's a decentralized app? a married bachelor?
14:03:22*nsf joined #nim
14:03:30*jamesroseman joined #nim
14:05:28nixfreakdecentralize - meaning the app and data are local but connect to multiple nodes , no centralize server
14:06:25nixfreakhttps://github.com/DavidJohnstonCEO/DecentralizedApplications#definition-of-a-dapp
14:06:54nixfreakusing p2p protocols like ipfs (interplanetary file system)
14:16:02Araqpretty sure an app can't be decentralized, a system can be, but it's probably hair splitting.
14:16:27Araqp2p protocols in Nim? No idea.
14:17:02krux02Araq: I just read your article about the Amiga.
14:17:39krux02The amiga surely was cool. But using every bit and hack on a system for the last bit of performance surely doesn't make very portable applications.
14:18:10krux02the programs would run on the Amiga, but future hardware would have struggle running it, because it isn't exactly the same.
14:18:50krux02and you can't always upgrade a system by adding more hardware, but keeping everything they ever put in in the past.
14:20:08krux02I like to write my application in OpenGL, even if it is not maximum performance, when I can be (relatively) sure that a new Hardware chip for rendering won't break the program.
14:25:50Araqit's not about "the last bit of performance", it is about control. not to be confused with "controls". http://www.codersnotes.com/notes/controls/
14:26:10*TheLemonMan joined #nim
14:26:12Araqit's an excellent blog.
14:26:58TheLemonManA brief publicity stunt, if you like microbenchmarks give this a try https://github.com/LemonBoy/criterion.nim :) (it's also my first piece of nim beside the work on the compiler so feel free to criticize it)
14:27:27FromGitter<mratsim> @nixfreak, @gogolxdong is using Nim and IPFS
14:27:30*TheLemonMan quit (Client Quit)
14:30:04Yardanicoipfs looks cool btw, but it's only about decentralization (not about anonymity) which is cool anyway
14:31:40FromGitter<mratsim> I think Swarm is getting a lot of mind share now: https://swarm-guide.readthedocs.io/en/latest/, there are PR in Go, I couldn’t find a C implementation for bzz (the swarm CLI client)
14:33:33nixfreak@mratism do you know how gogolxdong is calling ipfs from nim?
14:34:05krux02Araq: OpenGL is horrible in your term of "controls" it is full of controls and maks simple things incredibly hard.
14:34:23krux02that is why I am developing my `opengl
14:34:29krux02sandbox
14:34:37krux02(I need a new name for that)
14:34:46krux02to make use of the GPU simpler.
14:35:09krux02But there are a few key elements in the OpenGL pipeline that make it very portable.
14:35:43krux02one of them is that the shaders that are executed on th GPU are defined in a high level language (kind of).
14:35:57krux02There is no assembly instruction set to run on the gpu.
14:36:28*mike_oalian quit (Quit: mike_oalian)
14:36:46krux02then a compiler in the gpu driver can compile the shader to explicit GPU instructions that can eveb be different for every revision of the GPU.
14:38:00krux02so unlike CPU that all need to be compatible with old instruction sets GPU can come up with a completely new instruction set on every new GPU and it will just work (if they provide a working shader compiler in the driver)
14:39:02krux02All I want to do is take away controls, and provide control.
14:39:15Araq:-)
14:41:02FromGitter<mratsim> @nixfreak check the conversion from this day, not sure if it will help you much but that’s a starter: https://irclogs.nim-lang.org/02-05-2018.html
14:41:16FromGitter<mratsim> conversation*
14:41:45krux02Araq: can you now merge the gdb pretty printer branch?
14:41:49nixfreak@mratsim I just had a look at his repos didn't find anything , thanks for the link
14:42:03FromGitter<mratsim> because he is using it for work
14:42:17*donzx joined #nim
14:45:02*donlzx quit (Ping timeout: 276 seconds)
14:45:56nixfreakhttps://gist.github.com/gogolxdong/aa58f6f52cba398389c9a71aa53ac1b4 -- > I see he's trying to compile a merkel tree
15:06:40krux02http://www.codersnotes.com/notes/the-lost-program/
15:06:42krux02I like this
15:07:43*FromGitter quit (Remote host closed the connection)
15:07:51*FromGitter joined #nim
15:09:12krux02maybe that story is true. Maybe inventing a programming language is like making a flat map of the world without distortions.
15:10:00krux02and when you make a new map, the map will have less distorion in the area that you come from, but more in the areas that you don't care about
15:10:56*miran joined #nim
15:11:10FromDiscord<treeform> that is a good analagy
15:13:10FromGitter<Quelklef> Any way to pass arguments to `nimble test`?
15:13:20FromGitter<Quelklef> `--noNimblePath` is breaking an import for some reason
15:13:21krux02nimble test arg
15:13:23krux02maybe?
15:13:30FromGitter<Quelklef> Nope, doesn't seem to work
15:13:53krux02Quelklef: did you try to read the source of nimble?
15:14:06FromGitter<Quelklef> I can
15:14:15krux02reading the source code of something often reveals a lot of information that unlike documentation is never outdated
15:14:25FromGitter<Quelklef> I figured that since there's no documented way, and `nimble test <stuff>` seems to be a noop, there's no way
15:14:29FromGitter<Quelklef> Ah, I'll look
15:14:44FromGitter<Quelklef> but rather I was looking for any solution to get `nimble test` to run without `--noNimble Path`
15:16:28krux02the more I work with nimble the less I like it. It seems to be a constant source of issues.
15:16:44FromGitter<Quelklef> Yikes
15:16:53FromGitter<Quelklef> I like it because I like(d) how `nimble test` is set up
15:17:30krux02I used CMake and Sbt (scala), and I hate both
15:17:41krux02so nimble is still above them
15:18:29krux02cmake just circumvents explaining you how it works, and gives you thousands of controls
15:18:42FromGitter<Quelklef> I wonder if I should just make a `test.sh` in `tests/`
15:18:44krux02and sbt well it has a nice default config
15:18:51krux02so no config at all, and you can build your project
15:18:59krux02just by putting things in the right folder
15:20:24krux02but as soon as you have to do anything in the sbt files, it is like cmake. It just circumvents successfully to give you relevant information and then givets you thousands of controls that you don't want to know about.
15:20:51FromGitter<Quelklef> Which ones do you like?
15:21:32krux02the build system of Go
15:22:10FromGitter<Quelklef> echhhhh
15:22:12FromGitter<Quelklef> Go is so weird
15:22:40dom96krux02: what issues are you having with Nimble?
15:23:26FromGitter<Quelklef> I wonder how Go would have panned out if it weren't a Google project
15:25:47krux02dom96: I did not intent to trigger you. But there are a few issues.
15:26:25krux02for example releasing a package and bumping the version is too much of a hassle.
15:27:01krux02I would like that just uploading on github or bitbucket alone would be enough
15:27:09krux02no official packages list.
15:27:37dom96So you'd rather everyone specifies the Git URL?
15:28:02krux02go allows to import a packgae from an url, so that github isn't a must for packages.
15:28:31krux02yes git url
15:28:41Yardanicoisn't it already possible to use git url's?
15:28:45Yardanicoor only github urls?
15:29:04krux02Yardanico, you need to be in the packages list
15:29:15krux02I would like to make the central packages list obsolete.
15:29:24dom96Nope
15:29:25krux02A completely decentralized packages manager.
15:29:32dom96You can use git/hg URLs
15:29:43dom96The package list is currently completely optional
15:30:04krux02but it is required for nimble search, isn't it?
15:30:37dom96Of course
15:30:57dom96How does Go's search work?
15:31:08krux02well you just go to github and search there
15:31:31dom96Mmmhm
15:31:42dom96So Nimble already wins :P
15:31:51FromGitter<vendethiel> People often talk about Go's package system as the worst "feature" of the language...
15:32:43dom96There are plenty of features that Nimble is still missing, but I really don't agree that this is an issue.
15:32:48krux02dom96: https://gowalker.org/
15:32:58Araqmy nimble still says "what?" from time to time
15:34:26krux02vendethiel: go's package system doesn't solve versioning for you at all
15:34:42krux02it always take the master of the project
15:34:57krux02and some people just can't deal with that
15:35:02dom96So write a nimwalker.org website
15:35:41Araqyeah, we need an NP complete graph dependency solver, when has that ever failed us?
15:35:42Yardanicodom96, isn't that the same as nimble.directory ?
15:35:49Yardanico"Go Walker is a server that generates Go projects API documentation on the fly for the projects on GitHub."
15:35:56dom96"for projects on GitHub"
15:36:04Yardanicoyeah, but that can be easily changed
15:36:04dom96so it probably scans GitHub for Go projects
15:36:14krux02yes it does
15:36:21Yardanicothe thing is - not all nim packages follow nimble project structure
15:36:27Yardanicobecause you're not required to
15:36:28FromGitter<vendethiel> Araq: if your dep manager isn't even a potent SAT solver, can it even manage?
15:36:40FromGitter<tim-st> is it normal that when I use spawn in a loop and sync that it uses big amounts of increasing ram?
15:37:05Araqtim-st: maybe :-)
15:37:49krux02Yardanico, that is the next criticism about nimble
15:37:56FromGitter<tim-st> ah, ok, maybe the for loop runs over all files reads it in memory or at least a bit and saves this in a thread pool which used like 800mb ram
15:38:00krux02the wonky project structure definition
15:38:11Yardanicokrux02, the thing is - Nim didn't have a ONE FORCED project structure
15:38:12Araqvendethiel: here is a good rule of thumb: stay away from graphs. ;-)
15:38:13Yardanicogo has AFAIK
15:38:16krux02I would really like to have i root.nimble
15:38:22krux02or nimble.nimble
15:38:28Araqkrux02: it's not wonky at all IMO.
15:38:38Araqtook some time to understand its ways though.
15:38:41dom96What's wonky about it?
15:38:46krux02it feels wonky for me, but I am not very deep into nimble
15:39:06*Trustable joined #nim
15:40:05krux02dom96: look at this project here https://github.com/krux02/turnt-octo-wallhack
15:40:12krux02it is my project (dead by now)
15:40:21krux02it did not follow any project structure at all
15:40:31krux02it doesn't have a project file
15:40:34krux02there is just a main
15:40:45krux02and still everything just works
15:40:58krux02it is even on gowalker
15:41:02krux02https://gowalker.org/github.com/krux02/turnt-octo-wallhack/particles
15:41:11krux02I didn't do anything to make this work
15:41:25krux02it is simply a very robust system that you can't screw up
15:41:34FromGitter<tim-st> another question: when I use shared memory like a table and I write k, v in parallel can something bad happen, when I know that each v is unique for each k when threads write at same time?
15:41:37krux02or at least it is very compatible with my way of thinking about a project
15:41:56krux02tim-st: yous
15:41:57*FromGitter quit (Read error: Connection reset by peer)
15:41:58krux02yes
15:42:06*FromGitter joined #nim
15:42:08FromGitter<tim-st> does it work without locking? or can I get this SIG memory issues?
15:42:14dom96krux02: When you can write "import <git_url>" then that's possible
15:42:19dom96But Nim doesn't support this
15:43:42krux02tim-st: you have shared memory that you want to write to. of course you need to lock.
15:43:58krux02you can't expect a write operation to be atomic
15:44:27FromGitter<tim-st> krux02: ah ok of course, so internally it could break at 50% memory written
15:44:28krux02the only think that you can do from multiple threads without locking is pure read access.
15:44:43FromGitter<tim-st> ok, thanks
15:44:43krux02but as soon as one thread is allowd to write to it, locking is necessary.
15:44:49krux02even for the readers
15:45:02FromGitter<tim-st> ok, thanks!
15:45:08krux02because you don't want have written values
15:45:09FromGitter<tim-st> makes sense
15:46:03FromGitter<tim-st> or can a language define atomic operations?
15:46:10krux02tim-st: but try to avoid writing to shared memory.
15:46:23krux02locking is something that can easiliy fuck up.
15:46:31FromGitter<tim-st> I think I avoid spawn at all, it wasnt much quicker
15:46:47FromGitter<tim-st> used betwenn 2% and 40% cpu 90% it was at 5%
15:47:05krux02multithreading shouldn't be your first address for performance boost anyway
15:47:22FromGitter<tim-st> yes, I know, but I have 20k files to parse
15:47:24krux02try to optimize your loop and memory locality
15:47:39krux02you can do a lot of optimizations single threaded.
15:48:16krux02a lock is just another name for bottleneck
15:48:35krux02so when you do spawn plus a bottleneck, there isn't much performance gain.
15:48:37FromGitter<tim-st> I think my code is not bad, my wiki parser parses wikipedia in like 30mins where the official php parser would need many days
15:49:00krux02that is reasonable fast
15:49:14krux02but to be fair, php isn't make for that
15:49:17Araqstart with osproc.execProcesses()
15:49:28FromGitter<tim-st> also java's parser isnt much faster
15:49:37Araqand then move from multiple processes to multiple threads when required
15:49:38krux02if I understand php correctly it is just a templating engine for html
15:49:46dom96If you have 20k files then running your parser in parallel is super trivial
15:49:54dom96just spawn multiple processes like Araq said
15:50:11krux02tim-st: you should really beat java performance
15:50:11Araqomg, no, it's an OOP language like many others, including unique quirks. tons of quirks.
15:50:13FromGitter<tim-st> is there an example of multiple processes?
15:50:25krux02Java has a big disadvantage becaues it can't use memory efficient data structures.
15:51:08dom96tim-st: just build your parser and then launch multiple processes using bash or batch or powershell (or nimscript)
15:51:20FromGitter<tim-st> well I could compile one exe and pass by cmd line which ranges it should process
15:51:32FromGitter<tim-st> but that seems a bit hacky
15:51:34dom96indeed
15:51:35Araqno, use execProcesses() to launch them
15:51:48FromGitter<tim-st> ok, thanks
15:51:59dom96You have files. You should just launch `parser.exe file1`, `parser.exe file2` etc.
15:52:18FromGitter<tim-st> I have 20k should I start 20k processes?
15:52:23FromGitter<tim-st> processes are expensive
15:52:32AraqexecProcesses() damn it.
15:52:35dom96no
15:52:35FromGitter<tim-st> my whole system has ~160
15:52:41Araqit handles all of that
15:52:48dom96You should start <number_of_cores> at a time
15:52:57FromGitter<tim-st> ok, thanks
15:54:34Araqok, let's reinvent execProcesses()
15:54:46krux02Araq: what is up with AppVeyor?
15:54:57krux02my PR is still pending
15:55:44Araqhttp://www.codersnotes.com/notes/disassembling-jak/
15:56:08Araqkrux02: probably a hickup
15:56:36krux02I already read about GOAL
16:01:28nixfreakpretty sweet INim 0.3.0 Nim Compiler Version 0.18.0 [MacOSX: amd64] at /usr/local/bin/nim
16:01:42krux02Because I heared about GOAL I was looking for a substitute that was open source.
16:01:51krux02And that substitute for me is Nim.
16:02:09krux02I think without reading about GOAL I would not have landed here.
16:03:02*jamesroseman quit (Ping timeout: 276 seconds)
16:06:23*floppydh quit (Quit: WeeChat 2.1)
16:08:38*jamesroseman joined #nim
16:13:51krux02dom96: I am sorry I really didn't want to trigger you with nimble. The problem is that currently I cant frame it precisely what I don't like about nimble. It is more a feeling of what I don't like, not something concrete.
16:14:10*jamesroseman quit (Ping timeout: 264 seconds)
16:14:42krux02I remember for vim there were many package managers around to manage your plugins. Some with more features some with fewere features.
16:14:51dom96Please gather your feelings. It's incredibly frustrating to see you telling others that you dislike Nimble and that you're not able to explain why that is.
16:15:12krux02They all worked, but they didn't nail thear job precisely.
16:15:41dom96And keep in mind that Nimble is further away from v1.0 than Nim is.
16:15:57krux02And then there was the package manager https://github.com/junegunn/vim-plug
16:16:18krux02simple easy to use. and plugin management seems to be solved once and for all.
16:16:37krux02vim plug just nailed the plugin management for vim
16:18:39krux02and nimble doesn't feel like vim plug, it feels like emacs M-x list-packages
16:18:41*jamesroseman joined #nim
16:19:55FromGitter<tim-st> I like nimble, it's easy to use like `pip`, the only thing I miss is easy devel code support, but maybe that already exists
16:20:18FromGitter<tim-st> sometimes @ head works, sometimes not
16:20:35dom96`nimble install pkg@#head`
16:20:40dom96That will always work
16:20:48krux02dom96: not on zsh
16:20:53FromGitter<tim-st> hm, ok, I thought a few days ago I tried it and it failed
16:21:04FromGitter<tim-st> and the other day it worked for another package
16:21:05dom96Yes, you may need to escape it for some shell's
16:21:07FromGitter<kaushalmodi> @tim-st You can `nimble install` *any* git repo, from any branch/tag
16:21:18krux02this @# is really confusing zsh
16:21:26FromGitter<kaushalmodi> That package doesn't ever need to be a registered nimble package
16:21:32dom96For me, if I paste it into my terminal it gets automatically escaped by zsh
16:21:42krux02yea for you
16:21:51dom96Yes, for me.
16:22:02FromGitter<tim-st> ok, will have a look from now if it always works like that :D
16:22:30krux02so you adapted your zshrc to work better with nimble?
16:22:34dom96No?
16:23:09dom96It works for me. Maybe it's thanks to oh-my-zsh, or the fact that I use a mac.
16:23:18dom96So I don't know if it works for every zsh user
16:23:25krux02I use grml
16:23:26FromGitter<kaushalmodi> For example (related to devel code and nimble), `nimble install https://github.com/kaushalmodi/bignum` works (fetched devel-compatible version of bignum) even though the official nimble version fails on devel
16:23:56nixfreakmake sure you put the ~/.nimble/bin path in order to launch your nim binaries from nimble
16:24:04*jamesroseman quit (Ping timeout: 260 seconds)
16:24:21FromGitter<tim-st> @kaushalmodi ok, thanks
16:24:35*donzx quit (Quit: Leaving)
16:25:08krux02dom96: I tested the pkg@#head again, and I don't have issues, but my memory tells me that I had to quote it
16:25:43FromGitter<kaushalmodi> krux02: May be this is off-topic, but what's the problem with M-x list-packages
16:26:45FromGitter<kaushalmodi> I always use the Emacs package management solution in positive light, but in one of your comments above it sounded that you didn't quite like it.. so curious
16:27:53ldleworkeverone should use straight.el
16:27:59ldleworkplease stop using package.el
16:28:08ldlework(for the sake of the ecosystem)
16:28:32FromGitter<kaushalmodi> ldlework: Huh?
16:28:41*jamesroseman joined #nim
16:28:52FromGitter<kaushalmodi> Is there a different Gitter room for offtopic chat?
16:30:09FromGitter<kaushalmodi> ldlework, krux02: If you guys can use Gitter, I'd love the discuss the trouble you are having with package.el at https://gitter.im/KaushalModi/Lobby
16:30:10dom96Yeah, it's called nim-twitch or something
16:30:21ldleworkkaushalmodi, i wasn't making a comment about off-topicness
16:30:30FromGitter<kaushalmodi> ldlework: I know
16:30:47ldleworkoh ok
16:30:47FromGitter<kaushalmodi> I didn't want to discuss off topic stuff here as Emacs users are in minority here :P
16:30:58krux02kaushalmodi: emacs package management is ok. It works, but it was weird to get used to in my subjective perspective.
16:30:59ldleworkkaushalmodi, #emacs on freenode irc is probably the best place
16:31:11ldleworkemacs package management was terrible for ever
16:31:18ldleworkthen it got a package management system
16:31:21ldleworkthen someone invented use-package
16:31:36ldleworkthen someone invented straight.el which is a pure package manager like Nix
16:31:36FromGitter<kaushalmodi> Is there a web-accessible way to access #you-name-it IRC?
16:31:37krux02in vim plug I just put the packages I wint in the init script and then there are a few commands that not only do verything, but they are also very visual in what they are doing
16:31:51ldleworkkaushalmodi, webchat.freenode.net
16:32:04dzho@kaushalmodi or irccloud
16:32:07ldleworkkrux02: use-package does the same thing
16:32:20krux02kaushalmodi you can use irc from within emacs
16:32:25ldleworklol true
16:33:27FromGitter<kaushalmodi> krux02: couldn't.. whatever ports are needed for that are blocked
16:33:30FromGitter<kaushalmodi> (work)
16:33:49*jamesroseman quit (Ping timeout: 256 seconds)
16:33:54krux02did you block the ports on your own?
16:34:23krux02I recommend hexchat for IRC
16:34:27*dorelix quit (Ping timeout: 240 seconds)
16:34:30FromGitter<kaushalmodi> no
16:34:33FromGitter<kaushalmodi> work sysadmins
16:34:42FromGitter<kaushalmodi> anyways on webchat, I get "#emacs Cannot join channel (+r) - you need to be identified with services"
16:34:56krux02yes you need to get an account on freenode
16:35:02FromGitter<kaushalmodi> hmm
16:35:15krux02that account is then valid for all freenode channels
16:35:29mirani have an account, but i couldn't pass through the blocked ports, FWIW
16:35:30krux02that is spammer protection
16:36:37nixfreakis nimrod.vim a good script for indentation?
16:36:45krux02no idea
16:37:06krux02do indentation manually
16:37:09krux02isn.t that bad
16:37:44Demos[m]I think the emacs mode has good electric indent support
16:38:07krux02a good hint for indenting is when the last line ended on a : or = or when the last line opened more braces than it closed
16:38:39*jamesroseman joined #nim
16:38:46krux02Demos[m]: if my good you mean that it freezes the editor for several seconds and than screws up half of the document
16:39:05Demos[m]hey man I havent used it in a while
16:39:19krux02I turn off electric indent mode in emacs
16:39:26krux02because I don't know how to fix it
16:39:29krux02too complicated
16:39:40krux02but without electric indent mode, emacs is still very good to use
16:39:49krux02it still does indent in the next line and so on
16:39:58Demos[m]yeah it'
16:40:00krux02it just stops trying to reindent the entire document
16:40:01Demos[m]it's quite different from how most editors do it
16:40:22Demos[m]probably based off like some teletype from 1975
16:40:33krux02yea it's not an xml document describing stuff
16:40:51Demos[m]I always have to run indent-buffer to get it to indent the whole document
16:40:53Demos[m]idk though
16:41:26ldleworkI have been writing a ton of elisp lately
16:41:37ldleworkWell more like aggressively iterating a small bit of elisp
16:41:53Demos[m]nice
16:42:07FromGitter<kaushalmodi> Seems like too much work creating freenode account.. why can't I see a "create new account" link.. will have to postpone that offtopic chat until later
16:42:11krux02I like align-regexp it does help indenting the whitespace after the first written character
16:43:04Araqsomewhat related.
16:43:08ldleworkmy modeline is pretty beautiful now: https://i.imgur.com/TeqJqXI.png
16:43:17*dorelix joined #nim
16:43:25krux02kaushalmodi: you forget that IRC is a substitute for the web
16:43:32Araqin nimpretty I noticed that Nim has an -erm- let's say suboptimal 'object' syntax
16:43:35*jamesroseman quit (Ping timeout: 240 seconds)
16:43:41krux02you do everything within IRC even account creation
16:44:00Araqyou can indent after ':', '=' and some keywords like 'type'
16:44:17Araqbut that 'object' line doesn't end in a keyword
16:44:26Araqbecause it can be 'object of Foobar'
16:45:02Araqyes. we're are talking about syntax. bikeshed ahead.
16:45:19krux02if we are talking about syntex
16:45:54AraqI think we might allow for 'type Foo = object of Bar:' with the colon in order to solve this glitch
16:46:10krux02I think I got used to most of Nim syntax quirks by now, but it was confusing to me that almost all blocks of code were introduced by `:`, execpt function definition that was an `=` sign
16:46:57krux02I would like to allow this, too: ``proc fobar(a,b: int) -> int:``
16:47:04miranplease don't change `=` to `:`
16:47:11Araqoh that is consistent with 'const' and 'var' though, <keyword> stuff : type = body
16:47:52Araqand your solution would just enable more pointless fights ;-)
16:48:02krux02yea
16:48:26krux02but the syntax that I am suggesting is not my invention
16:48:42*jamesroseman joined #nim
16:48:45krux02I recently found out it is the syntax of python, and I liked it.
16:48:57krux02(python has pointless type annotations)
16:49:01miranis there any performance benefits of declaring `var foo` outside of a loop, insted of `let foo` inside of it?
16:49:07Araq(guess what, I know)
16:49:23Araqmiran: usually it's optimized to the same code
16:49:52krux02well it isn't that important though. I got used to it.
16:50:15AraqI like it better this way ;-)
16:50:25*endragor joined #nim
16:50:27miranAraq: thanks, i thought that might be the case
16:50:45Araqthe arrow makes more sense if you deal with types only (T, T) -> T
16:51:08Araqbut once parameter names enter the picture it's not as nice.
16:51:25miranagreed
16:52:09Araqhmm maybe I allowed 'object of Foo []' for consistency with tuples, can't remember
16:52:15krux02I am actually often confused on when to use -> and when to use =>
16:52:35AraqI don't use neither.
16:52:40FromGitter<kaushalmodi> krux02: I'd think you'd mostly want =>
16:52:46Araqbut -> is for types, => for code
16:52:57krux02yea I know
16:53:40krux02I am not proposing to change anything here, but somehow I want => for types. I don't know why
16:53:45*jamesroseman quit (Ping timeout: 265 seconds)
16:54:08*Sentreen quit (Quit: WeeChat 1.6)
16:54:15miranif we're bikeshedding about nim's syntax, i'm still wanting to see `case foo of:` syntax instead of `case foo` and then "of" on each line :)
16:54:49krux02I really liked lambda expressions when I was programming in scala. But now that I know that they are no as fast as loops, I use loops most of the time
16:54:49Araqno, we're bikeshedding about 'object of Foo <indentation>' only
16:55:07*endragor quit (Remote host closed the connection)
16:55:08krux02but I am still thinging in all these terms of functional programming
16:55:26miranoh, so there is offtopic even in bikeshed, ouukaay :P
16:55:49krux02map, filter, flatMap, slide
16:56:11*Sentreen joined #nim
16:56:26krux02I don't know what I should think about an optional : for object definitons
16:56:33mirankrux02: looping is faster than map/filter? in nim?
16:56:38Demos[m]well I want ⦂ for type
16:56:44Demos[m]but we can't get everything we want :D
16:56:49krux02it wouldn't help nimpretty would it, I mean nimpretty would still need to detect the old syntax
16:57:00AraqI want generic .compilerProcs
16:57:10Araqkrux02: nimpretty could patch it though.
16:57:20*jamesroseman joined #nim
16:57:20*Sentreen quit (Client Quit)
16:57:25Araqand then other tools can use the simpler rules
16:58:01krux02not sure about it.
16:58:04miranspeaking of nim tools (offtopic bikeshedding, part 2), could we get some warnings about unused imports?
16:58:34krux02I am not sure if I want to use nimpretty in the first place. I have the feeling it will destroy my nicely aligned ascii art
16:58:35Araqmiran: not anytime soon, the compiler doesn't track that at all
16:59:27Araqkrux02: that's the best part of it. clear code is readable on its own merits, not because it's aligned with the statements that happen to follow it
16:59:39*Sentreen joined #nim
16:59:57*stefanos82 quit (Quit: Quitting for now...)
16:59:58krux02well I like alignment
17:00:07krux02I like aligned comments
17:00:15krux02I like aligned type definitions
17:00:31krux02I like aligned arguments and aligned commata
17:00:39Araqfoo(a, b, c)
17:00:48Araqba( x, y, z)
17:01:13Araqthat's what you do, some random coincidence is exploited by you to make it "Look nice"
17:01:20*endragor joined #nim
17:01:29*Sentreen quit (Client Quit)
17:01:46*endragor quit (Remote host closed the connection)
17:01:47*Sentreen joined #nim
17:03:21krux02http://ix.io/1hoY
17:04:36krux02Araq: or this http://ix.io/1hp0
17:04:52krux02alignment here is acutally very important for readability
17:05:33dom96That lack of whitespace in the argument list though :/
17:05:33krux02some things are just easier to process visally when they are aligned
17:05:47krux02dom96: yes
17:05:54krux02there could be more alignment :P
17:06:17dom96well, I just mean 1 space after punctuation
17:07:06krux02dom96: I think i did it, because the line became too long
17:07:24krux02it is 90 characters
17:07:28krux02already too wide
17:07:39krux02but putting stuff on the next line I also didn't want to do
17:07:58FromGitter<amscotti> @Yardanico Sorry, just seeing your msg now. The Nim track was never enabled before as it’s been in beta in V1 of Exercism. I do think we are at the point to take the track out of Beta but I'm not sure what is needed for this beside setting `active` to `true`.
17:08:21Araqyeah, all terrible ascii art alignment code. but cool Nim allows it.
17:08:56krux02Araq: ``go fmt`` does alignment for you.
17:09:10Araqbut not in your style.
17:09:34krux02that is true
17:09:46krux02but this is aligned by go fmt https://golang.org/src/go/build/build.go?s=11872:14733#L367
17:10:09Demos[m]clang-format does alignment in almost any style
17:10:35Demos[m]I don't like alignment since I program using flexable width fonts
17:10:45krux02Araq: you can't denie it, alignment is something people care about.
17:10:46Demos[m]so I can't even tell if things are aligned anyways
17:10:53mirankrux02: IMO, rather to have 2 characters "too wide" line, than no whitspace after punctuation
17:11:15Araqthat style is "pretend it's a table and give up when it isn't", which is totally unconvincing.
17:11:29Araqcode is not stored in tables.
17:11:40FromDiscord<exelotl> I like some alignment but this is too much `proc alloc* (size: Natural ): pointer`
17:11:50Demos[m]I just want to be able to add some format command to a git hook and forget about it tbh
17:11:53*jjido joined #nim
17:12:26krux02Demos[m] or on saving the document.
17:12:30krux02that is what I did in go
17:12:38krux02every save the document was autoformated.
17:12:42Demos[m]yeah that works for me too
17:13:15Demos[m]sometimes I want to delay in c++ since I use lots of different editors at once (because *something* breaks every editor)
17:13:16krux02I really liked that I could just add {} to mark a block, then go fmt did take over to indent or deindent the code
17:13:53Demos[m]yeah that can be really nice when you move control flow around
17:14:09krux02seems trivial, but in c++ code you don't see in all editors when you accidently mix up spaces and tabs.
17:15:33krux02so it is a big deal when there is a tool that automatically ensures the right indentation style.
17:15:37AraqI don't understand your position. so you live with go fmt even if it would destroy your ascii art, but can't adopt nimpretty because it would destroy your ascii art. double standard.
17:16:17krux02well go fmt would at least preserve some of the alignment that I made
17:16:21krux02not all of it
17:17:23Demos[m]in the end I think it's a LOT of effort to make these tools sutable for every style
17:17:54Araqthat only means "go fmt" produces different results for identical ASTs, which is against "the one true style everything should look like"
17:18:01Demos[m]I just care that there is one
17:18:12Demos[m](it also makes codegeneration easier (esp given the filter that has a {} style)
17:18:26Demos[m]since you can generate an unholy mess and then just format it
17:18:34Araq(but I agree with it, this "one true style" idea is quite terrible)
17:20:28krux02does nim still allow the {} syntax?
17:21:22krux02Demos[m] I think the {} syntax for code generation doesn't really matter for Nim, nim has macros.
17:21:43krux02Go needs code generation, and that makes Go suck.
17:24:42Araqkrux02: no, it doesn't.
17:24:49Araqremoved that feature.
17:25:39krux02were you scared that people actually used it?
17:25:50krux02btw https://github.com/nim-lang/Nim/pull/8263 finally went through CI
17:26:05krux02you can merge it (please)
17:29:14krux02and last question: do you agree to split the create procs like I did is this PR https://github.com/nim-lang/Nim/pull/8337
17:29:42Araqno, stop it. the create procs need to die.
17:35:53fvs`github down?
17:36:50fvs`^^ angry pink unicorn
17:38:31FromGitter<rayman22201> Github definitely down: https://status.github.com/messages
17:40:07FromGitter<rayman22201> @Vindaar, if you are online, thanks for your explanations about the regex stuff! Makes a lot of sense now. I was afk this weekend longer than I expected (Stupid real life getting in the way of Nim :-P)
17:40:24FromGitter<Quelklef> holy moly
17:41:30FromGitter<Quelklef> is github being down worrisome
17:41:34FromGitter<Quelklef> feels worrisome to me
17:42:15miranwhy?
17:43:14FromGitter<Quelklef> because it's github! It's a monolith of stability in my life
17:43:21FromGitter<Quelklef> Also the last time I remember it being down was a big deal
17:43:29FromGitter<Quelklef> when it and a bunch of other big sites dropped
17:44:14miranthat was amazon's fault, if we're thinking about the same thing (when "half of the internet" was down)
17:44:32FromGitter<Quelklef> Was it? I thought it was a ddos
17:44:34FromGitter<Quelklef> What happened?
17:44:49miranbut even after that - the world returned back to normal quite soon. no reason to think this time would be different
17:45:03FromGitter<Quelklef> still slightly shaking
17:45:29krux02Araq: when the create procs should die, then how is shared memory supposed to be allocateds
17:46:03krux02Quelklef: github is down from time to time
17:46:10krux02it's not the most stable system in the world
17:46:19krux02and it won't be the last time
17:46:34FromGitter<Quelklef> Guess I just hadn't seen it before
17:47:04krux02it's no that often though, and usually back online in no time.
17:48:15FromGitter<rayman22201> good thing git is decentralized :-P
17:48:16mirannim is back up
17:48:21miranoops, git
17:48:30FromGitter<Quelklef> magical
17:48:35Araqugh, I feel stupid
17:48:52Araqcast[ptr NimSeqV2[T]](addr x).len = newLen is all it takes for what I need to do
17:49:04Araqone line of code...
17:56:42FromGitter<xmonader> Guys!! anyone successfully used libui ? I can't get anything to compile?
17:56:54FromGitter<xmonader> not with dynamic linking against the one my system even
17:57:07*DarkArctic joined #nim
17:57:31FromGitter<Quelklef> Can you give the error?
17:57:41krux02Araq: By the way I tried to use lineinfo for symbol disabiguation
17:57:45krux02doesn.t work at all
17:57:50krux02I need the id
17:58:54FromGitter<xmonader> @Quelklef ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4cdcde95e03e3d7b57306a]
17:59:10*PMunch joined #nim
17:59:53krux02miran: git is always online. I think on the Linux kernel people still send patches by mail.
17:59:55FromGitter<Quelklef> `nim c -r "/home/striky/wspace/nim-tictactoe/src/nim_tictactoe.nim" d:useLibUiDll`
18:00:02FromGitter<xmonader> weird the examples in nim works fine... don't know why mine doesnt work
18:00:04FromGitter<Quelklef> did you mean `nim -d:useLibUiDll c -r "/home/striky/wspace/nim-tictactoe/src/nim_tictactoe.nim"`
18:00:16FromGitter<Quelklef> Arguments after `-r` are passed to the nim file
18:00:19FromGitter<xmonader> does the order of the switch matter?
18:00:24FromGitter<Quelklef> And it's `d:...` not `-d:...`
18:00:29Araqyes!
18:00:31FromGitter<xmonader> oops! thanks @Quelklef
18:00:32mirankrux02: true :) i meant github, of course
18:00:39FromGitter<Quelklef> Sure
18:01:10FromGitter<xmonader> I copied it from the github https://github.com/nim-lang/ui#static-vs-dynamic-linking
18:01:24Araqlol no idea if you're serious or not. "send patches by mail"
18:02:01krux02I am
18:02:05krux02they do it
18:02:33FromGitter<xmonader> @Quelklef removing the nimcache directory and just reruning it works ..
18:02:57FromGitter<Quelklef> Problem solved then
18:03:33FromGitter<xmonader> yeah, but it's weird to that nimcache can really mess it up -_-
18:03:49FromGitter<Quelklef> ehhhhh
18:03:56krux02I was just searching for an example of "patch by mail" and I found this: https://lkml.org/lkml/2012/7/6/495
18:04:04krux02Linus, charming as always
18:04:05FromGitter<Quelklef> I'm not super surprised
18:04:27FromGitter<Quelklef> it seems like the kind of thing that's useful but'd sometimes break things
18:04:51Araqthat was 6 years ago.
18:05:05krux02yea
18:05:07krux02https://lkml.org/lkml/2018/7/10/1227
18:05:14krux02this is a patch by mail
18:05:37krux02I think the actual patch file is hidden, because that is the web view of the mail, but the actual mail contained the patch
18:08:24krux02emacs has a builtin command to format a patch and send it by mail
18:08:40krux02providing a much better workflow than any github web api.
18:09:12krux02Araq: can we talk again about the symID thing?
18:09:52krux02thank you for merging nim_gdb.py
18:09:55Araqwell it's an API, you can build a tool on top of it
18:10:09krux02well, I can't
18:10:19krux02because the api is not exposed
18:10:34Araqthe github web API is exposed.
18:10:41Araqnow ... back to symid
18:10:55krux02last time I asked you to merget the PR, you said I could simply use lineinfo for disambiguation, but that doesn't work at all.
18:11:21krux02ah github api you mean. Yes.
18:11:29Araqbut the IDs don't work well either, unless you like long C compile times.
18:11:49krux02well I am not generating C code :P
18:11:54krux02I am generating glsl code
18:12:55krux02currently I don't care that much about compile times
18:13:03PMunchOops, nimble.directory seems to be down
18:13:19krux02the slowest part in the compilation chain is the macro that generates the glsl code
18:13:26krux02compiling the glsl code is almost instant.
18:13:28PMunchI just get this when I try to enter it: http://ix.io/1hps
18:16:53krux02Araq: the symId is an easy fix that works now until macros can provide non ambiguous symbol names for code generation.
18:17:32Araqcan't you append a gensym()ed name to create a non-ambiguous name?
18:17:51krux02what do you mean?
18:18:00krux02I am not creating the sym
18:18:20krux02I am writing a glsl backend for Nim in a macro.
18:19:34Araqso where does the sym come from?
18:20:07krux02from items
18:20:31krux02wait, I try to reproduce something, but the ast is very different than it was before
18:20:46krux02can it be that a typed macro does not inline a for loop anymore?
18:22:16Araqthat wasn't changed
18:22:53Araqbut I doubt this transformation was done reliably as for loop elimination is not even part of semantic checking
18:24:05krux02Araq: well that is something that might be specified, because for me the for loop is eleminated or not eleminated
18:25:54krux02Araq: In my code the for loop is eleminated, for some reasons
18:25:58krux02and that causes problems
18:26:20krux02because the ..< iterator creates a local variable `i`
18:26:28krux02and the loop variable is also usually `i`
18:30:19FromGitter<Vindaar> @rayman22201 you're welcome! Always glad if I can help someone :)
18:31:51*jjido quit (Ping timeout: 260 seconds)
18:33:16FromGitter<xmonader> any idea how do i get the sender in libui on a btn click event?
18:33:39*NimBot joined #nim
18:34:01FromGitter<xmonader> in the c version u can https://github.com/andlabs/libui/blob/master/examples/timer/main.c#L53 but in nim the signature takes proc() with no params ?
18:39:02*krux02 quit (Quit: Leaving)
18:39:06Araqkrux02: it really shouldn't expand the for loop :-/
18:39:40Araqthe spec for this doesn't exist, but that is clearly wrong.
18:40:10Araqxmonader: use a closure
18:40:29Araqbut I don't remember if I added closure support to libui
18:44:54miranspeaking of closures - fuck them and their bottlenecking! :D
18:45:36miranjust refactored something, so now i don't have closures - instant 2x speedup
18:48:37*Vladar quit (Quit: Leaving)
18:49:59FromGitter<xmonader> @Araq how exactly? it takes a procedure onclick but ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4ce8d7582aaa6307719385]
18:51:30*nsf quit (Quit: WeeChat 2.1)
18:51:38FromGitter<xmonader> problem is i can't get the object itself ⏎ and in ui.nim ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4ce939c02eb83d7c810306]
18:52:54FromGitter<xmonader> maybe nim gtk is a better choice to use, and i'm already familiar with gtk apis
19:02:29*Trustable quit (Remote host closed the connection)
19:06:01FromGitter<Quelklef> @Araq sorry if this is nagging, but can you get back to me on https://github.com/nim-lang/Nim/pull/8176? I've made all requested changes (locally) but haven't pushed because of the performance issue. The optimizations I can think of would obscure the code to a point that feels like a terrible tradeoff
19:07:21Araqwhy do we need this whitespace stripping anyway
19:07:28Araqthe code was fine without it.
19:07:44FromGitter<Quelklef> I added it because the HTML my changes generate has some nesting
19:08:01FromGitter<Quelklef> and IMO it's a pain to read having it condensed in the Nim code
19:08:07FromGitter<Quelklef> But also shouldn't be expanded in the generated HTML
19:08:16FromGitter<xmonader> I got it to work! ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b4ced2095e03e3d7b57b7b9]
19:08:50FromGitter<Varriount> Araq: I've had an awesome time with Nim. It's so nice running a program and not worrying about attribute errors. :D
19:08:54FromGitter<Quelklef> I can just remove the leading whitespace if you'd like
19:09:52Araqno, I want a clean patch, the code didn't touch the whitespace before.
19:10:19Araqand shouldn't afterwards because all that changed was how the {. .} thing is rendered.
19:10:46FromGitter<Quelklef> I meant remove the leading whitespace in the string literals
19:12:00Araqoh ok.
19:12:08Araqvarriount: what are attribute errors?
19:12:16FromGitter<Quelklef> Cool. Thank you sir
19:20:07dom96Bah, the fact that toStrLit renders Nim code with 4 spaces is blasphemy
19:24:07*krux02 joined #nim
19:27:52dom96Thankfully Nim is happy with inconsistent indentation
19:28:35miranis something like this possible to do? `let myProc = if foo == 1: myFirstProc else: mySecondProc`
19:28:56Araqif they are campatible
19:29:20FromGitter<Quelklef> @miran that should work verbatim
19:30:10mirani'm asking because i get "type mismatch: got <proc (status: var int): typed> but expected 'proc (status: var int): typed'"
19:30:31PMunchHmm, that is a strange error..
19:31:00miranoh i think i know what's the problem, just a sec
19:31:55mirani had some templates, i need to refactor those to procs
19:38:51miranyup, now it works! sorry for the confusion
19:38:57nixfreakanyone using nimx for a project ?
19:48:04*tiorock joined #nim
19:48:04*tiorock quit (Changing host)
19:48:04*tiorock joined #nim
19:48:04*rockcavera quit (Killed (hitchcock.freenode.net (Nickname regained by services)))
19:48:04*tiorock is now known as rockcavera
20:09:21*arecacea1 quit (Read error: Connection reset by peer)
20:09:45*arecacea1 joined #nim
20:17:26FromGitter<mratsim> @nixfreak: nimx is used in Reel Valley, a 5 star Android, iOS and Facebook game written in pure Nim
20:28:34*miran quit (Ping timeout: 264 seconds)
20:35:51skrylaron the GUI front, also did some work on porting tablelayout to nim.
20:36:40skrylarhttps://github.com/EsotericSoftware/tablelayout its completely API agnostic, good for grids.
20:41:50skrylar(for the imgui fans, i really have no idea how you guys do layouts. only vaguely familiar with identity caching and such)
20:52:44*PMunch quit (Quit: leaving)
20:54:41*Sentreen quit (Quit: WeeChat 1.6)
20:54:55*Sentreen joined #nim
20:57:17*FromGitter quit (Remote host closed the connection)
20:57:17*oprypin quit (Quit: Bye)
20:57:37*FromGitter joined #nim
20:57:44*oprypin joined #nim
20:58:01*xylef joined #nim
21:13:13*Sentreen quit (Quit: WeeChat 1.6)
21:13:30*Sentreen joined #nim
21:23:03*Sentreen quit (Quit: WeeChat 1.6)
21:23:22*Sentreen joined #nim
21:31:54FromGitter<Varriount> Araq: In Python, attribute errors are what happen when you try to access an attribute an object doesn't have.
21:35:46FromGitter<xmonader> Anyone up?
21:47:43FromGitter<xmonader> Two more chapters in nimdays book https://xmonader.github.io/nimdays tictactoe, minmax, libui
21:53:05*jamesroseman quit (Ping timeout: 248 seconds)
22:01:17*rockcavera quit (Read error: Connection reset by peer)
22:01:32*rockcavera joined #nim
22:01:33*rockcavera quit (Changing host)
22:01:33*rockcavera joined #nim
22:03:37FromGitter<kaushalmodi> woh! Thanks @xmonader!
22:07:10FromGitter<xmonader> Didn't want to go on vacation with drafts on my laptop :) @kaushalmodi hope they're up to your expectations
22:08:39*nixfreak quit (Ping timeout: 252 seconds)
22:08:54FromGitter<kaushalmodi> *my* expectations? :P They are awesome! I have never coded a GUI so looking forward to trying out your tutorial.
22:09:11FromGitter<kaushalmodi> *They (your tutorials)
22:13:43FromGitter<xmonader> Thanks for your kind words, I'm no GUI expert too, this is the most complex gui thing i ever created https://github.com/xmonader/helloed/tree/master/src
22:14:48FromGitter<xmonader> I used to work on PIDA ide development and I was doing my own text editor in parallel too, GTK+ 2 and python
22:26:56skrylari wouldn't call myself an expert, but i do seem to be working on a lot of foundations for guis these days <.<
22:27:13*cspar joined #nim
22:29:17FromGitter<xmonader> @skrylar like what?
22:29:59skrylarxmonader: table layout (generic layout component for any api), cobweb (FRP event routing for the events), nfltk (FLTK binding), glib/gobject
22:30:52FromGitter<xmonader> that's very interesting! i was actually searching for table layout for libui but i guess it's not gonna be added
22:31:27FromGitter<xmonader> I'd love to give fltk a try
22:31:52skrylararaq doesn't maintain libui anymore because it's well, not a great lib
22:32:09skrylari also had a binding for it (bottlecap) but didn't publish it iirc, because i came to the same conclusion. it doesn't scale
22:32:30FromGitter<xmonader> it's annoying andlabs don't want to provide docs for it
22:32:50Araqwell I'm willing to maintain it further if I would see the merit.
22:32:53skrylarif you aren't working on macs and don't mind the uglies, fltk is quite robust
22:33:24Araqas far as I'm concerned, the libui code should be ported to Nim, as a dependency it's tough
22:33:28FromGitter<xmonader> @Araq how about `lcl` instead
22:33:47Araqand then the problem with the lack of good event handling remains
22:34:09skrylarcobweb is shaping up, although current revision is closure-heavy
22:34:14Araq'lcl'? lazarus' API?
22:34:14FromGitter<xmonader> @skrylar no macs, but i'm spoiled with Qt already :D
22:34:22FromGitter<xmonader> @Araq yea!
22:34:40skrylarlcl is in turn a wrapper around qt/winapi isn't it
22:34:59Araqwrapping that would be a ton of work and then you don't have their excellent UI builder.
22:35:17skrylarat least with gtk3 we can snarf glade
22:35:21FromGitter<xmonader> It'd be a really killer feature for nim if that happens
22:35:35Araqit's easier to "draw" the forms in Lazarus and call into Nim code
22:36:00AraqI've done that in the past
22:36:28FromGitter<xmonader> @Araq did u create a library in lazarus and linked against it in Nim?
22:36:32FromGitter<xmonader> in pascal*
22:37:00skrylarthere were people wanting to sponsor a Qt binding at one point, although doing such things is an extreme pain
22:37:02Araqno, I linked the .o files produced by Nim into a lazarus project. worked.
22:37:29FromGitter<xmonader> very nice maybe should try that
22:37:39Araqcould also turn the .o files into a static library.
22:47:20*fvs quit (Ping timeout: 276 seconds)
22:48:20Araqskrylar: checkout out what Trustable is building. a native widget set for Windows and Linux iirc
22:48:47AraqI mean comparable to how wxWidgets does it
22:48:49skrylarnimx?
22:49:00Araqno, not nimx.
22:50:38skrylari feel like people have mentioned trustable to me on several occasions but it wasn't very far along
22:51:59skrylari did a fun thing in go once, which had an unusual API. although i then learned unusual APIs are weird to deal with
22:52:26skrylaryou could just make button objects and shove them where buttons should be, the backend turned that in to a command button, menu item or tool button depending on context
23:00:41*xet7 quit (Quit: Leaving)
23:03:06*jamesroseman joined #nim
23:04:04Araqskrylar: what I would do if I had the time, develop yet-another terminal emulator. however I would extend the escape sequences to "draw line/pixel/rect/whatever" primitives
23:04:25skrylarisn't that basically curses
23:04:46Araqno, it would offer a real canvas
23:04:55Araqwith pixels and shit.
23:05:26Araqalso needs some simple API to hand mouse cursor data to the client program.
23:06:00skrylarthat just sounds like Processing or SDL tbh
23:06:01AraqI guess it would be a mixture of a terminal emulator and Wayland
23:06:19Araqyes "Just like", except
23:06:29Araq1. it runs all command line apps out of the box.
23:06:54Araq2. the canvas state is persistent just like the text in the terminal persists when the program dies.
23:08:32skrylarspeaking of.
23:08:56skrylarbleh. should look in to processingjs and compare it to raylib. i saw some AI stuff using processing ot test visualizations and i wouldn't mind an easy way to do visualizations in nim
23:09:15skrylarnanovg and opengl do pretty well at it
23:12:45*jamesroseman quit (Ping timeout: 256 seconds)
23:24:52krux02skrylar, I really hope to replace processing with my rendering library. But it isn't ready yet to replace it and it needs a new name.
23:25:14krux02Thanks to apple andthing bith OpenGL is now badly framed
23:32:51skrylari think one is meant to use vulkan going forward
23:44:54*jamesroseman joined #nim
23:45:06benjikunI'm trying to use the asyncHttpClient in `httpclient` and I'm having no luck
23:45:13benjikunare there any other examples other than the one on the docs?
23:45:41FromGitter<mratsim> dom96 chat app from his Nim in Action book
23:47:43benjikunThat uses asyncnet
23:50:19*jamesroseman quit (Ping timeout: 260 seconds)