<< 23-08-2018 >>

00:04:05*heinrich5991 quit (Ping timeout: 240 seconds)
00:04:36*Widdershins joined #nim
00:04:55AlexMax(and I'd really rather not the Nim GCC be in my path, because I have several GCC's on my system)
00:05:27shashlickya if you set the CC environment variable, nimgen will use that instead
00:06:40*heinrich5991 joined #nim
00:09:18AlexMaxshashlick: gcc -E runs the preprocessor, right and gives you nothing but macro expansions, right?
00:11:10AlexMaxI guess that means that you get whatever defines are in the header already...
00:11:50AlexMaxunwrapped
00:12:17*vqrs quit (Ping timeout: 255 seconds)
00:12:51AlexMaxSorry - I think I knew at some level that your solution would involve nimgen, but I'm not sure I understood all of the ramifications of it ahead-of-time
00:13:06AlexMaxI might still use my own homespun library
00:13:23AlexMaxdunno, haven't gotten to the part where I actually _need_ it yet
00:13:33AlexMaxjust thought I'd mess around with it for funsies
00:13:42AlexMaxand now at least I know how to add in .c files
00:14:30shashlickokay
00:14:38shashlickbut does setting CC allow the install?
00:17:37AlexMaxhttps://paste.ee/p/D2dAU
00:18:39*vqrs joined #nim
00:20:18shashlickCC=xyz\gcc.exe
00:20:40*skelett1 quit (Read error: Connection reset by peer)
00:22:21*skelett1 joined #nim
00:24:22AlexMaxshashlick: That's how you set localized environment variables in powershell
00:24:27AlexMax$env:CC
00:25:52shashlickno but you are setting it to the path and no the binary
00:25:55AlexMaxoh
00:26:10AlexMax*john cleese agitha christie head thump*
00:26:43AlexMax Success: nimtess2 installed successfully.
00:26:46AlexMaxthere we go
00:28:17shashlickđź‘Ť
00:32:16AlexMaxokay, i import it as nimtess2/tesselator which is a bit strange, but oh well
00:32:24AlexMaxvar x = tesselator.tessNewTess
00:32:24AlexMaxecho repr(x)
00:32:32AlexMaxgives me a memory address
00:32:41AlexMaxso I suppose it at least didn't fly apart at the hinges?
00:32:46AlexMaxthanks
00:37:31shashlick🙂
00:40:49*ftsf joined #nim
00:42:27shashlickif you import, you don't really need the full `tesselator.tessNewTess()`, you can just do `tessNewTess()`
00:45:16shashlickUnless you do `from x import nil`
00:47:40AlexMaxI prefer namespaced functions
00:47:51AlexMax...except if the namespace is in the identifier itself
00:47:58AlexMaxwhich in this case it is
00:48:18AlexMaxSo I do sdl2.glSetAttribute
00:48:30AlexMaxbut then I turn around and glVertexAttribPointer
01:08:22*fredrik92 quit (Quit: Client Disconnecting)
01:13:23*wildlander quit (Quit: Konversation terminated!)
01:17:05*thomasross quit (Remote host closed the connection)
01:17:32*thomasross joined #nim
01:32:00*cspar quit (Ping timeout: 272 seconds)
02:11:48FromGitter<ephja> is `template foo(...) {.pragma.}` the only supported user pragma application right now?
02:15:56AlexMaxhttps://puu.sh/BiO1L/c0e789294b.png
02:16:05AlexMaxNim is good for OpenGL programming, I guess :)
02:16:36shashlicknice work 🙂
02:17:06AlexMaxI'm saving the tesselator for the floors and ceilings
02:22:28*msmorgan_ joined #nim
02:22:45*odc_ joined #nim
02:29:31*syntonym[m] quit (*.net *.split)
02:29:31*zacharycarter[m] quit (*.net *.split)
02:29:31*sg-james[m] quit (*.net *.split)
02:29:31*narimiran[m] quit (*.net *.split)
02:29:32*codevance[m] quit (*.net *.split)
02:29:32*dyce[m] quit (*.net *.split)
02:29:32*msmorgan quit (*.net *.split)
02:29:32*odc quit (*.net *.split)
02:33:02*cspar joined #nim
02:33:03*heinrich5991 quit (Ping timeout: 252 seconds)
02:34:34*heinrich5991 joined #nim
02:35:47*sg-james[m] joined #nim
02:35:51*codevance[m] joined #nim
02:35:56*zacharycarter[m] joined #nim
02:35:59*syntonym[m] joined #nim
02:36:42*riidom_ joined #nim
02:37:00*dddddd quit (Remote host closed the connection)
02:37:43*narimiran[m] joined #nim
02:38:18*riidom quit (Ping timeout: 264 seconds)
02:38:21*dyce[m] joined #nim
02:41:47*druonysus quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
03:00:17*damon-kwok joined #nim
03:07:35*damon-kwok quit (Ping timeout: 240 seconds)
03:07:48*damon-kwok joined #nim
03:24:50*damon-kwok quit (Remote host closed the connection)
03:25:36*damon-kwok joined #nim
03:28:48*damon-kwok quit (Remote host closed the connection)
03:29:28*damon-kwok joined #nim
03:29:46*endragor joined #nim
03:34:22*damon-kwok quit (Remote host closed the connection)
03:36:35*damon-kwok joined #nim
03:42:23*damon-kwok quit (Ping timeout: 260 seconds)
03:43:43*kapil____ joined #nim
03:47:59*Erenzie15 joined #nim
03:50:28*Erenzie15 quit (Remote host closed the connection)
03:50:57*druonysus joined #nim
03:50:57*druonysus quit (Changing host)
03:50:57*druonysus joined #nim
04:00:01FromDiscord_<awr> ugh im so stupid
04:00:06FromDiscord_<awr> fucked up my PR lol
04:17:05*damon` joined #nim
04:20:17*damon` quit (Remote host closed the connection)
04:20:46*damon` joined #nim
04:30:40FromDiscord_<awr> ok lol i fixed it
04:31:13FromDiscord_<awr> accidentally did my branch on top of another branch when i meant to do it on top of devel
04:31:49FromDiscord_<awr> but fixed it now!
04:32:57*stefanos82 joined #nim
05:05:52*nsf joined #nim
05:08:57*heinrich5991 quit (Ping timeout: 240 seconds)
05:12:22*heinrich5991 joined #nim
05:26:52*ftsf quit (Ping timeout: 252 seconds)
05:34:10*damon` quit (Remote host closed the connection)
05:59:29*tzekid joined #nim
06:05:52*heinrich5991 quit (Ping timeout: 256 seconds)
06:08:30*heinrich5991 joined #nim
06:14:57*heinrich5991 quit (Ping timeout: 240 seconds)
06:18:12*heinrich5991 joined #nim
06:29:50*tzekid quit (Ping timeout: 255 seconds)
06:43:07FromGitter<bung87> `let re_han = re(r"(*UTF)([\p{Han}]+)") split(line,re_han)`I found it very slow,it takes 3 seconds,all word segments takes 4.5 seconds in my test case.
06:44:24*Vladar joined #nim
06:46:45*tzekid joined #nim
06:47:54*tzekid quit (Remote host closed the connection)
06:50:42stefanos82I have played with a silly example and got me confused. I have tried "var x: bool" which defaults to false. then I have tried "if x: echo x" and printed false as expected. then I have tried "if x: x = true" and tried to echoed x. To my surprise x is still false
06:51:03stefanos82now, if I say "if x == false: x = true", then "echo x" prints true
06:51:24stefanos82my question is: how does if statement evaluates the aforementioned example?
06:54:51FromGitter<narimiran> stefanos: the first example shouldn't print anything
06:56:25FromGitter<narimiran> this one: http://ix.io/1l0k/
06:56:45FromGitter<narimiran> it is definitely not "expected to print false"
06:58:11FromGitter<narimiran> in the second example (`if x: x = true`) it is also working as expected - x is still false because `x = true` is not executed
06:58:44FromGitter<narimiran> `if x` is the same as if you have written `if x == true`
06:59:01FromGitter<narimiran> ^ stefanos82
06:59:30stefanos82much like C-domain languages then
06:59:37stefanos82phew...I thought I got it all wrong
07:00:01stefanos82I read such examples in various Nim tickets and thought that maybe something's different with Nim
07:00:11stefanos82much like we can have a right associative operators
07:26:19*PMunch joined #nim
07:35:43*heinrich5991 quit (Ping timeout: 260 seconds)
07:37:50*heinrich5991 joined #nim
07:44:19*floppydh joined #nim
07:57:33*Entropic quit (Ping timeout: 252 seconds)
07:59:52*Entropic joined #nim
08:01:49*gangstacat joined #nim
08:03:56*gmpreussner_ joined #nim
08:04:27*gmpreussner quit (Ping timeout: 240 seconds)
08:05:29*gangstacat quit (Client Quit)
08:18:57*cspar quit (Ping timeout: 240 seconds)
08:36:19*qenthus1ast joined #nim
08:55:48*krux02 joined #nim
08:56:47*TheLemonMan joined #nim
09:03:14*heinrich5991 quit (Ping timeout: 256 seconds)
09:04:01*odc_ quit ()
09:04:23*odc joined #nim
09:05:28*heinrich5991 joined #nim
09:09:21*Arrrr joined #nim
09:09:52ArrrrIs ""/@[] now an alias for 'nil' ?
09:14:08dom96yep
09:15:04ArrrrAnd I assume setting the len to 0 won't have the same effect, right?
09:15:13FromGitter<tim-st> dom96: is that also needed if my global var is read only? https://stackoverflow.com/a/49225758/3646022
09:15:56dom96Arrrr: no. 'nil' for string/seq is effectively gone
09:16:06dom96It's just used as an optimisation in the background
09:17:35ArrrrI see. Thank you.
09:18:03dom96tim-st: define it using `let`?
09:18:52FromGitter<tim-st> no, because it gets filled one time before server is started
09:18:59FromGitter<tim-st> would that allow it?
09:19:22*qenthus1ast quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
09:20:12FromGitter<tim-st> the same using `let`
09:20:30FromGitter<tim-st> it's a table from which I only read
09:20:59TheLemonManthe real question is, should newSeq/newSeqOfCap(0) be optimized to nil?
09:22:18FromGitter<tim-st> When I create a global database handle it doesnt complain^^
09:25:54*heinrich5991 quit (Ping timeout: 256 seconds)
09:26:14*gangstacat joined #nim
09:26:46*heinrich5991 joined #nim
09:32:25dom96tim-st: It might be better if you pass this data around instead of putting it in a global
09:34:13PMunchHmm, just realized that Ruby has the `or` and `and` syntax I tried to implement for options. Although it works with nil and they're called `||` and `&&` like in bash.
09:34:27FromGitter<tim-st> dom96: it's a hashtable used as in memory database; I cant copy it :\
09:34:46FromGitter<tim-st> (*as readonly in memory db)
09:34:50dom96use a 'ref'?
09:35:28FromGitter<tim-st> but still I have to define it somewhere, this needs to be the global scope I think
09:36:50dom96hm
09:37:21FromGitter<tim-st> from my tests it seems to work; but I often hear: "DONT DO IT" shring this between threads...
09:37:30FromGitter<tim-st> *sharing
09:38:00dom96yeah, with Jester I suppose you need globals
09:38:15dom96The forum uses globals too
09:38:37FromGitter<tim-st> also a shared table, seq, string or set?
09:38:59FromGitter<tim-st> I think only these are the trouble maker
09:46:14FromGitter<tim-st> ok, I see I could annotate the proc that accesses the global as `{.gcsafe.}` but for this I need to know if global readonly hashtable is allowed to access between threads or what could go wrong
09:52:46*seni joined #nim
09:57:45*theaetetus joined #nim
10:01:05*heinrich5991 quit (Ping timeout: 240 seconds)
10:02:54*heinrich5991 joined #nim
10:03:07FromGitter<tim-st> Is the same true for nims table? https://stackoverflow.com/a/1312389/3646022
10:04:23PMunch@tim-st, no
10:04:25*theaetetus quit (Ping timeout: 268 seconds)
10:04:36PMunchNim doesn't have a "Global Interpreter Lock"
10:05:14FromGitter<tim-st> yes, I know, I meant if read only access from a dict is safe like in python when using threads in nim
10:05:18PMunchOh wait, nims
10:05:19PMunchHmm
10:05:25FromGitter<tim-st> 1) from a table
10:06:05PMunchWell, if you have a table that no-one is writing to at the same time it should be safe to read from it from multiple threads
10:06:23PMunchUnless it does some strange caching things
10:06:37FromGitter<tim-st> PMunch: Thanks, that was my guess too, but I cannot find a source that confirms it
10:06:41PMunchBasically it's safe as long as no-one modifies anything while you're using a shared resource
10:06:47PMunchAs a general rule
10:07:06PMunchIt's not implicitly unsafe to read from the same static block of memory
10:07:09FromGitter<tim-st> ok, so I can try to ignore the global var hint
10:07:22FromGitter<tim-st> ok, thanks!
10:07:34PMunchI can't guarantee it though, but it should be safe
10:07:49PMunchAnd don't write to it!
10:08:00FromGitter<tim-st> Yes, it seems it's a topic where no one really knows in all languages^^
10:08:39FromGitter<tim-st> I write to a file database and read from a hashmap
10:08:51FromGitter<tim-st> the file database is locked with transactions
10:10:45PMunchWell threading is still a bit of an open problem
10:11:32PMunchAnd most code is written with the expectation that it should be used only in a synchronous manner
10:11:52FromGitter<tim-st> ok, thanks for the answer, I will stay with my current global read only implementation unless tests fail
10:12:40*federico3 joined #nim
10:13:18PMunchYou also have this though: https://nim-lang.org/docs/sharedtables.html
10:13:38PMunchBut you need to use non-GC keys and values, so it's a bit limited
10:14:48FromGitter<tim-st> also this implementation allows read and write, since I only want to read I think I dont need locks
10:15:19FromGitter<tim-st> I meant delete and write
10:17:48FromGitter<GULPF> not sure but I think even reading readonly memory is unsafe if it's tracked by the GC
10:19:04FromGitter<GULPF> e.g see my question here: https://github.com/nim-lang/Nim/pull/8527#discussion_r207578319
10:21:04FromGitter<tim-st> I think the gc only collects memory from the table if the table is not used anymore, since the table is open forever, the gc shouldnt remove memory at all
10:23:09*kobi7 joined #nim
10:23:16kobi7hello
10:23:43kobi7where can I read about the keyword 'static' ? is it the same as in c# / java ?
10:26:36*kobi7 quit (Client Quit)
10:27:04*kobi7 joined #nim
10:27:53*heinrich5991 quit (Ping timeout: 252 seconds)
10:27:54FromGitter<tim-st> kobi7: https://nim-lang.org/docs/manual.html#statements-and-expressions-static-statement-expression
10:28:49kobi7thank you
10:29:20kobi7What would I use for a static variable, you know, one that is not connected to an object, but to the type itself.
10:30:05kobi7just put variables in the root level, maybe?
10:30:11kobi7(I mean no indentation)
10:30:30kobi7but that would associate them with the module, not the type.
10:30:31*heinrich5991 joined #nim
10:30:58kobi7if it's not supported, what is the nim way for it?
10:31:13*justache2 joined #nim
10:32:19kobi7What do you think tim-st?
10:32:43FromGitter<tim-st> I think this question is similar to one that was asked here before, either you put it in root level or you write a hack where you explicitly bind it to a type using a proc like:
10:34:02FromGitter<tim-st> ```type A = object ⏎ proc someValueForA*(_: typedesc[A]): int = 134 ⏎ echo A.someValueForA``` [https://gitter.im/nim-lang/Nim?at=5b7e8d9acff55e56174c1adb]
10:34:46FromGitter<tim-st> or was that exactly what you didnt want?^^
10:35:05kobi7oh, yeah, you showed me that last time.
10:35:20kobi7so typedesc is a way to bind the variables? it's not very clear from the docs
10:35:44kobi7I think docs should definitely present "how to do X" if you're coming from language Z
10:35:50*justache2 quit (Remote host closed the connection)
10:35:53FromGitter<tim-st> no, it's only a hack, I think it's not normal in nim; mostly you put it at module level
10:37:55kobi7so more idiomatic would be to just prefix with the type name, at module level?
10:39:08kobi7yea, it actually makes sense .. it's like a global.
10:39:15FromGitter<tim-st> I think without prefix; but if you want to translate a source code base 1:1 I think the way like in the source code above is prefered
10:39:49kobi7at least a first iteration should be 1:1 as much as possible, imo
10:40:54kobi7so instance vars are within the type decl, other vars are basically global, and procs are "static" unless have a first argument with the type name.
10:41:07FromGitter<tim-st> yes, the way above isnt bad, it's clear and you should prefer what is better to read and easy to understand
10:41:51FromGitter<tim-st> afaik procs are static, always, `method`s are not static
10:42:04kobi7there is a problem with the code you put, it is that you can't write to the variable this way
10:42:48FromGitter<tim-st> yes, it's a getter; what is the code from the other language you want to achieve?
10:43:20FromGitter<tim-st> if you want to write you normaly do `proc writeToA*(a: var A, value: int) = ...`
10:43:27kobi7just a simple static variable, in a class
10:43:59kobi7ok, i'll just prefix. it's simpler
10:44:15kobi7sorry for all the beginner questions.
10:44:19FromGitter<tim-st> you can also write the code as `proc someValueForA*(_: A): int = 134` then you can call it from the object
10:44:54FromGitter<tim-st> so you have the choice between `A.someValueForA` and `let a = A(); a.someValueForA`
10:45:25kobi7what is the difference between a proc and a method
10:46:22FromGitter<tim-st> I think a method has "dynamic dispatch"; but if you want to achive a static var for a type; the normal nim way is naming a getter proc the same, i think
10:47:21kobi7dynamic dispatch -- is that a runtime thing, like Dynamic ?
10:47:47kobi7untyped?
10:47:50FromGitter<tim-st> yes, proc is better
10:48:29kobi7but I can still do object oriented with proc
10:48:58FromGitter<tim-st> sure, it's the normal way to do object oriented using procs
10:49:31FromGitter<tim-st> just name the object as first param, then you can call like a.procName(b, c)
10:49:36kobi7I see, so method isn't used much, unless it's for handling unknown types at runtime, maybe parsing text to code, etc.
10:49:55FromGitter<tim-st> yes, I dont use it
10:50:09kobi7ok, awesome, thanks a lot
10:50:25FromGitter<gogolxdong> Is there a reference type string?
10:50:57FromGitter<gogolxdong> without quite breaking current code?
10:52:46kobi7https://nim-lang.org/docs/nimc.html#optimizing-for-nim-optimizing-string-handling
10:53:02kobi7is it for memory conserving purposes?
10:53:43kobi7I think you can just make a ref type of string
10:54:08*dadabidet joined #nim
10:58:04FromGitter<mratsim> a.foo(b) is not object oriented programming, that’s method call syntax.
10:58:21FromGitter<gogolxdong> yes
10:58:42FromGitter<gogolxdong> without breaking stdlib.
10:59:08FromGitter<mratsim> type MyString {.shallow.} = object ⏎ data: string ⏎ ⏎ ^ @gogolxdong, this avoids pointer indirection [https://gitter.im/nim-lang/Nim?at=5b7e937cac25fd11b582013e]
10:59:32FromGitter<mratsim> or use shallow(myString) and allow future usage will be shallow
10:59:40FromGitter<mratsim> all future usages*
11:00:33FromGitter<mratsim> but you will probably have stdlib issue, because it assumes that strings deep copy.
11:01:06*kobi7 quit (Ping timeout: 256 seconds)
11:01:38FromGitter<gogolxdong> like body proc in httpclient.nim assignment once :
11:01:53FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7e942138a12915e4e4d81a]
11:02:23*heinrich5991 quit (Ping timeout: 268 seconds)
11:02:48*zachcart1r quit (Ping timeout: 260 seconds)
11:02:55*heinrich5991 joined #nim
11:03:55*ftsf joined #nim
11:16:14*noonien joined #nim
11:20:01FromGitter<tim-st> @mratsim do you have a guess about whether using a global readonly Table is safe to share between threads in nim?
11:25:32FromGitter<Araq> @tim-st: It's not safe
11:25:44TheLemonManeverything is safe if you're brave enough
11:26:27FromGitter<Araq> I just noticed the bridge is down again and you didn't see my messages :-(
11:28:55*NeddySeagoon28 joined #nim
11:28:57FromGitter<tim-st> @Araq thanks, oh, no nothing from you today^^
11:30:00*ftsf quit (Ping timeout: 256 seconds)
11:30:43*NeddySeagoon28 quit (Remote host closed the connection)
11:30:49TheLemonManAraq, what about transforming newSeq/newString(0) and <string/seq>.setLen(0) into literals so that we take advantage of the nil representation? yay or nay? (No matter what you say I already have a patch ready :)
11:30:57*Arrrr quit (Quit: Arrrr)
11:33:33*Vladar quit (Remote host closed the connection)
11:38:55FromGitter<Araq> as I said, we map @[] to nil and don't touch newSeq() etc. seemed fair to me
11:53:13*SenasOzys quit (Ping timeout: 265 seconds)
11:56:21*dddddd joined #nim
11:57:36*SenasOzys joined #nim
11:59:48FromGitter<ephja> where do nnkCommentStmt nodes go in types?
12:08:54FromGitter<mratsim> @Araq I added 4 test cases for the noInit issues with perf impact from 30% to 6x (yes 500%) between naive and noInit version: https://github.com/nim-lang/Nim/issues/8745
12:14:09stefanos82Araq: what kind of characters are forbidden to be used with a .nim file?
12:18:58*abm joined #nim
12:23:34*cyberzeus24 joined #nim
12:25:32*heinrich5991 quit (Ping timeout: 256 seconds)
12:26:47*cyberzeus24 quit (Remote host closed the connection)
12:28:29*heinrich5991 joined #nim
12:33:10*elrood joined #nim
12:38:54TheLemonManmratsim, you could've used criterion.nim for your timings :P
12:39:27FromGitter<mratsim> make it a part of the stdlib ;)
12:40:50TheLemonManI'm against all-in-one stdlibs, probably due to the exposure to too much scheme heh
12:41:15TheLemonMannimble is nice enough IMO
12:41:44FromGitter<mratsim> well for reproduceable test cases, it’s better if it depends on just Nim and stdlib.
12:42:23*hsiktas19 joined #nim
12:42:58TheLemonManone could argue that nimble is part of Nim proper, and it does depend only on the stdlib
12:44:30FromGitter<mratsim> Anyway, I think genericResets should be fixed before 1.0, otherwise that would be a benchmark horror story.
12:45:21TheLemonManso much to fix, so few people (and time, stupid time)
12:45:36*hsiktas19 quit (Killed (Unit193 (Spam is not permitted on freenode.)))
12:46:52FromGitter<mratsim> fix glaring usability issues, publish 1.0, attract usability oriented people ⏎ fix glaring perf issues, publish 1.0, attract perf oriented people ⏎ fix whatever, publish 1.0, attract whatever people. ⏎ ⏎ Chicken and egg :P [https://gitter.im/nim-lang/Nim?at=5b7eacbcd8d36815e57b8045]
12:49:05*nsf quit (Quit: WeeChat 2.2)
12:49:32copygirlMhh.. there's no go-to way to delete a specific item from a sequence?
12:50:05copygirlAnd for that matter, no way to get the index of an item within a seq.
12:50:52TheLemonMancopygirl, `find` ?
12:51:43FromGitter<mratsim> @copygirl, `filter` in sequels?
12:51:48FromGitter<mratsim> sequtils
12:51:59FromGitter<mratsim> ah no string
12:52:21FromGitter<mratsim> you can use replace
12:52:44*heinrich5991 quit (Ping timeout: 256 seconds)
12:52:48FromGitter<mratsim> argh I don’t know what I’m reading, it’s not string, its seq, so filter it is
12:53:33*grubles22 joined #nim
12:54:57copygirlOr keepIf, I suppose. I am just confused why there's no straight-forward way to delete a single item. I'd do `let i = s.indexOf(item); s.delete(i)` but even indexOf doesn't exist :o
12:55:14*heinrich5991 joined #nim
12:55:28TheLemonManthat's because it's called `find`?
12:55:37copygirlI can't find "find".
12:56:12TheLemonManit's in system.nim
12:56:23copygirlOooh
12:56:46FromGitter<mratsim> @copygirl, feel free to add a remove proc in sequtils
12:57:39*grubles22 quit (Remote host closed the connection)
12:57:39copygirlThat would be confusing. I'd rather have removeAt(index) and remove(item) (or delete)
12:58:06FromGitter<mratsim> delete is in system.nim
12:58:06copygirlOr removeIndex?
12:58:27copygirlYeah but delete takes an index.
12:58:38FromGitter<mratsim> yes, and remove takes a value, like in Python
12:58:39copygirlPerhaps deleteItem..?
12:59:20copygirlSo you have to be familiar with python to know the difference at a glance?
12:59:25FromGitter<mratsim> I think having a by value and by index convention for delete/remove is fine. It can be added to NEP-1
13:00:33FromGitter<mratsim> no, you have to be familiar with Nim, but it’s fine if Nim adopts the same convention as Python.
13:02:52FromGitter<Araq> @mratsim the new runtime has no genericReset()
13:03:14FromGitter<Araq> it's the one thing that solves all issues once and forever *cough*
13:03:34FromGitter<mratsim> *cough* famous last words *cough*
13:04:15*endragor quit (Remote host closed the connection)
13:05:08copygirlWould it be possible somehow to pass a non-closure proc to a method that takes a proc?
13:05:13FromGitter<mratsim> even tuple of ref objects won’t? Like the tree examples from 2 days ago?
13:05:52FromGitter<mratsim> @copygirl, yes you can, but Nim might complain in that case, tag both the parameter type as {.nimcall.}
13:06:14FromGitter<mratsim> and you might need to tag the proc as well.
13:06:16copygirlWould it still allow closures, then?
13:06:43FromGitter<mratsim> use an overload if that doesn’t work
13:07:17FromGitter<mratsim> note that builtin “magic” proc like `+` cannot be passed as a proc argument (procvar)
13:10:11FromGitter<Araq> > fix glaring usability issues, publish 1.0, attract usability oriented people ⏎ > fix glaring perf issues, publish 1.0, attract perf oriented people ⏎ > fix whatever, publish 1.0, attract whatever people. ⏎ ⏎ I think both perf and usability are getting pretty solid with only a modest amount of improvements. I'm really pleased how much better the language is without 'nil' for strings and seqs :-)
13:10:11FromGitter... [https://gitter.im/nim-lang/Nim?at=5b7eb23260f9ee7aa47e1f41]
13:11:06FromGitter<mratsim> btw what is this escapes in `proc wrapper(s: seq[int]): proc () {.escapes: [s].}` mentioned here https://github.com/nim-lang/Nim/issues/3377#issuecomment-146106240 ⏎ ⏎ Is taht really a thing?
13:13:23copygirlMhhr..
13:14:23copygirlSo I have a stop() proc and to use it with setControlCHook it needs to be {.noconv.}, but then it's not compatible with my method that takes a {.nimcall.} proc?
13:14:39FromGitter<Clyybber> Github was just down for me... for like 1 minute
13:15:03FromGitter<mratsim> you can use {.noconv.} as parameter
13:15:17FromGitter<mratsim> addQuitProc uses this for example
13:15:20copygirlAn nvmd it still didn't work. Mh.
13:15:37FromGitter<mratsim> otherwise, use a template.
13:15:37copygirlNvmd that nvmd.
13:15:41FromGitter<mratsim> lol
13:15:57FromGitter<Araq> using too many abbrevs sucks
13:16:35PMunchAraq, by the way, now that strings and seqs can't be nil and the Option type is more likely to be used I think this should be merged: https://github.com/nim-lang/Nim/pull/8358
13:16:39FromGitter<ephja> "nvm" is more cmmn I thnk
13:17:07PMunchI remember you mentioning something about .? could you add a comment to the git issue so that I can look at that?
13:17:22PMunchIf that's what's holding it back
13:18:05*heinrich5991 quit (Ping timeout: 240 seconds)
13:19:04*heinrich5991 joined #nim
13:23:15FromGitter<Araq> well I have to review it properly. I used to hate the saying "what you don't have cannot be broken" but nowadays I appreciate it. The default should always be YAGNI
13:23:54FromGitter<Araq> '.?' is different enough from '.' to make people trip over it.
13:24:29FromGitter<mratsim> seems to work fine for Rust, though it’s less than a year old iirc
13:24:35PMunchYAGNI?
13:24:44FromGitter<mratsim> you aren’t gonna need it
13:24:49PMunchAh
13:25:20FromGitter<mratsim> typically the `==?` are YAGNI I think.
13:25:20FromGitter<Araq> I'm not familiar with Rust but for Nim it would mean a spec change so that some "dot like operators" are really parsed as the dot is
13:25:32PMunchHmm, I think =? should possibly be added as well. Assign the inner value if it is a some
13:25:46FromGitter<mratsim> ah, this would break Arraymancer badly.
13:26:21FromGitter<mratsim> I use .* vs * for element-wise matrix multiplication vs true matrix multiplication
13:26:24PMunchAraq, hmm. How so?
13:26:49FromGitter<Araq> I've told you. 'a.b[c]' is (a.b)[c]
13:27:06FromGitter<Araq> a.?b[c] is a .? (b[c])
13:27:34FromGitter<Araq> I can count the hours until somebody would complain about this gotcha.
13:28:22*xet7 joined #nim
13:28:42PMunchHmm, I need to test that
13:32:25FromGitter<Araq> and finally, if it's not dead-simple stuff it should start its life as a nimble package and then be adopted into the stdlib when enough people demand it. But we cannot do that for Option[T] as it would lead to incompatible Option[T] types. Solution: Only offer a barebones Option[T] and let others provide the sugar
13:32:58*heinrich5991 quit (Ping timeout: 256 seconds)
13:32:59FromGitter<Araq> Nim's design of not attaching procs to types really helps this design, we should make use of Nim's strengths.
13:34:16FromGitter<Araq> in fact, I thought about adding Rect, Point, Matrix etc types to the stdlib for the same reason. Matrix is too complex to get right though.
13:36:09*heinrich5991 joined #nim
13:39:07PMunchTrying to test this a.b[c] thing, but I can't really think of an example that would break
13:39:29PMunchI can see your point about packages though
13:40:08PMunchI just feel like this seq/string not nil thing will be more controversial without a good built-in way to handle optional value
13:40:45FromGitter<Araq> I'd also like to add a `keyboard.nim`
13:41:40FromGitter<Araq> colors, keys, rects, points -- every library does its own thing, a stdlib can try to unify these
13:42:30*dadabidet quit (Quit: Leaving)
13:44:46FromGitter<Araq> probably nobody cares though, text is good enough and computers are not about graphics or input devices or any of that fluffy stuff that was invented after 1970
13:45:24*elrood quit (Quit: Leaving)
13:45:24PMunchI'd love to see rects, points, colors implemented in stdlib
13:45:33PMunchI ran into this issue with SDLGamelib
13:45:46PMunchWanted to make it generic but I used the SDL library point and rect types
13:45:57PMunchNot sure what you mean by key though?
13:46:13FromGitter<Araq> mostly an enum that describes the typical keys on a keyboard
13:46:30copygirlBut they're different depending on layout, right?
13:47:01stefanos82@Araq: is it illegal to name a nim module as some-thing.nim?
13:47:04FromGitter<Araq> yes and no, they are mapped to the a-z and control keys
13:50:44FromGitter<ephja> scancodes! :p
13:51:29FromGitter<ephja> but yeah don't specialize the official modules too much
13:56:18PMunchProblem is that now people can't use nil the options module will be a lot more used. It's not really that special any longer, and I feel it should be more ergonomic to use it, otherwise people will just be annoyed they can't use != nil
13:58:23FromGitter<Araq> well I ported thousands of lines and 'nil' vs "" is just almost never required.
13:58:33FromGitter<Araq> "" is fine, no need for Option[string]
13:59:19FromGitter<Araq> the biggest problem are the db_ modules which will get support for Json in the hope it also makes the integers case faster
14:01:15FromGitter<Araq> but let's assume you're right, why not have `==`(x: Option[T]; T): bool to make the comparisons easier? who asked for ==? and .? ?
14:03:57PMunchThe .? people asked explicitly for in the PR
14:04:51PMunchThe other question marks were added as the options returned a new option, but those are gone now
14:05:49PMunchThe only stuff that's added now is .?, allSome, and some wrappers
14:06:06PMunchAnd I split out some of what used to be options into the new optionutils module
14:06:21*Vladar joined #nim
14:06:26FromGitter<Araq> your `either` template evaluates the first parameter twice
14:07:14PMunchAh yes
14:07:14FromGitter<Araq> I'm not saying this PR is bad, I'm trying to explain how the stdlib should be designed in the future, IMO.
14:07:37PMunchIt used to be a proc, forgot to add the let statement
14:08:12FromGitter<Araq> there is now an evaluateOnce in sequtils...
14:08:24FromGitter<Araq> should probably be in macros.nim instead
14:09:45*kapil____ quit (Quit: Connection closed for inactivity)
14:11:38PMunchI'll fix the either bug later today. Have to go now
14:11:39*PMunch quit (Quit: Leaving)
14:18:42TheLemonManshould we support or reject pragmas on for loop variables?
14:19:41FromGitter<Araq> reject them, except for .inject and .gensym
14:19:50FromGitter<Araq> which is why they were added
14:29:00dom96Araq: Can we merge this? https://github.com/nim-lang/Nim/pull/8727
14:29:58shashlickdom96: had a question around nimble packages - right now there's already 15 nimgen wrappers and there's many more we are looking into - do you have any recommendations on scaling these wrappers? right now they are all in separate repos which is its own maintenance headache. Any feedback around having all of them in one repo instead of maintaining a separate repo each? Any other i <message clipped>
14:30:30dom96"<message clipped>" lol?
14:31:42TheLemonManyou have to pay to see the remaining part
14:32:02dom96Nimble supports multiple packages in one repo now: https://github.com/nim-lang/nimble/blob/master/tests/tester.nim#L703
14:32:09dom96so you can do that if it helps
14:32:18FromGitter<ephja> what a cautious client :p
14:32:44FromGitter<Araq> @dom96 what's your opinion on Rect, Point, Key?
14:32:58dom96I bet the message was "Any other ideas?" and it was clipped to a longer message hah
14:33:15dom96Araq: Key?
14:33:24FromGitter<ephja> keyboard key
14:33:54FromGitter<ephja> hmm, rect. x,y,w,h or center, halfSize? :p
14:34:54shashlickmeh - must be matterbridge being conservative
14:35:01shashlickat least it should send the rest
14:35:44dom96from what I've seen matterbridge is frustratingly bad at dealing with long messages
14:35:51FromGitter<ephja> hopefully it's letting you know about it
14:35:59dom96to the point of "how the hell did the developers not implement this as a first-thing?"
14:36:24shashlickdidn't tell me squat on this side
14:37:02dom96Yeah... time to write a relay bot in Nim
14:37:22shashlicki see that nimble allows multi package repos but am curious if any feedback around putting too much into one repo
14:37:34shashlickif we end up with 100 wrappers, is it sensible to have it in one repo
14:37:53shashlickcurious if it helps around maintenance, issues, etc
14:37:56dom96I'd say no, but it depends what you need to maintain
14:38:38shashlicklike after our discussion on nimble install of nimgen dependency, I need to update the nimble file for every package, create tags, etc.
14:38:46shashlicktimes 15 now but times 40 in a year?
14:38:57FromGitter<data-man> @Arag: Rename #7062 to input events :)
14:40:35FromGitter<ephja> terminal only? :p
14:40:42*heinrich5991 quit (Ping timeout: 260 seconds)
14:41:09shashlicktomorrow you add the task require feature and i'll have to change everything again, though that may not be backwards compatible so will have to hold off for a few years
14:41:41dom96hm
14:41:54dom96You've just surfaced a problem with my multi-package approach
14:42:02FromGitter<data-man> @ephja: Now the concept has changed. :-D
14:42:14dom96a single git repo will have only one list of tags
14:42:26dom96so the packages inside the repo all need to have the same version
14:42:34dom96I dunno, maybe that's not a problem in practice
14:42:50shashlickya I was just thinking about that
14:43:08*heinrich5991 joined #nim
14:43:35shashlickit doesn't help when we get to a point where you can lock a wrapper tag to a specific upstream tag
14:43:46*Xe quit (Ping timeout: 268 seconds)
14:44:20dom96I don't really think there is much I can do about that
14:46:51shashlickya don't think it is nimble specific but just general feedback
14:47:30FromGitter<Araq> monorepos rule. :-)
14:50:40TheLemonManAraq, wrt #8746 should I amend it or drop it alltogether?
14:51:50FromGitter<Araq> your choice -- I think it's unnecessary
14:56:51shashlickI guess I just need to write scripts to simplify making mass updates and git commit/push
15:00:11FromGitter<bung87> anyone could improve `nre` module performance? the `nre.split` 3-4 times slower than python
15:01:00FromGitter<bung87> or may wrap https://github.com/google/re2 to nim
15:03:40TheLemonManAraq, compiling with -d:release doesn't seem to allow the compiler to elide the copystrings
15:04:59*kapil____ joined #nim
15:05:57*Xe joined #nim
15:06:17FromGitter<Araq> huh, why not, missing .inline?
15:08:00FromGitter<Araq> bung87 `nre` is deprecated though and splitting with a regex is a poor man's parser
15:08:32dom96Seriously? https://travis-ci.org/nim-lang/Nim/builds/419684345?utm_source=email&utm_medium=notification
15:09:44*heinrich5991 quit (Ping timeout: 276 seconds)
15:09:47TheLemonManAraq, yeah, inline is missing
15:09:48FromGitter<bung87> @Araq then what package else can use? I checked re,nre,regex.
15:11:02FromGitter<Araq> `regex` is pretty cool
15:11:18*heinrich5991 joined #nim
15:13:36FromGitter<bung87> `re_han = re(r"(*UTF)([\p{Han}]+)")` cant find a example like this
15:14:47*Trustable joined #nim
15:15:45pigmejdom96: am I wrong or asyncnet.connect doesn't handle properly initial connection timeouts ?
15:16:21dom96What do you mean?
15:16:23pigmejOR the default timeout is somehow crazy
15:16:39pigmejwhat's the default timeout for socket connect?
15:18:03pigmejor should I handle *all* sockets ops with withTimeout ? (sounds bit strange though)
15:21:53dom96That's up to the OS AFAIK
15:24:23dom96Seems you can set SO_RCVTIMEO/SO_SNDTIMEO on the socket to control this
15:24:23*pwntus quit (Read error: Connection reset by peer)
15:25:28FromGitter<Araq> how did that happen? https://travis-ci.org/nim-lang/Nim/jobs/419684346
15:25:36FromGitter<Araq> travis was green when I merged that PR!
15:25:53dom96Yes
15:25:57dom96I'm as annoyed as you
15:26:09*rayman22201 quit (Remote host closed the connection)
15:27:08*pwntus joined #nim
15:27:57dom96I'll fix it
15:28:00dom96The test is flaky
15:28:48FromGitter<Araq> ok, thanks
15:29:33*pwntus quit (Changing host)
15:29:33*pwntus joined #nim
15:29:42*heinrich5991 quit (Ping timeout: 256 seconds)
15:30:17*heinrich5991 joined #nim
15:37:53*floppydh quit (Quit: WeeChat 2.2)
15:38:48FromGitter<Araq> what does `\p{Han}` mean?
15:40:44FromGitter<Araq> never mind, found it
15:41:20FromGitter<Araq> should be covered by `regex`, please ask on its github issue tracker
15:44:23dom96How does HeapQueue determine the length of its elements?
15:45:03dom96i.e. how does it know which element is the "smallest"?
15:45:14TheLemonManhardcoded cmp using <
15:49:33dom96bah, heapqueue module should really be called heapqueues
15:50:42*k6ka25 joined #nim
15:52:22*heinrich5991 quit (Ping timeout: 256 seconds)
15:52:58dom96lol what
15:53:00dom96!eval echo((epochTime() + 5, "foobar") < (epochTime() + 10, "alberta"))
15:53:02NimBotCompile failed: in.nim(1, 7) Error: undeclared identifier: 'epochTime'
15:53:04*k6ka25 quit (Remote host closed the connection)
15:53:11dom96!eval import times; echo((epochTime() + 5, "foobar") < (epochTime() + 10, "alberta"))
15:53:15NimBottrue
15:53:51dom96Araq: Why is there a `<` for tuples?
15:54:53*heinrich5991 joined #nim
15:56:23TheLemonManconsistency™ probably, but it makes no sense
15:57:04dom96Python does it too
15:57:15dom96!eval echo((5.5, 30) < (10.0, 25))
15:57:18NimBottrue
15:57:18FromGitter<kaushalmodi> dom96: For version compares
15:57:42dom96A tuple containing a float and a string?
15:57:54dom96Okay, sure, if the tuple is all numbers then I can deal with that
15:58:02dom96But it just compares the first position and calls it a day
15:58:18dom96!eval echo((5.5, 30) < (10.0, 25, 56, 123123))
15:58:19NimBotCompile failed: in.nim(1, 16) Error: type mismatch: got <tuple of (float64, int), tuple of (float64, int, int, int)>
15:58:31dom96!eval echo((5.5, 30, 102131023213, 124124) < (10.0, 25, 56, 123123))
15:58:32NimBotCompile failed: in.nim(1, 38) Error: type mismatch: got <tuple of (float64, int, int64, int), tuple of (float64, int, int, int)>
15:58:47dom96!eval echo((5.5, 30, 102131023213, 124124) < (10.0, 25, 56'i64, 123123))
15:58:47FromGitter<kaushalmodi> https://scripter.co/notes/nim/#tuple-comparison
15:58:49NimBottrue
15:59:30FromGitter<kaushalmodi> dom96: It keeps on going till the first non-equal match from the left
16:00:06FromGitter<kaushalmodi> agreed that the < should be made to works on tuples where it made sense
16:01:46FromGitter<kaushalmodi> More than those tuple compares, I find the string compares strange: https://scripter.co/notes/nim/#string-comparison
16:05:33FromGitter<GULPF> the tuple thing can be used to sort on multiple fields, e.g `lst.sortedByIt((it.field1, it.field2))`
16:17:22FromGitter<bung87> @Araq thanks! I posted a issue to `regex ` just now.
16:19:04FromGitter<kaushalmodi> Talking about regex, where can I find good examples of replace from nre module?
16:22:56dom96The nre module is deprecated
16:25:03FromGitter<kaushalmodi> So what's the best way for search/replace using regex?
16:30:50FromGitter<data-man> I think the best way to replace PCRE with PCRE2. PCRE2 has very cool https://www.pcre.org/current/doc/html/pcre2_substitute.html
16:31:55FromGitter<kaushalmodi> I believe we don't have a Nim wrapper for that, right?
16:32:14FromGitter<kaushalmodi> I was just playing with regex and replacements and was trying to figure out the current best way to do it
16:32:34FromGitter<kaushalmodi> As a side note, where are the older changelogs saved on the devel branch?
16:32:46FromGitter<kaushalmodi> I was trying to find the version where nre got deprecated
16:35:47shashlick@kaushalmodi: look at nimgen source code - using regex extensively there
16:36:08FromGitter<kaushalmodi> regex is the nimble package, right?
16:36:17shashlickI used nre a lot in the past but have started using nim-regex now cause it is pure nim
16:36:31shashlickI believe @data-man is looking into a PCRE2 wrapper
16:36:41*SenasOzys quit (Remote host closed the connection)
16:37:00FromGitter<kaushalmodi> shashlick: Thanks!
16:37:17FromGitter<kaushalmodi> Until nim-regex gets into core, the re module is the best way?
16:37:24dom96kaushalmodi: the 're' module
16:38:02shashlickif you are bothered by the pcre.dll requirement, check out nimpcre
16:38:03FromGitter<bung87> could use https://github.com/genotrance/nimgen wrap pcre or https://github.com/google/re2 I think,but I dont have that skill.
16:38:32shashlickpcre is already wrapped by `re` and you can use nimpcre to build it into your binary
16:38:38shashlickpcre2 - data-man is looking into it
16:38:39*SenasOzys joined #nim
16:38:42FromGitter<kaushalmodi> I just tried out https://ptpb.pw/S6Of/nim .. works fine
16:39:28FromGitter<kaushalmodi> .. was basically writing a reply to https://mstdn.io/@xahlee/100600228333192182
16:39:33shashlickgoogle/re2 - looks like C++ so might be harder to wrap, but will check it out
16:40:59FromGitter<kaushalmodi> btw I use the `(?i)` syntax from nre in that example using re
16:41:02FromGitter<kaushalmodi> and it worked
16:41:11FromGitter<kaushalmodi> but that is not documented anywhere on https://nim-lang.org/docs/re.html
16:42:03shashlickthat's just pcre syntax right?
16:42:19FromGitter<kaushalmodi> hmm.. TIL
16:42:59FromGitter<kaushalmodi> yup, https://pcre.org/pcre.txt
16:43:05FromGitter<bung87> in mine case I use `let re_han = re(r"(*U)([\p{Han}]+)")` split string,` re` much slower than `nre` and both much slower than python ... so I will keep looking for aternative
16:44:50*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
16:48:30FromDiscord_<awr> yo
16:49:02FromGitter<ephja> what up
16:49:06FromDiscord_<awr> nm
16:49:36FromDiscord_<awr> what linux distro is good if you need bleeding-edge packages and are uninterested in manually compiling things all the time
16:49:40FromDiscord_<awr> arch?
16:50:35FromGitter<kaushalmodi> Who from here is active on Mastodon?
16:50:43FromGitter<kaushalmodi> Here was my reply to that Go lang snippet: https://mastodon.technology/@kaushalmodi/100600552586424281
16:51:06*Perkol joined #nim
16:53:44FromDiscord_<awr> nim needs one of those human readable regex libraries
16:53:51FromDiscord_<awr> for ex: https://github.com/VerbalExpressions/elm-verbal-expressions
16:56:18*captainkraft quit (Ping timeout: 264 seconds)
16:58:50FromGitter<kaushalmodi> awr: Yeah, Emacs/Emacs-Lisp has this "rx" library. This blog post introduces that lib well: https://francismurillo.github.io/2017-03-30-Exploring-Emacs-rx-Macro/
16:59:37FromGitter<data-man> High-performance regular expression matching library by Intel: https://github.com/intel/hyperscan Wrap it! :)
17:00:17FromGitter<mratsim> @shashlick, I’m always saying this but it would be really helpful if the wrapper proc signature was available in the github repo: for example: https://github.com/genotrance/nimbass
17:00:49FromGitter<mratsim> I know you have an external site but people go on Github first. And there is no git diff on external websites
17:05:03*byte512_ quit (Ping timeout: 260 seconds)
17:12:11*heinrich5991 quit (Ping timeout: 268 seconds)
17:13:20shashlick@mratsim: right - https://github.com/genotrance/nimgen/issues/37
17:13:30shashlickplease add your comments and suggestions
17:14:38*heinrich5991 joined #nim
17:18:47PerkolIs there any library to work with clipboard?
17:19:01shashlicknimclipboard
17:19:20*zachk joined #nim
17:19:40*zachk quit (Read error: Connection reset by peer)
17:20:22FromDiscord_<awr> added the WASM PR last night so idk if any of y'all wanna take a look at it
17:26:34*heinrich5991 quit (Ping timeout: 268 seconds)
17:28:17*heinrich5991 joined #nim
17:38:56PerkolThanks
17:40:23*captainkraft joined #nim
17:48:09*zachk joined #nim
17:48:24*zachk quit (Changing host)
17:48:24*zachk joined #nim
17:48:28FromDiscord_<treeform> Is there a wrapper for JavaScripts Regex?
17:49:23*Trustable quit (Remote host closed the connection)
18:03:16FromDiscord_<treeform> https://gist.github.com/treeform/a0a6da00fa0dc18ed05a5923a25dbd1e
18:03:20FromDiscord_<treeform> Does any one have anything better?
18:04:13FromDiscord_<treeform> awr link to WASM pr?
18:04:20FromDiscord_<treeform> @awr link to WASM pr?
18:07:34*NimBot joined #nim
18:10:08*Perkol quit (Remote host closed the connection)
18:12:55*aOssed26 joined #nim
18:15:01*aOssed26 quit (Remote host closed the connection)
18:21:49*SenasOzys quit (Quit: Leaving)
18:22:02*SenasOzys joined #nim
18:22:56*SenasOzys quit (Remote host closed the connection)
18:23:03*SenasOzys__ joined #nim
18:23:25*SenasOzys__ quit (Remote host closed the connection)
18:23:36*SenasOzys joined #nim
18:24:34*SenasOzys quit (Client Quit)
18:24:43*SenasOzys joined #nim
18:30:30*SenasOzys quit (Ping timeout: 268 seconds)
18:35:19*nsf joined #nim
18:37:24FromGitter<mratsim> @treeform: https://github.com/nim-lang/Nim/pull/8738
18:37:43*SenasOzys joined #nim
18:42:38FromDiscord_<treeform> thanks!
18:43:03*Croepha4 joined #nim
18:49:28*Croepha4 quit (Ping timeout: 260 seconds)
18:52:10FromGitter<mratsim> Seems like a good target for a Nim wrapper: https://github.com/GPUOpen-LibrariesAndSDKs/V-EZ
18:55:11shashlickwow 3 days old
19:13:54FromGitter<zetashift> @mratsim I don't really get it, is it just some interfaces to make the API easier?
19:14:34FromGitter<mratsim> I suppose, I didn’t dive into vulkan at all
19:25:29*a_b_m joined #nim
19:27:57*stefanos82 quit (Quit: Quitting for now...)
19:29:17*abm quit (Ping timeout: 268 seconds)
19:39:01FromGitter<Araq> @treeform wanna patch NimEdit to use your font renderer?
19:39:37FromGitter<kayabaNerve> I think I found a bug
19:39:53FromGitter<kayabaNerve> My function has just `ref` in the signature
19:40:18FromGitter<kayabaNerve> I couldn't cast an address to a raw ref so I casted to ref bool (it was a bool)
19:40:46FromGitter<kayabaNerve> Nim now expects all return values to be of ref bool
19:42:00FromGitter<Araq> just `ref`? that would be a typeclass
19:42:12FromGitter<kayabaNerve> I'm not saying this should be allowed; looks like I have to use pointers; my comment was that the finding signature changed
19:42:19FromGitter<kayabaNerve> *function signature
19:42:55FromGitter<kayabaNerve> (that's probably an inaccurate term; it said ref; first return was of ref bool; everything was then expected to be of ref bool)
19:43:24FromGitter<kayabaNerve> Again. Not saying I should be allowed to use ref/ref bool/ref int. Saying the signature changed.
19:46:20FromGitter<Bennyelg> How I can implement list of procs
19:46:31FromGitter<Araq> I don't think it "changed", you got multiple instantiations of the implicit generic
19:47:57FromGitter<Bennyelg> seq[proc1, proc2, proc3]
19:48:03FromGitter<Bennyelg> any way to do it ?
19:49:54*krux02 quit (Remote host closed the connection)
19:51:30FromGitter<Araq> these all have to have the same signature then and usually you're better off with a macro
19:51:53FromGitter<Araq> but it's entirely possible: seq[proc () {.closure.}]
19:52:01FromGitter<Araq> watch out for the calling conventions
19:52:24FromGitter<Bennyelg> I dont want them to have the same signature :/
19:54:34FromGitter<Araq> usually you can hide the type differences in the closure's environment
19:57:01FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7f118dcff55e56174f70ed]
20:02:52FromGitter<Araq> can't work, you need
20:03:06FromGitter<Araq> m.beforeMove.add(proc () = fun args)
20:05:25FromGitter<Bennyelg> same error :(
20:06:41FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7f13d1fd3c641b06fd81e5]
20:08:28FromGitter<tim-st> I think it's not needed at all (in general) to save procs in a collection; most likely you can easily implement this using a `case`
20:08:49FromGitter<Bennyelg> example will be great
20:13:17FromGitter<tim-st> I dont know what you want to achieve, I just say you can always translate it using a case
20:13:38FromGitter<Bennyelg> adding proc into a variable and use it later
20:14:15FromGitter<tim-st> but why do you add a proc? a proc is known at compile time; instead you could add an int, or some unique identifier
20:16:33FromGitter<Araq> check how Ormin does it
20:21:33*PMunch joined #nim
20:37:37*nsf quit (Quit: WeeChat 2.2)
20:39:45*kapil____ quit (Quit: Connection closed for inactivity)
20:45:26dom96Sooo the test I have written passes locally
20:45:30dom96and I tested it on Linux too
20:45:37dom96But for some reason travis fails on it
20:47:21FromGitter<Araq> that PR queue ... it kills me.
20:47:44PMunchGetting more and more popular is both a blessing and a curse
20:47:59FromGitter<Araq> nah, it's only a blessing, it's awesome
20:48:21FromGitter<mratsim> @tim-st, it’s fine to add proc to a collection, but you need to make sure you use {.nimcall.} or {.closure.} everywhere
20:48:36PMunchWell that PR queue won't shrink the more people who gets interested in Nim :)
20:48:43FromGitter<mratsim> closure if you carry environment around, nimcall if you want to use it like a normal proc
20:49:20FromGitter<Araq> also .nimcall if you need the speed
20:49:27FromGitter<mratsim> that’s basically dynamic dispatch
20:49:42FromGitter<mratsim> if you need the speed use a template and inline everything :P
20:50:03dom96PMunch: More people means more reviewers, hopefully :)
20:50:20FromGitter<mratsim> it first means more requests and complaints
20:51:14PMunchdom96, that's true
20:52:14PMunchBut I guess that effort could be better organized. Set some stricter guidelines on what's to be accepted and not for example.
20:52:28PMunchIt feels like a bit of a hit or miss if things are going to be accepted or not
21:10:02*a__b__m joined #nim
21:14:07*a_b_m quit (Ping timeout: 268 seconds)
21:14:51*seni quit (Quit: Leaving)
21:22:59*arecaceae quit (Remote host closed the connection)
21:23:16*arecaceae joined #nim
21:29:11*PMunch quit (Remote host closed the connection)
21:38:58*Vladar quit (Remote host closed the connection)
21:40:09*Jesin quit (Quit: Leaving)
21:50:45*Jesin joined #nim
21:58:20FromGitter<Araq> I'm thinking about principles of how to grow this thing without it becoming more of a mess all day long
21:59:13zachkhow do I do a for loop over a sequence?
22:01:25FromGitter<Araq> via a for loop
22:03:03*SenasOzys quit (Ping timeout: 252 seconds)
22:15:52FromGitter<zetashift> @zack `for element in yoursequence: `
22:16:36*noonien quit (Quit: Connection closed for inactivity)
22:20:02FromGitter<kayabaNerve> for wronglyNamedElement in notASequence:
22:20:24FromGitter<kayabaNerve> Use preprocessor rules to redefine in as out :thinking:
22:20:58FromGitter<kayabaNerve> There's also `for i in 0 ..< seq.len:` which is useful if you don't just care about the values but the order they're in/their count
22:23:59zachkso I don't need to use 'for item in s.items:'?
22:24:15FromGitter<kayabaNerve> Nope.
22:25:11FromGitter<Araq> actually in a generic context, you still do... (somewhat hard to fix...)
22:25:30FromGitter<kayabaNerve> Oh. You can use `for i, element in mySeq:`. Cool
22:29:40FromGitter<ephja> `for i in foo` -> `for i in items(foo)`, `for i, x in foo` -> `for i, x in pairs(foo)`
22:33:50FromDiscord_<awr> ugh this emscripten+wasm stuff is killing me
22:33:59FromDiscord_<awr> i need to try the clang wasm stuff again
22:37:01FromDiscord_<awr> i keep getting an error about __wait being an unresolved symbol in emcc
22:42:33AlexMaxhey shashlick, want a challenge?
22:42:39AlexMaxwrap dear imgui :P
22:53:17FromDiscord_<awr> also i need to stop trying to code outside
22:53:35FromDiscord_<awr> computer bugs are enough i don't need real bugs on top of them
22:54:30FromDiscord_<awr> [audience laughter]
22:55:11FromGitter<zetashift> be one with nature dawg
22:55:37FromDiscord_<awr> i said i wanted was*m* not a was*p*
22:57:49shashlickWorth a try @AlexMax
22:58:06shashlickWasn't there already a wrapper?
22:58:53FromDiscord_<awr> since emcc isn't providing me with useful error messages and i'm just gonna hold this off until tomorrow and then start commenting stuff out of the nimcache and seeing what sticks
22:58:58shashlickhttps://github.com/lmariscal/nimgl/blob/master/src/nimgl/imgui.nim
23:01:28FromDiscord_<awr> emcc's wasm output for nim code doesn't validate correctly against the wasm suite, plus when you tell it to produce an html file it produces asmjs instead even when you tell binaryen "please please just give me wasm and just fail if you can't do that instead of an asmjs fallback"
23:02:17*test__ joined #nim
23:03:44FromDiscord_<awr> basic C programs output just fine to wasm. Chrome can be a little pedantic on the HTML output though so you'll need a local HTTP server or something. I remember it used to be like that for asm.js but I think it changed
23:04:12*SenasOzys joined #nim
23:05:04FromDiscord_<awr> once i'm done with emcc i'll move my attention to clang
23:09:02FromDiscord_<awr> also @zetashift wrt V-EZ there's been some desire to create a simpler, somewhat less low-level interface to vulkan on top of vulkan, think the way D3D11 is to D3D12
23:10:47FromDiscord_<awr> and yes people are still using D3D11 Microsoft is not going to kill it. they've been adding features to it since D3D12 came out, positioning it as a "low-level but not that low-level" API to counterpart D3D12.
23:12:02*test__ quit (Quit: Leaving)
23:19:47*zachcarter joined #nim
23:21:24AlexMaxSo this is a little confusing
23:21:35AlexMaxI have a proc that has the following signature
23:21:38AlexMaxproc persist*(atlas: var Atlas, p: PersistProc) =
23:21:56AlexMaxPersist Proc is a type PersistProc* = proc(data: ptr, x, y, w, h: uint32)
23:22:28AlexMaxBut when I actually try passing a proc to the function...
23:22:30AlexMaxatlas.persist(proc (data: ptr, x, y , w, h: uint32) =
23:22:41AlexMaxit says there's a type mismatch
23:22:54AlexMaxDo I have to cast the proc somehow?
23:28:24FromGitter<zetashift> @awr thanks I heard vulkan was really low level
23:28:46AlexMaxFinally, got it
23:28:58AlexMaxwell, not really, let me try the exported type again
23:29:38AlexMaxYeah, got it
23:41:24FromDiscord_<hcorion> woah when did Nim get a discord
23:41:47FromGitter<zetashift> quite a while ago
23:41:58AlexMaxusing discord for programming stuff feels yucky :P
23:42:07AlexMaxeven though I do prefer it to slack and gitter
23:42:38FromDiscord_<hcorion> I have it up all the time for other projects I work on
23:42:46FromDiscord_<hcorion> haven't hung around Nim in a while
23:43:06FromGitter<zetashift> welcome back !
23:46:58*cow_2001 quit (Quit: cow_2001)
23:51:20AlexMaxoof
23:51:33AlexMaxI can't take the address of the first character of a string passed to an anonymous proc
23:51:49AlexMaxwithout assigning the string to a local variable and taking the address of that
23:54:00AlexMaxhttps://paste.ee/p/oXo2z
23:57:54*zachk quit (Quit: Leaving)
23:58:22FromGitter<kayabaNerve> Discord ftw
23:58:42FromGitter<kayabaNerve> I was on too many servers/have some Gitter exclusive servers anyways though