00:02:46 | * | kinkinkijkin quit (Quit: kinkinkijkin) |
00:03:11 | * | kinkinkijkin joined #nim |
00:33:56 | * | shuji joined #nim |
00:36:47 | FromGitter | <jrfondren> random compiler benchmark: https://github.com/jrfondren/chrestomathy/tree/master/pwcheck . it was a little bit funny how the Rust and D versions immediately segfaulted after I generated a bunch of dummy (erroneously-lengthed) hashes for them, otherwise nothing surprising |
00:37:38 | Yardanico | are you taking RSS of the C compiler into the account? |
00:37:42 | Yardanico | for nim |
00:37:53 | FromGitter | <jrfondren> yeah, it's /usr/bin/time for the entire run of the process |
00:38:44 | FromGitter | <jrfondren> and I checked in some other ways, it's consistent |
00:38:48 | Yardanico | ok, nice |
00:41:29 | ForumUpdaterBot | New thread by 19: Handmade hero in nim ( warning: noob), see https://forum.nim-lang.org/t/6980 |
00:49:31 | FromGitter | <sealmove> Did you do gc:none? |
00:49:50 | * | clemens3 quit (Ping timeout: 256 seconds) |
00:50:30 | FromGitter | <jrfondren> no, default flags. this is the 'nimble build' MaxRSS, not that of running the program. all three programs take <5M when running |
00:53:18 | * | xet7 joined #nim |
00:56:23 | * | clemens3 joined #nim |
00:57:27 | FromDiscord | <William_CTO> can someone link me the github for the irc bot here? |
01:00:15 | Yardanico | !repo ircord |
01:00:16 | disbot | https://github.com/Yardanico/ircord -- 9ircord: 11Discord <-> IRC bridge in Nim 15 11โญ 1๐ด |
01:00:20 | Yardanico | you can ask me questions about it if you want |
01:00:22 | Yardanico | !repo nimbot |
01:00:23 | disbot | https://github.com/nim-lang/nimbot -- 9nimbot: 11The friendly, slightly sentient, Nim IRC bot. 15 8โญ 3๐ด 7& 3 more... |
01:00:26 | Yardanico | if you meant nimbot |
01:00:45 | Yardanico | @William_CTO ^ |
01:01:47 | FromDiscord | <William_CTO> sure deal |
01:04:58 | FromDiscord | <William_CTO> Yardanico do you think dimscord is up for the task of a bot in 100+ servers? |
01:05:20 | Yardanico | well, you know that it's a Discord<->IRC bot right? |
01:05:33 | FromDiscord | <William_CTO> Correct |
01:05:47 | FromDiscord | <William_CTO> I just wanted to see dimscord in a project |
01:06:11 | Yardanico | i'm not sure if a single instance can handle that many servers, I've never tried more than 1 |
01:06:22 | Yardanico | and right it only can support 1 discord server |
01:06:44 | Yardanico | i don't think that it'll be hard to add support for multiple servers to ircord and its config, but I've never tried it really |
01:06:51 | Yardanico | also it's not "hot config reload" ;) |
01:07:16 | Yardanico | so if you need to map 100 different IRC channels to 100 different Discord channels (each channel being on a separate server), you'll still need 100 different config sections |
01:07:30 | Yardanico | right now the mapping is irc channel/discord channel id/discord webhook |
01:07:44 | Yardanico | why do you want to bridge so many discord servers with irc btw? |
01:07:53 | Yardanico | and of course ircord does bridging on a per-channel basis |
01:08:11 | FromDiscord | <William_CTO> I'm not doing that. I've written a translate bot with discord.py and am considering moving it to nim |
01:08:28 | Yardanico | ah, for dimscord you should ask @krisppurg first :) |
01:08:36 | FromDiscord | <Yardanico> he's the creator of dimscord |
01:08:39 | FromDiscord | <William_CTO> Ah sorry for misunderstanding |
01:08:40 | FromDiscord | <Yardanico> lemme link his discord server |
01:09:04 | FromDiscord | <Yardanico> https://discord.gg/bw4mHUV |
01:10:23 | FromDiscord | <William_CTO> thanks |
01:15:13 | FromDiscord | <shashlick> Would be cool if we had one server for such channels - I'd move my nimterop gitter channel |
01:15:28 | FromDiscord | <Yardanico> wdym? |
01:24:32 | * | apahl quit (Ping timeout: 260 seconds) |
01:25:14 | * | mbomba quit (Quit: WeeChat 2.9) |
01:26:27 | * | apahl joined #nim |
01:32:00 | * | krux02 quit (Remote host closed the connection) |
01:34:54 | Yardanico | nim devel docset https://i.imgur.com/2dQyACq.png (includes stdlib, compiler, fusion) |
01:34:59 | Yardanico | funny how there are only 6 public converters :) |
01:35:16 | Yardanico | only in httpcore and dom |
01:37:00 | * | theelous3 quit (Read error: Connection reset by peer) |
01:46:41 | * | ForumUpdaterBot quit (Remote host closed the connection) |
01:46:54 | * | ForumUpdaterBot joined #nim |
02:08:02 | FromDiscord | <ITR> Is there any way I can get better output than "execution of external program failed"? Like which line the program crashes on |
02:08:19 | disruptek | don't run your program inside another problem. |
02:08:22 | disruptek | er, program. |
02:08:34 | disruptek | compile your program with --stackTrace:on. |
02:10:23 | FromDiscord | <ITR> I tried `nim c --stackTrace:on -r ./test.nim` but I'm still only getting that error. Trying to run it with --debugger:on or --debugger:native gives the same result |
02:12:28 | FromDiscord | <Avatarfighter> ELLO everyone |
02:12:35 | FromDiscord | <Avatarfighter> how are you all doing |
02:12:52 | FromDiscord | <ElegantBeef> Fine, finding type bugs in the nim VM ๐ |
02:12:53 | disruptek | sup fighter. |
02:13:01 | FromDiscord | <Avatarfighter> what's good disruptek |
02:13:10 | FromDiscord | <Avatarfighter> @ElegantBeef what type of bugs ๐ |
02:13:31 | FromDiscord | <ElegantBeef> The nimVM cannot generate unnamed tuples in generics apparently |
02:13:36 | FromDiscord | <Avatarfighter> oh |
02:13:42 | FromDiscord | <Avatarfighter> you really want unnamed tuples lmao |
02:14:04 | FromDiscord | <ElegantBeef> I mean they're a datatype so i sorta have to support them |
02:14:10 | FromDiscord | <Avatarfighter> yeahhh |
02:14:27 | FromDiscord | <Avatarfighter> just segfault whenever someone tries to use them /s |
02:14:33 | FromDiscord | <ElegantBeef> The entire thing is to make it seemless, not sorta seemless |
02:18:45 | * | arecacea1 quit (Remote host closed the connection) |
02:19:38 | * | arecacea1 joined #nim |
02:20:49 | * | johnzorn joined #nim |
02:22:55 | * | apahl quit (Ping timeout: 272 seconds) |
02:23:08 | johnzorn | Would it be possible to compile a nim program so that the nim "vm" is somehow embedded that way the programs configuration could be written in nim and even reloaded? |
02:23:26 | disruptek | sure. |
02:24:40 | * | apahl joined #nim |
02:24:44 | johnzorn | Is that how nimble is able to use a nim subset for it's configuration? |
02:24:53 | disruptek | it is. |
02:26:54 | disruptek | "Efficient, expressive, elegant. Rediscover programming without compromise." |
02:27:26 | FromDiscord | <Avatarfighter> disruptek what is new |
02:27:47 | disruptek | working on new landing page copy. |
02:28:04 | disruptek | pushed some IC code you can look at. |
02:28:10 | FromDiscord | <Avatarfighter> yay |
02:28:11 | disruptek | tightened up mangling. |
02:28:33 | FromDiscord | <Avatarfighter> I've spent time just reading how the internals work so I should hopefully be able to edit it without breaking it all! |
02:28:43 | johnzorn | Cool, I do mostly DevOpsy stuff and nim seems like a much better alternative for many tasks that would be done in python, golang and even bash... |
02:29:53 | FromDiscord | <Avatarfighter> Devops sounds pretty exciting |
02:29:55 | disruptek | as an interpreted language, nimscript leaves something to be desigred. |
02:30:17 | disruptek | but, if you don't mind half a second to compile the code, i'd say it easily replaces those languages. |
02:30:30 | FromDiscord | <Avatarfighter> half a second is too long sMh |
02:32:00 | Yardanico | just used recursive imports in nimeventer and i feel good |
02:32:17 | * | muffindrake quit (Ping timeout: 246 seconds) |
02:34:33 | * | muffindrake joined #nim |
02:34:48 | Yardanico | when you change the project structure https://i.imgur.com/oBko6V3.png |
02:36:11 | Yardanico | lets hope my nimeventer doesn't go rogue and starts spamming 1000 times a second |
02:36:48 | * | ForumUpdaterBot quit (Remote host closed the connection) |
02:37:27 | * | ForumUpdaterBot joined #nim |
02:40:55 | FromDiscord | <ElegantBeef> Johnzorn that's what i'm currently doing |
02:41:42 | FromDiscord | <ElegantBeef> This video has been spammed a lot but it's an "in process" vidja https://streamable.com/90r58l |
02:41:49 | * | ForumUpdaterBot quit (Remote host closed the connection) |
02:41:57 | * | ForumUpdaterBot joined #nim |
02:43:11 | Yardanico | now time to wait for someone to post something on the forum/reddit/so |
02:46:04 | Yardanico | @ElegantBeef thanks it works |
02:46:21 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/769391299006300210/unknown.png |
02:46:27 | FromDiscord | <ElegantBeef> No problem always happy to be a visible fool |
02:49:28 | Yardanico | !status |
02:49:30 | FromDiscord | Uptime - 3 days, 7 hours, and 12 minutes |
02:50:08 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/769392253332357120/unknown.png |
02:50:15 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/769392280116265000/unknown.png |
02:50:36 | FromDiscord | <Avatarfighter> time to make a FAT circular import |
02:50:38 | FromDiscord | <Yardanico> the trick is to put import statements for the modules which use the current module after the symbols they need |
02:50:57 | FromDiscord | <Yardanico> https://github.com/Yardanico/nimeventer/blob/master/src/nimeventer.nim#L83 |
02:51:16 | FromDiscord | <Yardanico> my submodules only need post and catchErr (and two globals) from above |
02:51:22 | FromDiscord | <Yardanico> (edit) "my submodules only need post and catchErr (and two globals) from above ... " added "the import statement" |
02:51:48 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/769392670916345856/unknown.png |
02:52:13 | FromGitter | <gogolxdong> Is there a way to define object type with default value field? |
02:52:25 | disruptek | not yet. |
02:53:10 | FromDiscord | <ElegantBeef> My constructor macro can generate constructors and force default values ๐ |
02:53:26 | FromDiscord | <ElegantBeef> <https://github.com/beef331/constructor> To save you from manually making constructors if you want it |
02:54:40 | johnzorn | ElegantBeef, so that is nim or nimscript? |
02:54:46 | FromDiscord | <ElegantBeef> That's nimscript |
02:54:52 | FromDiscord | <ElegantBeef> Which is why it reruns no problem |
02:55:55 | FromDiscord | <ElegantBeef> All it takes is `{.exportToScript.}` and then hypothetically your proc is exposed to nimscript and can be invoked there, the hypothetically is there due to nim's VM having some bugs that cause issues atm |
02:56:17 | FromDiscord | <ElegantBeef> Unnamed tuples dont work for instance |
02:57:14 | johnzorn | So it would be possible to create a standalone binary that can be connected to after it starts running and code hotplugged (like common lisp)? |
02:57:32 | Yardanico | did you check out enu? |
02:57:36 | FromDiscord | <ElegantBeef> I mean that's what's done there, i build the nico program which has a simple main loop and invokes nimscript |
02:57:40 | Yardanico | https://www.youtube.com/watch?v=3l6tsKM1cY8 |
02:57:49 | FromDiscord | <ElegantBeef> https://github.com/beef331/nicoscript/blob/master/src/main.nim |
02:57:55 | FromDiscord | <ElegantBeef> The entirety of that program |
02:57:56 | Yardanico | and then https://www.youtube.com/watch?v=AW0PT9j976s |
02:58:01 | Yardanico | and beef's program too |
02:58:17 | FromDiscord | <ElegantBeef> Yea ENU does the same, but enu isnt attempting to abstract it away in a nice bundle afaik |
03:00:22 | FromGitter | <gogolxdong> A type section with all ref object hints me invalid indentation, it works when they are {.bycopy.} object |
03:01:05 | FromDiscord | <Yardanico> ? |
03:01:07 | FromDiscord | <Yardanico> can you show it? |
03:01:58 | FromGitter | <gogolxdong> https://play.nim-lang.org/#ix=2BNl |
03:02:21 | * | oculuxe joined #nim |
03:02:22 | * | oculux quit (Ping timeout: 256 seconds) |
03:02:26 | FromDiscord | <Yardanico> " AVOptionUnion {.bycopy.}= object {.union.}" |
03:02:27 | FromGitter | <gogolxdong> invalid indentation from where the first ref object begins |
03:02:31 | FromDiscord | <Yardanico> that's not how you do it |
03:02:48 | FromDiscord | <Yardanico> also "VOption= ref object" |
03:02:51 | FromDiscord | <Yardanico> wrong place for |
03:03:01 | FromDiscord | <Yardanico> ok lemme share the correct version |
03:03:18 | FromDiscord | <Yardanico> https://play.nim-lang.org/#ix=2BNm |
03:03:21 | FromDiscord | <Yardanico> spacing matters in some cases |
03:03:40 | Yardanico | *= is parsed as one token *= and not as two tokens * and = |
03:04:09 | Yardanico | and generally proper spacing will make your code look nicer :) |
03:05:10 | FromGitter | <gogolxdong> get it , thanks! |
03:11:37 | * | astronavt quit (Quit: Leaving) |
03:12:42 | * | mbomba joined #nim |
03:23:43 | * | muffindrake quit (Ping timeout: 272 seconds) |
03:25:47 | * | muffindrake joined #nim |
03:29:32 | * | TomDotTom quit (Ping timeout: 272 seconds) |
03:52:50 | * | shuji quit (Remote host closed the connection) |
04:03:07 | FromDiscord | <flywind> What's wrong with this? https://play.nim-lang.org/#ix=2BNz |
04:05:00 | leorize[m]1 | @flywind never directly modify the dom |
04:05:29 | leorize[m]1 | karax will bail the moment an undeclared foreign agent modify the dom |
04:05:52 | leorize[m]1 | with the vdom what you would want to do is to render a new node replacing the previous one |
04:05:58 | leorize[m]1 | a kind of functional programming i suppose |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:34 | * | supakeen joined #nim |
04:06:34 | FromDiscord | <flywind> https://svelte.dev/examples#7guis-counter |
04:06:44 | Yardanico | yes |
04:07:13 | FromDiscord | <flywind> I want to implement something similar like this, I don't how to achieve that with `karax`. |
04:07:44 | FromDiscord | <MiniApple> Hmm |
04:07:55 | leorize[m]1 | I can whip up one for you real quick, wait |
04:07:58 | FromDiscord | <MiniApple> Is there journey for nim |
04:08:07 | FromDiscord | <MiniApple> (edit) "journey" => "jquery" |
04:09:35 | Yardanico | wdym "journey"? |
04:09:48 | Yardanico | you can check difference resources on https://nim-lang.org/learn.html |
04:09:51 | Yardanico | for learning |
04:13:42 | Yardanico | ah jquery |
04:13:50 | Yardanico | well if you compile nim to js you can use jquery just fine |
04:13:55 | Yardanico | see e.g. https://nim-lang.org/docs/jsffi.html |
04:18:59 | * | leorize_ joined #nim |
04:19:12 | leorize_ | flywind: this is sorta how you do it: https://play.nim-lang.org/#ix=2BNB |
04:19:25 | FromDiscord | <flywind> Thanks! |
04:20:08 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2BNC |
04:20:11 | FromDiscord | <flywind> Is this right? |
04:22:57 | leorize_ | probably :P |
04:23:38 | leorize_ | the thing with karax is that it tries to be stateless |
04:23:41 | leorize_ | but the dom is stateful |
04:23:51 | leorize_ | so there might be some interaction bugs if you're not careful |
04:24:21 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2BND |
04:24:25 | FromDiscord | <flywind> What about this? |
04:24:46 | leorize_ | that would error out |
04:24:49 | leorize_ | never modify the dom |
04:25:14 | leorize_ | if you really want to then karax's native node can be used, but that one is undocumented |
04:25:45 | FromDiscord | <flywind> @flywind It works for me. ๐ฑ |
04:26:08 | leorize_ | let's just say that I don't recommend it |
04:27:29 | FromDiscord | <flywind> Compared to other popular frontend frameworks, Is karax flexible enough? |
04:28:08 | leorize_ | for this you'll have to consult @dom96 and @alehander42 |
04:28:21 | FromDiscord | <flywind> Yea, thanks |
04:28:25 | leorize_ | I don't do frontend a lot so I can't tell |
04:28:42 | leorize_ | so far it can do whatever I throw at it though, so I'm happy |
04:29:27 | FromDiscord | <flywind> I want do UI/admin libraries based on `karax`. But have no ideas. |
04:29:31 | FromDiscord | <flywind> (edit) "I want ... do" added "to" |
04:29:57 | leorize_ | what is ui/admin? |
04:30:04 | leorize_ | like a database controller? |
04:30:23 | FromDiscord | <flywind> Like this https://github.com/ant-design/ant-design |
04:30:47 | FromDiscord | <flywind> and https://github.com/PanJiaChen/vue-element-admin |
04:30:56 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:31:42 | leorize_ | definitely doable with karax, you will need to consult the people behind karax though :P |
04:31:44 | leorize_ | basically Araq |
04:32:14 | leorize_ | so karax got this VComponent system which is similar to React's components I believe? |
04:33:06 | FromDiscord | <flywind> Maybe, I'm still learning JS stuff. |
04:33:20 | leorize_ | but Araq said you should not use it and instead interact with the dom directly |
04:33:46 | leorize_ | also check out the forum, someone posted a svelte-inspired library a while ago |
04:35:13 | FromDiscord | <flywind> I will check it. |
04:39:03 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
04:39:10 | * | njoseph joined #nim |
04:51:16 | FromDiscord | <flywind> I find `getVNodeById` and will use it instead. |
04:51:20 | * | rockcavera joined #nim |
04:52:00 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2BNG |
04:52:10 | FromDiscord | <flywind> It doesn't cause problem in browser. |
04:54:55 | FromDiscord | <nikki> honestly, incremental-dom is pretty good |
04:55:04 | FromDiscord | <nikki> http://google.github.io/incremental-dom/ |
04:55:13 | leorize_ | !repos dom |
04:55:13 | FromDiscord | <nikki> afaict doesn't create much JS garbage |
04:55:14 | disbot | https://github.com/phildenhoff/domainator-nim -- 9domainator-nim: 11It's a domain hacking tool, but written in Nim. 15 0โญ 0๐ด |
04:55:14 | disbot | https://github.com/khooj/nim-simple-dom -- 9nim-simple-dom: 11simple module that allow to manipulate html with DOM 15 0โญ 0๐ด |
04:55:14 | disbot | https://github.com/treeform/taggy -- 9taggy: 11HTML DOM generator for Nim's JS mode. 15 1โญ 0๐ด 7& 1 more... |
04:55:31 | leorize_ | iirc someone did wrap that incremental dom thingy |
04:55:41 | FromDiscord | <nikki> and all you need is elemOpenStart('div'), attr('blah', val); ...; elemOpenEnd(); ... children ... elemClose(); |
04:55:41 | FromDiscord | <nikki> nice |
04:56:35 | FromDiscord | <nikki> i was messing around w/ wrapping it in a thin yet useful wrapper in zig: https://github.com/nikki93/zig-wasm-test/blob/6633810ea26b54ff1fb3733e6b29059c6c3dc22a/main.zig#L96-L114 |
04:56:49 | FromDiscord | <nikki> but actually mainly have used it from c++ |
04:57:30 | FromDiscord | <nikki> like this: https://gist.github.com/nikki93/003d19e263931edf28ff5d0ebb1ec585#file-main-cc-L491-L502 |
04:57:48 | FromDiscord | <nikki> but the main thing honestly is about app state mgmt for your domain logic itself |
04:58:02 | FromDiscord | <nikki> like in this case i was just kinda immediate-mode-ing it cuz it was for editors for video games |
04:58:56 | FromDiscord | <nikki> i just thought it was interesting that incremental-dom felt analogous to old school fixed-function opengl api; or maybe postscript drawing apis (thus canvas) etc. |
04:59:05 | FromDiscord | <nikki> (the push / pop paradigm) |
04:59:18 | leorize_ | https://mildred.github.io/nclearseam/ |
04:59:52 | FromDiscord | <nikki> v interestnig ๐ฎ |
04:59:55 | FromDiscord | <nikki> will have to dig |
05:00:08 | FromDiscord | <nikki> i was thinking to just try karax |
05:00:14 | FromDiscord | <ElegantBeef> Nah V isnt interesting ๐ |
05:00:21 | FromDiscord | <nikki> good one |
05:00:30 | FromDiscord | <ElegantBeef> It really wasnt |
05:00:51 | FromDiscord | <nikki> i'm really interested in trying a mix of nim -> C -> WASM + nim -> JS -> DOM in the browser |
05:01:10 | FromDiscord | <nikki> so it's kinda a ui thread and a simulation+graphics / other compute thread |
05:04:50 | * | vicfred quit (Quit: Leaving) |
05:07:57 | disruptek | that sounds... very painful. |
05:15:27 | FromDiscord | <nikki> is that a good thing |
05:16:15 | FromDiscord | <Avatarfighter> i wonder how calling methods from nim wasm via nim generated js would look like |
05:17:11 | FromDiscord | <nikki> basically the stuff you define as 'exported C symbols' are visible from the webassembly module you instantiate from js |
05:17:20 | FromDiscord | <Avatarfighter> oh thats nice |
05:17:25 | FromDiscord | <nikki> it's actually introspectible -- you can eg. iterate over the exports |
05:17:34 | FromDiscord | <Avatarfighter> super cool |
05:19:05 | FromDiscord | <nikki> but yeah those are available as js functions |
05:19:10 | FromDiscord | <nikki> the main thing is the boundary only understands integers |
05:19:20 | FromDiscord | <nikki> the way you eg. talk about "strings" is you have a shared memory, and it's pointers into that memory |
05:19:27 | disruptek | the web just makes me sleepy. it's just one shitty interface after another. |
05:19:39 | FromDiscord | <nikki> the shared memory looks like the C address space from something you compiled to wasm; the other side is in JS just functions you call |
05:19:42 | FromDiscord | <nikki> yeah i agree with that re: the web |
05:20:19 | FromDiscord | <nikki> the main thing IMO is; if you want to make some native media application, probably still helps to have a web player for it regardless |
05:27:02 | * | leorize_ is now known as leorize |
05:30:38 | disruptek | have you tried nlvm? |
05:34:35 | Yardanico | what for? you can use clang's wasm32 target even with the c backend |
05:34:56 | Prestige | Is there a way to write a proc that requires a particular object variant, at compile time? |
05:35:02 | Yardanico | no |
05:35:17 | * | mbomba quit (Quit: WeeChat 2.9) |
05:35:26 | Prestige | Dang, was hoping there was some weird black magic macro or something. |
05:35:30 | Prestige | oh well |
05:35:37 | FromDiscord | <ElegantBeef> you could make a template that does `if T.kind != x: return` |
05:36:08 | Yardanico | yes but that's not a compile-time check |
05:36:11 | Yardanico | it'll check at runtime |
05:36:29 | FromDiscord | <ElegantBeef> Yea i know, i was just saying |
05:36:37 | Prestige | All good |
05:37:05 | Prestige | I think I'm trying to do something with variants that would be better suited for inheritance |
06:05:50 | * | solitudesf joined #nim |
06:13:22 | * | mbomba joined #nim |
06:20:00 | * | mbomba quit (Quit: WeeChat 2.9) |
06:57:26 | Prestige | I didn't expect `using` to work with generics, interesting stuff |
07:01:22 | Prestige | Oh, it only sort of does. |
07:24:45 | FromDiscord | <nikki> dang, nim's sink inference is rly good |
07:25:06 | FromDiscord | <nikki> i was checking out the codegen for option's `some` constructor yday and it does a copy, and was thinking yeah the `val` param should be annotated with `sink` |
07:25:11 | Yardanico | it's disabled for your code by default |
07:25:16 | Yardanico | only enabled for the stdlib |
07:25:18 | FromDiscord | <nikki> but yeah the sink inference catches it, nice. guess it may count as a simple case but, yeah |
07:25:26 | Yardanico | that's not "sink inference" :) |
07:25:37 | Yardanico | sink inference is when the compiler automatically inserts sink annotations where possible |
07:25:52 | Yardanico | it infers that |
07:26:02 | FromDiscord | <nikki> yeah, like the `val: T` parameter in option's `some` constructor |
07:26:11 | FromDiscord | <nikki> `Option[T]`'s |
07:26:36 | FromDiscord | <nikki> tbf, i tried it on my own version of the option code; but will check that it does the same on the actual stdlib one now |
07:26:42 | Yardanico | it's enabled for stdlib but disabled for user code, you can enable it for your code as well with --sinkInference:on |
07:26:48 | Yardanico | but it might cause incompatible types for closure procedures |
07:27:06 | Yardanico | for that there's {.nosinks.} |
07:28:10 | FromDiscord | <nikki> so; all of this is cool |
07:28:17 | FromDiscord | <nikki> but the most interesting part to me isn't how it's enabled or disable |
07:28:18 | FromDiscord | <nikki> (edit) "disable" => "disabled" |
07:29:18 | * | gmaggior joined #nim |
07:30:04 | FromDiscord | <nikki> it was seeing it happen in the c output ๐
was just like "oh nice" |
07:30:32 | FromDiscord | <nikki> it seems like the `some` constructor does gen a copy tho |
07:30:36 | FromDiscord | <nikki> i'll check again |
07:30:39 | Yardanico | are you compiling with arc/orc? |
07:30:45 | FromDiscord | <nikki> yeah for sure |
07:31:05 | FromDiscord | <nikki> so |
07:31:07 | FromDiscord | <nikki> `nim c --panics:on --gc:arc -d:danger` |
07:31:08 | FromDiscord | <nikki> is what i have |
07:31:34 | FromDiscord | <nikki> i thought you were saying sink inference is on in stdlib; which would mean that the `val: T` param would be inferred to sink |
07:32:00 | Yardanico | " i thought you were saying sink inference is on in stdlib" yes it is |
07:32:00 | FromDiscord | <nikki> https://media.discordapp.net/attachments/371759389889003532/769463187204472853/unknown.png |
07:32:08 | FromDiscord | <nikki> so this is, in my own code |
07:32:09 | FromDiscord | <nikki> not stdlib |
07:32:30 | FromDiscord | <nikki> but, yeah sink inference catches that -- if i turn on inference, yup, that becomes an eqsink |
07:32:51 | FromDiscord | <nikki> i remember the equivalent in stdlib not having an eqsink by default but i'll check |
07:33:46 | FromDiscord | <nikki> yeah some does eqcopy |
07:34:09 | FromDiscord | <nikki> oh and, if i add --sinkInference:on, it does eqsink |
07:34:20 | FromDiscord | <nikki> maybe it's because it's inlined? not sure |
07:34:54 | FromDiscord | <nikki> (proc in stdlib is marked `{.inline.}`, the defn appears in the .c for my module, not for an stdlib one) |
07:46:53 | FromDiscord | <ElegantBeef> Hmm should i make a forum post to suggest that "This (Determined amount of time) with Nim", where community members submit small like 1 paragraph of what they're doing with links or images if they want to share, that then gets published to the website every X amount of time? |
07:50:43 | FromDiscord | <Vindaar> If that would result in an automated stream of people sharing what they do, seems like a fun idea. Especially if it's ok to share random fun things (and doesn't force you to write up something cohesive etc) |
07:50:50 | * | tefter joined #nim |
07:51:16 | FromDiscord | <Vindaar> like "look I wrote this fun macro, which does x. Super neat, see:". I would participate ๐
|
07:51:33 | FromDiscord | <ElegantBeef> Yea i mean a sentence or two is fine imo |
07:51:41 | FromDiscord | <ElegantBeef> Nothing more than a paragraph though |
07:51:53 | FromDiscord | <Vindaar> I like it |
07:52:01 | FromDiscord | <ElegantBeef> Mostly inspired by this forum post https://forum.nim-lang.org/t/6971 |
07:52:19 | FromDiscord | <ElegantBeef> It seems rather popular with a many people so seems it's a good idea |
07:52:36 | FromDiscord | <Vindaar> yep, I figured |
07:54:42 | FromDiscord | <Vindaar> In that thread I personally didn't feel like posting so far, cause... I don't know. Felt like plugging my own work, when I feel like the people who care about what I do probably know anyway? I don't know, I guess I'm just not someone who wants to look like I'm advertising my work more than it's worth |
07:55:27 | FromDiscord | <ElegantBeef> Could probably make a `nim-lang/tmwn` repo so people can just add their work, then when it's supposed to be posted someone can post it |
07:55:52 | FromDiscord | <ElegantBeef> Or automate the posting since someone has to merge PRs |
07:56:25 | FromDiscord | <Vindaar> Best would be to have it automated I'd say. Although I see how that would complicate things in the beginning. Main thing I wonder about is where it should be shared? |
07:56:41 | FromDiscord | <Vindaar> A special page on the website + twitter or something? |
07:56:59 | * | Vladar joined #nim |
07:57:31 | FromDiscord | <ElegantBeef> It could just be a blog post on nim-lang website if that's what you're asking |
07:57:37 | * | superbia joined #nim |
07:59:07 | FromDiscord | <Vindaar> Well, I suppose. But I think if such a thing were to be used actively than either the posts about it would get so long that people don't read it or if they are posted often they drown out normal posts |
07:59:22 | FromDiscord | <ElegantBeef> I mean it'd post only every month |
07:59:29 | FromDiscord | <ElegantBeef> Or whatever the determined time was |
08:00:00 | FromDiscord | <impbox> just came across `out T` in the manual, but I can't find where it explains what `out T` means |
08:00:09 | FromDiscord | <ElegantBeef> The repo would be used like a queue, submit what you're working on then in X amount of time it's posted in on a blog post |
08:00:29 | FromDiscord | <ElegantBeef> That way it's not spammy but also allows people to see what others are doing |
08:01:01 | FromDiscord | <ElegantBeef> I didnt even know out was a keyword in nim ๐ |
08:01:05 | FromDiscord | <impbox> same |
08:01:10 | FromDiscord | <impbox> i'm guessing it's new |
08:01:18 | FromDiscord | <ElegantBeef> You sure you werent looking at the C# docs ๐ |
08:01:28 | FromDiscord | <Vindaar> Guess that might work, yeah. One could think about tweeting out each added submission when it's done in addition maybe?โตWould be important to have it as easy to submit as possible though. Because otherwise one enters the territory of not bothering to post |
08:01:41 | FromDiscord | <impbox> related to https://github.com/nim-lang/RFCs/issues/62 i'm guessing |
08:01:43 | disbot | โฅ [RFC] `out` params: allows to call in-place `proc` with rvalues ; snippet at 12https://play.nim-lang.org/#ix=2BOa |
08:02:58 | FromDiscord | <ElegantBeef> Interesting |
08:03:09 | FromDiscord | <impbox> though it seems like that didn't go through |
08:03:12 | FromDiscord | <impbox> so i'm confused |
08:04:52 | FromDiscord | <impbox> sent a code paste, see https://play.nim-lang.org/#ix=2BOb |
08:05:01 | FromDiscord | <ElegantBeef> interesting |
08:06:21 | FromDiscord | <ElegantBeef> Seems the all out does is cause a error ๐ |
08:06:40 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2BOc |
08:06:52 | FromDiscord | <ElegantBeef> Or is it only with generics? :d |
08:07:16 | FromDiscord | <impbox> nfi |
08:09:37 | FromDiscord | <impbox> mysterious feature is mysterious |
08:10:04 | FromDiscord | <ElegantBeef> Wonder if it was an accidental PR, that got through, considering the fact it's very weird |
08:10:12 | FromDiscord | <ElegantBeef> I also tried `out a = 100` and same error |
08:12:03 | FromDiscord | <impbox> ahh well, i probably don't need to use it, was just curious since i spotted it in the manual |
08:16:04 | FromDiscord | <impbox> whoa, i totally never knew nim had named arguments o_O |
08:16:22 | FromDiscord | <ElegantBeef> Really? |
08:16:34 | FromDiscord | <impbox> yeah, wow, wonder how i missed that |
08:16:36 | FromDiscord | <ElegantBeef> You have all those optional arguements and never knew, feels bad |
08:16:42 | FromDiscord | <impbox> yeah |
08:17:10 | FromDiscord | <impbox> i was just thinking "i wish nim had named arguments..." |
08:17:15 | FromDiscord | <ElegantBeef> I've reread the manual like 3-5 times |
08:17:47 | FromDiscord | <ElegantBeef> I dont remember it all 100% but some things get recalled on the fuzzy edges |
08:18:05 | FromDiscord | <ElegantBeef> Which i then scramble to find and then wakeup in my bed with a cold sweat ๐ |
08:18:41 | FromDiscord | <Vindaar> you didn't know Nim had named arguments? wow, that's crazy indeed. I had the opposite realization a few weeks ago. Had to help a colleague with some C++ and got majorly confused when I couldn't resolve an overload ambiguity by passing an argument with its name... |
08:19:09 | FromDiscord | <ElegantBeef> I rarely use named arguments, but they have their usage |
08:19:30 | FromDiscord | <Vindaar> it really depends on the kind of code one writes / uses imo |
08:19:48 | FromDiscord | <ElegantBeef> I know swift programmers use them everywhere and it makes their code, very ehhh to me |
08:19:50 | FromDiscord | <Vindaar> provide an API with many options for the user? named arguments are a godsend |
08:19:51 | FromDiscord | <impbox> it's not something i've often wanted to use, but there's a few times it would have been great |
08:20:24 | FromDiscord | <ElegantBeef> looks at your spr procs ๐ |
08:20:33 | FromDiscord | <impbox> haha exactly what i'm looking at |
08:21:41 | FromDiscord | <ElegantBeef> We need some proc call introspection from the compiler "Hey hackerman, you know you can just do `procName(a,b,namedArg = val)`" |
08:23:08 | FromDiscord | <impbox> time for nico 2.0 API =) |
08:23:42 | FromDiscord | <Vindaar> the C++ case I had to deal with: the `Fill` here taking `const char, Double_t` and the one two down taking `Double_t, Double_t`: https://root.cern.ch/doc/master/classTH1.html#a894833e678f283b6849e777c635c059dโตstupid g++ wasn't able to figure out that my colleague obv. wanted the latter proc, cause he was _literally_ handing two floats. That's a broken type system + calling conventions right there if you ask me |
08:24:04 | FromDiscord | <ElegantBeef> Is nico 2.0 opengl based? |
08:24:44 | FromDiscord | <impbox> hmm probably no nico 2.0, but the opengl based one i need a different name |
08:25:41 | FromDiscord | <ElegantBeef> Nove2D ๐ |
08:26:48 | FromDiscord | <ElegantBeef> Yes i just took your Pico -> Nim(ico) and applied it to Love2D |
08:28:00 | FromDiscord | <impbox> before I did nico i made picolove which made pico8 games run in love2d |
08:28:06 | FromDiscord | <impbox> then i realised lua was horrible |
08:28:12 | FromDiscord | <impbox> and moved to nim <3 |
08:28:17 | FromDiscord | <ElegantBeef> It's dynamically typed what do you expect ๐ |
08:28:51 | * | opal quit (Remote host closed the connection) |
08:28:51 | * | leorize quit (Remote host closed the connection) |
08:29:06 | FromDiscord | <ElegantBeef> Also between you showing off your rotating sprites and my nimscript stuff i now want to make a game like screeps, so need to figure out something for it |
08:29:14 | * | leorize joined #nim |
08:29:33 | FromDiscord | <impbox> yeah, next on my list of stuff to do is to play with your nimscript stuff |
08:29:52 | FromDiscord | <impbox> haven't seen screeps before, sounds interesting |
08:30:03 | * | opal joined #nim |
08:30:31 | FromDiscord | <impbox> i'm keen to try livecoding units in a game |
08:30:55 | FromDiscord | <ElegantBeef> Yea it seems like a fun idea |
08:31:09 | FromDiscord | <ElegantBeef> I really like games that have scripting in game, space engineers for instance |
08:31:32 | FromDiscord | <impbox> but you can only script units that you are close to, so once you're away from them they need to fend for themselves via the code you wrote |
08:31:57 | FromDiscord | <ElegantBeef> Well the way i'd do it is have RTS like units, where you code behaviour of each type |
08:32:12 | FromDiscord | <ElegantBeef> So miner, harvester, intercepter, bomber etc |
08:32:25 | FromDiscord | <impbox> mmm i started working on a little RTS/TD project recently |
08:32:30 | FromDiscord | <ElegantBeef> And then also the construction building |
08:33:00 | FromDiscord | <ElegantBeef> The block in my way right now is trying to figureout what to even start making it |
08:33:31 | FromDiscord | <ElegantBeef> Cant exactly use nico since i want a code editor and the limitations dont really enable a split view code editor |
08:33:42 | FromDiscord | <impbox> well you could, but it would suck |
08:34:02 | FromDiscord | <ElegantBeef> I think fidget could work |
08:34:12 | FromDiscord | <impbox> though it could open the code in your fav editor in a separate process |
08:34:22 | FromDiscord | <impbox> in a tmp file and update when it's written to |
08:34:39 | FromDiscord | <ElegantBeef> That works for like an itch.io game, but for a proper game that's not that nice |
08:34:54 | FromDiscord | <ElegantBeef> ~~Although let's be honest i'm never getting to a proper game~~ |
08:35:19 | * | nikita` quit (Ping timeout: 272 seconds) |
08:36:19 | * | nikita` joined #nim |
08:36:35 | * | notchris quit (Ping timeout: 272 seconds) |
08:38:56 | * | notchris joined #nim |
08:39:45 | * | zielmicha__ quit (Ping timeout: 272 seconds) |
08:41:01 | * | nikita` quit (Ping timeout: 272 seconds) |
08:41:39 | * | matlock quit (Ping timeout: 272 seconds) |
08:42:43 | * | nikita` joined #nim |
08:42:43 | * | nikita` quit (Excess Flood) |
08:42:47 | * | zielmicha__ joined #nim |
08:43:05 | * | nikita` joined #nim |
08:43:06 | * | nikita` quit (Excess Flood) |
08:43:36 | * | nikita` joined #nim |
08:43:40 | * | vqrs quit (Ping timeout: 272 seconds) |
08:44:32 | * | matlock joined #nim |
08:45:24 | * | vqrs joined #nim |
08:50:20 | * | natrys joined #nim |
09:02:19 | FromDiscord | <impbox> hmm is there a nimidiomatic way of doing nim version specific code? |
09:02:43 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/system.html#NimMinor |
09:02:54 | FromDiscord | <ElegantBeef> Use `when` with it i believe |
09:03:09 | FromDiscord | <impbox> ahh cool, thanks, i figured it'd be `when ` something |
09:03:11 | FromDiscord | <ElegantBeef> Guess https://nim-lang.org/docs/system.html#NimMajorโตshows it exactly |
09:03:23 | FromDiscord | <impbox> nice |
09:04:09 | FromDiscord | <impbox> I wonder if it's better to use that or use `when compiles...` |
09:04:37 | FromDiscord | <ElegantBeef> That's above my paygrade ๐ |
09:06:33 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:16:54 | FromDiscord | <Rika> depends, when compiles is to check if a feature exists |
09:17:04 | FromDiscord | <Rika> at least thats what i hear people use it for |
09:19:05 | FromDiscord | <ElegantBeef> Can also use it for optional features |
09:19:16 | * | Q-Master quit (Quit: ะฃัะตะป) |
09:19:30 | FromDiscord | <impbox> the situation is a module's type that overrides on in the system library was defining a member that is now included in the base type |
09:19:54 | FromDiscord | <impbox> so I can easily fix it in 1.4 by removing that definition in the module, but it'll break pre 1.4 |
09:20:56 | FromDiscord | <lqdev> `when declared(x)` or `when NimVersion >= (1, 0, 0)` |
09:32:14 | FromDiscord | <impbox> https://play.nim-lang.org/#ix=2BOu |
09:32:29 | FromDiscord | <impbox> I'm not sure how to use when declared in this context or if it's possible |
09:34:16 | * | Q-Master joined #nim |
09:34:26 | * | Q-Master quit (Client Quit) |
09:35:17 | * | Q-Master joined #nim |
09:38:04 | FromDiscord | <lqdev> i think there was a declaredField or fieldDeclared |
09:38:18 | FromDiscord | <lqdev> but i don't remember because i never use it. |
09:38:33 | FromDiscord | <lqdev> whatever you're doing, feels like quite a hack. |
09:39:04 | FromDiscord | <impbox> mmm just aiming for backwards compatibility, but maybe i shouldn't bother |
09:39:47 | * | Q-Master quit (Client Quit) |
09:40:30 | FromDiscord | <haxscramper> If I use `{.experimental: "caseStmtMacros".}` and have `case` statement inside generic function I need to use `mixin` for all symbols in the dsl, like `mixin _, all, JString` etc. Example: https://play.nim-lang.org/#ix=2BOz |
09:40:49 | FromDiscord | <haxscramper> Or force expansion with something like `expandMacros` |
09:41:05 | FromDiscord | <haxscramper> Is it a bug or I'm just doing something wrong with `match`? |
09:56:55 | * | Q-Master joined #nim |
10:19:01 | * | lritter joined #nim |
10:26:42 | supakeen | Zevv: Getting close to GNU now: https://bpa.st/raw/XKKQ :) |
10:29:50 | * | krux02 joined #nim |
10:43:00 | * | waleee-cl joined #nim |
11:33:55 | * | Vladar quit (Quit: Leaving) |
11:52:23 | * | superbia quit (Quit: WeeChat 2.9) |
12:02:00 | * | tane joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:34 | * | supakeen joined #nim |
12:07:19 | * | lum quit (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net) |
12:08:20 | * | gmaggior quit (Quit: Leaving) |
12:08:44 | * | lum joined #nim |
12:09:16 | * | lum quit (Client Quit) |
12:10:43 | * | lum joined #nim |
12:12:31 | * | lum quit (Client Quit) |
12:12:55 | * | lum joined #nim |
12:14:52 | * | lum quit (Client Quit) |
12:16:03 | * | lum joined #nim |
12:19:21 | * | lum quit (Client Quit) |
12:20:22 | * | lum joined #nim |
12:48:13 | Zevv | can you disambiguate between grouped shortopts and shortopts with option? like "-a -b -c -dfoo" is the same as "-abc -dfoo" |
12:48:19 | Zevv | because you can't, with a generic grammar |
12:49:09 | Zevv | PMunch recently came with some language that formally describes command lines; the description is suitable for human consumption as --help, but you can also parse it and generate a parser for it |
12:49:25 | supakeen | Zevv: I've listed that as something that won't be supported. |
12:49:47 | supakeen | As in -afoo and -abc where one is option+value and the other is 3 short opts. |
12:50:06 | supakeen | I'd have to generate grammars, which is the future. |
12:50:33 | supakeen | And likely the way it's supposed to work :) |
12:52:35 | supakeen | I also have to see what happens in getopt if you have both -a and -f and -b which takes an argument and you give it -bfoo |
12:53:03 | supakeen | But first I need to solve more quoting woes :) |
12:53:55 | Zevv | NPeg allows for dynamic generating of grammars |
12:54:00 | Zevv | although that part is not documented |
12:54:06 | supakeen | Ah that's nice though. |
12:54:23 | Zevv | the "peg" macro is built on top of other primitives which you can compose |
12:54:38 | supakeen | I was going to determine an API to define a command line and then letting it be parsed by various parsers which determine how options/etc look. If I have the first bit I could look at generating the grammar based on that API instead of the reverse. |
12:54:50 | Zevv | my plan was to parse the pmunch thing with npeg into an AST, and then transform this AST into an npeg grammar which makes a parser |
12:54:57 | Zevv | all the parts are there, it's just work |
12:55:32 | supakeen | Yea, PMunch and I talked a bit that we had the same ideas though I think mine is mostly for 'parse any style you want into an abstraction and define your requirements on that abstraction'. |
12:56:00 | Zevv | ah, docopt |
12:56:08 | Zevv | that would make a nice week end project |
12:56:27 | Zevv | I had something else in mind, but that's so much work it makes me tired to think of it |
12:56:57 | FromDiscord | <haxscramper> > PMunch recently came with some language that formally describes command lines; the description is suitable for human consumption as --help, but you can also parse it and generate a parser for itโตZevv: do you have a link for discussion/project? |
12:57:05 | Zevv | http://docopt.org/ |
12:57:30 | Zevv | there's parser generaters for other languages, but nim could do thich way cooler. No separate generate step |
12:57:51 | FromDiscord | <haxscramper> Oh, I expected something in reverse - generate everything from machine-readable specification |
12:57:58 | Zevv | it's machine readable |
12:58:00 | Zevv | and human readable |
12:58:04 | FromDiscord | <haxscramper> Like yaml/json/xml/dsl etc. |
12:58:18 | Zevv | so you give your help text, and it generates a parser that can generate the optiosn as described in your help text |
12:58:24 | supakeen | I've been all over the place today though; I also added some extra LFSRs to my PRNG library and then started exploring making Python bindings for that. |
12:58:29 | supakeen | Probably return to parsing in the evening! |
12:58:41 | Zevv | haxscramper: nope, this is way cooler and better |
12:59:08 | FromDiscord | <haxscramper> Well, IMO it is just approach from wrong end. If you generated it from YAML you can shovel so much validation hooks, documentation additional notes etc. |
12:59:34 | Zevv | it's perfectly legal for you to have that opinion |
12:59:55 | FromDiscord | <haxscramper> Although it is really nice for small CLI tools |
13:00:10 | Zevv | let me see if the spec is tight enough to peg it |
13:00:20 | Zevv | hmm good thing disruptek is not here |
13:00:31 | FromDiscord | <haxscramper> And since not everyone writes CLI frontends for ffmpeg that requires whole bookshelf to document |
13:01:18 | supakeen | https://github.com/docopt/docopt.nim how about this one? |
13:02:13 | Zevv | I don't care |
13:02:37 | Zevv | I remember now, I saw that and decided to skip it |
13:02:44 | Zevv | but now I already got started. too bad. |
13:02:48 | supakeen | rip |
13:08:58 | FromDiscord | <haxscramper> How does vscode/other text editors provide highlighting for nim compilation errors? I know compiler outputs file/line/column - this is just being parsed to show errors? |
13:09:16 | FromDiscord | <haxscramper> Or there is something smarter than this |
13:09:24 | Zevv | basically that. nimsuggest does the work |
13:12:19 | FromDiscord | <haxscramper> nimsuggest outputs errors too, not only suggestions at particular point in code? |
13:12:27 | Zevv | right. |
13:12:32 | FromDiscord | <haxscramper> awesome |
13:12:50 | Zevv | it's not perfect, but it does pretty well |
13:13:29 | FromDiscord | <haxscramper> Well, any machine-readable format is certainly better than pretty-printed compiler 120+ line dumps |
13:18:29 | FromDiscord | <ITR> How do I get a better error message than `Error: execution of an external program failed: '[path/to/exe.exe] '` |
13:19:23 | FromGitter | <jrfondren> try --verbosity:1 |
13:22:31 | FromDiscord | <ITR> I tried `nim c -r --verbosity:1 test.nim` and it didn't work. I've also tried --debugger:on, and --stackTrace:on, and --debugger:native |
13:23:47 | FromDiscord | <Rika> is that the ONLY line you're getting? |
13:23:52 | FromGitter | <jrfondren> I wouldn't expect stacktrace or debugger options or help; it's an external program that's failing |
13:23:58 | FromGitter | <jrfondren> yeah I've gotten that as the only error before as well. |
13:24:53 | FromGitter | <jrfondren> in a pinch you can strace nim to get the full execve that's failing |
13:25:14 | FromDiscord | <Yardanico> @ITR please show full output from the Nim compiler command to the last one |
13:31:04 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=2BPZ |
13:31:57 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=2BQ0 |
13:31:58 | FromGitter | <jrfondren> ah ok, I was thinking it was gcc or something that was failing |
13:32:11 | FromGitter | <jrfondren> in this case it's actually good. you can just run test.exe yourself |
13:32:22 | FromGitter | <jrfondren> it doesn't matter that nim can't provide a good error message; nim successfully built the exe |
13:33:08 | FromDiscord | <Rika> its probably an issue with the logi |
13:33:09 | FromDiscord | <Rika> c |
13:34:05 | FromDiscord | <ITR> Ah, so the error just means the return code of the program was not 0? |
13:34:51 | FromGitter | <jrfondren> you will get that error from a non-zero return yes |
13:35:05 | FromGitter | <jrfondren> `quit "hi"` is enough of a program for that |
13:35:18 | FromDiscord | <ITR> That's a very non-descript error message :/ |
13:35:39 | FromDiscord | <ITR> I guess I'll manually add logging then |
13:35:56 | * | haxscramper joined #nim |
13:35:57 | FromDiscord | <Rika> well no its pretty concise |
13:35:57 | FromDiscord | <enthus1ast> is there a way to get the current nim file name on compilation, (i'm playing with --import / --include and with term rewriteing macros, but some modules dont like it eg. system.nim) |
13:38:01 | FromDiscord | <haxscramper> `currentSourcePath()` gives abosolute path |
13:38:47 | FromDiscord | <enthus1ast> yeah this unfortunately gives the name of the file the call is in |
13:39:10 | FromDiscord | <enthus1ast> but --import includes a module into every other module compiled, i want to get the file name of THIS module |
13:39:24 | FromDiscord | <enthus1ast> to basically do not term rewrite on some modules |
13:39:37 | FromDiscord | <ITR> @Rika I'd argue it should at least log which return code the program has. |
13:40:06 | FromDiscord | <haxscramper> You can also try `instantiationInfo()`, not sure if it works differently though |
13:40:25 | FromDiscord | <enthus1ast> tried this as well, this seems not to be propagated |
13:40:48 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=2BQ5 |
13:42:55 | FromDiscord | <haxscramper> So you want to (1) import module using `--import` flag, and (2) do term rewriting macros only in certain ones, but not others, right? And AFAIK `system.nim` is automatically included in each compilation, so it might be some magic interference from compiler |
13:43:09 | FromDiscord | <haxscramper> I.e. this module might behave differently just becase |
13:44:25 | FromDiscord | <enthus1ast> yes |
13:44:44 | FromDiscord | <haxscramper> Can you show the code? |
13:45:23 | FromDiscord | <enthus1ast> ist a customized version of this: https://github.com/Yardanico/nim-strenc/blob/master/src/strenc.nim |
13:45:27 | FromDiscord | <enthus1ast> its |
13:52:28 | FromDiscord | <enthus1ast> i could fork everything that i use and import this obfuscation module into every module, but this is not so h4xor ๐ |
13:52:54 | FromDiscord | <Yardanico> sadly that module fails for some stdlib modules |
13:53:49 | FromDiscord | <enthus1ast> yes, so i thought, this could be disabled for some, but i do not find a way to get the current nim filename on compilation |
13:55:08 | FromDiscord | <ITR> How do I excempt logging from counting as a side-effect? |
13:56:35 | FromDiscord | <haxscramper> Use `{.cast(noSideEffect).}`, but I would advise against it, since logging is side-effect, so you are effectively tricking compiler |
13:57:13 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2BQd |
13:57:49 | FromDiscord | <ITR> what effects can tricking it have though? |
13:59:14 | FromDiscord | <haxscramper> Well, logging accesses global state/prints messages/writes to file, therefore it has side effects. So with `cast` here you are just losing compiler-enforced checks and hiding side effects. |
13:59:26 | FromDiscord | <enthus1ast> there is also `debugEcho` |
14:00:17 | FromDiscord | <ITR> Like, the whole point of no side effects (for me at least) is to prevent bugs that come from stuff being touched without you realizing it, touching logging should never cause a bug to begin with |
14:00:17 | FromDiscord | <haxscramper> IMO - Either logging of noSideEffects, pick one. `debugecho` is just quick-n-dirty for variable printing, but full-blown logging is quite a differetn story |
14:01:58 | FromDiscord | <haxscramper> @ITR Are you sude about this? Logging can write to file or stdout. What if your program is piped somewhere? What if pipe suddenly closes? Writing to file? You can use all space on disk and god-only-knows what can happen |
14:03:14 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2BQg |
14:03:26 | FromDiscord | <ITR> yeah, I'll probably do that. |
14:03:30 | FromDiscord | <ITR> (edit) "yeah, I'll probably do that. ... " added "thanks ^^" |
14:03:45 | FromDiscord | <ITR> but basically, if logging is that unstable then it's a problem |
14:03:50 | FromDiscord | <haxscramper> no |
14:03:56 | FromDiscord | <haxscramper> That's not the point |
14:04:13 | FromDiscord | <haxscramper> The point is - you either access global state or you have no side effects |
14:04:39 | FromDiscord | <haxscramper> This is not a problem of `std/logging` or whatecher you are using. |
14:04:54 | FromDiscord | <ITR> that's the equivalent of either running a program with sudo or running it with no permissions at all |
14:05:41 | FromDiscord | <haxscramper> And since logging does access global state, you have mutually exclusive requirements. You can lie about side effects using `cast` |
14:06:24 | FromDiscord | <haxscramper> E.g do you really need noSideEffects that much? Maybe push logging upwards in logic - I usually do this |
14:11:16 | disruptek | wait you guys talked about pegging without me? |
14:15:01 | Zevv | yeah but only if the spec is tight enough |
14:15:04 | Zevv | which it isn't |
14:15:11 | Zevv | unpeggable |
14:15:16 | disruptek | fair enough. |
14:15:30 | disruptek | you wouldn't want to force it. |
14:15:35 | Zevv | true, true |
14:15:41 | disruptek | bad things could happen. |
14:16:07 | disruptek | shit could get messy, is what i'm saying. |
14:16:16 | Zevv | yeah, we get you right :) |
14:16:22 | disruptek | where are we on cps, zevv? |
14:16:31 | disruptek | do you need to kick the clyybber again? |
14:17:01 | Zevv | I don't know. I'm not supposed to leave the country, otherwise I would long have waited for him in a dark alley to tell him the truth |
14:17:27 | Zevv | but maybe timothee can do all of this for us |
14:17:37 | disruptek | because last night i was working on the landing page and i noticed that the section on concurrency, currently entitled "Crappy Concurrency", is a little thin. |
14:17:39 | Zevv | i seems to get the point |
14:18:58 | Zevv | s/i/he/ |
14:20:54 | * | arecacea1 quit (Remote host closed the connection) |
14:21:34 | disruptek | oh, we're back to pegging, huh. |
14:23:08 | * | arecacea1 joined #nim |
14:32:01 | FromDiscord | <lqdev> Hint: 105222 lines; 6.138s |
14:32:08 | FromDiscord | <lqdev> this is taking sooooooo loooooooong |
14:32:42 | haxscramper | On nimsuggest: I have file that has `echo 1 * '1'` and I want to get compilation errors for it. So I should do `echo -e "chk\nquit" | nimsuggest --stdout --debug file_with_errors.nim` or something like that? |
14:32:43 | FromDiscord | <lqdev> disruptek: approximate just how many weeks i'll have to wait for IC |
14:33:05 | disruptek | dude. that's not long. |
14:33:20 | haxscramper | I assumed `chk` is for check, but there is no documentation for all commands (or I missed something) |
14:33:28 | leorize | haxscramper: you can also just run nim check... |
14:33:30 | FromDiscord | <lqdev> it wouldn't have been so horrible if nimsuggest wasn't so fucking slow |
14:34:08 | disruptek | also, you are more than talented enough to do the job. don't make the morons write your code and then demand they cut corners. ๐ |
14:34:11 | FromDiscord | <lqdev> and nim check, too. |
14:34:18 | haxscramper | leorize: I was told nimsuggest can output more machine-readable error messages. `nim check` has to be parsed |
14:34:54 | haxscramper | And I would prefer to avoid this if I can get something more defined |
14:35:01 | leorize | assuming you read vim regex, this is all you'll ever need: https://github.com/alaviss/nim.nvim/blob/master/compiler/nim.vim#L11-L17 |
14:35:16 | leorize | the format of the compiler messages are designed to be easily parsed |
14:35:39 | disruptek | i can confirm they are utf-8. |
14:35:54 | leorize | it's always `filename(line, col): Error/Warning/Hint: message` |
14:36:15 | leorize | nimsuggest give you the same list, just in a tab-separated format |
14:36:16 | haxscramper | I want to deal with `Error: type mismatch` and highlight all alternatives & first error position for wrong argument |
14:36:34 | haxscramper | And things like that |
14:36:36 | leorize | nimsuggest won't give you the alternatives either |
14:36:50 | leorize | because those stuff doesn't have concrete formatting |
14:36:58 | haxscramper | Well, looks like `npeg` gets another user for parsing compiler output |
14:37:06 | haxscramper | Or something like that |
14:37:29 | disruptek | the pegging is fast and furious today. |
14:37:41 | leorize | good luck, the compiler gained a new switch to make parsing that output slightly worse :P |
14:38:03 | leorize | personally I'd like something structured like gcc/clang overloading hints |
14:38:14 | * | sealmove joined #nim |
14:38:24 | leorize | (people says rust compile errors are nice but I've never looked into them) |
14:38:25 | haxscramper | I'm thinking about implementing json-based compiler output, but I just don't have any concrete ideas for it |
14:38:37 | leorize | don't spam json tbh :P |
14:38:47 | sealmove | @Zevv do you have any examples of how to incorporate ternary operator to a peg grammar similar to the one in the rod example? |
14:38:49 | * | lritter quit (Quit: Leaving) |
14:39:08 | haxscramper | So I will try to just parse whatewher we have right now into json, see how bad things are and then start from that. |
14:39:25 | leorize | if you want json then just use nimlsp |
14:39:32 | leorize | that protocol is built on json |
14:41:26 | haxscramper | I just watched https://www.destroyallsoftware.com/talks/a-whole-new-world and now I need to have this (stacktrace part from the talk) for nim, but also with logging output, compiler error messages (exceptions in macros included) and other things like that |
14:41:42 | leorize | the problem with json-based compiler output is that it doesn't stream |
14:41:50 | disruptek | rude. |
14:42:55 | Oddmonger | i'm trying to try (yes) godot-nim. With nim 1.2.6, i have this error: ยซ .nimble/pkgs/compiler-#head/compiler/msgs.nim(13, 19) Error: cannot open file: std/private/miscdollars ยป, and with nim 1.4.0rc (from gitnim) i get this one: ยซ.nimble/pkgs/nake-1.9.3/nakelib.nim(219, 18) Error: undeclared identifier: 'toSeconds' ยป |
14:43:12 | leorize | and while you can use json lines, Nim's own json module won't allow that :p |
14:43:31 | Oddmonger | it's when i ยซ nake build ยป the default sample, btw |
14:43:35 | disruptek | eh you should be able to use the parseFragment stuff for json lines. |
14:44:44 | Oddmonger | nim -v from 1.4rc returns me 1.3.7, so maybe i can test with even fresher nim. But hey. Another error maybe ? |
14:44:56 | leorize | disruptek: is it some devel-only thing? |
14:45:01 | disruptek | no, toSeconds is likely gone due to deprecation. |
14:45:11 | disruptek | leorize: no, it was added to address a performance bottleneck. |
14:45:29 | Oddmonger | ahhh oh |
14:45:34 | disruptek | pre-1.0 iirc. |
14:45:50 | haxscramper | leorize: right now error is just genenerated from string concatenation, I think doing generating json and converting it into pretty-printed form only on output is better than https://github.com/nim-lang/Nim/blob/devel/compiler/semcall.nim#L289 |
14:45:58 | leorize | disruptek: found it, yea this looks like it'd work |
14:46:07 | Zevv | sealmove: euh elaborate? |
14:46:09 | Oddmonger | maybe upgrade nake then |
14:46:47 | sealmove | I have a peg very similar to rod's and want to add `a ? b : c` operator |
14:46:56 | disruptek | it's an easy deprecation to patch, also. |
14:47:03 | Oddmonger | so ยซnimble install nakeยป: /tmp/nimble_47567/githubcom_fowlmouthnake/nakelib.nim(219, 18) Error: undeclared identifier: 'toSeconds' |
14:47:04 | Zevv | sealmove: right, so what is the problem then? |
14:47:07 | Oddmonger | Prompt: Build failed for '[email protected]', would you like to try installing 'nake@#head' (latest unstable)? [y/N] |
14:47:16 | leorize | haxscramper: the issue is that json is expensive (at least with Nim's default json module) |
14:47:19 | Zevv | sealmove: precedence? |
14:47:25 | Oddmonger | i've cowardly answered 'N' |
14:47:30 | disruptek | nimble isn't all that strong when it comes to versions. maybe try nimph. |
14:47:43 | Zevv | mild today, are we |
14:47:48 | disruptek | extra mild. |
14:47:52 | Zevv | sweet |
14:48:17 | disruptek | you catch more flies with honey than vinegar. |
14:48:30 | haxscramper | Since you just instantly looze all information etc. And for "don't stream part" - doesn't putting each log on it's own line/json entry solve the issue? Like `/tmp/file_with_errors.nim(1, 8) Error: type mismatch: got <int literal(1), char>` will be turned into `{"lineinfo" : {"file": ...}, "kind" : "error"}` |
14:48:32 | leorize | haxscramper: also you don't really need json here, just convert the not found errors into hints |
14:48:36 | disruptek | and you catch more flies with rotten animal carcasses than honey. |
14:48:49 | Zevv | I was about to type something like that yes |
14:48:55 | sealmove | Not sure how to do it. I read you can treat it as binary op. Does this seem correct: https://play.nim-lang.org/#ix=2BQD ? |
14:49:20 | disruptek | Zevv: that was my mild version of `dogshit`. ๐ |
14:49:45 | Zevv | sealmove: pfff dude, I never use that stuff :) |
14:49:47 | Zevv | lemme see |
14:49:56 | disruptek | haxscramper: just setup your own error handler. |
14:49:56 | leorize | haxscramper: I'm not sure what advantages does json bring to the table |
14:50:10 | haxscramper | machine-readable output |
14:50:22 | leorize | the current output is not machine readable? |
14:50:26 | Zevv | sealmove: excellent question, I'm not even sure if it really fits in :/ |
14:50:29 | disruptek | hearts and minds, people; HEARTS AND MINDS! |
14:50:46 | disruptek | don't be afraid to write some nim. |
14:50:53 | haxscramper | leorize: well, depends on how much information you want to give up |
14:51:15 | disruptek | you don't get that much information to begin with. |
14:52:05 | haxscramper | If you are not interested in anything but line/column/file then sure, it is parsable by regex even |
14:52:26 | disruptek | wut |
14:52:39 | leorize | so you want to have semantics attached to the error message? |
14:52:52 | haxscramper | Yes, something like structured logging |
14:53:05 | disruptek | but the messages in the compiler aren't structured. |
14:53:19 | disruptek | i don't write messages you should parse, at least. |
14:53:32 | disruptek | assert lfNoDecl notin sym.loc.flags, "don't come aroun' here no more" |
14:53:44 | disruptek | assert sym.loc.lode != nil, "i will need you to fill out the loc" |
14:54:01 | disruptek | assert lfDynamicLib in sym.loc.flags, "are you lost, son?" |
14:54:08 | disruptek | good fucking luck, buddy. |
14:54:15 | leorize | I wouldn't mind if someone do a complete rework of compiler messages :P, Araq might, though |
14:54:40 | leorize | json construction is slow so you should avoid having it in the hot path |
14:55:06 | disruptek | my testes has some stacktrace rendering in it that might be useful. |
14:55:38 | disruptek | probably not, actually. |
14:55:51 | haxscramper | Yes, messages are not structured right now (although this is not really true, since there is an enumeration for all compiler warnings for example: https://github.com/nim-lang/Nim/blob/devel/compiler/lineinfos.nim#L29), that is true. But they /can/ be structured, the question is just how to make it easy to write & use in compiler code |
14:56:12 | disruptek | this sounds like a job for timmy. |
14:56:18 | disruptek | he absolutely loves this shit. |
14:56:34 | haxscramper | leorize: I've already said that I'm thinking about it, just don't exactly know where / how to start |
14:56:51 | disruptek | focus on maximal disruption for minimal impact. |
14:57:07 | disruptek | like my mangling patch that took 4 months and touches 78 files. |
14:57:13 | FromDiscord | <ITR> How can I get `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` from an immutable array I have read from a few lines earlier :/ |
14:57:39 | disruptek | probably not from the array. |
14:57:40 | disruptek | gdb it. |
14:57:52 | haxscramper | For example rust has https://doc.rust-lang.org/error-index.html etc |
14:57:55 | disruptek | and use my mangling pr. |
14:57:59 | haxscramper | And some messages can be improved overall |
14:58:33 | haxscramper | For example these insane walls of text on type mismatch errors. Just try `echo 1 * '1'` or something - it generats two screens worth of text |
14:58:55 | FromDiscord | <haxscramper> Or something like that https://media.discordapp.net/attachments/371759389889003532/769575654089556009/unknown.png |
14:59:11 | disruptek | have you looked at elm? |
14:59:21 | disruptek | i think it raises the bar for error messages. |
14:59:39 | disruptek | sasha has some opinions about this, too; you should hit him up. |
15:00:30 | haxscramper | Yes, it is a second time I've talked about this here |
15:01:15 | haxscramper | But that time It was about prettier compilation errors, so since everyone has different personal preferences ... |
15:01:23 | Zevv | haxscramper: I do agree that's a lot of output, but what would be the alternative |
15:01:31 | disruptek | we could gzip it. |
15:01:36 | Zevv | saying "I can not find anything that matches" is less helpful then *listing* them |
15:01:40 | Zevv | or should we list only 3 or so? |
15:02:03 | disruptek | we should give interactive introspection. |
15:02:07 | Zevv | dude |
15:03:06 | disruptek | wut |
15:03:18 | disruptek | i'm thinking, like, a graphical event log. |
15:03:40 | Zevv | with emoticons and a lot of color |
15:03:44 | haxscramper | Zevv: Well, for type matching: do unification of expected proc signature and the shit I wrote in my code. Like when I have callback proc signature it usually takes me 10 minutes to determine that "oh, the only difference is gcsafe" |
15:03:48 | haxscramper | Also |
15:04:19 | disruptek | it's hard to diff gz output, though. |
15:04:23 | leorize | at one point you really gotta think if you want structured logging, or do you want the compiler to log smarter |
15:04:25 | haxscramper | Smarter sorting for listing is also a thing. Out of three possible symbols it can omit one, but when I have 30 it happily dumps 28 of them. |
15:04:25 | haxscramper | |
15:04:25 | haxscramper | Possible solution: sort all mismatches based on their similarity with |
15:04:28 | disruptek | maybe we diff it and THEN gzip it. |
15:04:28 | haxscramper | given call site. For example, if proc matches on all arguments except |
15:04:31 | haxscramper | first one, which differs in ~var~ annotation this proc should |
15:04:34 | Zevv | haxscramper: so, like, ordering on "closeness" |
15:04:35 | haxscramper | *certainly* be on top of the list, maybe even highlighted with |
15:04:39 | haxscramper | colorfull arrows 'most likely you wanted to use this one'. Some random |
15:04:41 | haxscramper | scrap that does not match on any type (especially first argumment) |
15:04:44 | haxscramper | should be hidden behind ~--showAllMismatches~. |
15:04:49 | Zevv | no need to list all the float variants when I'm passing in an int and a char, right |
15:04:49 | leorize | oh no haxscramper is spamming |
15:05:00 | Zevv | no he has a point |
15:05:07 | Zevv | his example is good. |
15:05:24 | leorize | I mean you shouldn't write multi-line message for irc :P |
15:05:34 | leorize | but yes the example is fine |
15:06:03 | disruptek | eh. these are very specific though. |
15:06:04 | Zevv | hm let me see how that is implemented and if I can grok that |
15:06:09 | disruptek | they could be determined using ast diff. |
15:06:22 | disruptek | a better example is missing overload. |
15:06:30 | leorize | a lot of nim errors can be improved by inspecting the AST |
15:06:41 | leorize | if you want that to be structured I think you'll have to serialize the AST |
15:06:47 | Zevv | I always think of C++ and stop whining |
15:06:47 | leorize | and, uh, that's not very pretty |
15:07:00 | haxscramper | Also (IMO) just do more colors, or add option (or better just give me all info so I can write my own pretty-printer instead of nagging compiler devs to implement "that nice colored pretty-printed emoji-filled thing") |
15:07:03 | disruptek | the human doesn't need to parse the ast, though. |
15:07:18 | Zevv | you two should marry, the pope is ok I believe |
15:07:36 | disruptek | nimsuggest can tell you the problem and then you can zero in on the ast yourself. |
15:07:39 | leorize | disruptek: haxscramper is thinking about the solution where everything is printed out for a frontend to consume and emit nice error messages |
15:07:55 | FromDiscord | <Clyybber> i want that too |
15:08:14 | Zevv | you're just hiding the problem in glitter and decorations |
15:08:23 | FromDiscord | <Clyybber> then we can have file:line:col too |
15:08:26 | disruptek | i say the compiler is correct. nimsuggest is where you put this functionality, at worst. |
15:08:27 | leorize | I'm not to sure about it, the AST is not cheap to serialize |
15:08:32 | leorize | too* |
15:08:41 | disruptek | at best, you put it in your own tool. |
15:08:48 | leorize | I'd say a new compiler frontend works the best :P |
15:09:02 | disruptek | why do you say the ast is not cheap to serialize? |
15:09:22 | disruptek | 1) it's getting cheaper, and 2) we have to do it for ic anyway. |
15:09:39 | leorize | so you're saying... we should wait for IC? :P |
15:10:19 | disruptek | yes. |
15:10:27 | disruptek | everyone go on vacation for a couple weeks. |
15:10:52 | disruptek | especially araq. |
15:11:03 | disruptek | he's gonna break me with his ic3 branch. |
15:11:45 | leorize | the current compiler already have a ton of information laying around in the memory when an error message is emitted |
15:12:01 | leorize | so it's not too hard to just traverse those and print better messages |
15:12:19 | leorize | @Clyybber file:line:col is ugly imo :P |
15:12:32 | Zevv | but that is exactly what the compiler already does. traverse AST gen generate messages |
15:12:47 | * | NimBot joined #nim |
15:12:53 | disruptek | haxscramper: totally agree. |
15:13:03 | haxscramper | Since you will be running compiler again, and it is more expensive than any tree -> json conversion |
15:13:04 | leorize | haxscramper: nimsuggest is the issue though |
15:13:24 | disruptek | the expense is human, machine expense is free afaic. |
15:14:04 | leorize | if error reporting is too expensive then nimsuggest would eat even more memory and be even more sluggish |
15:14:22 | disruptek | i'm fine with that. |
15:14:40 | haxscramper | ^ excactly. I don't think that dumping just plain /everyting/ (maybe as optional switch though) is that bad of an idea really (all scopes and whathewher internal state compiler has). If someone is willing to dig down into all of this |
15:14:43 | disruptek | i would rather drop $1000 on a new cpu than pay for $1000 of programmer labor. |
15:15:09 | leorize | the problem is that nimsuggest is already sluggish and memory heavy :P |
15:15:22 | haxscramper | leorize: I don't think generating json is **that** much more expensive than regular string |
15:15:27 | leorize | mratsim can't even escape the problems of nimsuggest even when he got an overkill rig |
15:15:50 | Zevv | how exactly does "1 * 2.3" match `*`(float, float)? |
15:15:52 | haxscramper | I mean, it is just more accurately placed quoted and `{}[]""`, that's all |
15:16:07 | leorize | it's expensive if you use JsonNode |
15:16:14 | leorize | packedjson can give you a way out though |
15:16:23 | Zevv | I don't see anything in the manual explicitly converting ints to floats |
15:16:36 | haxscramper | leorize: is it really that bad? |
15:17:03 | sealmove | @Zevv my example works fine after all :) I had some stupid bug in my code (not grammar related) |
15:17:13 | Zevv | good! |
15:17:15 | leorize | haxscramper: yes, Nim's JsonNode is one of the slowest type around |
15:17:32 | leorize | and it doesn't help that our allocator just pool up a ton of memory and also terrible at reusing them |
15:17:46 | leorize | remember, Nim's allocator is O(1), it's meant for latency and not performance |
15:17:47 | disruptek | true. |
15:18:05 | disruptek | we really need to expose the allocator hooks. |
15:18:12 | disruptek | so we can write pools and stuff correctly. |
15:19:22 | leorize | Araq got rid of allocators in Nim right before newruntime ships |
15:19:24 | leorize | not sure why |
15:19:45 | disruptek | haxscramper: i'm watching this video. i like the profiling thing, but i want something like that which is applied to the ecosystem for testing. |
15:20:10 | disruptek | tight specs are only a problem for pegging. |
15:20:23 | disruptek | i'm fine with having the allocator hidden right now. ๐ |
15:20:58 | haxscramper | disruptek: the only problem is just making things output structured data instead of pretty-printed-everything-is-a-text |
15:22:03 | leorize | you can try to make errors structured within the compiler backend first |
15:22:17 | leorize | then you can plug whatever frontend in to print whatever kind of messages |
15:23:43 | leorize | once you got that working then feel free to make the frontend print json out for interop |
15:23:58 | haxscramper | good point |
15:24:26 | haxscramper | oh |
15:24:34 | disruptek | how serious do you want to take this? |
15:24:44 | disruptek | like, how much effort are you willing to put in? |
15:25:24 | haxscramper | And it will also make using nim compiler is a library easier too (I couldn't find a way to don't `quit` when parser encounters invalid nim code for example). |
15:25:55 | disruptek | !repo dust |
15:25:56 | disbot | https://github.com/disruptek/dust -- 9dust: 11DUST is Unattended Syntax Truncation 15 4โญ 0๐ด 7& 1 more... |
15:26:16 | disruptek | the design changed, so earlier work might be more useful to you. |
15:26:38 | disruptek | but again, how serious are you? |
15:26:43 | FromDiscord | <Rebel> Asking again as there are more awesome people online. Are there any nimble packages that implement AES encryption with support for padding? At least PKCS7. Very surprised that nimAES and nimcrypto don't as that is a very basic component of any block-based crypto system... |
15:27:00 | haxscramper | disruptek: I don't know exactly, but since I've finished pattern matching and hcparse is just @#$%RT^Y right now |
15:27:09 | disruptek | rebel: i don't know of an aes solution, no. |
15:27:18 | haxscramper | But I think that is pretty importany |
15:27:20 | leorize | @Rebel maybe look inside nim-p2p, iirc Status wrote something for that in there |
15:27:29 | haxscramper | So I could say I'm relatively serious |
15:27:53 | disruptek | well, compiler-as-a-library needs a lot of work based on my dust experience. |
15:28:18 | disruptek | but i would maybe recommend starting with dust. |
15:28:27 | disruptek | it's largely the same problem. |
15:28:33 | Araq | hmm what about me? |
15:28:44 | disruptek | Araq: we love you, enjoy the weekend. |
15:28:53 | Araq | good good. |
15:29:09 | leorize | I'm all for making the compiler backend more robust and easier to use \o/ |
15:29:12 | disruptek | you're going to make me rebase against ic3. i guess it's fair. |
15:29:18 | leorize | please keep us posted with your progress haxscramper |
15:29:26 | Araq | disruptek: seems like it, yeah |
15:29:44 | disruptek | i mean, my time is cheaper than yours; i'm okay with it. |
15:29:49 | haxscramper | disruptek: yes, I've seen dust and even wrote https://gist.github.com/haxscramper/8821819221b1d73866e4aed306147f0c (just small example of custom compiler pass) using it as a base |
15:30:06 | disruptek | but ice is now rebased against mangling. so it's starting to be real work to track this stuff. |
15:30:11 | disruptek | would like to get mangling in asap. |
15:30:34 | Araq | we have some process in place here |
15:30:37 | disruptek | haxscramper: okay, sounds like you are now state-of-the-art. just lemme know if i can help. |
15:30:39 | * | Araq tries to remember |
15:30:57 | disruptek | i need to get leorize to train me on rebase. |
15:31:11 | FromDiscord | <Rebel> Thank you leorize I shall take a look later today. |
15:31:28 | haxscramper | leorize: Right now I'm just thinking about to do this, but from this discussion I could say it just comes down to refactoring compiler error handing and using separate type for everything instead of just plain errors |
15:31:36 | FromDiscord | <Rebel> Maybe one day Nim will have an official cryptography module |
15:31:44 | disruptek | Araq: it was red due to cligen, not me. |
15:32:13 | leorize | haxscramper: object variants ftw :P |
15:32:15 | disruptek | rebel: we go over this all the time. nimcrypto is audited, which is as close as you're going to get. |
15:32:20 | Araq | โThe PR has to be approved (and is often merged too) by one "code owner", either by the code owner who is responsible for the subsystem the PR belongs to or by two core developers or by Araq.โ |
15:32:34 | FromDiscord | <Rebel> Yes look at the aes issue on nincrypto lmao |
15:32:43 | FromDiscord | <Rebel> That is a bit of a yikes |
15:32:48 | FromDiscord | <Rebel> A huge yikes |
15:32:59 | Araq | so get both Clyybber and cooldome to approve your name mangling patch |
15:33:11 | disruptek | give us a link on the issue. |
15:33:24 | FromDiscord | <Rebel> ๐ฌ https://media.discordapp.net/attachments/371759389889003532/769584331601084496/image-20.png |
15:33:25 | disruptek | !issue aes repo:status-im/nimcrypto |
15:33:25 | disbot | https://github.com/nim-lang/Nim/issues/9503 -- 3nimpretty indents object constructor badly 7& 4 more... |
15:33:35 | leorize | @Rebel well you still have openssl to go by |
15:33:37 | FromDiscord | <Rebel> One sec let me pull it uo |
15:33:38 | FromDiscord | <Rebel> Up |
15:34:14 | ForumUpdaterBot | New question by jjv360: What is the significance of uppercase file names?, see https://stackoverflow.com/questions/64515076/what-is-the-significance-of-uppercase-file-names |
15:34:15 | disruptek | Araq: aight. |
15:34:29 | haxscramper | Although I would like to first finish hcparse and use sourcetrail on nim compiler so I could do refactoring faster |
15:34:39 | FromDiscord | <Rebel> https://github.com/cheatfate/nimcrypto/issues/9 |
15:34:39 | disbot | โฅ AES encrypt and decrypt |
15:35:14 | FromDiscord | <Rebel> I think someone ran into the same issue as me |
15:35:16 | FromDiscord | <Rebel> https://gist.github.com/genotrance/53d3ae50434ad73365d45bdd6a0ff97d |
15:35:21 | FromDiscord | <Rebel> Had to resort to toast |
15:35:34 | leorize | I guess I'm gonna do some CI work today, gotta get my `process` library working and I need more tests |
15:35:58 | disruptek | github needs an email-subscription mode where they just send you the initial issue so you can subscribe to it there if you are interested. |
15:36:31 | disruptek | i don't like having to watch entire repositories. |
15:37:46 | Araq | disruptek: however... |
15:38:28 | Araq | let's assume we have ic3 applied. What stops you from using the new stable IDs for name mangling, augmented with some type info for convenience |
15:38:37 | disruptek | you don't need to break me; how hard could it be to offer me uniqueId and .id on sym? |
15:38:55 | disruptek | there's nothing preventing me to adapting my code. |
15:39:07 | disruptek | let's not worry about it. it's about the simplest problem we have. |
15:39:11 | Araq | remember, that we used to use .id for the name mangling |
15:39:16 | Araq | and it was fine. |
15:39:19 | disruptek | of course. |
15:39:34 | disruptek | like i said, just deprecate the fields and replace them with procs. |
15:39:48 | Araq | ? |
15:39:56 | disruptek | the .id and .uniqueId. |
15:40:23 | Araq | what about them? why are accessor procs better for you? |
15:40:40 | disruptek | they aren't; it's fine if they are still there. |
15:40:57 | disruptek | i'm just saying that i use them. that's the only breakage we need to worry about. |
15:40:59 | * | Vladar joined #nim |
15:41:08 | disruptek | and it's hardly anything to be concerned of. |
15:41:15 | Araq | alright |
15:41:35 | Araq | so you now like my patch, right?! |
15:41:41 | disruptek | yes, yes! |
15:41:48 | Araq | :-) |
15:41:50 | disruptek | gut gut |
15:42:18 | FromDiscord | <ITR> disruptek: I managed to set up gdb with vscode, but some of the fields are listed as "optimized out", despite it being a debug build (I tried adding --opt:off too), do you happen to know what the issue might be? |
15:42:41 | disruptek | --debuginfo |
15:42:53 | disruptek | also --embedsrc is nice. |
15:42:59 | disruptek | --debugger:native |
15:43:20 | disruptek | --linedir:on |
15:43:23 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=2BR9 |
15:43:46 | disruptek | man, i broke something so i can't open links from my terminal and it's fucking killing me. |
15:44:08 | disruptek | what's -x:on and -a:on? |
15:44:41 | Araq | -x = checks |
15:44:42 | FromDiscord | <ITR> runtime checks and assertions, but I think they're on by default |
15:44:45 | disruptek | if they are optimized out, they are optimized out. |
15:44:47 | Araq | -a = assertions iirc |
15:45:03 | disruptek | that's literally a message from the c compiler saying, "yo, you don't need this so i'm throwing it away." |
15:45:24 | disruptek | logically, you can ignore it. |
15:45:44 | FromDiscord | <ITR> my problem is when it's the parameter to a function, and it doesn't let me see the value because of it |
15:46:01 | disruptek | Araq: we run asserts in release now? |
15:46:16 | Araq | yeah, due to an oversight |
15:46:23 | disruptek | sigh. |
15:46:57 | Araq | but it's not a big deal either way |
15:47:05 | leorize[m]1 | oh wait it's not intentional? |
15:47:07 | disruptek | man, i am so not a fan of that. |
15:47:14 | mipri | hasn't that been true since -d:danger was added? or does release do more asserts than before? |
15:47:16 | leorize[m]1 | I brought it up several times and no one said a thing |
15:47:16 | disruptek | what would it take to fix it? |
15:47:30 | disruptek | gah, i thought it must have been a lie. |
15:47:39 | leorize[m]1 | disruptek: just modify nim.cfg to add assertions:off to release |
15:47:47 | Araq | leorize[m]1: when I introduced -d:danger vs d:release |
15:47:53 | disruptek | no, i mean in the compiler. |
15:48:05 | Araq | I meant to enable all checks for release |
15:48:09 | disruptek | when they got merged, you mean. |
15:48:14 | disruptek | oh. |
15:48:32 | Araq | but I never thought about assertions |
15:48:52 | disruptek | hmm. |
15:49:02 | disruptek | now i can't decide how i feel about this. |
15:49:20 | Araq | this is what happens when you avoid the RFC process |
15:49:20 | disruptek | danger is new, right? |
15:49:40 | Araq | it's in 1.0, so no. |
15:49:44 | Araq | it's not new |
15:49:48 | disruptek | right, but danger is the one you added. |
15:50:15 | Araq | yes but 'release' used to be 'danger' |
15:50:20 | leorize[m]1 | so is there anything blocking us from turning assertions off for release? |
15:50:22 | disruptek | exactly. |
15:50:29 | disruptek | so release used to not include assertions. |
15:50:29 | Araq | so I changed them both quite considerably |
15:50:32 | disruptek | and now it does. |
15:50:36 | Araq | true |
15:50:51 | disruptek | okay. i say you pick what you want where and we move it. |
15:51:11 | disruptek | and either way it's fine, but get it the way you want it. |
15:51:30 | Araq | well personally I want --assertions:on for the release compiler |
15:51:45 | disruptek | okay, that's interesting. |
15:51:53 | Araq | but I can totally see that others want something else |
15:52:23 | disruptek | you mean for their projects. |
15:52:29 | Araq | for me the -d:release switch was a productivity boost, no need to check code snippets with two different compilers |
15:52:59 | Araq | (debug and 'danger' compiler) |
15:53:05 | disruptek | that's makes a lot of sense. |
15:53:26 | disruptek | but, as you point out, it's solved in the compiler build configuration. |
15:53:58 | disruptek | i guess it has to stay enabled. |
15:54:04 | disruptek | it's in 1.0, 1.2, 1.4. |
15:54:33 | FromDiscord | <ITR> wait, does inc/dec not check for bounds of the variable type? |
15:54:47 | Araq | it does |
15:54:50 | disruptek | it does with checks. |
15:55:10 | disruptek | there's even a custom check switch iirc. |
15:55:52 | FromDiscord | <ITR> strange, because I'm somehow managing to get a -1 in a 0..5 range |
15:56:12 | disruptek | that makes sense. |
15:56:25 | disruptek | try toggling the check. |
15:56:34 | disruptek | maybe something in your config is toggling it. |
15:57:01 | FromDiscord | <ITR> even stranger is that I'm manually checking if `WidthIndex.low < pos.x:` before calling dec on it |
15:57:10 | mipri | what D has is a bunch of additional distinctions on assertions: there's assert(), and there are bounds checks, and then there are bounds checks in {.safe.} code vs. other code, then there's contract programming, and there's invariants, that can all be toggled separately. |
15:57:20 | disruptek | show the code. |
15:57:25 | Araq | what the heck is up with our CIs... |
15:57:44 | Araq | mipri: yeah I know, and we have quite the same setup for better or worse. |
15:58:26 | FromDiscord | <ITR> gonna try with `--rangeChecks:on --boundChecks:on` first and step through with the debugger first |
15:58:48 | FromDiscord | <ITR> I'll see if I can extract the small part where this happens |
15:59:06 | disruptek | i think leorize is planning on working on ci today. |
16:01:11 | leorize[m]1 | Araq: so something is broken? |
16:01:29 | leorize[m]1 | I plan to work on CI for libraries since I need them for stuff I develop |
16:01:34 | FromDiscord | <ITR> ah, I see my issue, I'm checking against the wrong variable. Strange that the checks on inc/dec aren't catching it though. |
16:03:41 | Araq | leorize[m]1: it was just an SSL connection hickup I think |
16:04:16 | FromDiscord | <ITR> disruptek: https://play.nim-lang.org/#ix=2BRk |
16:05:12 | disruptek | that talk was pretty good and it captures how i feel about pl development. |
16:05:36 | mipri | ITR: without distinct that fails with an underflow |
16:05:56 | FromDiscord | <ITR> ah, so distinct is the issue |
16:06:05 | disruptek | neat. |
16:06:22 | disruptek | that should be an easy fix. |
16:06:23 | mipri | !eval var x: distinct range[0..2]; x.dec; echo x.int |
16:06:24 | Araq | disruptek: so ... what does 'frosty' do? |
16:06:26 | NimBot | -1 |
16:06:40 | disruptek | Araq: copies memory to stream or socket. |
16:07:11 | Araq | huh? and how? what if my memory has pointers inside? |
16:07:13 | disruptek | or from stream or socket. i felt it necessary. |
16:07:26 | FromDiscord | <ITR> is there a proc that would have to be borrowed for the check to work? or is it a bug? |
16:07:29 | disruptek | the pointers get stashed and unstashed. |
16:07:47 | disruptek | no, i think it's a bug. |
16:08:10 | disruptek | i think we need to skiptypes and we aren't. |
16:08:18 | FromDiscord | <ITR> welp, I guess I'll just have to keep that in mind for now. Thanks for all the help |
16:08:20 | disruptek | if i'm right it's a 1-line fix. |
16:08:31 | disruptek | ITR: will you file an issue, please? |
16:08:37 | FromDiscord | <ITR> ๐ |
16:08:41 | disruptek | danke. |
16:09:12 | FromDiscord | <ITR> what does that look like on irc? \๐๐ discord has a tendency to replace unicode emoticons with their text versions |
16:09:29 | disruptek | it's a thumbs ofc. |
16:09:46 | mipri | it's definitely not getting replaced with a text version. Just looks like a meaningless blob to me. But that's my preference. |
16:09:59 | disruptek | did you see someone made an emoji translator in nim? |
16:10:11 | disruptek | !repo nimoji |
16:10:12 | disbot | https://github.com/pietroppeter/nimoji -- 9nimoji: 11nimoji - ๐๐บ emoji support for Nim ๐ and the world ๐. 15 9โญ 0๐ด 7& 1 more... |
16:10:53 | disruptek | mipri: you're one of /those/ people, huh? |
16:10:58 | mipri | oh nice. that might be worth integrating into an IRC client |
16:11:33 | disruptek | well, we apparently don't need it. |
16:11:37 | disruptek | (for irc) |
16:12:05 | disruptek | or maybe Yardanico is already using it. such a smart boy. |
16:12:22 | disruptek | !requires nimoji |
16:12:23 | disbot | nimoji: 11pietroppeter/imoji 71 total |
16:13:07 | mipri | oh god, I thought iwas going the other way |
16:13:33 | mipri | it turns perfectly readable ASCII into emojis. |
16:14:25 | haxscramper | on json speed again: why exactly it is considered too slow to work with? I'm just trying to understand what is the difference betweej `JsonNode` and let's say `TNode` - both defined using pretty similar approach (case object with `seq` of subnode elements), all have int/string leaf node types etc. |
16:15:10 | disruptek | it's slow because it makes a lot of allocs. |
16:15:11 | haxscramper | And this is how any tree is defined usually (most logical and straighforward way) |
16:15:22 | FromDiscord | <Rebel> Maybe one day Nim will have options like Python does with a plethora of json options such as orjson and ujson. |
16:15:34 | disruptek | we already have those options via c. |
16:15:54 | disruptek | a wrapper practically writes itself. |
16:16:46 | FromDiscord | <Rebel> Fair enough, do you have a specific wrapper in mind that is faster than the default module? |
16:17:00 | Araq | my 'packedjson' is |
16:17:06 | FromDiscord | <Rebel> ๐ |
16:17:26 | disruptek | i think npeg is 3-5x faster, depending on when and how you measure. |
16:17:46 | disruptek | it would be interesting to see how it performs under arc now. |
16:18:22 | FromDiscord | <Rebel> What features have been cut? No wiki :( |
16:19:49 | FromDiscord | <Rebel> Ok the macro "magic" is still there excellent I will give this is a try in the future. I use a lot of json for my project. |
16:20:39 | leorize[m]1 | haxscramper: TNode is also very slow, Araq planned to replace it in the future |
16:21:08 | leorize[m]1 | you can look at packedjson to see how inefficient json is |
16:21:11 | leorize[m]1 | !repo packedjson |
16:21:12 | disbot | https://github.com/Araq/packedjson -- 9packedjson: 11packedjson is an alternative Nim implementation for JSON. The JSON is essentially kept as a single string in order to save memory over a more traditional tree representation. 15 49โญ 7๐ด |
16:21:30 | disruptek | this is the first time, ever, that i'm using nimph while being high. high to the point where i really don't know what it's doing or why. |
16:21:41 | disruptek | i've had to really put my trust in this software. |
16:22:04 | disruptek | so, what do you think happened? |
16:22:28 | disruptek | btw, this is the error i started with: /home/adavidoff/git/golden/deps/pkgs/gittyup-2.5.1/gittyup.nim(1018, 9) Error: undeclared identifier: 'git_strarray_free' |
16:22:58 | disruptek | $ nimph outdated |
16:23:11 | disruptek | would upgrade bump from 1.8.20 to 1.8.24 |
16:23:14 | disruptek | would upgrade cligen from 1.0.0 to v1.2.2 |
16:23:18 | disruptek | would upgrade gittyup from 2.5.1 to 2.5.6 |
16:23:22 | disruptek | would upgrade nimgit2 from 0.3.0 to v0.3.2 |
16:23:30 | disruptek | would upgrade nimterop from 0.6.2 to v0.6.13 |
16:23:33 | disruptek | would upgrade regex from 0.15.0 to v0.17.0 |
16:23:38 | disruptek | ๐golden is not where you want it |
16:23:51 | disruptek | i'm nervous. |
16:24:23 | mipri | I was on the edge of my seat but no "upgrade superimportant from 1.2.3 to 1.1.4" |
16:24:29 | disruptek | you can cut the tension in this room with a knife. |
16:24:37 | disruptek | $ nimph upgrade |
16:24:41 | disruptek | rolled bump from 1.8.20 to 1.8.24 |
16:24:56 | disruptek | rolled cligen from 1.0.0 to v1.2.2 |
16:24:57 | disruptek | rolled gittyup from 2.5.1 to 2.5.6 |
16:24:57 | disruptek | rolled nimgit2 from 0.3.0 to v0.3.2 |
16:24:57 | disruptek | rolled nimterop from 0.6.2 to v0.6.13 |
16:24:58 | disruptek | rolled regex from 0.15.0 to v0.17.0 |
16:24:59 | disruptek | added path `/home/adavidoff/git/golden/deps/pkgs/regex-0.17.0/src/` to `/home/adavidoff/git/golden/nim.cfg` |
16:25:06 | disruptek | ๐golden is lookin' good |
16:25:27 | disruptek | yeah baby. |
16:25:30 | disruptek | that's good, i think. |
16:25:51 | disruptek | $ nim c -d:danger --gc:arc --panics:on src/golden.nim |
16:26:05 | disruptek | /home/adavidoff/git/golden/deps/pkgs/nimgit2-0.3.2/nimgit2.nim(27, 10) template/generic instantiation of `getHeader` from here |
16:26:08 | disruptek | /home/adavidoff/nims/lib/system/fatal.nim(41, 5) Error: cannot 'importc' variable at compile time; cstderr |
16:26:14 | FromDiscord | <ITR> beep boop, issue made: <https://github.com/nim-lang/Nim/issues/15706> |
16:26:17 | disbot | โฅ Underflow not detected when using dec on distinct ranges ; snippet at 12https://play.nim-lang.org/#ix=2BRp |
16:26:17 | disruptek | ๐ผ |
16:26:25 | disruptek | thanks, itr |
16:27:55 | Araq | I remember fixing this one. :-) iirc I had to revert because it breaks code. but yeah, we should fix all these things and call it version 2 |
16:28:24 | disruptek | seriously. |
16:28:32 | disruptek | is there a list of these things somewhere? |
16:28:54 | Araq | compilerdev repo |
16:29:08 | Araq | (it lacks this one though) |
16:29:10 | disruptek | weird, i don't remember seeing it. |
16:29:12 | disruptek | ahh. |
16:30:14 | disruptek | $ goto nimgit2 |
16:30:19 | disruptek | $ nimble test |
16:30:56 | disruptek | error: pathspec '1.0.0' did not match any file(s) known to git [AssertionDefect] |
16:45:09 | FromDiscord | <shashlick> Hmm |
16:51:20 | Zevv | disruptek, smart man. I asked earlier today but got washed in other discussions. What does make `1 * 2.3` work in nim? |
16:51:36 | Zevv | there is no `*`(int, float) |
16:51:51 | Zevv | and it seems to match float,float, even |
16:52:19 | disruptek | don't look for int, float but SomeInteger or even SomeNumber? |
16:52:35 | disruptek | i wonder if our docs are fixed yet. |
16:53:28 | Zevv | Nimsuggest points me to float,float if I lookup `*` for this case |
16:53:40 | disruptek | clever. |
16:54:00 | disruptek | toFloat isn't a converter, though. |
16:54:06 | Zevv | who converts the int, and why does it do that without asking me first |
16:54:13 | disruptek | that would be super fun, of course. |
16:54:23 | mipri | put this in a file: let y = 2.3; echo 1 * y |
16:54:30 | mipri | then nim c --gc:arc --expandArc:file file |
16:54:40 | mipri | `$`(1.0 * y) |
16:54:44 | disruptek | just paste us the output, chucklehead. |
16:54:53 | leorize[m]1 | Zevv: literal magics |
16:55:00 | disruptek | LITERAL MAGIC |
16:55:05 | disruptek | i knew it was real. |
16:55:08 | disruptek | i just knew it. |
16:55:11 | Zevv | where does this live, and do the docs talk about it? |
16:55:18 | mipri | https://play.nim-lang.org/#ix=2BRz |
16:55:21 | disruptek | shh, the first rule of literal magic is, |
16:55:23 | leorize[m]1 | int literal is a special type in the compiler |
16:55:26 | disruptek | you don't talk about literal magic. |
16:55:47 | mipri | if you do let x = 1 as well, instead of leaving it a literal, it's a compilation error |
16:55:58 | Zevv | thats nasty |
16:57:03 | disruptek | no, it's kinda smart. |
16:57:51 | disruptek | think about it; this is a thing which is different from other things that are illiteral. |
16:58:17 | * | hnOsmium0001 joined #nim |
16:58:45 | leorize[m]1 | Zevv: https://nim-lang.org/docs/manual.html#type-relations-convertible-relation |
17:00:07 | * | oculux joined #nim |
17:00:32 | * | oculuxe quit (Ping timeout: 260 seconds) |
17:00:53 | Zevv | ah right |
17:00:59 | mipri | flexible literals is a really common ergonomic feature in programming languages, I don't think it's that surprising, and other langauges take it farther |
17:01:02 | Zevv | that was pretty obvious |
17:01:21 | disruptek | yeah, i'm such an idiot. |
17:01:30 | Zevv | sure, but I always explictly convert, never realized this is allowed |
17:01:56 | mipri | hah I didn't even notice the isIntLiteral(x) in that link until Zevv said it was obvious |
17:04:57 | * | abm joined #nim |
17:07:05 | * | Axiomatic quit (Remote host closed the connection) |
17:07:35 | Zevv | hehe |
17:15:46 | disruptek | how about this idea for a project: something whatfer pair programming on-stream. like kibbitz back in the day. |
17:17:33 | Zevv | vi + screen + mumble + twitch? |
17:17:53 | Zevv | can even do a trio if you like these kinds of things |
17:19:10 | mipri | https://www.codetogether.com/pricing/ only $1750/year for the non-saas edition |
17:19:24 | disruptek | lol |
17:19:39 | disruptek | sorry, i lagged out. |
17:20:52 | disruptek | yeah, i was thinking 3-4, but maybe 5-6 could be interesting too, because you can be "on deck". |
17:26:01 | disruptek | this is how we should do the 48hr nim jam. |
17:27:03 | disruptek | actually, we can stream 2 or 4 windows on the screen at once. |
17:27:09 | * | rockcavera quit (Remote host closed the connection) |
17:27:28 | disruptek | or even have two streams going. |
17:27:34 | disruptek | such a neat idea. |
17:27:39 | disruptek | we should totally build this. |
17:27:50 | disruptek | also, i may be high. |
17:37:27 | * | letto_ joined #nim |
17:37:49 | * | letto quit (Read error: Connection reset by peer) |
17:39:18 | * | lritter joined #nim |
17:55:51 | * | Axiomatic joined #nim |
17:55:57 | * | Axi0matic joined #nim |
17:56:12 | * | lmariscal quit (Quit: I'm Out!) |
17:56:16 | * | Axi0matic quit (Client Quit) |
17:57:14 | * | lmariscal joined #nim |
17:58:15 | * | lmariscal quit (Client Quit) |
17:58:35 | * | lmariscal joined #nim |
18:05:29 | * | sealmove quit (Quit: WeeChat 2.9) |
18:07:36 | * | witcoffee joined #nim |
18:10:02 | * | witcoffee left #nim (#nim) |
18:15:35 | federico3 | can we remove the "Generated: <timestamp>" line from nim doc or replace it with a version number? |
18:16:05 | leorize[m]1 | export SOURCE_CODE_EPOCH to lock it into a number of your choice |
18:16:17 | leorize[m]1 | if you wanna get rid of that you'll have to modify nimdoc.cfg and it's a pain then |
18:16:32 | federico3 | I'l already maintaining a patch that I re-apply to every release... |
18:17:27 | * | arecacea1 quit (Read error: Connection reset by peer) |
18:17:45 | federico3 | and SOURCE_CODE_EPOCH seems to be gone |
18:17:54 | * | arecacea1 joined #nim |
18:20:00 | federico3 | leorize[m]1: are you sure it is in the codebase? |
18:21:09 | * | natrys quit (Quit: natrys) |
18:27:15 | FromDiscord | <ITR> vs code is annoying me, so i feel like starting a spaces vs tabs discussion, lol |
18:28:31 | disruptek | tabs makes more sense to me but our ecosystem is too small to suppose more than one style. |
18:28:31 | FromDiscord | <Rika> dont do it |
18:28:38 | disruptek | s/suppose/support/ |
18:30:33 | FromDiscord | <ITR> nvm, i managed to find the tabs-as-spaces extension for vs code |
18:30:49 | FromDiscord | <ITR> idk why it's so hard to find :| |
18:30:57 | FromDiscord | <exelotl> I prefer tabs, like indentation is literally what they're for gdi xD |
18:30:58 | FromDiscord | <ITR> idk why it's not built into the editorrr |
18:31:27 | FromDiscord | <exelotl> but also I appreciate that nim picks one and enforces it |
18:31:42 | FromDiscord | <ITR> yeah, that's one of my fav parts of go |
18:32:05 | FromDiscord | <Rika> i do not like how nim enforces it, since everything else nim doesnt enforce |
18:32:16 | FromDiscord | <Rika> hell we have partial style insensitivity for fucks sake |
18:32:33 | disruptek | "not just any whitespace, OUR whitespace" |
18:32:53 | disruptek | i agree, exelotl. but what can you do. |
18:33:27 | disruptek | i think it was an example of araq copying bad design simply because guido regretted not using spaces. but that's just my opinion. |
18:35:33 | FromDiscord | <ITR> personally i prefer tabs for indentation and spaces for alignment |
18:36:19 | disruptek | depending on whether the checksum of the file is odd or even, i use a tab every four spaces, or once every three spaces. |
18:36:44 | disruptek | which it is varies with the checksum of the last modification timestamp. |
18:37:07 | * | arecacea1 quit (Remote host closed the connection) |
18:37:21 | disruptek | which i render as a string and then rot13 encode for security. |
18:37:38 | * | arecacea1 joined #nim |
18:38:09 | supakeen | i indent with the fibonacci style |
18:41:26 | FromDiscord | <ITR> Is there any way to mark a proc to only be removed in release builds? I put a `when defined(release): return` in it, but not sure if there's a better way or not |
18:41:53 | disruptek | you can just when out the proc. |
18:42:01 | FromDiscord | <Rika> yeah |
18:42:30 | FromDiscord | <ITR> like, before defining it? so even if I call it somewhere it won't complain? |
18:44:21 | FromGitter | <iffy> I'm trying (my first time) to fix a bug in the compiler. I've got a test case in `tests/vm/tvmmisc.nim` which fails when I do `nim c -r --gc:orc tests/vm/tvmmisc.nim`. Is there a quicker way to test a fix than compiling a new `nim` binary each time I try something? |
18:44:42 | disruptek | no. |
18:45:17 | FromGitter | <iffy> Second question: does the Nim CI run tests with both default GC and ARC/ORC? |
18:45:25 | disruptek | yep. |
18:45:32 | FromGitter | <iffy> Great, thanks! |
18:45:57 | disruptek | i've taken to using testament for testing, directly, because koch is too big a pita. |
18:46:44 | FromDiscord | <neow> 48 hr nim jam? |
18:46:51 | FromDiscord | <neow> like make something in nim in 48 hours? |
18:46:53 | FromDiscord | <neow> when is that |
18:46:58 | leorize[m]1 | @Rika well it's a lesson learned from python |
18:47:04 | FromGitter | <iffy> I don't understand testament or koch, so I'm just running the `nim c -r` |
18:47:06 | disruptek | i don't have a date, yet. |
18:48:02 | FromDiscord | <neow> sounds like something I'd participate in if the date suits me |
18:48:15 | FromDiscord | <neow> (if the date is not during exam season) |
18:48:35 | disruptek | neat, that's one. |
18:53:04 | FromGitter | <iffy> Any tips on debugging a compiler bug (link to docs are fine)? My usual approach of adding `echo` statements everywhere doesn't work so well with these PContexts and PNodes |
18:53:28 | FromGitter | <iffy> derp... I should read the next section of intern.rst |
18:56:49 | disruptek | use debug instead of echo. |
19:01:26 | FromGitter | <iffy> What about for things that don't have a `$` proc? |
19:01:50 | FromGitter | <iffy> PContext and PNode is where I'm at right now |
19:02:17 | disruptek | well, i don't think pcontext has a debug overload ๐คฃ |
19:02:24 | disruptek | pnode does, though. |
19:02:33 | FromGitter | <iffy> oh yep, sure enough |
19:02:39 | disruptek | it's for ast. |
19:04:49 | * | Vladar quit (Quit: Leaving) |
19:18:29 | FromGitter | <iffy> Where can I find out what `magic` does in this: `n[0].sym.magic` (n is a `PNode`)? |
19:19:29 | disruptek | look up whether magic is a field in ast.nim or grep if it's a proc. |
19:24:15 | FromGitter | <iffy> field; thanks for the tip on `ast.nim` -- that'll be a handy file |
19:28:30 | * | lritter quit (Quit: Leaving) |
19:53:24 | FromGitter | <iffy> disruptek: thanks for your help -- I found the source of the bug (though I don't know how to fix it as I think it will require someone to decide what's supported/not). Thanks! |
19:59:29 | * | vicfred joined #nim |
20:23:55 | * | TomDotTom joined #nim |
20:24:01 | disruptek | nice. |
20:41:02 | FromDiscord | <notchris> Is there a library for creating c bindings in nim? I thought I heard of one once |
20:41:13 | disruptek | !repo nimterop |
20:41:15 | disbot | https://github.com/nimterop/nimterop -- 9nimterop: 11Nimterop is a Nim package that aims to make C/C++ interop seamless 15 220โญ 20๐ด 7& 11 more... |
20:42:09 | FromDiscord | <notchris> Thank you! |
20:43:47 | notchris | disruptek: So the lib im trying to wrap isn't that complex, though I did have another question |
20:43:56 | notchris | I have the source repo, and within it has the header file |
20:44:12 | notchris | but when i got the lib off of homebrew, all i see in my local files are the binary |
20:46:18 | * | bung joined #nim |
20:52:59 | disruptek | what's the punchline. |
20:56:39 | * | astronavt joined #nim |
20:57:12 | * | tane quit (Quit: Leaving) |
21:02:12 | Zevv | pmunchline |
21:06:15 | FromDiscord | <Recruit_main707> https://tenor.com/view/ba-dum-tsss-punchline-gif-7320811 |
21:06:42 | disruptek | #15564 makes me so sad. |
21:06:43 | disbot | https://github.com/nim-lang/Nim/pull/15564 -- 3Make IntSet a generic ordinal set OrdSet[A] |
21:09:11 | * | haxscramper quit (Remote host closed the connection) |
21:14:09 | FromDiscord | <William_CTO> sent a code paste, see https://play.nim-lang.org/#ix=2BSY |
21:15:27 | * | jonjitsu[m] joined #nim |
21:15:36 | * | johnzorn left #nim ("WeeChat 2.8") |
21:22:30 | FromDiscord | <dom96> What makes you think `HttpHeaders` is an enum? |
21:26:46 | FromDiscord | <William_CTO> Sorry, I got it confused with httpMethod |
21:27:10 | Prestige | Would it be faster to check equality of an enum state, or to invoke an empty proc? |
21:27:46 | * | solitudesf quit (Ping timeout: 246 seconds) |
21:27:49 | disruptek | check the enum. |
21:27:58 | Prestige | Thanks |
21:28:18 | disruptek | unless it's not in cache, i guess. |
21:28:32 | disruptek | such a weird question. what are you even doing? |
21:29:51 | Prestige | game engine things, using an object variant if an enum check will be faster. If the object is renderable, I'd pass it to a render proc |
21:30:28 | Prestige | or invoke a render method which would be empty |
21:30:31 | disruptek | ah. |
21:31:05 | disruptek | it's unlikely to matter, but i'd use a template that may call the renderer if it's renderable (check the enum). |
21:31:24 | Prestige | Sounds good. Thanks |
21:31:38 | disruptek | it will be as easy to read and may save some cycles when the enum matches, etc. |
21:46:08 | FromDiscord | <Recruit_main707> how can i make a macro expect a seq[Object] and treat it as such? |
21:46:51 | FromDiscord | <lqdev> `macro foo(x: seq[Object]) =` |
21:47:01 | FromDiscord | <lqdev> but macros deal with AST |
21:47:19 | FromDiscord | <lqdev> so you'll get the NimNode representing your `seq[Object]` |
21:47:55 | FromDiscord | <lqdev> alternatively, if your seq is known at compile time, you can do `x: static seq[Object]` and then you get an actual seq |
22:10:19 | * | Sembei joined #nim |
22:23:07 | * | TomDotTom quit (Ping timeout: 260 seconds) |
22:28:48 | * | mbomba joined #nim |
22:42:03 | * | opal quit (Ping timeout: 240 seconds) |
23:02:31 | * | vicfred quit (Quit: Leaving) |
23:03:31 | FromDiscord | <Gyllou> hiya |
23:05:04 | FromDiscord | <Gyllou> did anyone here work on weave? |
23:11:16 | FromDiscord | <Gyllou> anybody know what the underlying message passing mechanism is with channels then? |
23:13:35 | leorize | not sure how weave channels work, but nim channels are done with a shared buffer and some locks |
23:13:51 | leorize | https://github.com/nim-lang/Nim/blob/devel/lib/system/channels.nim <- here's Nim's channel implementation |
23:14:01 | leorize | mratsim wrote a better one for weave but I've not read it yet |
23:15:51 | FromDiscord | <Gyllou> okay, ill look through that, based on his source code it looks like he uses nim channels in there to some degree as well. im not familiar with the idea of channels, bc ive never really used go which i think is only place I've heard of them before. |
23:29:50 | * | bung quit (Ping timeout: 256 seconds) |
23:58:43 | * | bung joined #nim |
23:59:58 | * | apahl quit (Remote host closed the connection) |