00:19:07 | * | krux02_ joined #nim |
00:21:56 | * | krux02 quit (Ping timeout: 248 seconds) |
00:27:19 | * | filcuc quit (Quit: Konversation terminated!) |
00:27:31 | * | filcuc joined #nim |
00:36:48 | * | muffindrake quit (Quit: muffindrake) |
00:38:56 | * | muffindrake joined #nim |
00:55:43 | * | filcuc quit (Quit: Konversation terminated!) |
00:59:02 | * | moduledge joined #nim |
01:01:54 | moduledge | Hi there folks. I got a question, would this be a bug when using sequtils.all() on an empty sequence? I was trying to solve an Exercism exercise with something like this and it didn't make sense to me that it would return `true`: https://play.nim-lang.org/#ix=26xf |
01:03:13 | moduledge | I'm open to be corrected as well |
01:09:03 | disruptek | because all members of the sequence pass the predicate. |
01:14:14 | * | krux02_ quit (Remote host closed the connection) |
01:17:29 | moduledge | Oh I see. It's true by default unless it finds a false in the sequence. |
01:19:19 | moduledge | and any() would do the opposite. |
01:35:45 | * | endragor quit (Remote host closed the connection) |
01:36:20 | * | endragor joined #nim |
01:41:37 | * | dwdv quit (Ping timeout: 265 seconds) |
01:44:35 | * | abm joined #nim |
01:44:45 | * | lritter quit (Ping timeout: 268 seconds) |
01:45:00 | * | lritter joined #nim |
01:47:15 | * | lritter quit (Client Quit) |
01:56:57 | * | endragor quit (Remote host closed the connection) |
02:05:33 | disruptek | yay, i got a [FATAL] unpaired dealloc |
02:05:39 | disruptek | now we're on the road to a solution. |
02:07:32 | * | chemist69 quit (Ping timeout: 252 seconds) |
02:08:42 | * | chemist69 joined #nim |
02:15:05 | * | abm quit (Read error: Connection reset by peer) |
02:33:26 | FromGitter | <perfecto25> Hello, noob question |
02:33:38 | FromGitter | <perfecto25> how do I append to a JSON object? |
02:33:48 | FromGitter | <perfecto25> or remove a key:val from a json obj |
02:34:50 | disruptek | https://nim-lang.org/docs/json.html -- add, []=, delete |
02:45:20 | * | endragor joined #nim |
02:56:27 | * | Hideki_ joined #nim |
03:01:18 | * | Hideki_ quit (Ping timeout: 260 seconds) |
03:08:28 | FromGitter | <gogolxdong> `/usr/bin/ld: /mnt/c/Nim/nimcache/r_linux_amd64/stdlib_intsets.nim.c.o: relocation R_X86_64_32 against undefined symbol `NTI__PQrmFm4BXFkFSVOUl1ojSg_' can not be used when making a PIE object; recompile with -fPIC ⏎ /usr/bin/ld: final link failed: Nonrepresentable section on output ⏎ collect2: error: ld returned 1 exit status` |
03:08:36 | FromGitter | <gogolxdong> latest devel |
03:18:37 | * | Jjp137 quit (Read error: Connection reset by peer) |
03:19:11 | * | Jjp137 joined #nim |
03:25:09 | * | arecaceae quit (Remote host closed the connection) |
03:25:53 | * | arecaceae joined #nim |
03:49:55 | * | endragor quit (Ping timeout: 258 seconds) |
03:59:57 | * | muffindrake quit (Ping timeout: 260 seconds) |
04:01:43 | * | muffindrake joined #nim |
04:10:37 | FromGitter | <perfecto25> thanks |
04:10:58 | * | uu91 joined #nim |
04:11:55 | FromGitter | <perfecto25> is there a way to pass a Table to a proc, ie, ⏎ ⏎ proc add_to_table (mytable: Table): Table = ⏎ ⏎ ``` return table.add("newkey", "newval")``` [https://gitter.im/nim-lang/Nim?at=5e12b38bbe6bab58cd7e814e] |
04:28:25 | * | endragor joined #nim |
04:36:07 | * | chemist69 quit (Ping timeout: 260 seconds) |
04:37:54 | * | chemist69 joined #nim |
04:49:31 | * | nsf joined #nim |
04:49:39 | disruptek | yes, but add() doesn't return a value. use a TableRef. |
04:49:44 | disruptek | ~tables |
04:49:45 | disbot | https://nim-lang.org/docs/tables.html |
05:04:49 | muffindrake | Is there a flag you can pass to the nim compiler to have the companion C compiler generate CPU-specific code a la -march=native? |
05:05:19 | disruptek | yeah, you can pass whatever you want through to the native compiler. |
05:07:18 | muffindrake | You didn't answer my question |
05:07:28 | disruptek | sure i did. |
05:08:11 | muffindrake | My question wasn't 'can you pass arbitrary flags to the C compiler' |
05:08:48 | disruptek | you asked if there was a flag. in the same sentence, you gave example of such a flag. |
05:11:06 | disruptek | try `nim --fullhelp` and note the --passC (and --passL) switches. |
05:12:27 | muffindrake | I was asking if I could give a specific switch to the nim compiler that doesn't have me write build scripts for every possible C compiler that could potentially be used, because all of them have differently named flags for this feature |
05:13:34 | disruptek | in that case, it's unlikely. nim supports multiple backends, so the compiler options are geared towards broader goals such as "size", "speed", etc. |
05:14:16 | disruptek | even for, say, a c backend, nim supports multiple compilers (gcc, clang, vcc, tcc, mingw, etc.) |
05:15:20 | disruptek | you can specify flags for particular compilers in a single nim.cfg or config.nims, though. |
05:16:39 | disruptek | ~compiler |
05:16:40 | disbot | compiler: 11https://nim-lang.org/docs/nimc.html -- disruptek |
05:55:59 | * | ltriant quit (Quit: leaving) |
06:11:35 | * | dddddd quit (Ping timeout: 268 seconds) |
06:14:02 | * | beshr quit (Read error: Connection reset by peer) |
06:58:27 | * | Hideki_ joined #nim |
07:02:48 | * | Hideki_ quit (Ping timeout: 260 seconds) |
07:05:41 | * | ikan-keli_2 joined #nim |
07:05:56 | * | ikan-keli_ quit (Ping timeout: 265 seconds) |
07:06:59 | * | narimiran joined #nim |
07:16:42 | * | matic joined #nim |
07:19:15 | * | marmotini_ joined #nim |
07:31:50 | * | marmotini_ quit (Remote host closed the connection) |
07:32:17 | * | marmotini_ joined #nim |
07:32:40 | * | marmotini_ quit (Remote host closed the connection) |
07:32:47 | * | marmotini_ joined #nim |
07:37:06 | * | endragor_ joined #nim |
07:40:46 | * | PMunch joined #nim |
07:41:00 | * | endragor quit (Ping timeout: 268 seconds) |
07:46:17 | * | ptdel quit (Ping timeout: 260 seconds) |
07:46:41 | * | solitudesf joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:05:03 | * | gmpreussner joined #nim |
08:07:59 | FromDiscord | <Skaruts> from testing it seems like the operator `==` works by default for `objects` but not for `ref objects` |
08:08:03 | FromDiscord | <Skaruts> why is that? |
08:12:32 | Zevv | you are comparing the refs |
08:12:57 | FromDiscord | <Skaruts> ah, I thought the comparison would go through the refs |
08:13:00 | Zevv | which are basically pointers. Two different pointers to two objects are never the same |
08:13:12 | Zevv | dereference your objects: let same == a[] == b[] |
08:13:16 | FromDiscord | <Skaruts> indeed |
08:13:31 | Zevv | PMunch: ping |
08:13:45 | FromDiscord | <Skaruts> I implemented my own `==` to make it easier |
08:13:59 | * | Trustable joined #nim |
08:14:42 | Zevv | Sure |
08:14:50 | Zevv | this is nim, after all |
08:15:03 | PMunch | Zevv, pong |
08:15:05 | Zevv | oi! |
08:15:28 | PMunch | What's up? |
08:15:36 | Zevv | You've been doing the atmel stuff lately, right? |
08:15:41 | PMunch | Yup |
08:15:42 | Zevv | Did you use heap memory there? |
08:16:07 | PMunch | I think I did some manual allocation and freeing |
08:16:14 | PMunch | But I didn't set up the garbage collector |
08:16:23 | Zevv | hold on, phone, sorry |
08:20:23 | Zevv | back |
08:20:44 | Zevv | yeah, I was thinking to get nim-in-linux-kernel space up and running with --gc:arc |
08:20:59 | Zevv | but with useMalloc and os:standalon allocs always happen in 32Mb chunks |
08:21:05 | Zevv | so I was wondering what you did to get small allocs to work |
08:24:53 | Zevv | is your stuff public somewhere? |
08:25:41 | PMunch | Unfortunately not.. |
08:25:46 | PMunch | Yet at least |
08:26:03 | PMunch | But I had a look and it doesn't actually seem like I'm doing an alloc in that code |
08:26:07 | Zevv | right :) |
08:26:16 | PMunch | Must've been thinking of another project.. |
08:26:49 | * | marmotini_ quit (Remote host closed the connection) |
08:27:01 | PMunch | But have a look at https://github.com/gokr/ardunimo, it even works with the GC |
08:27:14 | Araq | -d:useMalloc and --os:standalone in combination is untested |
08:27:16 | * | marmotini_ joined #nim |
08:27:52 | Zevv | well, I can test that. But at this time it uses an additional layer of allocators which does large chunks |
08:27:58 | Zevv | I do see why, the comments are clear enough about that |
08:28:08 | PMunch | What does -d:useMalloc actually do? |
08:28:21 | Zevv | It makes 'theHeap' and does allocs from that |
08:28:48 | Zevv | last time my workaround was adding my own os: to Nim, but I'd like to avoid that |
08:29:00 | Zevv | so we can run on generic standalone targets and use default malloc()/free() |
08:29:16 | Zevv | PMunch: ardunimo did the same as I did: For the moment Ardunimo needs a patched Nim, copy the alloc.nim file to replace the one in your Nim installation: |
08:29:37 | PMunch | Yeah I was thinking that that might be the case |
08:29:38 | Araq | I think the problem is --os:standalone |
08:29:50 | Araq | ARC with -d:useMalloc is fine and ARC was designed for it |
08:30:03 | Zevv | yes but still we don't have an os |
08:30:21 | Zevv | no main, and a limb libc stumbling on one leg |
08:31:58 | * | marmotini_ quit (Ping timeout: 265 seconds) |
08:34:15 | * | marmotini_ joined #nim |
08:38:28 | * | cyraxjoe quit (Ping timeout: 260 seconds) |
08:41:35 | * | cyraxjoe joined #nim |
09:06:56 | * | Vladar joined #nim |
09:50:12 | * | Trustable quit (Remote host closed the connection) |
09:53:06 | * | leorize joined #nim |
09:57:46 | PMunch | Been programming in C# for ~2 hours today, already missing Nim.. |
09:58:20 | FromDiscord | <Skaruts> is there any possible way to make a nim file implicitly imported by every other file in the same project? |
09:59:10 | PMunch | Not without doing something funky in your Nimble file |
09:59:51 | PMunch | Set up a build task that adds the import statement to every file before compiling |
10:00:14 | leorize | --import |
10:00:18 | leorize | but please don't do that |
10:00:27 | PMunch | Oh there is a flag for it? |
10:02:57 | FromDiscord | <Skaruts> I have a bit of a beef with nim's for loops (I never hit the dots right), so I made an iterator that I could potentially use to make the ranges easier for me to type, but it kinda sucks to have to import a file with this everywhere |
10:03:52 | FromDiscord | <Skaruts> I have a bit of a beef with nim's for loops (I never hit the dots or the '<' right), so I made an iterator that I could potentially use to make the ranges easier for me to type, but it kinda sucks to have to import a file with this everywhere |
10:05:36 | PMunch | Why not just use countup from the standard library? |
10:05:37 | leorize | maybe you should try to get used to it? :p |
10:06:02 | PMunch | https://nim-lang.org/docs/system.html#countup.i%2CT%2CT%2CPositive |
10:06:09 | leorize | there's also countup/countdown fwiw |
10:06:13 | FromDiscord | <mratsim> if you have things that you often import just create a "prelude" file where you import/reexport every common things |
10:06:35 | FromDiscord | <mratsim> countup is annoying because you always have to do -1 |
10:06:38 | leorize | you can just `include` it if it only contains import statements |
10:07:16 | FromDiscord | <Skaruts> countup isn't so practical to type for me either, tbh. |
10:07:24 | FromDiscord | <Skaruts> I'm not sure it would conflict with system range, but I made it so I just do `for i in range(100)` (and overloads for `min` and `step`), which is Godot's loops, and I type that in literally 2 secs |
10:08:13 | leorize | import everywhere doesn't seem too bad tbh |
10:08:31 | * | marmotini_ quit (Remote host closed the connection) |
10:08:37 | leorize | it lets people that read your code knows where something might be from |
10:08:53 | FromDiscord | <Skaruts> but it requires worrying about it, and I know I'll forget 99999999 times 😄 |
10:09:01 | * | marmotini_ joined #nim |
10:09:05 | * | dwdv joined #nim |
10:10:13 | leorize | if you don't import it, it won't work so don't worry :P |
10:13:38 | * | marmotini_ quit (Ping timeout: 258 seconds) |
10:20:21 | FromDiscord | <kodkuce> hi if someone bored and have time, can you check/review my code, i am thinking of rewriting it from start with using some kind of pattern or something cuz duno i think its starting to look like mess, this is poker websocket game http://ix.io/26z4 |
10:21:29 | FromDiscord | <kodkuce> basicly my main issue comes i think from bridging websockets with game logic, i think i should use some patter or duno, open for suggestions |
10:23:07 | FromDiscord | <kodkuce> meybe some kind of command pattern or something |
10:23:08 | * | krux02 joined #nim |
10:34:15 | Araq | Skaruts: write a 'prelude' include file that has the imports you seek. import+export is not as nice as that confuses where the symbol actually comes from IMO |
10:34:50 | FromDiscord | <Clyybber> Araq: Morning, to answer your question: I didn't find any additional flaws, but I think what cooldome said is right, this should exclude global vars. |
10:35:19 | FromDiscord | <Clyybber> Good news: I think I know what the bug in my one pass find all approach is 😄 |
10:38:19 | Araq | for global vars we need to distinguish between |
10:38:22 | Araq | var x = value |
10:38:24 | Araq | and |
10:38:27 | Araq | var x: T |
10:38:29 | Araq | x = value |
10:38:44 | Araq | it's bad to pessimise globals too much, people use them quite a bit |
10:38:57 | Araq | even worse |
10:39:03 | * | Vladar quit (Remote host closed the connection) |
10:39:21 | Araq | move-only types lack the '=' and yet var nonMovable = foo() must work |
10:40:31 | FromDiscord | <Clyybber> why must it work? |
10:40:38 | FromDiscord | <Clyybber> I think we should leave globals alone |
10:41:23 | Araq | var x = value # this actually doesn't move nor assign, it constructs 'x' with 'value' |
10:41:46 | FromDiscord | <Clyybber> does it not invoke sink? |
10:43:00 | FromDiscord | <mratsim> constructors! |
10:44:59 | * | Vladar joined #nim |
10:46:58 | * | marmotini_ joined #nim |
10:52:00 | FromDiscord | <Skaruts> @Arak how does that work? I make the prelude file and include it in the main one? |
10:52:15 | * | marmotini_ quit (Remote host closed the connection) |
10:52:22 | * | marmotini_ joined #nim |
10:58:16 | FromDiscord | <Skaruts> nvm, saw it in karax's codebase, it has to be included everywhere |
10:59:59 | * | Hideki_ joined #nim |
11:00:26 | * | dwdv quit (Quit: quit) |
11:01:31 | FromDiscord | <Skaruts> does help though |
11:02:26 | FromDiscord | <Skaruts> is there any added cost to importing a file in parts where it's not needed? |
11:03:27 | * | Vladar quit (Ping timeout: 260 seconds) |
11:04:30 | * | Hideki_ quit (Ping timeout: 268 seconds) |
11:07:50 | * | moduledge quit (Quit: Leaving) |
11:08:59 | * | nsf quit (Quit: WeeChat 2.7) |
11:22:19 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
11:22:33 | * | pbb joined #nim |
11:23:52 | FromGitter | <mratsim> Slight compilation time |
11:25:58 | * | Gnjurac joined #nim |
11:28:13 | * | Gnjurac quit (Remote host closed the connection) |
11:46:26 | * | Hideki_ joined #nim |
11:57:59 | FromDiscord | <Skaruts> ah nice |
12:02:39 | Araq | "This is a rocket" |
12:03:10 | Araq | I suppose it does mean some secret benchmark got faster |
12:03:16 | Araq | https://github.com/nim-lang/Nim/pull/13021 |
12:03:17 | disbot | ➥ Continue #13002 |
12:03:41 | FromDiscord | <Clyybber> heh |
12:03:56 | FromDiscord | <Clyybber> I think my new analysis will improve it a bit |
12:04:27 | Araq | as I said, now wasMoved+destroy elision should have prio number one |
12:04:28 | FromDiscord | <Clyybber> since it will consider lastRead - firstWrite pairs too |
12:04:42 | Araq | ah yeah |
12:09:28 | FromDiscord | <Skaruts> are there any future plans to allow parent folder imports like this `import ../[things, stuff, beer]`? |
12:09:50 | FromDiscord | <Clyybber> hmm, does it not work currently? |
12:10:12 | FromDiscord | <Skaruts> hmm, I upgraded nim a few days ago and didn't check |
12:10:57 | FromDiscord | <Clyybber> ah then it probably doesn't work (yet), I faintly remember an issue about it, or at least a comment |
12:11:51 | Araq | I think at least |
12:11:57 | Araq | import ".." / [a, b] |
12:11:59 | Araq | does work |
12:12:58 | FromDiscord | <Clyybber> deech: Can you report those issues you encountered with the parser? I think it would be a good idea to have an issue for them to track |
12:13:04 | FromDiscord | <Clyybber> or at least discuss |
12:14:21 | FromGitter | <alehander92> `.. / services / [event_log_service, debugger_service, editor_service, callgraph_service, history_service, flow_service]` work |
12:14:36 | FromGitter | <alehander92> hm but `../` as well |
12:14:39 | FromDiscord | <Skaruts> oh yea that works |
12:14:47 | FromGitter | <alehander92> i thought it might be the space |
12:14:54 | FromDiscord | <Skaruts> why are the quotes needed though? |
12:15:21 | FromDiscord | <Clyybber> maybe its the space between `/` and `[` |
12:15:49 | Araq | what you need to know (and apparently nobody does?) is that parsing 'import' |
12:15:51 | FromGitter | <alehander92> ah i just realized mine is not ../ [ directly sorry |
12:15:56 | Araq | has no special rules whatsoever |
12:16:26 | Araq | it's just import <expr> (',' <expr>)* |
12:16:29 | FromGitter | <alehander92> yeah so `/[` is probably an error everywhere in import |
12:16:33 | FromDiscord | <Skaruts> this doesn't work though: `import ".."/[sfmlw, tilemap, asset_manager as am]` |
12:16:35 | FromDiscord | <Skaruts> `Error: undeclared identifier: 'am'` |
12:17:01 | Araq | but that's the parsing step, it's why sometimes you need "" |
12:17:13 | FromGitter | <alehander92> put spaces around `/` imho |
12:17:16 | Araq | the other side of the coin is then how we interpret the expression |
12:17:23 | FromGitter | <alehander92> hm nvm |
12:17:44 | Araq | and that intepretation has grown and supported more and more features |
12:18:49 | PMunch | Ugh, why is everything so convoluted in C# https://stackoverflow.com/questions/1500194/c-looping-through-lines-of-multiline-string |
12:19:00 | PMunch | What's wrong with for line in mystring.lines.. |
12:19:26 | FromDiscord | <Skaruts> wanna know why I ran away from C++ like the plague? 😄 |
12:19:48 | PMunch | Haha, don't worry I've been down that road as well |
12:20:19 | FromDiscord | <Skaruts> don't even mention stl error messages... |
12:21:14 | FromGitter | <alehander92> c# is usually not verbose |
12:21:27 | Araq | Zevv, should we fix --os:standalone or come up with a new switch? |
12:22:49 | federico3 | a default panicoverride.nim would be nice |
12:24:50 | FromGitter | <alehander92> what is the problem with standalone |
12:24:54 | PMunch | alehander42, where do you get that from? I find C# very verbose |
12:28:33 | FromGitter | <alehander92> sorry |
12:28:41 | FromGitter | <alehander92> i remember c# being less verbose than java |
12:28:51 | FromGitter | <alehander92> but not very experienced with both :O |
12:29:17 | lqdev[m] | both are overly verbose imo |
12:29:43 | FromDiscord | <Skaruts> C# setters/getters? |
12:29:59 | FromGitter | <alehander92> yeah c# had some shortcuts didnt it? |
12:30:06 | FromGitter | <alehander92> and they added a simple form of pattern matching? |
12:30:13 | lqdev[m] | well, they're better than the non-existent Java getters and setters |
12:30:15 | FromGitter | <alehander92> but java also changed a lot of things .. so dont know |
12:30:36 | FromDiscord | <Skaruts> off the top of my head I think I remember setters/getters being a bit cryptic or verbose |
12:30:56 | FromDiscord | <Skaruts> but I hardly ever look at C# so I could easily be wrong |
12:30:59 | lqdev[m] | I ran away from Java to start using Groovy |
12:31:06 | lqdev[m] | it helped a bit, but not much |
12:31:46 | lqdev[m] | at least I didn't have to do ctx.setFillColor() everywhere, I could just use ctx.fillColor = |
12:32:11 | lqdev[m] | Groovy is quite a big improvement over Java, tbh |
12:32:16 | FromDiscord | <Skaruts> I ran away from java because of `org.this.that.theother.yetanother.otheragain.stuff.things.more` |
12:32:32 | lqdev[m] | ah shit, this too |
12:32:48 | lqdev[m] | wasn't that much of a problem with a proper IDE, but still |
12:32:59 | Araq | C# is excellent in the sense that it is the one production language I know about where featurism didn't cause quality problems |
12:33:03 | FromDiscord | <Clyybber> intellij saves your ass |
12:33:19 | FromDiscord | <Clyybber> yeah, C# is solid |
12:33:27 | Araq | C# has many many features and they all work well together |
12:33:33 | FromDiscord | <Clyybber> I also like that you can pretty easily reverse engineer C# |
12:33:36 | Araq | quite remarkable |
12:33:49 | FromDiscord | <Clyybber> take any unity game |
12:33:51 | FromDiscord | <Skaruts> just two days ago I was looking in some codebase and went to the depths of the earth to find a file that might be interesting, only to find 20 lines of code, 3 of which were imports from elsewhere... -.- |
12:33:54 | FromDiscord | <Clyybber> inspect its whole code |
12:34:06 | FromDiscord | <Skaruts> but it was kotlin not java, but same thing |
12:34:54 | Araq | contrast that with Scala where stuff also works well together afaict but compile-times suffered |
12:35:55 | PMunch | Everything works together, but at the penalty that everything seems to be wrapped in 8 layers of abstraction.. |
12:36:18 | Araq | that's Java's influence on C#, sadly |
12:36:31 | PMunch | But yeah, Nim could definitely work a bit more to make features work together more seamless (which is mostly a stdlib problem I think) |
12:37:13 | Araq | it's mostly a dogfood issue, whenever we eat our own dogfood stuff works well |
12:37:31 | Araq | and when we don't (not nil, concepts) it's really not fleshed out enough |
12:39:12 | PMunch | Yeah, if concepts was a lot more fleshed out you could write the stdlib to work on concepts instead of specific types |
12:39:37 | Araq | a bit but it's complex |
12:39:38 | lqdev[m] | ^ |
12:39:58 | PMunch | So you could create your own version of something and it would just work because it shares the same "interface" as the type it was indented to work with |
12:40:15 | Araq | for example, proc countWords(input: string): CountTable[string] |
12:40:27 | Araq | ok, concepts instead: |
12:40:28 | lqdev[m] | I wanted to use concepts in rapid, but was forced to use the usual tuple approach for implementing interfaces, because concepts were buggy |
12:40:44 | PMunch | proc countWords[T: concept](input: T): CountTable[T] |
12:40:46 | FromDiscord | <mratsim> concepts kind of Work in Weave |
12:40:55 | Araq | proc countWords(input: StringLike): CountTable[StringLike] |
12:40:59 | FromDiscord | <mratsim> I use them in a couple of places |
12:41:09 | Araq | but this is still not enough... |
12:41:11 | Araq | so ... |
12:41:16 | * | FromGitter quit (Read error: Connection reset by peer) |
12:41:17 | Araq | proc countWords(input: StringLike): CountTableLike[StringLike] |
12:41:34 | PMunch | Well no, it could return a specific CountTable |
12:41:34 | * | FromGitter joined #nim |
12:41:42 | Araq | except we don't have return type inference for 'CountTableLike' |
12:42:05 | Araq | and also is the input string the same concept as in CountTable[string]? |
12:42:39 | FromDiscord | <mratsim> while I would love return type overloading that seems like opening pandora's box in the current state of generics/typedesc/semchecks/sigmatches issue |
12:42:43 | PMunch | Yeah if you do `proc countWords[T: StringLike](input: T): CountTable[T]` |
12:42:48 | PMunch | That way it would be the same type |
12:42:48 | lqdev[m] | kind of sucks that there isn't a runtime alternative to concepts, it could really help with some code using inheritance and methods |
12:43:06 | FromDiscord | <Clyybber> @mratsim Yeah, return type overloading would be great, fixing generic bugs even more so |
12:43:12 | FromDiscord | <mratsim> @lqdev, there is a commented out description of runtime concepts :p |
12:43:12 | FromDiscord | <Skaruts> are there printable versions of the manual and the tutorial? |
12:43:14 | Araq | maybe my input is 'cstring' though and the return type is CountTable[string] |
12:43:45 | Araq | even with a perfect concept implementation it's not simple |
12:44:07 | FromDiscord | <mratsim> @lqdev: https://raw.githubusercontent.com/nim-lang/Nim/a7aeabb9d2c70a5d9bd89abf3eb08372d2c6d9d0/doc/manual_experimental.rst scan for VTable |
12:44:31 | PMunch | I just want to be able to pass a cstring or a StringSlice to a procedure that does some simple things on a string. |
12:44:49 | PMunch | E.g. to `[]`(index: int) |
12:45:28 | Araq | we're getting openArray borrowing for that but I'm also considering to support O(1) slicing for Nim's builtin strings |
12:45:31 | PMunch | Would make using distinct types much more important though.. |
12:45:35 | FromDiscord | <Clyybber> for now I think its a better idea to fix generic bugs first and then concept |
12:46:03 | Araq | 'concept' is my weapon to make Nim's generics more robust, see my RFC about it |
12:46:09 | FromDiscord | <mratsim> How are methods nowadays though? |
12:46:27 | Araq | I think they are fine |
12:46:42 | Araq | we could use a better implementation now that the 'multi' aspect of them is dead |
12:46:58 | FromDiscord | <mratsim> I'm mostly using either compile-time stuff or enums but I suspects methods are needed in many high-level cases |
12:47:20 | Araq | for high level cases I use closures |
12:47:27 | Araq | they work really well |
12:47:44 | Araq | and even ARC supports them, yay |
12:48:20 | FromDiscord | <mratsim> They work so weel that when you want a higher-order function, you need to tag {.nimcall.} everywhere because otherwise everything is a closure ... |
12:48:22 | FromDiscord | <Clyybber> we should lure people into sigmatch |
12:48:23 | FromDiscord | <mratsim> well* |
12:48:30 | FromDiscord | <mratsim> it's a trap |
12:48:35 | FromDiscord | <Clyybber> "big pile of gold spotted at the bottom of sigmatch" |
12:48:44 | FromDiscord | <Clyybber> dig deep and dig safe! |
12:49:04 | Araq | sigmatch not as bad as semexprs.nim |
12:49:15 | FromDiscord | <mratsim> maybe you should use synthesis and rewrite sigmatch as a state machine 😉 |
12:49:16 | FromDiscord | <Clyybber> oh |
12:49:31 | Araq | semexprs.nim is full of WTFs |
12:49:31 | * | Hideki_ quit (Ping timeout: 268 seconds) |
12:49:36 | FromDiscord | <mratsim> now if it could spit out a diagram that would be nice |
12:49:43 | FromDiscord | <Clyybber> @mratsim nah, I don't think so, sigmatch having state is one of the big problems |
12:49:58 | FromDiscord | <Clyybber> I think |
12:49:58 | Araq | I can guide you through the code and tell you |
12:50:08 | FromDiscord | <mratsim> state machine is not about removing state, it's about making it manageable. |
12:50:20 | Araq | "not in the spec, violating the spec" |
12:50:22 | FromDiscord | <mratsim> flags, booleans and what not |
12:50:22 | FromDiscord | <Clyybber> exactly, but I think sigmatch should have no state |
12:50:29 | FromDiscord | <Clyybber> Araq: lol |
12:51:08 | Araq | whereas sigmatch is mostly inline with the spec |
12:51:23 | FromDiscord | <Clyybber> hmm |
12:51:27 | Araq | sigmatch is complex, semexprs is wrong. |
12:52:21 | Araq | or "not even wrong". |
12:53:52 | FromDiscord | <mratsim> btw, low-priority as i have a workaround but why does the Nim compiler returns a "r" char instead of a nnkSym here? https://github.com/nim-lang/Nim/issues/13049#issuecomment-571089335 That's like WTF. |
12:53:54 | disbot | ➥ typeof(default(T)[]) cannot be manipulated in macros ; snippet at 12https://play.nim-lang.org/#ix=26zO |
12:55:24 | FromDiscord | <mratsim> That's the strangest issue I've ever seen I think |
12:55:28 | FromDiscord | <Clyybber> because [r] |
12:55:36 | FromGitter | <alehander92> Araq i think `not nil` is mostly just lacking the final implementation |
12:55:54 | FromGitter | <alehander92> i dont think there is so much confusion about how it should work |
12:57:04 | Araq | alehander92: agreed, not any more |
12:57:31 | * | a_chou joined #nim |
13:00:01 | * | a_chou quit (Client Quit) |
13:00:06 | FromGitter | <sheerluck> No videos found at https://www.twitch.tv/araq4k/videos and that makes me sad |
13:00:48 | FromDiscord | <Stuffe> I just formatted and reinstalled OSX, on a fresh install Nim is missing "libmysqlclient.20.dylib" for the mysql module |
13:01:07 | FromDiscord | <Stuffe> Anyone have an idea why? |
13:02:54 | FromGitter | <sheerluck> @Stuffe I think it's `mysql-connector-c ` not Nim |
13:02:57 | * | nsf joined #nim |
13:03:30 | FromDiscord | <Stuffe> Something I need to install? |
13:04:46 | * | Kaivo joined #nim |
13:04:59 | FromDiscord | <Stuffe> Crap, I get these errors: |
13:04:59 | FromDiscord | <Stuffe> dlopen(libmysqlclient.dylib, 2): image not found |
13:05:00 | FromDiscord | <Stuffe> dlopen(libmysqlclient.20.dylib, 2): image not found |
13:05:00 | FromDiscord | <Stuffe> dlopen(libmysqlclient.19.dylib, 2): image not found |
13:05:00 | FromDiscord | <Stuffe> dlopen(libmysqlclient.18.dylib, 2): image not found |
13:05:00 | FromDiscord | <Stuffe> dlopen(libmysqlclient.17.dylib, 2): image not found |
13:05:02 | FromDiscord | <Stuffe> dlopen(libmysqlclient.16.dylib, 2): image not found |
13:05:04 | FromDiscord | <Stuffe> dlopen(libmysqlclient.15.dylib, 2): image not found |
13:05:06 | FromDiscord | <Stuffe> dlopen(libmariadbclient.dylib, 2): image not found |
13:05:07 | FromDiscord | <Stuffe> dlopen(libmariadbclient.20.dylib, 2): image not found |
13:05:09 | FromDiscord | <Stuffe> dlopen(libmariadbclient.19.dylib, 2): image not found |
13:05:11 | FromDiscord | <Stuffe> dlopen(libmariadbclient.18.dylib, 2): image not found |
13:05:13 | FromDiscord | <Stuffe> dlopen(libmariadbclient.17.dylib, 2): image not found |
13:05:14 | FromDiscord | <Stuffe> dlopen(libmariadbclient.16.dylib, 2): image not found |
13:05:16 | FromDiscord | <Stuffe> dlopen(libmariadbclient.15.dylib, 2): image not found |
13:05:19 | PMunch | Please don't paste stuff into Discord.. |
13:05:26 | FromDiscord | <Stuffe> But I found libmysqlclient.21.dylib in a dir, I assume with my new mysql install |
13:05:30 | FromDiscord | <Stuffe> Ok sorry |
13:05:48 | FromDiscord | <Stuffe> Anyway, I guess it may be looking for older versions only |
13:07:55 | * | Romanson joined #nim |
13:15:31 | * | marmotini_ quit (Remote host closed the connection) |
13:15:58 | * | marmotini_ joined #nim |
13:20:42 | * | marmotini_ quit (Ping timeout: 258 seconds) |
13:20:53 | FromDiscord | <Stuffe> I tried installing mysql-connector-c with brew and I tried creating a symlink to libmysqlclient20 from libmysqlclient21, neither worked |
13:22:02 | FromDiscord | <Stuffe> I have no idea what it is about and google has nothing about it either :/ |
13:24:47 | * | dddddd joined #nim |
13:28:35 | FromGitter | <alehander92> Araq btw |
13:29:02 | FromGitter | <alehander92> about standalone, i wonder if now it would be easier to use more of the stdlib in this mode (with arc) |
13:30:46 | FromGitter | <alehander92> i remember people complaining about not knowing which modules are avaiable with js backend, so some kind of docs feature where it can infer "show me a list of stuff available for X flag" might be useful |
13:33:28 | * | marmotini_ joined #nim |
13:33:53 | FromGitter | <alehander92> the discord bot can autodetect many lines added very quickly by timestamp maybe |
13:34:07 | FromGitter | <alehander92> maybe not so easy |
13:35:44 | Araq | alehander92: I figured it out |
13:35:53 | Araq | the design was unclear but now I know |
13:49:38 | Zevv | he once was blind but now can see |
14:02:19 | blackbeard420 | when using asyncnet, is it possible to spawn off a long running task on the threadpool via spawn and send the response *from* that thread. The code compiled and ran however wouldnt send due to what im assuming is the threadlocal storage having different global dispatcers |
14:05:53 | FromDiscord | <mratsim> can't you pass the handle or whatever asyncnet provide to the spawned thread? |
14:06:07 | * | lritter joined #nim |
14:06:20 | blackbeard420 | yeah passing the AsyncSocket is what i did |
14:06:58 | blackbeard420 | however asyncCheck'ing it did nothing and trying a waitFor errored with an unregistered handle |
14:09:37 | disruptek | because the dispatcher is in the other thread. |
14:10:58 | blackbeard420 | yeah thats what i discovered, is there any way to share the dispatcher between threads. Or how would i go about sending from another thread? Im used to c++ asio where you can post send/reads from other threads |
14:16:08 | FromGitter | <alehander92> Araq so what did you figure out |
14:18:09 | FromDiscord | <treeform> with --gc:arc the heap objects are shared between threads right? So should you be able to append to a regular string from all threads? (which requires reallocation some times) |
14:21:17 | FromDiscord | <mratsim> yes, but it's very discouraged |
14:21:35 | FromDiscord | <mratsim> I would need a lock that would be hammered by all threads |
14:22:53 | FromDiscord | <treeform> isn't the point of shared heap is that we can pass stuff? (provided we lock stuff) |
14:30:38 | disruptek | i thought sink annotation was optional. 🙁 |
14:35:48 | FromDiscord | <mratsim> yes the points of shared heap is to pass stuff, but the point of threading is to handle more stuff in a similar amount of time. |
14:35:48 | FromDiscord | <mratsim> Locking goes against threading. parallel program are much much faster when they don't need to synchronize |
14:36:15 | FromDiscord | <mratsim> and if you need to synchronize, only require synchronization between 2 threads in a P2P fashion instead of N threads |
14:36:35 | FromDiscord | <mratsim> that's what channel/flowvar allow you to do |
14:36:50 | FromDiscord | <treeform> well let me time it then? |
14:36:51 | Araq | nevertheless it is supported |
14:37:13 | FromDiscord | <treeform> Is there a way to disable "is not GC-safe as it accesses" |
14:37:14 | Araq | treeform: with --threads:on the heap is shared by default and once you lock your stuff |
14:37:21 | Araq | it's safe |
14:37:35 | Araq | oh yeah, use {.gcsafe.}: block here |
14:37:42 | Araq | to make the compiler shut up |
14:38:20 | FromDiscord | <treeform> that did make it shut up, thanks! |
14:38:49 | FromDiscord | <treeform> segfaults with "execution of an external program failed" instead |
14:39:02 | Araq | can you share the gist? |
14:39:14 | FromDiscord | <mratsim> you often need gdb/lldb to backtrace and have the actuall Nim stacktrace |
14:39:36 | FromDiscord | <treeform> https://play.nim-lang.org/#ix=26Al |
14:39:41 | FromDiscord | <mratsim> I think the stacktrace doesn't have enough time to be printed to stdout otherwise or something like that |
14:40:56 | FromDiscord | <mratsim> works on my machine |
14:41:25 | FromDiscord | <mratsim> ah, with danger it crashes |
14:41:42 | FromDiscord | <treeform> with `--gc:arc --threads:on` ? |
14:41:51 | FromDiscord | <mratsim> 1: 15 ...................................................................... |
14:41:51 | FromDiscord | <mratsim> 2: 16 ....................................................................... |
14:41:52 | FromDiscord | <mratsim> 4: 16 ........................................................................ |
14:41:52 | FromDiscord | <mratsim> 3: 16 ......................................................................... |
14:41:52 | FromDiscord | <mratsim> [Thread 0x7ffff78ab700 (LWP 512962) exited] |
14:41:53 | FromDiscord | <mratsim> |
14:41:55 | FromDiscord | <mratsim> Thread 4 "abb" received signal SIGSEGV, Segmentation fault. |
14:41:57 | FromDiscord | <mratsim> [Switching to Thread 0x7ffff762a700 (LWP 512963)] |
14:41:59 | FromDiscord | <mratsim> 0x0000555555560295 in resizeString () |
14:42:00 | FromDiscord | <mratsim> (gdb) bt |
14:42:02 | FromDiscord | <mratsim> #0 0x0000555555560295 in resizeString () |
14:42:03 | FromDiscord | <mratsim> #1 0x0000555555566a81 in threadFunc__9cIvQ16Dlrt0c4oldW9b0Mcg () |
14:42:05 | disbot | https://github.com/nim-lang/Nim/issues/1 -- 5Trojan horse reported by avira free-av during the setup (installer) |
14:42:05 | FromDiscord | <mratsim> #2 0x00005555555650d0 in threadProcWrapDispatch__xMRsJuvEkkgop9aeu6Zsxaw_2 () |
14:42:07 | disbot | https://github.com/nim-lang/Nim/issues/2 -- 5Compiler segfaults ; snippet at 12https://play.nim-lang.org/#ix=22vr |
14:42:07 | FromDiscord | <mratsim> #3 0x000055555556519c in threadProcWrapper__oTnP9cUoE9cVTUL7iHAoIIAA () |
14:42:08 | disbot | https://github.com/nim-lang/Nim/issues/3 -- 5methods cause compiler to segfault |
14:42:09 | FromDiscord | <mratsim> #4 0x00007ffff7e054cf in start_thread () from /usr/lib/libpthread.so.0 |
14:42:11 | disbot | https://github.com/nim-lang/Nim/issues/4 -- 5high, len function with sequences |
14:42:11 | FromDiscord | <mratsim> #5 0x00007ffff7d342d3 in clone () from /usr/lib/libc.so.6 |
14:42:12 | disbot | https://github.com/nim-lang/Nim/issues/5 -- 5compile pragma does not support cpp files |
14:42:13 | FromDiscord | <mratsim> let me try with arc |
14:42:13 | Yardanico | what is happening |
14:42:41 | FromDiscord | <treeform> neat |
14:42:54 | FromDiscord | <mratsim> no crash with arc |
14:42:56 | FromDiscord | <treeform> I though GDB output was issues |
14:43:04 | FromDiscord | <treeform> It though GDB output was issues |
14:43:06 | Araq | crashes for me too, interesting |
14:43:10 | FromDiscord | <Skaruts> is it at all possible to implement syntax like `i++`? |
14:43:31 | FromDiscord | <mratsim> Nim doesn't support postfix (except the export marker) |
14:43:31 | Araq | it also crashes with -d:useMalloc |
14:43:54 | FromDiscord | <Skaruts> would it be possible with a prefix? |
14:43:55 | FromDiscord | <mratsim> it doesn't for me :/ |
14:44:02 | Araq | however |
14:44:02 | FromDiscord | <treeform> @manterolat what OS? |
14:44:04 | FromDiscord | <mratsim> yes @Skaruts |
14:44:10 | FromDiscord | <treeform> I am on windows |
14:44:14 | Araq | for me it also crashes with counter.add commented out |
14:44:20 | Araq | so it's something else |
14:44:22 | Yardanico | @Skaruts do you have a specific usecase for it? You can write a simple proc with a different name which will do the same |
14:44:33 | Araq | maybe thread creation wasn't ported properly |
14:44:52 | FromDiscord | <mratsim> are you on windows as well @Araq? |
14:44:53 | FromDiscord | <treeform> works for me without counter add |
14:45:02 | Araq | mratsim: yes |
14:45:10 | FromDiscord | <mratsim> a wild test case appears |
14:45:36 | FromDiscord | <Skaruts> I'm just having fun with templates, but didn't seem to work, I'm guessing this would be a thing for macros |
14:45:41 | FromDiscord | <mratsim> no |
14:45:55 | FromDiscord | <mratsim> proc `++`(i: var int) = inc i |
14:46:20 | Araq | treeform: works for me with --exceptions:setjmp |
14:46:39 | Araq | my exit handling for the new exceptions is not threadsafe |
14:46:47 | Araq | or something like that :-) |
14:46:56 | FromDiscord | <treeform> @Skaruts https://play.nim-lang.org/#ix=26Am |
14:46:57 | FromDiscord | <mratsim> ah, I didn't update devel the past week AFAIK |
14:47:28 | Yardanico | @treeform that's not i++ though :P |
14:47:36 | Yardanico | ah nvm |
14:48:12 | FromDiscord | <Skaruts> hah! the reason why it wasn't working for me is that I was doing `echo ++i` |
14:48:47 | FromDiscord | <mratsim> you can do proc `++`(i: var int): int {.discardable.} = inc i; i |
14:48:55 | FromDiscord | <treeform> @Skaruts https://play.nim-lang.org/#ix=26Ao |
14:48:57 | FromDiscord | <mratsim> if you really want the result to also be returned |
14:48:59 | * | marmotini_ quit (Remote host closed the connection) |
14:49:01 | Araq | "This approach worked fine until our application got threaded, at which point atexit() handlers stopped to work predictably. |
14:49:01 | Araq | We learned by trial an error that threads may already be dead in atexit() handler, and their stacks deallocated." |
14:49:03 | Araq | bummer |
14:49:32 | FromDiscord | <mratsim> Sonds like a great quote on a tomb |
14:49:41 | FromDiscord | <Skaruts> hmm works |
14:49:59 | FromGitter | <alehander92> mratsim please please dont paste |
14:50:01 | FromGitter | <alehander92> in discord |
14:50:08 | Araq | oh well I have a better way to do the same, I think |
14:50:32 | FromDiscord | <mratsim> @alehander42 noted |
14:50:32 | FromGitter | <alehander92> disruptek can disbot ignore `#<one digit>` maybe |
14:50:33 | FromDiscord | <treeform> Araq, how would you do it? |
14:50:48 | FromDiscord | <Skaruts> not even one liners should be pasted? |
14:50:52 | FromGitter | <alehander92> it seems that often they are not nim issues but just normal parts of markdown |
14:50:55 | FromDiscord | <mratsim> one liners are OK |
14:51:03 | FromDiscord | <mratsim> but it's the newline characters that is broken I think |
14:51:25 | FromGitter | <alehander92> Skaruts it seemed as many lines on my screen, + disbot got confused and it became pretty :P |
14:51:31 | FromGitter | <alehander92> but one-two liners are fine |
14:51:47 | FromDiscord | <Skaruts> yea I noticed it on irc the code gets all weird or cut out |
14:51:48 | FromDiscord | <mratsim> If I write something that spans |
14:51:48 | FromDiscord | <mratsim> multiple line it will come up ugly |
14:51:48 | FromDiscord | <mratsim> whether it's code or not |
14:51:48 | FromDiscord | <mratsim> See https://irclogs.nim-lang.org/ |
14:51:59 | FromGitter | <alehander92> sorry, one day i guess there would be better bridges |
14:52:07 | Araq | treeform: via compiler magic |
14:52:19 | Araq | in fact, I already have the code |
14:52:43 | FromGitter | <alehander92> mratsim yeah a bit annoying no big deal |
14:53:03 | FromGitter | <alehander92> @michael72 are you on gitter |
14:53:29 | disruptek | yeah, i keep forgetting to fix disbot for short numbers. |
14:53:47 | disruptek | on the plus side... |
14:53:53 | FromDiscord | <treeform> Araq, what would happen if two threads decide to resize the same string at roughly the same time? |
14:53:59 | FromGitter | <alehander92> gdb stacktraces are full of those disruptek :P |
14:54:02 | disruptek | we have biographies now. |
14:54:04 | disruptek | ~zevv |
14:54:05 | disbot | zevv: 11#nim's resident german. -- disruptek |
14:54:14 | FromGitter | <alehander92> ~disruptek |
14:54:15 | disbot | disruptek: 11a sexy fella with magic hands. |
14:54:23 | FromGitter | <alehander92> ~Araq |
14:54:24 | disbot | no footnotes for `araq`. 🙁 |
14:54:31 | FromGitter | <alehander92> neat! |
14:54:35 | disruptek | ~araq is 👑 |
14:54:36 | disbot | araq: 11👑 |
14:54:49 | FromDiscord | <treeform> "no footnotes" - only "fingernotes" |
14:54:50 | FromDiscord | <mratsim> @treeform, that's why you need a lock before add |
14:55:00 | FromGitter | <alehander92> especially the zevv one .. great banter :D |
14:55:06 | PMunch | ~PMunch |
14:55:07 | disbot | no footnotes for `pmunch`. 🙁 |
14:55:13 | PMunch | Aw :( |
14:55:15 | FromGitter | <alehander92> ~mratsim |
14:55:16 | disbot | no footnotes for `mratsim`. 🙁 |
14:55:20 | FromGitter | <alehander92> ~disbot ! |
14:55:21 | disbot | no footnotes for `disbot`. 🙁 |
14:55:24 | disruptek | you have to add them, knuckleheads. |
14:55:28 | disruptek | ~help |
14:55:34 | Araq | treeform: also try --tslEmulation:off |
14:55:35 | FromDiscord | <mratsim> ~welp |
14:55:36 | disbot | no footnotes for `welp`. 🙁 |
14:55:41 | PMunch | ~help |
14:56:17 | PMunch | ~PMunch is testing out the new biography feature |
14:56:17 | disbot | no footnotes for `pmunch`. 🙁 |
14:56:27 | FromGitter | <alehander92> disruptek it needs to be a stack that you push bio-lines to |
14:56:32 | disruptek | lowercase. |
14:56:40 | PMunch | ~pmunch is testing out the new biography feature |
14:56:41 | disbot | pmunch: 11testing out the new biography feature |
14:56:44 | PMunch | Ey! |
14:56:48 | FromGitter | <alehander92> ~disruptek is dont replace the previous ? |
14:56:48 | disbot | disruptek: 11a sexy fella with magic hands. |
14:56:48 | PMunch | ~PMunch |
14:56:48 | disbot | disruptek: 11dont replace the previous ? |
14:56:49 | disbot | pmunch: 11testing out the new biography feature |
14:57:01 | FromGitter | <alehander92> huh it seems it already is interesting |
14:57:10 | disruptek | you will replace your last footnote on the term, but not the footnote others have left. |
14:57:13 | PMunch | ~disruptek |
14:57:14 | disbot | disruptek: 11a sexy fella with magic hands. |
14:57:14 | disbot | disruptek: 11dont replace the previous ? |
14:57:20 | PMunch | Oh, it adds them? |
14:57:22 | FromGitter | <alehander92> great bio |
14:57:27 | FromGitter | <alehander92> makes you think |
14:57:29 | PMunch | Oooh, right |
14:57:34 | FromGitter | <alehander92> asking questions about life |
14:57:52 | disruptek | ~compiler |
14:57:53 | disbot | compiler: 11https://nim-lang.org/docs/nimc.html -- the Nim Compiler User Guide -- disruptek |
14:57:53 | PMunch | It should att the -- <name> part automatically |
14:58:00 | FromDiscord | <mratsim> I think you just unleashed black hole that will suck IRC soul |
14:58:08 | disruptek | it will omit others' names so that they don't get pinged. |
14:58:10 | FromGitter | <alehander92> no |
14:58:22 | disruptek | unless you speak to it privately, of course. |
14:58:33 | PMunch | Aah, that makes a lot of sense :P |
14:58:43 | FromDiscord | <mratsim> ~API is https://nim-lang.org/docs/theindex.html |
14:58:44 | disbot | no footnotes for `api`. 🙁 |
14:58:45 | Araq | treeform: it's --tlsEmulation:on in combination with --exceptions:goto |
14:58:50 | disruptek | lowercase. |
14:58:51 | FromDiscord | <mratsim> ~api |
14:58:52 | disbot | no footnotes for `api`. 🙁 |
14:58:55 | Araq | but I don't have a fix yet, sorry |
14:58:59 | FromDiscord | <mratsim> ~api is https://nim-lang.org/docs/theindex.html |
14:59:00 | disbot | api: 11https://nim-lang.org/docs/theindex.html |
14:59:04 | Araq | more complex that I thought it would be |
14:59:05 | disruptek | i guess that's the first bug. |
14:59:11 | FromGitter | <alehander92> ~mratsim is a french guy, aspiring go player and true man of baguette |
14:59:11 | disbot | mratsim: 11a french guy, aspiring go player and true man of baguette |
14:59:18 | FromGitter | <alehander92> ok yeah private makes more sense |
14:59:35 | FromDiscord | <mratsim> lol |
14:59:50 | * | marmotini_ joined #nim |
14:59:58 | PMunch | Hmm, I got "-- #nim" when I polled it for my bio in a private chat |
15:00:13 | disruptek | neat, the second bug. |
15:00:31 | FromGitter | <alehander92> ok 9disruptek |
15:00:46 | PMunch | Can I delete a bio? |
15:00:58 | disruptek | you can replace them but you can't delete them. |
15:01:02 | PMunch | Or will I be testig the new biography feature until I can think of something better to write? :P |
15:01:03 | PMunch | Ah.. |
15:01:18 | disruptek | the problem with allowing deletion is that it makes people put garbage into the database. |
15:01:18 | FromGitter | <alehander92> ~help |
15:01:22 | FromDiscord | <treeform> Araq, it seems to work, but then it crashes some place in the middle for unknown reason. |
15:01:24 | disruptek | at least, that's my theory. |
15:01:37 | FromGitter | <alehander92> ~~ |
15:01:38 | disbot | no footnotes for `~`. 🙁 |
15:01:42 | Araq | treeform: for me it then doesn't crash |
15:03:30 | PMunch | disruptek, what do you mean? |
15:03:37 | PMunch | Now I can't remove the garbage I put in there.. |
15:03:49 | disruptek | yeah, that's the way bugs are. |
15:03:59 | disruptek | they are like the opposite of features. |
15:04:02 | disruptek | they arrive broken. |
15:04:23 | FromDiscord | <treeform> Araq, ha, for me it crashes at the very end when all threads finish... and it should return from the joinThreads. |
15:04:42 | Araq | yes, when it does crash |
15:04:50 | Araq | it does crash at the end when we try to cleanup threads |
15:05:53 | * | PMunch quit (Quit: Leaving) |
15:07:30 | FromDiscord | <treeform> Araq, arc+thread bug? |
15:07:48 | Araq | for me it's a --tlsEmulation:on bug |
15:08:07 | Araq | and it's easy enough to see in gdb.exe |
15:08:19 | Araq | we access thread local storage after it was freed |
15:08:29 | Araq | in the implementation of --exceptions:goto |
15:08:54 | Araq | working on a fix but --tlsEmulation:on is a hack anyway, disable it |
15:09:09 | Araq | please disable it, native TLS is much better |
15:10:35 | * | ng0_ joined #nim |
15:10:48 | FromDiscord | <treeform> Araq, I do "--gc:arc --threads:on --exceptions:goto --tlsEmulation:on" still crashes: minimal example: https://play.nim-lang.org/#ix=26AB |
15:11:06 | Araq | no, use --tlsEmulation:off |
15:11:25 | Araq | alternatively use --exceptions:setjmp |
15:11:32 | FromDiscord | <treeform> Araq, yes off works, sorry miss understood you |
15:11:47 | Araq | but --exceptions:setjmp sucks and is obsolete |
15:11:57 | disruptek | lol |
15:12:04 | FromDiscord | <treeform> --exceptions:setjmp works |
15:12:22 | Araq | I know but I don't want to support it for much longer |
15:13:10 | disruptek | nim 2020: obsoleting features before they are even replaced. |
15:13:16 | FromDiscord | <treeform> i'll use the "--exceptions:goto --tlsEmulation:off" for now, I guess. |
15:13:28 | disruptek | treeform: resistance is futile. |
15:13:37 | * | ng0 quit (Ping timeout: 265 seconds) |
15:13:38 | FromGitter | <alehander92> https://news.ycombinator.com/item?id=21968686 |
15:13:46 | Araq | treeform: yeah, that's what we strive for |
15:13:53 | FromGitter | <alehander92> dont know if my comments are correct feel free to correct me here |
15:15:36 | Araq | it's correct but you could elaborate a bit |
15:16:11 | Araq | given Nim's distinction between ref/ptr we have lots of flexibility how to map Nim onto an MM scheme |
15:16:30 | Araq | and we exploit that |
15:17:13 | * | marmotini_ quit (Remote host closed the connection) |
15:17:36 | FromGitter | <alehander92> well i am not entirely sure how what does this mean :D |
15:20:50 | FromDiscord | <treeform> "what would happen if two threads decide to resize the same string at roughly the same time?" - you get a crash... now we know. |
15:23:23 | * | ng0_ is now known as ng0 |
15:28:20 | * | solitudesf quit (Remote host closed the connection) |
15:28:27 | * | solitudesf- joined #nim |
15:31:28 | FromGitter | <matrixbot> `grantmwilliams` Anyone know of a comparision between Nim and some of the other newer languages like crystal, V, zig, pony etc. ? |
15:31:53 | Yardanico | what do you mean by "comparasion"? |
15:32:28 | FromDiscord | <mratsim> there is an in-depth D comparison but AFAIK it's already obsolete 😛 |
15:33:21 | FromDiscord | <mratsim> ultimately besides some deal breaker (do you need windows support?), the best would be to try each language to see what fit for you and your applications |
15:34:20 | FromDiscord | <mratsim> I honestly don't think there is one thing in those languages that cannot be done in Nim. So it all comes down to the library ecosystem. |
15:35:09 | FromDiscord | <mratsim> On another hand, there are several things that I do in Nim that I wouldn't be able to do in those languages. So it all depends on your use cases. |
15:35:21 | FromGitter | <matrixbot> `grantmwilliams` I dont really care about benchmarks or anything like that. I guess I'm mostly interested in more of the design. What do the language authors intend the language to be used for, what dependencies do the languages have, what platforms can they target etc. |
15:36:29 | Yardanico | well, Nim can target the most platforms out of all languages you asked, because it compiles to C and has support for quite a lot of OSes |
15:36:50 | Yardanico | Zig and Crystal use LLVM IR so the number of targets is more limited, although I really like cross-compilation in Zig |
15:37:02 | FromGitter | <alehander92> 1) browser/electron (with js backend and afaik maybe with nlmv's wasm support ) |
15:37:11 | FromDiscord | <mratsim> AFAIK except from Pony which is heavily biaised towards distributed, usually financials, applications all aim to be a general-purpose languages, usually a better C |
15:37:42 | FromGitter | <alehander92> i'd say crystal sounds like a "fast typed ruby" , alternative to go to me |
15:37:55 | FromDiscord | <Rika> it even has the fitting name! |
15:37:58 | FromGitter | <alehander92> but yeah people use even it for system stuff indeed(as well as go) |
15:38:10 | FromDiscord | <treeform> Big LOL: https://play.nim-lang.org/#ix=26AM |
15:38:19 | FromDiscord | <mratsim> it's not even always typed, and when you use untyped Crystal apparently it slow downs compilation a lot |
15:39:19 | FromGitter | <alehander92> you mean inference? it is still statically typed |
15:39:23 | FromDiscord | <Rika> is it type inference or dynamic typing? |
15:39:24 | FromDiscord | <Rika> yhea |
15:39:26 | FromDiscord | <Rika> yeah* |
15:39:35 | FromGitter | <alehander92> but yeah, i've heard the inference might be slow sometimes indeed |
15:39:36 | FromDiscord | <mratsim> no crystal has a mixmatch of both AFAIK |
15:39:39 | FromGitter | <alehander92> for their design |
15:39:43 | FromGitter | <alehander92> mratsim i dont think so |
15:40:30 | FromGitter | <alehander92> they just skip many of the annotations but no real dynamic typing (except if they have something like our `.` JsObject kind of thing) |
15:41:42 | FromDiscord | <mratsim> look at the very last example here: https://crystal-lang.org/2015/03/04/internals.html |
15:41:51 | FromDiscord | <mratsim> apparently it's dynamic dispatch |
15:42:17 | FromDiscord | <Rika> so still static typing |
15:42:34 | FromDiscord | <mratsim> no, the def(x, y) example is dynamic |
15:42:55 | FromDiscord | <mratsim> or i didn't understand anything |
15:43:24 | * | solitudesf- quit (Quit: Leaving) |
15:43:45 | Yardanico | maybe it's just like "auto" in Nim? |
15:43:45 | * | solitudesf joined #nim |
15:44:06 | Yardanico | creates a new generic function for each combination of argument types |
15:44:06 | FromGitter | <alehander92> i think it just looks like generics or auto indeed |
15:44:20 | FromGitter | <alehander92> but i agree that "And this also works if the type of all arguments is not known at compile time." is confusing |
15:44:28 | FromGitter | <alehander92> but i guess this is about subclasses? |
15:54:49 | * | marmotini_ joined #nim |
15:58:20 | * | Trustable joined #nim |
16:01:28 | * | Vladar joined #nim |
16:04:13 | FromGitter | <FabienPoirierPrincipia> Hi all, I am new to Nim, found it great, I'd like to statProcess (osProc) with a specific PRIORITY (lower one), but it seems hard coded tp normal priority. Is it possible to run process in lower prority? |
16:08:48 | Yardanico | I think you have to use OS-specific APIs for now |
16:09:37 | * | beshr joined #nim |
16:23:32 | Araq | FabienPoirierPrincipia: PRs are accepted for the stdlib |
16:24:24 | Araq | and usually better than copying the existing lib in order to mutate it. though this is useful too |
16:24:55 | * | NimBot joined #nim |
16:26:38 | * | filcuc joined #nim |
16:26:56 | * | Romanson quit (Quit: Connection closed for inactivity) |
16:35:24 | disruptek | i'm getting an index error during compilation of a nimph test in 1.0.4. the error is absent in 1.0.5. 😢 |
16:36:29 | Araq | time for 1.0.6 then |
16:37:44 | * | marmotini_ quit (Remote host closed the connection) |
16:39:03 | * | disruptek sighs. |
16:40:39 | narimiran | disruptek: now's the time then for "can you backport this too?" :) |
16:41:02 | disruptek | thanks, i'm good. 😉 |
16:46:10 | * | Hideki_ joined #nim |
16:50:46 | * | Hideki_ quit (Ping timeout: 258 seconds) |
16:54:21 | disruptek | maybe the way to do `maybe` is with operators that visually indicate the addition of the `denil` "condom". a.<|x2.x3|> would allow the semantics to change without respect to the deref operator. |
16:54:40 | disruptek | looks nice with ligatures, also. |
16:55:34 | Araq | interesting idea |
16:56:01 | Araq | but I would use ?(a.b.c.d) |
16:56:18 | disruptek | that's even cheaper, yeah. |
16:56:20 | Araq | a ? prefix operator has little problems |
17:00:50 | Araq | in fact, I'd pick `?!` |
17:01:04 | Araq | it sticks out and is unlikely to be used for something else |
17:01:22 | Araq | if ?!x.foo.bar.baz == "a" |
17:01:28 | disruptek | nim-result is using `?` but i think i'm gonna fork it in any event. |
17:01:52 | disruptek | https://github.com/arnetheduck/nim-result/issues/10 |
17:01:52 | disbot | ➥ `$` is side-effect free yet calls `$` on all values |
17:04:32 | disruptek | () means you cannot pass a Maybe around. maybe that's good. |
17:04:59 | Araq | we have Option[T] for that |
17:05:10 | disruptek | i guess ?!foo is a Maybe. |
17:06:06 | * | sagax quit (Ping timeout: 258 seconds) |
17:14:00 | * | marmotini_ joined #nim |
17:26:37 | disruptek | maybe ?!foo is defined in optons, and its value is Option[typeof(foo)] and there's no Maybe. then it works correctly with the rest of stdlib and nil/notnil. |
17:31:58 | * | endragor_ quit (Remote host closed the connection) |
17:33:52 | disruptek | nim 1.0.5 doesn't ignore `sink` in default gc? and i get different behavior with and without `sink`. |
17:35:43 | Araq | sounds like a bug to me |
17:35:47 | Araq | 'sink' is an optimization |
17:36:00 | Araq | (except for move-only types but we don't have them in the stdlib...) |
17:36:30 | disruptek | i know, but i'm having a devil of a time debugging between all these different behaviors. |
17:37:16 | Araq | that's because you're helping us to get --gc:arc stable |
17:37:33 | disruptek | there's a sucker born every minute. |
17:37:57 | Araq | I don't know what that means |
17:38:33 | disruptek | it's a quote of p.t. barnam, the famous showman. |
17:38:58 | disruptek | it means there's always another fool to dupe. |
17:39:49 | disruptek | adding sink got me around the bug i pm'd you about ~12hrs ago. |
17:40:27 | FromDiscord | <mratsim> when sink fixes bug it means it's ready for prime :p |
17:43:03 | disruptek | if i get a nil Cell it means i'm trying to dealloc something that we have no rc on, right? |
17:43:29 | FromDiscord | <mratsim> ping @Clyybber |
17:44:58 | Zevv | --gc:arc is totally done and finished. I switched it on, ran my tests, and all was well |
17:45:01 | Zevv | amen |
17:45:31 | disruptek | no more bugfixes, then. |
17:46:13 | * | filcuc quit (Ping timeout: 260 seconds) |
17:47:47 | * | nixfreak joined #nim |
17:49:46 | FromDiscord | <Clyybber> @mratsim pong |
17:50:00 | FromDiscord | <mratsim> see disruptek question about nil Cell |
17:50:39 | FromDiscord | <Clyybber> Cell is what? |
17:50:49 | FromDiscord | <Clyybber> An ref object I assume? |
17:51:24 | * | matic quit (Quit: Leaving) |
17:55:33 | disruptek | i had a nil deref issue where the pointer wasn't nil but head(p) was. |
17:57:12 | disruptek | an exhaustive case should error on else: |
18:01:27 | * | marmotini_ quit (Remote host closed the connection) |
18:06:15 | nixfreak | is it possible to create a buffer overlow using nim ? |
18:07:16 | Araq | yes. it's more difficult than in C though. |
18:07:35 | Araq | and if you use 'unsafe' memory it's even possible in Java |
18:08:08 | nixfreak | I'm just looking to use nim for exploit development , so trying to learn |
18:09:38 | FromDiscord | <mratsim> just use alloca |
18:10:37 | FromDiscord | <treeform> I think it's possible to create a buffer overflow in any general purpose language if you are creative enough. |
18:10:47 | Araq | yup |
18:13:49 | Zevv | if you can't do that, its not general purpose |
18:14:07 | Zevv | it should be hard and look ugly as hell, though |
18:15:55 | disruptek | this outputs "dumb `` 6"; result is string: echo "dumb `", result, "` ", result.len |
18:18:21 | disruptek | if i subsequently append to result, the new result is "6" & appended_string |
18:32:32 | disruptek | this is crazy. definitely broken, but it seems to have something to do with cstring. |
18:33:19 | narimiran | here are some numbers for arc-lovers: https://forum.nim-lang.org/t/5734#35803 (and a puzzle at the end for arc-debuggers :)) |
18:35:56 | Araq | btw it's not "my" benchmark |
18:36:09 | narimiran | whose is it? :) |
18:36:30 | * | endragor joined #nim |
18:36:34 | Araq | it was a semi-official benchmark for latencies extracted from someone's production code |
18:37:16 | narimiran | ok, changed to "Araq has shared...." :) |
18:38:00 | FromDiscord | <treeform> When will --gc:arc will be default? |
18:39:33 | leorize | persumably when async supports it :P |
18:40:25 | FromDiscord | <sealmove> What exactly is async? Is it a stdlib module ? |
18:41:38 | * | endragor quit (Ping timeout: 260 seconds) |
18:42:05 | FromDiscord | <treeform> @sealmove yes its a set of modules asyncdispatch, asyncnet ... async* |
18:42:25 | FromDiscord | <treeform> @sealmove yes its a set of stdlib modules asyncdispatch, asyncnet ... async* |
18:44:49 | Araq | treeform: we said 'async' needs to work with it but *changing the default* are big words |
18:45:07 | Araq | and arguably the Nim compiler itself must work with it then |
18:47:14 | Araq | I got async to work on Unix, need to make the test part of the suite so we notice regressions |
18:47:42 | Araq | likewise we got GordonBGood's hell of a test to work |
18:53:43 | leorize | @treeform, please avoid editing on discord, it results in two messages on irc |
18:55:56 | Araq | narimiran, is it too late to fix/change your test results? |
18:56:04 | Araq | there is another bug in the code :-( |
18:56:27 | narimiran | update the gist and i'll re-run it and post the updated version |
18:56:52 | Araq | I don't have an update, the problem is this line |
18:56:56 | Araq | GC_setMaxPause(30) |
18:57:15 | Araq | the GC cannot handle this deadline so it never runs |
18:57:19 | Araq | I think |
18:57:30 | Araq | 30µs is too low for it |
18:57:47 | Araq | maybe give it 500µs |
18:58:30 | Araq | but yeah, it does highlight a benefit of arc, there are no numbers to fill out |
18:58:43 | narimiran | yep, that gives much more reasonable results for old gc |
18:58:47 | narimiran | no long tail anymore |
18:59:38 | Araq | ok, so 500? or 400? or ...? |
18:59:54 | Araq | you need to tweak the value to the lowest sustainable latency |
19:00:05 | narimiran | 60 is still bad, 70 is ok |
19:00:13 | Araq | in order to get meaningful results |
19:00:46 | narimiran | ha, 61 is bad, 62 is ok :D |
19:01:00 | Araq | it's machine specific :P |
19:01:09 | Araq | as you can see for me 30 was OK |
19:01:19 | Araq | otherwise why would the code contain it? |
19:01:30 | narimiran | excuses, excuses.... :D |
19:01:43 | Araq | sorry, well not too many have read it yet :P |
19:01:56 | Araq | so what number should my gist use? 100? |
19:02:30 | narimiran | yeah, i can run it with 100 to be on the safe side |
19:07:49 | narimiran | heh, now my conclusions are all wrong |
19:08:43 | Araq | sorry, I only spoted the problem |
19:08:53 | Araq | once you posted it |
19:09:05 | Araq | zct capacity: 1,008,895 # <-- 1 million entries?! |
19:09:46 | Araq | oh well, benchmarking is hard, everybody knows it |
19:15:10 | narimiran | btw, is the forum slow or is that on my end? |
19:16:54 | narimiran | there, updated my post, not as spectacular anymore |
19:18:16 | disruptek | but the misses delta grew in our favor. |
19:21:07 | * | luis_ joined #nim |
19:21:52 | disruptek | manual is a document worth reading at least once: https://nim-lang.org/docs/manual.html |
19:21:57 | disruptek | ~manual is a document worth reading at least once: https://nim-lang.org/docs/manual.html |
19:21:58 | disbot | manual: 11a document worth reading at least once: https://nim-lang.org/docs/manual.html |
19:23:42 | disruptek | ~arc is a new memory manager for Nim; see https://forum.nim-lang.org/t/5734 |
19:23:43 | disbot | arc: 11a new memory manager for Nim; see https://forum.nim-lang.org/t/5734 |
19:25:19 | * | luis_ quit (Client Quit) |
19:25:53 | * | luis_ joined #nim |
19:28:37 | leorize | disruptek: what is this new feature? :P |
19:29:18 | disruptek | just a little key/val database people can add to. |
19:29:45 | disruptek | try ~help |
19:29:50 | leorize | ~help |
19:30:07 | leorize | nice |
19:30:50 | disruptek | we'll see... |
19:32:18 | FromGitter | <timotheecour> nim CI broke => https://github.com/nim-lang/Nim/pull/13052 |
19:32:19 | disbot | ➥ testament/important_packages dont run hts |
19:33:00 | disruptek | ~leorize is responsible for an awesome NeoVim plugin at https://github.com/alaviss/nim.nvim |
19:33:01 | disbot | leorize: 11responsible for an awesome NeoVim plugin at https://github.com/alaviss/nim.nvim |
19:33:42 | leorize | make it `the awesome NeoVim plugin` :P |
19:33:54 | disruptek | ~leorize is responsible for the awesome NeoVim plugin at https://github.com/alaviss/nim.nvim |
19:33:55 | disbot | leorize: 11responsible for the awesome NeoVim plugin at https://github.com/alaviss/nim.nvim |
19:34:03 | leorize | is it possible to make disbot print it out to the chat? |
19:34:17 | disruptek | print what out? |
19:34:47 | leorize | the added snippets? |
19:34:54 | * | filcuc joined #nim |
19:35:08 | disruptek | code snippets? from where? |
19:35:39 | disruptek | it migrates snippets from issues to the playground. |
19:36:16 | leorize | I mean the added texts to disbot? those ~term? |
19:36:31 | disruptek | you query for terms with just ~someterm: |
19:36:33 | disruptek | ~leorize |
19:36:34 | disbot | leorize: 11responsible for the awesome NeoVim plugin at https://github.com/alaviss/nim.nvim -- disruptek |
19:36:48 | leorize | ooooh |
19:36:58 | leorize | I thought everything was going to be like ~help :P |
19:37:36 | disruptek | it was, originally, but usually people who know the terms don't need to know their definitions, so... |
19:38:04 | solitudesf | ~manual |
19:38:05 | disbot | manual: 11a document worth reading at least once: https://nim-lang.org/docs/manual.html |
19:40:42 | FromDiscord | <has1> Can you create a dll file with nim? Instead of a binary? |
19:40:57 | disruptek | ~concepts is user-defined type classes; documented in the experimental section of the manual: https://nim-lang.org/docs/manual_experimental.html#concepts |
19:40:58 | disbot | concepts: 11user-defined type classes; documented in the experimental section of the manual: https://nim-lang.org/docs/manual_experimental.html#concepts |
19:41:08 | disruptek | has1: yep. |
19:41:22 | FromDiscord | <has1> Something that you can call methods on easily? |
19:41:54 | disruptek | some good demonstrations of what's possible here: https://scripter.co/ |
19:41:58 | FromDiscord | <has1> In .net you can load the assembly and they just call the methods of the dll file |
19:42:37 | disruptek | ~kaushalmodi is a badass coder with a wealth of useful Nim articles on his blog, at https://scripter.co/ |
19:42:37 | disbot | kaushalmodi: 11a badass coder with a wealth of useful Nim articles on his blog, at https://scripter.co/ |
19:43:13 | FromDiscord | <has1> What am I looking at here |
19:43:32 | disruptek | i have no idea; hold the camera closer to the screen. |
19:43:49 | disruptek | it looks like porn to me. |
19:43:55 | disruptek | is that a horse? |
19:44:01 | disruptek | oh, it's a llama? |
19:44:46 | FromDiscord | <inv> Hello, duplicate from telegrams: |
19:44:54 | FromDiscord | <inv> I have a question about vs-code nim plugin. Isn't it right that it has tab for 4wide? Or something wrong with my vs.code |
19:45:50 | FromDiscord | <has1> Is that guy mental |
19:46:07 | FromDiscord | <has1> Why is he talking about porn in a programming discord |
19:47:19 | Zevv | has1: he is kind of bad publicity for the nim community every now and then |
19:47:20 | Araq | yeah disruptek, enough jokes for now |
19:47:32 | Zevv | hush, boy |
19:48:10 | Araq | has1: there is support for that via the dynlib.nim stdlib module |
19:48:24 | Araq | but it's not as easy as in .NET land I suppose |
19:50:30 | FromDiscord | <has1> This seems interesting, but what do I need to do to compile nim code so that I can call it this way? |
19:52:18 | Araq | https://nim-lang.org/docs/nimc.html#dll-generation |
19:52:31 | Araq | and read about the .dynlib and .exportc pragmas |
19:52:56 | Araq | and yeah, once again the results of our polls show documentation is lacking |
19:53:04 | Araq | so once again we'll improve it |
19:53:54 | disruptek | ~dynlib is shared library creation; documented at https://nim-lang.org/docs/nimc.html#dll-generation |
19:53:55 | disbot | dynlib: 11shared library creation; documented at https://nim-lang.org/docs/nimc.html#dll-generation |
19:54:16 | FromDiscord | <has1> Thanks I'll check this out |
20:01:07 | * | hpyc9 is now known as Irving |
20:02:04 | * | Irving is now known as hpyc9 |
20:04:25 | * | pbb quit (Ping timeout: 252 seconds) |
20:07:27 | leorize | Araq: btw on *nix Nim isn't hiding unexported symbols when building dlls |
20:07:43 | * | pbb joined #nim |
20:07:56 | leorize | should we just enforce -fvisibility=hidden then un-hide symbols like for windows? |
20:10:58 | * | pbb quit (Excess Flood) |
20:11:06 | * | pbb joined #nim |
20:13:21 | * | pbb quit (Excess Flood) |
20:13:31 | * | pbb joined #nim |
20:15:38 | * | nsf quit (Quit: WeeChat 2.7) |
20:24:28 | FromGitter | <deech> Does "there must be only one instance of the GC per process/address space" mean that I can't have a Nim executable that depends on more than one Nim library DLL? |
20:28:49 | shashlick | disruptek: that link is wrong for dynlib |
20:29:06 | shashlick | https://nim-lang.org/docs/dynlib.html |
20:31:39 | leorize | @deech no |
20:31:46 | leorize | it just means that don't mix pointers |
20:32:08 | leorize | a ref from a DLL is not compatible with one from the other afaict |
20:32:46 | leorize | things get messy once you start using threads though |
20:32:58 | shashlick | best to use boehm for this situation |
20:33:09 | leorize | I'd just recommend --gc:arc :P |
20:33:14 | shashlick | eventually yes |
20:33:41 | shashlick | feud has a main nim executable and a bunch of nim dlls all coexisting with memory moving around |
20:36:00 | * | pbb_ joined #nim |
20:36:38 | * | pbb quit (Ping timeout: 246 seconds) |
20:37:19 | * | filcuc quit (Ping timeout: 258 seconds) |
20:44:54 | * | luis_ quit (Quit: luis_) |
20:46:13 | * | marmotini_ joined #nim |
20:47:12 | nixfreak | does nim have a library like binascii with python? |
20:47:50 | * | Hideki_ joined #nim |
20:49:35 | FromDiscord | <mratsim> that seems like a pragmatic versioning scheme: https://calver.org/ |
20:50:39 | FromDiscord | <mratsim> @nixfreak, you have some stuff in strutils and parseutils, otherwise in stew we have some parsers for hex |
20:50:57 | nixfreak | stew? |
20:50:59 | * | marmotini_ quit (Ping timeout: 265 seconds) |
20:51:43 | nixfreak | forgive my ignorance what is stew? |
20:52:21 | nixfreak | also does nim have a doc like javadoc ? |
20:52:22 | * | Hideki_ quit (Ping timeout: 268 seconds) |
20:52:32 | nixfreak | or just look online ? |
20:52:49 | * | pbb_ quit (Quit: No Ping reply in 180 seconds.) |
20:54:06 | * | pbb joined #nim |
20:55:58 | disruptek | !repo nim-stew |
20:55:59 | disbot | https://github.com/status-im/nim-stew -- 9nim-stew: 11stew is collection of utilities, std library extensions and budding libraries that are frequently used at Status, but are too small to deserve their own git repository. 15 11⭐ 2🍴 |
20:56:22 | disruptek | there's no javadoc/pydoc yet, but you're welcome to contribute. |
20:56:42 | nixfreak | ok thanks |
20:56:47 | disruptek | !repo disruptek/ndoc |
20:56:48 | disbot | https://github.com/disruptek/ndoc -- 9ndoc: 11like pydoc but for nim 15 0⭐ 0🍴 |
20:57:49 | * | tane joined #nim |
20:58:22 | * | sealmove joined #nim |
20:59:03 | * | pbb quit (Ping timeout: 252 seconds) |
20:59:16 | * | pbb joined #nim |
21:00:42 | nixfreak | ok ndoc is a WIP , but can't really use yet ? |
21:00:53 | disruptek | it's more of an RFC. |
21:01:02 | nixfreak | gotcha |
21:04:01 | sealmove | what's the standard equivelant to tables in C++? |
21:04:28 | sealmove | currently using `const char* myTable[]` duh... |
21:04:46 | sealmove | in combination with enums |
21:05:55 | sealmove | essentially I want a Table[myEnum, string] |
21:07:02 | sealmove | using const char* myTable[] I must be careful to not messup ordering... |
21:07:05 | disruptek | ~dynlib is shared library creation; documented at https://nim-lang.org/docs/dynlib.html |
21:07:05 | disbot | dynlib: 11shared library creation; documented at https://nim-lang.org/docs/dynlib.html |
21:07:05 | sealmove | which is annoyin |
21:07:19 | leorize | sealmove: pretty sure they have unordered_map iirc |
21:07:40 | sealmove | so I should use STL? |
21:07:59 | disruptek | ~nimrtl.dll DLL generation is documented briefly at https://nim-lang.org/docs/nimc.html#dll-generation |
21:08:00 | disbot | no footnotes for `nimrtl.dll`. 🙁 |
21:08:05 | disruptek | ~nimrtl.dll is DLL generation is documented briefly at https://nim-lang.org/docs/nimc.html#dll-generation |
21:08:05 | disbot | nimrtl.dll: 11DLL generation is documented briefly at https://nim-lang.org/docs/nimc.html#dll-generation |
21:08:12 | sealmove | leorize: thx |
21:08:20 | disruptek | sealmove: yes, use STL. |
21:08:30 | * | Ven`` joined #nim |
21:08:55 | FromDiscord | <Clyybber> ~disbot is a cool bot |
21:08:55 | disbot | disbot: 11a cool bot |
21:09:07 | disruptek | shashlick: footnotes are cumulative; you can add your own answers to terms. |
21:09:19 | disruptek | to correct knuckleheads such as myself. |
21:10:30 | disruptek | disbot only outputs the first three answers in channel, but privately can yield many more. |
21:10:41 | disruptek | clyybber: want to look at this arc bug? |
21:10:50 | sealmove | another thing.. is there a better way than stdarg.h to traverse command line arguments? |
21:11:09 | leorize | use nim :P |
21:11:42 | sealmove | i wish... |
21:12:40 | skrylar[m] | muffindrake: as requested https://gist.github.com/Skrylar/cb626152b7af8c413816eaa1f4f3377c |
21:13:59 | muffindrake | skrylar[m]: The issue was had was related to calling conventions, which was solved by a {.nimcall.} annotation |
21:14:20 | muffindrake | The issue I had* |
21:14:34 | muffindrake | Thanks, anyway. |
21:14:48 | * | Vladar quit (Quit: Leaving) |
21:17:26 | FromDiscord | <yewpad> @Araq: Do you have a clue what happened there? Does this happen because the CSS is now being written to a separate CSS file? https://github.com/nim-lang/Nim/issues/12998 |
21:17:28 | disbot | ➥ regression(1.04) `nim doc main.nim` generates broken html (no css) ; snippet at 12https://play.nim-lang.org/#ix=26CF |
21:18:10 | FromGitter | <timotheecour> @yewpad yes, that’s exactly what’s going on, shd be an easy fix, PR welcome |
21:20:30 | sealmove | lqdev: Just fyi I decided to abandom the idea of constructing a macro call in a macro. Yes, it would help me avoid having to implement a typechecker, but it messes up the overall code architecture and makes the code less readable... |
21:20:57 | sealmove | and less functional too |
21:21:31 | sealmove | was fun learning this technique though |
21:21:39 | * | pbb quit (Quit: No Ping reply in 180 seconds.) |
21:22:56 | * | pbb joined #nim |
21:25:41 | FromDiscord | <yewpad> It indeed is broken @timotheecour. Gonna look into it |
21:47:14 | * | narimiran quit (Ping timeout: 240 seconds) |
21:49:16 | * | krux02 quit (Remote host closed the connection) |
21:55:29 | * | vsantana joined #nim |
22:00:01 | * | sagax joined #nim |
22:02:23 | FromDiscord | <mratsim> wohoho I added dataflow graph parallelism to Weave |
22:04:12 | FromDiscord | <mratsim> this means that you can do continuations and trigger tasks only when their dependencies are resolved |
22:10:55 | skrylar[m] | soooo. futures. :3 |
22:11:47 | * | Trustable quit (Remote host closed the connection) |
22:14:23 | FromGitter | <timotheecour> @leorize ⏎ ⏎ > leorize Araq: btw on *nix Nim isn't hiding unexported symbols when building dlls ⏎ ⏎ => see https://github.com/nim-lang/Nim/issues/13054 [https://gitter.im/nim-lang/Nim?at=5e13b13ee409da486cd75286] |
22:14:25 | disbot | ➥ we need a cross-platform way to set dll symbol visibility ; snippet at 12https://play.nim-lang.org/#ix=26D0 |
22:14:45 | FromDiscord | <mratsim> No futures are different @skrylar |
22:15:01 | FromDiscord | <mratsim> Futures are about control flow dependencies |
22:15:11 | FromDiscord | <mratsim> what I did was about data dependencies |
22:16:00 | FromDiscord | <mratsim> i.e. when you spawn a task with a future result, it's eagerly scheduled |
22:16:01 | disruptek | zedeus: regarding #12982, does your `$` actually work? looks like it's not defined for the new MultipartEntry type. also, wanna make that a ref and inherit from RootObj? |
22:16:03 | disbot | https://github.com/nim-lang/Nim/pull/12982 -- 3Implement file streaming for httpclient's MultipartData |
22:16:39 | FromDiscord | <mratsim> while what I did was allow tasks to be delayed until what they depends on is ready |
22:19:11 | zedeus | yeah, I modified the $ for MultipartData which is just a list of MultipartEntry, although the output probably isn't as useful as before |
22:19:32 | zedeus | why ref? and why inherit? |
22:20:01 | skrylar[m] | @mratsim well sounds neat anywya |
22:20:24 | skrylar[m] | was there still a need to fork rfc3339 to support iso dates |
22:21:04 | * | endragor joined #nim |
22:21:56 | disruptek | for extending the type. |
22:25:24 | disruptek | that cl constant could go into httpcore. |
22:25:25 | * | endragor quit (Ping timeout: 258 seconds) |
22:28:53 | zedeus | hmm sure, I can do that. you want it public too? |
22:28:56 | disruptek | prolly should have an addLine proc that includes the cl. anyway, this pr lgtm. nice upgrade; i wanted it numerous times. |
22:29:21 | disruptek | i bet it's a huge win in practical code. |
22:30:19 | disruptek | i wonder what else this knocks off my list of httpclient errors. |
22:30:34 | disruptek | !issue author:disruptek httpheaders |
22:30:35 | disbot | https://github.com/nim-lang/Nim/issues/12211 -- 3proposed changes to HttpHeaders as in HttpClient |
22:31:31 | FromGitter | <kaushalmodi> why is disbot outputting "3" before every message (I see this on gitter) |
22:32:16 | disruptek | it's an irc color code. |
22:32:31 | disruptek | actually, the color prefix. subsequent character is the color. |
22:33:10 | FromGitter | <kaushalmodi> those "3" and other numbers show in the IRC log too https://irclogs.nim-lang.org/ |
22:33:20 | Yardanico | guess we need to fix NimBot too :P |
22:33:39 | * | tane quit (Quit: Leaving) |
22:35:59 | * | ptdel joined #nim |
22:36:30 | zedeus | disruptek: do you want the MultipartEntry type public? i'm hesitant to do that since it might cause users to try tinkering with its fields which they shouldn't |
22:36:30 | FromDiscord | <Clyybber> Araq: I'm not sure how to handle instructions in the cfg that don't have .sym set |
22:37:08 | disruptek | zedeus: it can start private and could be exposed later if necessary. |
22:37:16 | * | ltriant joined #nim |
22:37:42 | disruptek | nim's http is a mess that i don't want to fight about; anything is an improvement if it actually gets committed. |
22:38:35 | zedeus | sure, I'll let it stay non-ref for now then since it's passed around in a seq belonging to a ref object. I might be wrong but having the entries be refs as well shouldn't make any difference |
22:38:55 | disruptek | right, i think it's fine. |
22:40:08 | FromDiscord | <Clyybber> Araq: ping if you're here |
22:40:46 | FromDiscord | <Clyybber> `s/if/to see if |
22:49:24 | disruptek | why does arc want me to move() a str constant as in `newException(IOError, "str constant here")`? |
22:58:05 | * | endragor joined #nim |
23:02:55 | * | endragor quit (Ping timeout: 268 seconds) |
23:04:10 | FromDiscord | <Clyybber> can't reproduce |
23:06:49 | disruptek | gittyup is a source of bewilderment. |
23:07:06 | shashlick | Imagine how horses feel |
23:07:27 | FromDiscord | <Clyybber> or do you mean someConstStr and not "str literal" ? |
23:07:27 | * | nixfreak quit (Ping timeout: 260 seconds) |
23:07:29 | disruptek | double free or corruption (fasttop) |
23:08:02 | disruptek | i tried const foo = "bar" ... raise newException(... foo) ... same result. |
23:08:35 | disruptek | it seems that my problems are all in iterators. |
23:11:15 | FromDiscord | <Clyybber> hmm |
23:13:37 | FromGitter | <Albus70007> i have an hexadecimal string, but i need it to have the "\x" thing before every byte, how can i do it?? |
23:15:52 | * | solitudesf quit (Ping timeout: 268 seconds) |
23:16:08 | leorize | @Albus70007 wdym? |
23:16:15 | * | marmotini_ joined #nim |
23:18:31 | disruptek | i will write a little thingy to translate irc color to pango and/or html. then someone and patch nimbot with it eventually. |
23:18:39 | disruptek | s/someone and/someone can/ |
23:19:19 | * | pbb quit (Quit: No Ping reply in 180 seconds.) |
23:20:36 | * | pbb joined #nim |
23:20:50 | * | marmotini_ quit (Ping timeout: 240 seconds) |
23:22:08 | FromGitter | <Albus70007> @leorize i have a socket client that communicates with a python server, the server sends me data, and i need to send a buffer back, with a two bytes long header, hardcoding the header works (if the data stays the same obv), but if i try pass the header, the server wont interpret it as it should |
23:23:27 | nisstyre | Albus: not sure what the issue is. IF the size changes, you need to somehow encode that in the beginning of the data being sent |
23:23:46 | FromGitter | <matrixbot> `arkaroo` and the header needs to be bytes, not a string? |
23:23:48 | nisstyre | e.g. as 2 bytes representing a little endian integer or something |
23:23:56 | nisstyre | or however large you need it to be |
23:24:22 | leorize | arkaroo: join #freenode_#nim:matrix.org instead of relaying to gitter :P |
23:25:17 | FromGitter | <Albus70007> yes, i know all of that, i even have the proper header, but i need it to have "\x" at the beggining of each byte because if it doesnt, the server messes up decoding it |
23:25:18 | nisstyre | or are the 2 bytes the length already? in which case you calculate how large it needs to be |
23:25:22 | * | arkaroo[m] joined #nim |
23:26:00 | FromGitter | <Albus70007> the 2 bytes are the lenght yes |
23:26:11 | FromGitter | <Albus70007> want the code? |
23:26:21 | nisstyre | Sure |
23:26:42 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:27:20 | * | Ven`` joined #nim |
23:27:29 | * | Ven`` quit (Client Quit) |
23:27:31 | FromGitter | <Albus70007> var inputs = bot.inputs ⏎ inputs.get_inputs(game_info) ⏎ let strinputs: string = $tojson(inputs) ⏎ let header: string = (len(strinputs) + 2).int16.toHex() ⏎ echo(header) ... [https://gitter.im/nim-lang/Nim?at=5e13c2630ba7b60f2035a359] |
23:27:36 | nisstyre | Albus: you might find this useful, https://github.com/weskerfoot/ADBTool/blob/b74aa9a91a5f7062b786b429009a02d1f184fcd5/src/adbtoolpkg/adb.nim#L60-L63 |
23:27:47 | nisstyre | I wrote it a little while ago to do something similar |
23:28:11 | nisstyre | instead of 4 bytes you could do the same for 2 |
23:28:35 | FromGitter | <Albus70007> how |
23:28:43 | nisstyre | the way it would be used would be like `text.len.unrollBytes` |
23:28:45 | * | uu91 quit (Remote host closed the connection) |
23:28:50 | nisstyre | which would give you a byte string |
23:28:51 | * | arecaceae quit (Quit: WeeChat 2.0.1) |
23:28:56 | nisstyre | that you could then send over the wire |
23:29:42 | * | arkaroo[m] left #nim (#nim) |
23:30:04 | FromGitter | <Albus70007> the main problem is that i need it to be in utf8 therefore have this "\x" between bytes |
23:30:13 | FromGitter | <matrixbot> `arkaroo` @leorize looks like the freenode room munges code formatting, while the gitter one respects it :P |
23:30:26 | nisstyre | FromGitter: yeah I see |
23:30:27 | FromGitter | nisstyre, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
23:30:30 | nisstyre | oops |
23:30:46 | FromGitter | <Albus70007> so this header; 0074 would look like this \x00\x74 |
23:32:19 | FromGitter | <Albus70007> and i cant just do something like buffer.add("\x") because nim considers it as a typo |
23:33:16 | FromGitter | <matrixbot> `arkaroo` maybe I'm missing something here, but it seems like this needs to be solved on the python side? if python is respecting the \x syntax, doesn't that tell you tha python is interpreting the data as a string, not a byte sequence? |
23:33:29 | nisstyre | yeah that's the part I find a bit confusing |
23:34:03 | FromGitter | <matrixbot> `arkaroo` I'm not sure whether you're dispatching it as a byte sequence or a string from the nim end, but I'm pretty sure you're reading it as a string on the python end |
23:34:44 | FromGitter | <Albus70007> python decodes it with header = struct.unpack("H", recieved[:2])[0] |
23:35:47 | nisstyre | so it's interpreting it as an unsigned short |
23:35:51 | FromGitter | <matrixbot> `arkaroo` yeah, so you;re trying to unpack a string. if it's arriving as a byte sequence, you shouldn't need to unpack it |
23:35:55 | nisstyre | why would it be utf-8 then? |
23:36:32 | FromGitter | <Albus70007> thats how the python client seems to do it |
23:36:54 | FromGitter | <Albus70007> length = len(jString.encode('utf-8'))header = struct.pack("H",length) |
23:37:16 | nisstyre | so the data is utf-8 |
23:37:32 | FromGitter | <Albus70007> at least in python, yes |
23:37:49 | nisstyre | and the length is a 2 byte sequence representing an unsigned short (in what byte order?) |
23:38:33 | FromGitter | <Albus70007> the opposite to the one nim uses, but i already flipped their position |
23:44:01 | nisstyre | Albus: Is this not what you want then? https://play.nim-lang.org/#ix=26DD |
23:44:40 | nisstyre | that gives you the length as 2 bytes (unrolled) and converted to a string which you can prepend to the data |
23:44:57 | nisstyre | which is exactly what that python is doing |
23:45:10 | nisstyre | except maybe not in the correct byte order |
23:46:25 | FromGitter | <Albus70007> i will try it, i have a very pythonic way of solving things and i am not used to dealing with bytes at all yet, starting in such a high level language is being painful now |
23:47:25 | nisstyre | no problem, and FWIW, there are probably better ways of doing this, I think there are a few libraries for dealing with parsing/serializing binary protocols |
23:47:31 | nisstyre | but it's probably overkill for this |
23:48:19 | FromGitter | <matrixbot> `arkaroo` cap'n proto has nim support I think? |
23:48:31 | nisstyre | capnp is great |
23:48:43 | FromGitter | <matrixbot> `arkaroo` >last updated 2 years ago ⏎ situation unclear :P |
23:48:53 | FromGitter | <matrixbot> `arkaroo` * > last updated 2 years ago ⏎ situation unclear :P |
23:49:07 | nisstyre | yeah I actually tried building it and it needed a compiler flag to build |
23:49:13 | nisstyre | I think I left a comment on the issue |
23:49:35 | nisstyre | https://github.com/zielmicha/capnp.nim/issues/8#issuecomment-562317259 |
23:49:36 | disbot | ➥ When using latest nim "[...] util.nim(81, 12) Error: 'nil' is now invalid for 'string';" |
23:52:42 | FromGitter | <Albus70007> i think it worked, thank you <3 |
23:52:48 | nisstyre | awesome |
23:53:26 | * | ng0 quit (Quit: leaving) |
23:55:33 | * | marmotini_ joined #nim |
23:55:54 | * | Hideki_ joined #nim |
23:56:30 | FromDiscord | <Fern & Simula (They/Them)> why does so much of the stdlib define data types like this? https://github.com/nim-lang/Nim/blob/devel/lib/pure/ropes.nim#L33 |
23:56:46 | FromDiscord | <Fern & Simula (They/Them)> why not just have a `Rope = ref object` ? |
23:58:38 | FromDiscord | <mratsim> Legacy |
23:58:47 | FromGitter | <Varriount> Because there are times where using an object is faster, (less heap allocation) |
23:58:53 | FromDiscord | <mratsim> before you coudln't do ref object followed by the field |
23:59:46 | FromGitter | <Varriount> Also, I believe that originally ref types could only be specified in procedure parameters and type bodies |