<< 06-12-2019 >>

00:05:52disrupteki agree that configurability is generally overrated.
00:06:51cloudberbut OTOH nim is style insensitive
00:06:58cloudberfor good
00:23:12*tiorock joined #nim
00:23:12*tiorock quit (Changing host)
00:23:12*tiorock joined #nim
00:23:12*rockcavera is now known as Guest5300
00:23:12*Guest5300 quit (Killed (cherryh.freenode.net (Nickname regained by services)))
00:23:12*tiorock is now known as rockcavera
00:25:13*cloudber quit (Quit: WeeChat 2.6)
00:33:45*Hideki_ joined #nim
00:38:19*krux02 quit (Remote host closed the connection)
00:49:28*ponyride1 quit (Ping timeout: 245 seconds)
00:51:50*Hideki_ quit (Remote host closed the connection)
01:06:08*rusua joined #nim
01:17:07*dwdv quit (Ping timeout: 268 seconds)
01:57:49*gmpreussner quit (Ping timeout: 268 seconds)
02:04:36*lritter quit (Ping timeout: 268 seconds)
02:05:04*lritter joined #nim
02:20:15*nif quit (Quit: ...)
02:20:25*nif joined #nim
02:22:47disrupteknimph and lockfiles doing their job: compiler-#1db21721ec816e01ef91633941e0295f7724e1f7 repository in invalid bisect state
02:23:02disrupteknot confident enough to lock nimph-#d155fe5e3127c2998162b99ee153e780fc7b09b1
02:38:11rayman22201nimph has lockfiles now? you have been busy lol.
02:38:45*dchem quit (Ping timeout: 265 seconds)
02:48:04disrupteklockfiles is about 5% of the codebase, so i can't say i've spent much time on them.
02:48:37disruptekbut it's nice to see them work, even it's only on writes.
02:50:00rayman22201indeed. Even a proof of concept is nice!
02:50:42disrupteki'm learning things, yeah.
02:51:02disrupteki'm really glad i made this. it's been great.
02:51:23FromDiscord<yewpad> what's the purpose of lockfiles? i don't quite get it
02:51:49disruptekto make a record for reference regarding what combination of dependencies was used successfully.
02:52:06FromDiscord<yewpad> hm
02:52:46disruptekprobably the right reaction, all things considered.
02:53:59rayman22201this is a decent explanation from nodejs land: https://www.twilio.com/blog/lockfiles-nodejs
02:55:30disruptekjust take a look at the data that's in there; it can answer certain questions... play jeopardy for a minute or two and you'll get the idea.
02:55:56disruptekreally not something that should take more than an afternoon to implement, and indeed, it did not.
03:05:36*ponyrider joined #nim
03:15:24*rusua quit (Quit: Connection closed for inactivity)
03:25:17*lritter quit (Ping timeout: 240 seconds)
03:42:32*endragor joined #nim
04:04:52*nsf joined #nim
04:05:09*chemist69 quit (Ping timeout: 250 seconds)
04:07:10*chemist69 joined #nim
04:14:00*gmpreussner joined #nim
04:45:58*narimiran joined #nim
05:03:13*chemist69 quit (Ping timeout: 250 seconds)
05:05:23*chemist69 joined #nim
05:20:59*dddddd quit (Ping timeout: 250 seconds)
05:23:15*rockcavera quit (Remote host closed the connection)
05:45:30*njoseph quit (Ping timeout: 252 seconds)
05:58:33FromDiscord<Rika> orderedset has missing functionality it seems
05:58:53FromDiscord<Rika> how do i get an intersection while retaining insertion order?
06:44:13*kevinchau joined #nim
06:44:23kevinchauhi
06:45:25*solitudesf joined #nim
06:45:29*Sargun quit (Ping timeout: 276 seconds)
06:49:59*Sargun joined #nim
06:59:40FromGitter<cndkhuong> hi
07:00:12kevinchauexit
07:00:16*kevinchau quit (Quit: ERC (IRC client for Emacs 26.3))
07:01:47FromGitter<cndkhuong> I'm trying with hotcodereloading but got issue : could not load: libnimhcr.so
07:02:08FromGitter<cndkhuong> someone had exp on it ? please help
07:02:35*njoseph joined #nim
07:04:43Araqyou need to build libnimhcr.so first
07:04:52Araqhave you read the 'hcr' article?
07:05:51*dwdv joined #nim
07:06:05FromGitter<cndkhuong> I'm reading this link https://nim-lang.org/docs/hcr.html
07:06:27FromGitter<cndkhuong> isn't it ?
07:06:40FromGitter<cndkhuong> sorry, I'm newbie
07:08:17Araqthat's the article, yes
07:08:55FromGitter<cndkhuong> let me try, thank you
07:09:07Araqmaybe you also need to add
07:09:09Araq --passL:-rpath --passL:@loader_path
07:09:15Araqto your compile commands, not sure
07:09:41Araqoh wait that's OSX specific (?)
07:10:22FromGitter<cndkhuong> it's linux (ubuntu distro)
07:12:54Araqset LD_LIBRARY_PATH on Ubuntu
07:17:33*njoseph quit (Ping timeout: 250 seconds)
07:20:04*njoseph joined #nim
07:32:37*solitudesf quit (Ping timeout: 240 seconds)
07:40:04*PMunch joined #nim
07:40:26FromGitter<cndkhuong> I still got same issue. What did I understand from article : write a module with hotcodereloading and invoke performCodeReload() after that I imported this module to main module and compile with option --hotcodereloading:on
07:41:22FromGitter<cndkhuong> ```#logic.nim ⏎ import hotcodereloading ⏎ proc init*() = ⏎ performCodeReload()``` [https://gitter.im/nim-lang/Nim?at=5dea06228e906a1c8d7b0ee2]
07:42:15FromGitter<cndkhuong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5dea06571659720ca809e37c]
07:43:17shashlickYou need to compile the hcr library and link to it during compile
07:45:19FromGitter<cndkhuong> do you have any link about that ? :'(
07:47:57shashlicknim c --app:lib nim/dir/lib/nimhcr
07:48:06shashlickOn a phone, cannot verify
07:48:16shashlickDo the same for the nimrtl library as well
07:48:46shashlickThen export LD_LIBRARY_PATH=nim/dir/lib
07:53:34FromDiscord<Kaynato> is [] as an empty array going to allocate the overhead, or does it point to some singleton...? I want to make sure that giving this as the return type of `lent Enumerable[int]` won't cause memory issues
07:54:43Araqit doesn't allocate anymore but 'lent T' might cause trouble anyway
07:54:58Araqwe're sorting it out
08:00:00*gmpreussner quit (Quit: kthxbye)
08:00:41FromGitter<cndkhuong> Thanks shashlick & Araq , after I compiled nimrtl & nimhcr
08:00:52FromGitter<cndkhuong> but got another error : could not import: csuCmpIgnoreStyle
08:02:42FromGitter<cndkhuong> Nim Compiler Version 1.0.2 [Linux: amd64] ⏎ Compiled at 2019-10-22
08:03:29Araqso don't use module strutils ;-)
08:03:36Araqbut it's progress
08:04:33*gmpreussner joined #nim
08:05:31FromDiscord<Kaynato> got it, thank you!
08:16:10*wink left #nim ("https://quassel-irc.org - Chat comfortably. Anywhere.")
08:17:37*Vladar joined #nim
08:39:04FromDiscord<Kaynato> huh, interesting
08:40:01FromDiscord<Kaynato> with AnyGraph[V] = concept g, type G ... Enumerable[Paired[V]].toGraph is G , implementing func toGraph*[V](edges: Enumerable[Paired[int]]): IntGraph still does not satisfy the concept
08:40:33*FromGitter quit (Remote host closed the connection)
08:40:52*FromGitter joined #nim
08:44:45FromDiscord<Kaynato> So if I say I'm returning some Enumerable[int] from a function, and return possibly IntSet or the empty array, though the compiler doesn't complain, it then fails to satisfy the concept,
08:46:26*floppydh joined #nim
08:47:03Araqconcepts are not interfaces
08:47:56Araqreturn a seq[int] from the function, Nim is not C# and Enumerable in C# has its own downsides.
08:48:21Araqlike the fact that you don't know if len/Count is an O(1) operation
08:50:05FromDiscord<Kaynato> I guess returning empty seq[int] should be a safer bet (leaving it to the GC) than wondering if [] is Enumerable[sometype]
08:51:42Araqyou can also offer an iterator x(): sometype if you're after laziness
08:55:12Araqshashlick, what's up with the choosenim problems? the tarballs don't have the execution flag set?
08:55:27*PMunch_ joined #nim
08:55:55*PMunch quit (Ping timeout: 268 seconds)
09:06:18*PMunch__ joined #nim
09:08:48*PMunch_ quit (Ping timeout: 265 seconds)
09:10:46*PMunch_ joined #nim
09:13:15*PMunch__ quit (Ping timeout: 250 seconds)
09:18:47*PMunch__ joined #nim
09:19:03shashlickI tested it and it worked fine
09:19:33shashlickBut issue submitter is running choosenim stable instead of choosenim 1.0.4 so could be something different
09:20:05shashlickI'll take a look
09:20:57*PMunch_ quit (Ping timeout: 240 seconds)
09:21:22shashlickAlso possible libarchive didn't find some dependency and doesn't retain flags but seems unlikely
09:28:47FromGitter<cndkhuong> someone can help me on 'csuCmpIgnoreStyle' error ?
09:30:42Araqas I said, try to *not* import strutils
09:31:28FromGitter<cndkhuong> hi Araq, I'm not using strutils in source codes
09:31:50FromGitter<cndkhuong> I used import asynchttpserver, asyncdispatch
09:32:07FromGitter<cndkhuong> and got this issue
09:32:12Araqoh my, you're in a world of trouble
09:32:24FromGitter<cndkhuong> :D
09:32:29Araqasync hasn't been tested with hot code reloading
09:32:40FromGitter<cndkhuong> ok ok
09:33:10FromGitter<cndkhuong> if I remove web, it works
09:33:20Araqnor do you need it for servers, just use a load balancer
09:33:56FromGitter<cndkhuong> I just try a simple web server
09:34:16FromGitter<cndkhuong> maybe I switch to jester
09:34:19*krux02 joined #nim
09:35:56Araqanyway, here is how to fix it
09:36:25Araqedit nimrtl.nim and add 'cstrutils' to the import list
09:38:08FromGitter<cndkhuong> It works ! Thanks
09:43:27Araqand please create a PR for this...
10:37:04FromGitter<alehander92> is clyybber cloudber
10:37:45FromGitter<alehander92> life changes fast
10:41:48PMunch__Hmm, first time I've seen a ".raise effects differ" error
10:42:54*Trustable joined #nim
10:50:21FromDiscord<Clyybber> @mratsim Did you report your compiler crash on github?
10:50:32FromDiscord<Clyybber> alehander92: only temporary
10:50:53*clyybber joined #nim
11:01:18FromDiscord<itmuckel> Hey guys! The assimp wrapper does this and relies on the "count" variables to access the arrays. So my code works only when I compile with "--boundChecks:off". Of course I don't want to disable boundChecks for my whole program. Can I temporarily disable them for a part of my code (with a pragma or something)?
11:01:18FromDiscord<itmuckel> https://cdn.discordapp.com/attachments/371759389889003532/652464574934679562/unknown.png
11:08:14FromGitter<alehander92> {.push boundChecks:off.}
11:08:33FromGitter<alehander92> then you can {.pop.} after the code
11:08:58Araqitmuckel: fix the wrapper already to use UncheckedArray
11:09:20Araqsystem.UncheckedArray
11:11:54FromDiscord<itmuckel> @alehander92 thx that worked!
11:12:08FromDiscord<itmuckel> @Araq thx, that worked and is the better solution
11:13:27FromDiscord<itmuckel> @Araq once I got a model loaded with it and resolved all annoyances like this, I'll have an up-to-date and working fork
11:23:35FromDiscord<onelivesleft> is there a complicated language reason why `nimsuggest` doesn't find all instances of a token, or is it just a bug? If it's the latter then I was gonna have a look at fixing it, but if it's the former I'd probably be out of my depth.
11:26:28Araqask Zevv or leorize when they around
11:26:59FromDiscord<onelivesleft> what timezone they in?
11:26:59Araqwhat do you mean "find all instances of a token"? nimsuggest doesn't deal with tokens much
11:27:28FromDiscord<onelivesleft> I mean, if you wanted to implement a variable rename refactor, you need to change every time that variable is referenced
11:27:37FromDiscord<onelivesleft> and right now `use` doesn't give them all
11:28:07Araqit does give them all
11:28:42FromDiscord<onelivesleft> 2 secs
11:31:59FromDiscord<onelivesleft> ok, if you look at: https://raw.githubusercontent.com/onelivesleft/simple_parseopt/master/src/simple_parseopt.nim
11:32:13FromDiscord<onelivesleft> and the const `options_instance_label`
11:32:36FromDiscord<onelivesleft> `nim use` will find the first three references to it, but not the bottom two
11:33:13FromDiscord<onelivesleft> the ones inside `template add_field_value_offset`
11:34:15*nsf quit (Quit: WeeChat 2.6)
11:35:18Araqsounds easy to fix
11:36:17FromDiscord<onelivesleft> kk
11:40:47*PMunch_ joined #nim
11:41:54*PMunch_ quit (Read error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number)
11:42:20*PMunch_ joined #nim
11:43:57*PMunch__ quit (Ping timeout: 240 seconds)
11:45:10*tklohna joined #nim
11:45:45PMunch_The schedule for our Minimilistic, Experimental, and Emerging Languages devroom for FOSDEM 2020 is out: https://fosdem.org/2020/schedule/track/minimalistic_experimental_and_emerging_languages/
11:45:56PMunch_And we have no less than four Nim talks this year!
11:49:43Zevv\o/
11:49:45*PMunch_ is now known as PMunch
11:50:53FromDiscord<itmuckel> Haha, nice!
11:59:05PMunchNote that the talks are fairly late in the day, so if you plan on going don't book your return early :)
12:00:16*rockcavera joined #nim
12:02:21FromDiscord<mratsim> So multithreading in and tensors out 😉
12:04:02Zevvwider audience for that I guess
12:21:05PMunchHmm, when compiling for the Arduino and using a panicoverride file doAssert will fail because it tries to use the panic procedure defined there which uses C stuff
12:21:16PMunchSo it gets an error about importc on compile-time
12:21:32*hylix joined #nim
12:21:44*hylix quit (Client Quit)
12:22:11PMunchmratsim, yeah the others picked what they thought looked most interesting, which I feel is a good idea since they probably represent a broader audience than I do :)
12:24:10clyybbermratsim: Did you report the compiler crash with the captures?
12:46:24*sz0 joined #nim
12:52:28FromGitter<zetashift> Really nice PMunch!
12:53:00FromGitter<zetashift> I was expecting a Zig talk there quite surprised. But 4 Nim talks is awesome
12:54:34*nsf joined #nim
13:11:20*solitudesf joined #nim
13:18:14*abm joined #nim
13:26:09FromGitter<alehander92> i think they couldn't send anyone for fosdem
13:26:37FromGitter<alehander92> as probably they're based in usa mostly and are just on some donations currently
13:27:16FromGitter<alehander92> i also hoped for more zig/pony/cone whatever talks
13:27:29FromGitter<alehander92> but on the other hand 4 nim talks is almost a miniconf!
13:27:35FromGitter<alehander92> niice!
13:29:27*lritter joined #nim
13:31:57FromGitter<alehander92> Pmunch whats your plan for your talk: one example "app" that uses all those environments?
13:34:03FromGitter<alehander92> one thing i really value is how one can *reuse* types/minilibs from microcontrollers to frontend: so e.g. you can easily serialize something on your rpi and send it somewhere and finally deserialize it in the browser + show it without any additional type schemas/models etc
13:34:17PMunchYeah I think the Zig people wanted to hold one, but no-one could make the trip
13:34:23PMunchOr at least no-one who wanted to hold a talk
13:35:03PMunchI haven't actually thought too much about what I'll do for my talk
13:35:29PMunchBut I was thinking about doing one super simple thing that runs in all the environments just as a demo at the end
13:37:51FromDiscord<itmuckel> Hey guys I take the addr() of a seq to point `glBufferData` to the data it should send to the graphics card. Now I noticed that "sometimes" it works, sometimes it doesn't. Is the memory layout not determined for sequences? 🤔
13:37:52FromDiscord<itmuckel> https://cdn.discordapp.com/attachments/371759389889003532/652503970635579433/unknown.png
13:38:53PMunchitmuckel, you definitely want to take the address to vertices[0]
13:39:15FromDiscord<itmuckel> Sometimes the compilation returns a valid program, sometimes compiling and running it yields "Illegal storage access" at glBufferData
13:39:16PMunchSequences in memory store their size and capacity as two integers at the beginning
13:39:34FromDiscord<itmuckel> omg, that's definitely not what I want 😱
13:39:39PMunchHaha :P
13:40:06PMunchBut yeah, take the address of the first element instead. The others in the sequence should follow in order like a normal C array
13:40:22*endragor quit (Remote host closed the connection)
13:40:37FromDiscord<itmuckel> Nice, just compiled it 5 times in a row with no problems
13:40:45FromDiscord<itmuckel> thx!
13:40:49PMunchNo problem
13:40:58PMunchBit weird that it results in a compilation error though..
13:41:38FromDiscord<itmuckel> No, not a compilation error, I always run the program after compilation and it is a runtime error
13:41:49FromDiscord<itmuckel> "Illegal Storage Access" is what opengl returns
13:42:21FromDiscord<itmuckel> C:\Users\Admin\.nimble\pkgs\opengl-1.2.3\opengl\private\errors.nim(22) glBufferData
13:42:21FromDiscord<itmuckel> SIGSEGV: Illegal storage access. (Attempt to read from nil?)
13:42:39Araqcall loadExtensions()
13:43:18FromDiscord<itmuckel> I did, otherwise the preceding gl-calls would fail as well
13:43:27FromDiscord<itmuckel> PMunch's tip solved it
13:47:59FromGitter<alehander92> PMunch gotcha
13:48:05FromGitter<alehander92> whatever you decide
13:48:33FromGitter<alehander92> but good work with fosdem !
13:50:06Araqclyybber, https://github.com/nim-lang/Nim/pull/12823
13:50:07disbotARC: cycle detector 👑11Araq
13:50:35Araquntested :P
13:50:51Araqbut I'm getting good at writing GCs
13:51:45clyybberAraq: Nice, hows the approach called that you do there?
13:52:06Araqkey insight: moves cannot produce cycles so if you optimize for =sink over = you push the cycle detection's overhead into the noise level
13:52:19clyybberoh, just saw the comment
13:52:28clyybberthat explains the approach
13:52:42clyybber*links to the paper
13:52:51PMunchalehander92, thanks :)
13:53:05clyybberAraq: Thats great
13:53:50Araqthe jump stack changes the complexity from 3*N to 2*N where N is the side of the involved subgraph
13:53:58clyybberAraq: Another insight, dunno if you used that there, is that we only need to check for a cycle if some refcount decreases to more than zero
13:54:01Araqmaking it competetive with tracing
13:54:33Araqthat's an old hat
13:54:51Araqand also implemented
13:54:57clyybberNice
13:55:12clyybberso you hold up your part of the deal
13:55:17clyybbernow its time for my part :)
13:55:29Araqwell it's completely undebugged
13:56:26Araqbut in theory it's sound. we also do non-atomic RC'ing and use the older .gcsafe mechanism to restrict sharing
13:56:52Araqthe idea is that you can move graphs around between threads
13:57:24Araqbut only one thread is allowed to access it really
13:57:42Araqagain emphasizing the 'move' idea
13:57:58*Araq is writing a blog post...
13:58:33*clyybber is anticipating the blog post...
14:00:48FromGitter<alehander92> so i basically
14:00:57FromGitter<alehander92> want to call a nim method
14:01:00FromGitter<alehander92> with a jsobject
14:01:08FromGitter<alehander92> but to recognize what type should i cast it to
14:01:44FromGitter<alehander92> my best guess is to somehow find the overload through a macro
14:01:56FromGitter<alehander92> and maybe find the type of its arg
14:02:06FromGitter<alehander92> is there a simple way
14:07:08FromGitter<alehander92> i can just use function pointers i guess
14:07:27FromGitter<alehander92> because even with a macro i probably cant just
14:07:44FromGitter<alehander92> find the "only" overload of method m for type t
14:09:01disruptekalehander92: there's a lot of code that does stuff like that in openapi.
14:09:10disruptek!repo openapi
14:09:11disbothttps://github.com/disruptek/openapi -- 9openapi: 11OpenAPI Code Generator for Nim 15 9⭐ 0🍴 7& 4 more...
14:09:52disruptekalso there's this, but, y'know, yer not supposed to use it.
14:10:02disruptek!repo disruptek/jsonconvert
14:10:02disbothttps://github.com/disruptek/jsonconvert -- 9jsonconvert: 11lazy json node conversion 15 0⭐ 0🍴
14:11:39FromGitter<Willyboar> disruptek is nimph ready for use?
14:11:58disruptekdepending on what you'd use it for, yes.
14:12:30FromGitter<Willyboar> simple things
14:12:49FromGitter<alehander92> disruptek yeah but i mostly want to
14:13:09FromGitter<alehander92> hm, do it based on methods defined in the same program
14:13:15FromGitter<alehander92> but i decied to just add type hints
14:13:17FromGitter<alehander92> to my dsl
14:13:40clyybberAraq: The test failures look nasty, but cosmetic :)
14:13:56FromGitter<alehander92> thanks!
14:14:06FromGitter<Willyboar> Ok. I will plaay with nimph tonight :D
14:14:11disrupteki'd be surprised and pleased if you could find a way to break it.
14:14:14FromGitter<alehander92> its probably something good, but i have to change a lot more
14:15:27clyybberdisruptek: rm -f shuf -n1 -e ~/builds/nimph/*
14:15:47disrupteki will add installation instructions today. there are apparently some bugs in nimterop/nimble that make it harder than it should be.
14:15:48*nsf quit (Quit: WeeChat 2.6)
14:16:34disruptekclyybber: it should be fine with that. 😜
14:16:36clyybberdisruptek: Curious; do you actually need to ship nimterop with it? Can't you include the wrappers generated by nimterop?
14:16:40clyybberdisruptek: Really?
14:16:59disruptekyeah, it knows about changes to your repos and will prevent you from locking if they are corrupted.
14:17:35disrupteki depend upon nimgit2, which depends upon nimterop. too much work to do it any other way.
14:18:29clyybberafaik shashlick said there is a way to make nimterop spit out the wrapper for standalone usage
14:18:34disruptekthe idea is that it adds value to any project. it should work with normal nimble workflow, too, by design.
14:19:04disruptekit makes very, very few assumptions.
14:20:48shashlickIt will get better with use
14:21:07shashlickCan fix more issues as it becomes more prevalent
14:22:02disruptekshashlick did a lot of work just to get nimgit2 going.
14:27:37*tklohna quit (Ping timeout: 240 seconds)
14:28:52*ehmry is now known as ehmry_
14:31:12*ehmery joined #nim
14:31:14*ehmry_ left #nim (#nim)
14:41:17shashlickdisruptek please open issues as you find them
14:44:49disruptekwell, nimterop isn't blocking nimble install of nimph anymore. or, nimble is also blocking it, so you're off the hook. 😁
14:55:24*sz0 quit (Quit: Connection closed for inactivity)
14:57:46*PMunch quit (Quit: Leaving)
14:57:54disruptekTip: 540 messages have been suppressed, use --verbose to show them.
14:58:25clyybberuse --verbose to open pandoras box
14:59:52FromGitter<alehander92> woww
15:01:35disruptekwhen i try to pass nimble a --passNim statement, it gets rewritten and then i'm told it's an unknown option.
15:01:42disruptekdoes that feature work?
15:03:06disruptekError: Unknown option: --path:/home/adavidoff/nimph/src
15:20:35*Kaivo quit (Read error: Connection reset by peer)
15:20:39*narimiran quit (Quit: leaving)
15:26:55disruptekahh, you can't use a space with nimble long-options.
15:30:46*Ven`` joined #nim
15:31:16*clyybber quit (Quit: WeeChat 2.6)
15:39:59*dddddd joined #nim
15:44:30*tklohna joined #nim
15:45:36*krux02 quit (Remote host closed the connection)
15:52:31disruptekhttps://github.com/nim-lang/nimble/issues/748
15:52:32disbotpermission denied to ~/.nimble/pkgs is fatal 🧚11disruptek
15:52:38disruptekhappy, shashlick? 😛
16:01:02*floppydh quit (Quit: WeeChat 2.6)
16:10:50*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:14:01*Ven`` joined #nim
16:34:23FromGitter<kayabaNerve> Should C constants still be imported via importcpp?
16:38:05FromDiscord<mratsim> usually I hardcode them as const and on debug mode I load them via importc and assert that those are equal
16:38:34FromGitter<kayabaNerve> Can you load `#define`s via importc?
16:38:41FromDiscord<mratsim> see: https://github.com/numforge/laser/blob/master/laser/photon_jit/photon_osalloc.nim#L63-L76
16:38:51FromDiscord<mratsim> yes you can
16:38:56FromGitter<kayabaNerve> I can't find anything about it in the manual and a 2016-2017 issue said use importcpp
16:38:57FromGitter<kayabaNerve> oh
16:39:07FromGitter<kayabaNerve> Thank you
16:39:25FromDiscord<mratsim> see: https://github.com/mratsim/weave/blob/master/experiments/e04_channel_based_work_stealing/primitives/coz.nim#L21
16:39:46FromDiscord<mratsim> and the defined is here: https://github.com/mratsim/weave/blob/master/experiments/e04_channel_based_work_stealing/primitives/coz.h#L79
16:43:10FromGitter<kayabaNerve> Thanks.
16:50:09*nsf joined #nim
17:43:56*tklohna quit (Ping timeout: 276 seconds)
18:01:43*nsf quit (Quit: WeeChat 2.6)
18:13:45*xet7 quit (Quit: Leaving)
18:16:43*xet7 joined #nim
18:25:34Zevvsealmove: no pull for us on pullrequest friday I guess :/
18:37:07FromDiscord<treeform> disruptek, lol your jsonconvert looks like mine ... no one has time to fix broken json sent from some one else...
18:37:21disruptekyeah, pretty much.
18:37:53FromDiscord<treeform> mine does objects too though
18:38:02FromDiscord<treeform> it tries to be supper loose though
18:38:09disrupteki'm starting to not care about making my json parsing legible.
18:38:24FromDiscord<treeform> if it fits it sits, if it not fits it not sits...
18:38:28disrupteki just figure, if you're in there, you probably know it's a clusterfuck.
18:41:58AraqZevv, sorry, no PR friday today
18:42:11AraqI'm having to much fun with cycle detection.
18:43:09Zevvhttp://zevv.nl/div/detect.jpg
18:43:14Zevvnot *that* hard, is it?
18:44:23disruptekthat looks like way more than 45% of a bike.
18:45:14Zevvwell, 50% is because it looks like a bike from *this* side, but you can't tell the other side
18:45:42disruptekfair enough.
18:45:44Zevvthe leftover 5% is the bad cropping
19:04:13disruptekZevv: npeg head, seems like maybe P[0..1] "matches P m+1 to n+1 times" maybe? or 0-n+1?
19:12:08Zevvoh I never thought of 0 in there...
19:12:57Zevvbut otoh, doesnt it just work, 0 or 1 times?
19:13:34Zevvi dont thin
19:13:36disruptekno, it works up to two times for me.
19:13:48Zevvbwah no way
19:13:59Zevvill check when i get home!
19:14:11disrupteki will commit a test to nimph.
19:14:24disruptekoh, i already did.
19:14:51disrupteksee the end of tests/tpackage.nim
19:14:54Zevvdang youre right, how could my tests have missed that. its just obviously stupid
19:15:09disruptekjust change the docs 😉
19:15:39Zevvhttps://github.com/zevv/npeg/blob/master/src/npeg/patt.nim#L217
19:15:41disruptekbut srsly, i do wish it worked 0..1x for 0..1 values.
19:15:48Zevvit just adds P, and then some
19:16:06disruptekheh
19:16:14ZevvIll fix it
19:16:38Zevvthanks dude
19:16:43disruptekthanks 👍
19:16:58Zevvlook at us being friendly again. we _can_ do it
19:17:05disrupteki don't believe it.
19:17:24disruptekwait, this doesn't mean you got over the rainbow thing, does it?
19:17:32disruptek!pull author:zevv
19:17:34disbothttps://github.com/nim-lang/Nim/pull/12777 -- 3Increased TInstr field sizes: allow long jumps and 65535 VM registers 🌈11zevv 7& 28 more...
19:17:52disruptek'cause that's pretty bad.
19:18:26Zevvi love it
19:18:36Zevvbecause its just a little green square
19:18:41disrupteklol
19:19:16disruptekon non-emoji i think it's just like a bunch of pixelated streaks.
19:20:30FromDiscord<kodkuce> anyone played with pose estamination, i want to buy some under 100$ ai hoping it can run pose estamination at least 10fps, just pose no fingers or face featurs, was hoping OrangePi 4 can meybe do it
19:20:50Zevvno wait what, it is correct
19:21:08disruptekis it?
19:21:25Zevvno it is not!
19:22:35*nif quit (Quit: ...)
19:22:45*nif joined #nim
19:26:47Zevvdisruptek: 0.21.3 is there, just for you
19:26:53disruptekw00t danke.
19:27:05Zevvit was an off by one, `m..n` -> `m..<n`
19:27:36disruptekconfirmed: 0.21.3 breaks my tests 😁
19:28:23Zevvgood!
19:41:15*tklohna joined #nim
20:01:10ZevvI just earned myself I beer
20:01:28*NimBot joined #nim
20:22:14*Vladar quit (Quit: Leaving)
20:30:47*kungtotte joined #nim
20:53:03*tklohna quit (Ping timeout: 246 seconds)
20:59:46*Trustable quit (Remote host closed the connection)
21:00:54*abm quit (Read error: Connection reset by peer)
21:02:08FromDiscord<treeform> Does any one know if a site like this? https://godbolt.org/ but it does nim too?
21:02:31disrupteki thought godbolt did nim.
21:02:47FromDiscord<treeform> It was never added: https://github.com/mattgodbolt/compiler-explorer/issues/206
21:02:48disbotNim Language Support @11Varriount
21:03:12FromDiscord<treeform> But i remember seeing some place, but could it have been a dream?
21:04:53FromDiscord<treeform> could it have been a feature of https://play.nim-lang.org/ ?
21:05:04disruptekwhat are you looking to do?
21:05:15FromDiscord<treeform> see asm output
21:05:24disrupteki think you can do that in the playground.
21:05:42FromDiscord<treeform> how?
21:06:50disrupteki dunno.
21:07:14disruptekmaybe there's a commit that explains it, or explains that it doesn't exist. 😉
21:09:37*donpdonp joined #nim
21:10:22donpdonphttps://play.nim-lang.org/#ix=23IO internal error
21:12:52FromGitter<Willyboar> https://play.nim-lang.org/#ix=23IP
21:13:32disruptekdonpdonp: that should be reported.
21:15:10donpdonpdisruptek: any ideas where to report it?
21:15:34disruptekhttps://github.com/nim-lang/Nim/issues
21:15:44donpdonpthx
21:17:52*Ven`` quit (Quit: Textual IRC Client: www.textualapp.com)
21:18:26FromDiscord<Fern & Simula (They/Them)> how can i properly use locks without having a global lock variable?
21:19:32FromDiscord<Fern & Simula (They/Them)> im sure that's a really dumb question but for some reason it's just evading me
21:22:46disrupteksorry, no experience with threads in nim.
21:28:07*donpdonp left #nim ("WeeChat 2.6")
21:33:18Araqwith a global lock variable.
21:33:56Araqi doesn't have to be global, but usually if one asks this question one is not ready for anything else
21:34:27FromDiscord<Fern & Simula (They/Them)> alright. i'm not planning on using it, i was just curious
21:47:13*tiorock joined #nim
21:47:13*rockcavera is now known as Guest59385
21:47:13*tiorock quit (Changing host)
21:47:13*tiorock joined #nim
21:47:13*Guest59385 quit (Killed (cherryh.freenode.net (Nickname regained by services)))
21:47:13*tiorock is now known as rockcavera
22:23:42rayman22201sadly, still no Godbolt support for Nim. I started working on it again again a while back, but got distracted with other things. (story of my life)
22:24:03rayman22201on my list of things to get back to eventually...
22:31:30FromDiscord<treeform> rayman22201, thats ok, life is more important
22:35:16*kotrcka joined #nim
22:38:03*clyybber joined #nim
22:39:23FromDiscord<mratsim> @Fern & Simula (They/Them) either a global or a "var foo {.global.]: Lock"
22:39:37FromDiscord<mratsim> so that it's actually global but only visible in the scope of a proc
22:40:05FromDiscord<mratsim> or in an object if it's to protect potentially shared field
22:41:45FromDiscord<mratsim> @Araq, @Clyybber, here is the syntax for captures I ended up with: https://github.com/mratsim/weave/blob/master/benchmarks/matrix_transposition/weave_transposes.nim#L74-L103
22:43:35FromDiscord<treeform> @mratsim what are your thoughts on: https://github.com/genotrance/shared
22:45:29FromDiscord<mratsim> I think you would use shared strings and shared seq only for proof-of-concepts or when you expect very very few concurrent accesses. This is true whether you would use locks or more fancy atomics strategy.
22:45:53FromDiscord<mratsim> The issue with multithreading is that the best way to do multithreading is for thread to work in its own corner
22:46:01FromDiscord<mratsim> every thread*
22:46:11FromDiscord<treeform> no shared memory of any kind?
22:46:31FromDiscord<mratsim> only at very few synchronization points
22:46:44Yardanico@mratsim can your weave library be used for simple multithreading (for example to process 10000 entries from a sequence by a proc in parallel, with a maximum of 500 threads?)
22:46:56YardanicoI just didn't find a lot of simple examples :P
22:47:06FromDiscord<mratsim> for example, in my multithreading runtime: every thread has its memory manager, its caches, its scheduling loop
22:47:26*krux02 joined #nim
22:47:28FromDiscord<treeform> @mratsim what are your thoughts on MPI? https://www.open-mpi.org/
22:47:52FromDiscord<mratsim> they only communicate with very simple channels: https://github.com/mratsim/weave/blob/master/weave/channels/channels_spsc_single_object.nim#L81-L103
22:48:33FromDiscord<mratsim> I didn't try MPI yet, given how old it is I guess it has issues with legacy API that were misguided but people manage to overcome that one way or another since it's still alive 😛
22:49:00FromDiscord<mratsim> also since it's message passing based I can probably adapt MPI channel to transport weave, so I don't have to redo a bunch of things for starter
22:49:37FromDiscord<mratsim> @Yardanico isn't that simple? https://github.com/mratsim/weave/blob/master/benchmarks/matrix_transposition/weave_transposes.nim#L69-L81
22:49:49Yardanicooh thanks! :P
22:50:01FromDiscord<mratsim> or this? https://github.com/mratsim/weave/blob/master/benchmarks/fibonacci/weave_fib.nim#L9-L17
22:50:22Yardanicoweave_fib is exactly what I need, thanks again :)
22:50:43FromDiscord<mratsim> the API is very simple: https://github.com/mratsim/weave/blob/master/weave.nim#L13-L18
22:51:20FromDiscord<mratsim> Very important caveat
22:51:29FromDiscord<mratsim> There is absolutely 0 test
22:51:37FromDiscord<treeform> mratsim, mpi is very odd I only learned about it a few days ago.
22:52:20FromDiscord<mratsim> Actually I should add that as a disclaimer
22:52:26FromDiscord<treeform> @mratsim, they have their own C compiler. It can work to message between threads, between processes, or even between machines across the net.
22:52:49FromDiscord<treeform> OpenAI uses it heavily.
22:53:13FromDiscord<treeform> And many other science labs, from biology to physics.
22:54:54FromDiscord<treeform> @mratsim I was trying to design a system for nim based on this diagram:
22:54:55FromDiscord<treeform>
22:54:55FromDiscord<treeform> https://cdn.discordapp.com/attachments/371759389889003532/652644169021652995/unknown.png
22:55:08FromDiscord<treeform> I felt overwhelmed though.
22:58:09FromDiscord<mratsim> for IO tasks, you can look into the couple of papers I put there: https://github.com/mratsim/weave/issues/22
22:58:11disbotResearch on IO-bound tasks11mratsim
22:58:42FromDiscord<mratsim> especially the Go slides
22:59:29FromDiscord<mratsim> libmill or anything with "work-stealing" + fibers also
22:59:39FromDiscord<mratsim> and Tokio from Rust
23:00:29*solitudesf quit (Ping timeout: 250 seconds)
23:00:39FromDiscord<treeform> "Rust coupled both IO and a task parallelism" What do you think you will do?
23:01:01FromDiscord<treeform> "However even for compute bound tasks we will have to deal with IO latencies for example in a distributed system or cluster." - This is a really good point!
23:05:09FromDiscord<mratsim> For now I think I'll play well with asyncdispatch and Chronos
23:05:49FromDiscord<mratsim> My main goal with weave was solving my issues with nested OpenMP parallelism, or OpenMP tasks being really flaky with GCC
23:06:11FromDiscord<mratsim> because for my ML compiler project I will create a lot of nested for loops
23:06:16*kotrcka left #nim (#nim)
23:06:24FromDiscord<mratsim> and I solved that a hour ago 🙂
23:07:09FromDiscord<treeform> congrats on solving it
23:08:00FromDiscord<mratsim> so now I have 2 choices:
23:08:01FromDiscord<mratsim> - publish the library on Nimble, call it a day and work on my compiler
23:08:01FromDiscord<mratsim> - or polish the internals so that they are actually maintainable (even I get lost in the control flow). My idea is to create a macro that generates a state machine and transform the internal into different state described by "current state", "input", "transition"
23:08:08FromDiscord<treeform> ML compiler project - machine learning compiler project?
23:08:11FromDiscord<mratsim> yes
23:08:30FromDiscord<treeform> compiler that uses ML? or compiler used by ML?
23:08:38FromDiscord<mratsim> This: https://github.com/numforge/laser/tree/master/laser/lux_compiler
23:08:38FromDiscord<mratsim> See details in the markdown files here: https://github.com/numforge/laser/tree/master/laser/lux_compiler/core
23:08:50FromDiscord<mratsim> used for ML
23:09:44FromDiscord<treeform> how is this related to https://github.com/mratsim/Arraymancer ?
23:11:34FromDiscord<mratsim> It will be the new backend of Arraymancer
23:12:10FromDiscord<mratsim> well I planned that a year ago with nothing to show so ...
23:13:00FromDiscord<treeform> What kind of ML are you doing?
23:13:07*sealmove joined #nim
23:13:07FromDiscord<mratsim> The idea is that once it's working it would be much easier to develop complex machine learning algorithm that are actually fast because I have been struggling with that
23:13:14FromDiscord<mratsim> And supporting GPUs
23:14:02FromDiscord<mratsim> The worse is deriving matrix formulas by hand
23:14:20FromDiscord<mratsim> see: https://people.csail.mit.edu/tzumao/gradient_halide/ for the difference between Hlide (my inspiration) and handcoded Cuda
23:14:20FromDiscord<treeform> oh no the flashbacks ...
23:15:06disrupteklaser is the future.
23:15:12FromDiscord<mratsim> All kind, computer vision and NLP
23:15:15FromDiscord<treeform> Halide is your version?
23:15:29FromDiscord<mratsim> no Halide is my inspiration, it's an existing library in C++
23:16:00FromDiscord<mratsim> however it's a bit of a pain to deploy, you need to compile it, then pass your C++ code in Halide, then link it in your actual code
23:16:09FromDiscord<treeform> is Halide faster than hand-rolled Cuda?
23:16:22FromDiscord<mratsim> some I'm building a Halide-like compiler in Nim macros
23:16:44FromDiscord<treeform> cool, and thats laser, that you will use in array manser
23:16:55FromDiscord<mratsim> no, but it's 100x faster to experiments various parallel schedules in Halide without introducing bugs
23:17:09FromDiscord<mratsim> let's see if I can find an example
23:18:33FromDiscord<treeform> So many people use PyTorch .. and some use TenserFlow... I hear nothing else.
23:18:59FromDiscord<mratsim> 3 examples of a blur kernel
23:18:59FromDiscord<mratsim> https://cdn.discordapp.com/attachments/371759389889003532/652650225500160030/unknown.png
23:19:18FromDiscord<treeform> blury
23:19:22FromDiscord<treeform> Is that nim?
23:19:38FromDiscord<mratsim> if you look at the "h.compute_root()", you see that after it you have vectorize or another interleaving
23:19:45FromDiscord<mratsim> no that's not, it's a DSL
23:19:54FromDiscord<treeform> this is your DSL?
23:19:59FromDiscord<mratsim> you could add "parallelize" or various other things
23:20:11FromDiscord<mratsim> and the compiler will automatically adjust the generated code
23:20:19FromDiscord<mratsim> while keeping the algorithm the same
23:20:38FromDiscord<mratsim> so you can experiments very fast on different parallelization of vectorization strategy
23:21:09FromDiscord<mratsim> no it's not mine, it's halide, I have a couple of issues with it so I will be changing it a bit
23:21:20FromDiscord<treeform> I see.
23:21:47FromDiscord<mratsim> example in Nim: https://github.com/numforge/laser/blob/master/laser/lux_compiler/lux_dsl.nim#L43-L55
23:22:33FromDiscord<treeform> looks cool
23:23:01FromDiscord<mratsim> one big advantage is that you can have 2 people working on the same code as well:
23:23:01FromDiscord<mratsim> - 1 researcher who knows the algorithm
23:23:01FromDiscord<mratsim> - 1engineer who knows how to optimize stuff
23:23:19FromDiscord<mratsim> when training a model takes 1000+ GPU/year that's very valuable
23:23:26FromDiscord<mratsim> today you basically need to know both
23:23:37rayman22201@mratsim, I know your focus is compute bound problems, but I just want to say that I appreciate you looking at the IO bound aspeccts (weave #22). As a person who has done a lot of work with asyncdispatch, long running and IO bound tasks are very important to me :-P
23:23:38disbothttps://github.com/nim-lang/Nim/pull/22 -- 6Added documentation for implicit conversions @11reactormonk
23:24:01rayman22201I had a feeling disbot would get that wrong lol
23:25:44disruptekyeah. 😁
23:26:08disruptekwe probably should have a shorthand for outside repos.
23:27:45rayman22201;-) feature request
23:30:58disruptekyou can search them, it just doesn't do the expansion that github does by default.
23:31:19disruptekbut, we can add that.
23:32:58disruptekit's surprisingly difficult to find 22.
23:33:13rayman22201magic number?
23:33:25rayman22201not quite 42 but close enough :-P
23:56:12*gmpreussner quit (Ping timeout: 265 seconds)
23:57:20FromGitter<Obround> Hey guys! I was wondering if there was a way to run nim code without creating a new file and including? Something like a proc maybe?
23:57:36Yardanicowhat do you exactly mean?
23:57:50Yardanicoyou mean a REPL?
23:58:04FromGitter<Obround> Yeah, but able to do it from the code
23:58:23FromGitter<Obround> Like `execNimCode("echo 2+2")`
23:58:55Yardanicowell, you want to execute nim code at your program's runtime?
23:59:29FromGitter<Obround> Basically.
23:59:32Yardanicothe code provided by the third-party (like the user)? then I think you should look into embedding NimScript into your program (although be aware that NimScript doesn't support all Nim features and is quite slower)
23:59:48Yardanicothat's because Nim is fully statically compiled without any VM, you can't eval like in Python