00:00:50 | rayman22201 | @Araq, so you gather up all the unowned closure env variables in this table: `unownedEnvVars`... Who ends up owning them? |
00:03:00 | * | stefanos82 quit (Quit: Quitting for now...) |
00:29:55 | Araq | rayman22201, nobody, they are unowned? it's just a view into the owned env var to make the move optimizer shut up |
00:30:31 | rayman22201 | who owns the "owned env var"? |
00:30:47 | * | dddddd quit (Remote host closed the connection) |
00:31:06 | Araq | it gets moved into the 'owned(proc())' or else dies at scope exit |
00:31:36 | Araq | seems to work :-) |
00:32:22 | rayman22201 | ah, cool. So if you take a closure as an argument to your function, you take ownership of the closure env? |
00:33:13 | rayman22201 | bad use of "you". The function takes ownership |
00:33:44 | Araq | if it's an 'owned' parameter, yes |
00:33:50 | rayman22201 | sweet. I <3 this |
00:33:57 | rayman22201 | very intuitive |
00:34:10 | rayman22201 | also, isn't it like 3 am for you? go to sleep lol :-P |
00:34:49 | Araq | the defaults are a bit weird, usually inside object fields it's "owned" |
00:35:36 | Araq | but better defaults conflict with "ease of understanding" :-/ |
00:37:25 | rayman22201 | lol. I consider "ease of understanding" to be a feature of good defaults, so in that sense, these are good defaults. |
00:38:11 | rayman22201 | A closure env is a weird "special case" object though. In a way it's an implementation detail, so a weirder default is ok in this case. |
00:38:37 | rayman22201 | imo |
00:39:11 | dom96 | rayman22201, we just need to support async for FlowVars |
00:39:25 | dom96 | Maybe that's what you have in mind |
00:39:35 | dom96 | not sure what you mean by "async api for channels" |
00:39:47 | Araq | https://github.com/rbehrends/btree-alloc pretty interesting results |
00:39:57 | dom96 | But we just need to be able to await channels and flowvars |
00:39:59 | Araq | though BTree is a terrible benchmark IMO |
00:40:13 | dom96 | 'night |
00:40:19 | Araq | same here, bye |
00:40:22 | rayman22201 | gn |
00:40:34 | rayman22201 | to be continued lol |
00:41:06 | rayman22201 | I might make a forum post about my idea. might be better there anyway |
00:42:04 | rayman22201 | and yes, BTree is a terrible benchmark for an allocator. |
01:16:16 | * | vlad1777d_ quit (Ping timeout: 248 seconds) |
01:47:46 | * | Tyresc quit (Quit: WeeChat 2.5-dev) |
02:46:03 | * | abm quit (Quit: Leaving) |
02:48:28 | * | redlegion quit (Quit: Ded.) |
03:12:56 | * | damosan joined #nim |
03:20:45 | * | damosan quit (Quit: Leaving) |
03:29:27 | * | nc-x joined #nim |
03:31:06 | nc-x | vlang got released today (right now, only for mac). And apparently, their "400 KB compiler with zero dependencies" requires `brew install glfw freetype curl` & `xcode-select --install` (And similar for other OSes as well) |
03:33:30 | nc-x | And a lot of the stuff showcased in their home page is under "Missing features that will be available soon" according to the readme. |
03:35:41 | * | nc-x quit (Quit: Page closed) |
03:36:23 | * | cyraxjoe joined #nim |
03:36:33 | rayman22201 | lol. Why am I not surprised |
03:38:55 | * | nc-x joined #nim |
03:39:28 | laaron- | always soon, tied |
03:39:39 | nc-x | Also "The ui module only works on Windows and macOS for now.", But then how does their 'volt' work on linux (bcos they say it is written in V)? |
03:40:48 | nc-x | I don't understand. Either the guy does not want to release it completely at the moment. Or it is just some smart marketing technique (which apparently worked very well looking at his patreon). |
03:43:46 | * | cyraxjoe quit (Quit: No Ping reply in 180 seconds.) |
03:44:45 | nc-x | Also, according to their homepage, V compiles extremely fast because of their own codegenerator. But according to the the readme it is again in missing features. So then how was it benchmarked, if it does not even work or maybe is not even implemented yet? |
03:44:59 | nc-x | Nothing in their website matches their readme file. |
03:45:03 | * | cyraxjoe joined #nim |
03:46:36 | * | nc-x quit (Quit: Page closed) |
04:24:23 | * | nsf joined #nim |
04:40:44 | * | rockcavera quit (Remote host closed the connection) |
04:41:22 | * | def- quit (Quit: -) |
04:53:16 | * | def- joined #nim |
04:53:36 | * | rockcavera joined #nim |
04:56:30 | * | theelous3 quit (Read error: Connection reset by peer) |
04:58:33 | FromGitter | <rokups> Everywhere I go people are hyped about v and jay. I don't know why.. |
05:21:59 | * | leorize quit (Quit: WeeChat 2.3) |
05:46:02 | FromDiscord_ | <SychoRyn> I’ve heard of v |
05:52:25 | Araq | rokups: so go outside and enjoy the sun. In reality most people do not program and are not hyped about PLs ;-) |
05:57:19 | FromGitter | <rokups> Outside? That's preposterous :trollface: no seriously. All those new languages have too much hype and nothing to back it up. Nim is superior in that respect but nobody cares about nim. |
05:57:40 | * | leorize joined #nim |
05:57:56 | FromDiscord_ | <SychoRyn> Has anyone tried getting the word of nim out to the public |
05:58:14 | FromDiscord_ | <SychoRyn> Can’t just make something and expect it to get famous overnight without telling people about it |
06:00:48 | * | narimiran joined #nim |
06:01:52 | Araq | SychoRyn: what do you suggest? |
06:01:53 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
06:02:06 | FromDiscord_ | <SychoRyn> Idk spread it literally like the plague |
06:02:29 | FromDiscord_ | <SychoRyn> Twitter, youtube, bring it up in programming chats, etc. |
06:03:41 | FromDiscord_ | <SychoRyn> I’m going for rn though bye. |
06:03:49 | leorize | I believe the community tried that :p |
06:04:00 | FromDiscord_ | <SychoRyn> Then keep at it |
06:04:02 | leorize | and got quite some bad rep on HN :p |
06:04:12 | * | hoijui joined #nim |
06:04:23 | FromDiscord_ | <SychoRyn> What’s HN’s abbreviation |
06:04:31 | leorize | Hacker News |
06:04:37 | FromDiscord_ | <SychoRyn> Oh ew hacker nees |
06:04:43 | FromDiscord_ | <SychoRyn> Hacker news* |
06:04:49 | FromDiscord_ | <SychoRyn> Or do you mean hacker noon |
06:04:51 | FromDiscord_ | <SychoRyn> Which ew to both |
06:04:53 | FromDiscord_ | <SychoRyn> Anyway night |
06:05:10 | Zevv | all releases are usually announced on HN |
06:10:21 | * | dwdv joined #nim |
06:13:30 | narimiran | SychoRyn: "Has anyone tried getting the word of nim out to the public" --> well, if you like nim, write a blog post about it. people want to hear users' stories, not creators praising their own language |
06:14:20 | FromGitter | <rokups> Araq since you are around and you are pretty much the only one who might know... whats that market line in ast dump? how do i create such node manually in my own macro? http://ix.io/1MgX/nim |
06:15:03 | leorize | so, there's `dumpTree` so you don't have to use your own `dump` |
06:15:45 | FromGitter | <rokups> `dumpTree` produces same output as if my macro was using untyped arguments |
06:15:46 | * | solitudesf joined #nim |
06:16:31 | leorize | I'm pretty sure the marked line is the generic param generated by typedesc |
06:16:41 | leorize | since typedesc is strictly compile-time only |
06:16:45 | Araq | ^ yup |
06:19:09 | FromGitter | <rokups> i guessed as much. then i tried to create same thing using `genSym(nskGenericParam, "_:type")`. my macro makes ast look exactly same as dump of code i try to generate with my macro, but it fails with an error `Error: illformed AST: [A; B; _:type300344]` |
06:19:17 | FromGitter | <rokups> so i figured my assumption had to be wrong |
06:20:59 | Araq | some stuff that the sem'check does is not do-able with a macro |
06:21:11 | Araq | the idea is that sem'check runs after your macro |
06:21:23 | Araq | so it would then introduce this _:type thing for you |
06:21:27 | FromGitter | <rokups> this is what im trying to do: http://ix.io/1MgZ/nim |
06:21:58 | FromGitter | <rokups> if i do not add that generic param it still errors |
06:22:20 | FromGitter | <rokups> then error is `Error: illformed AST: [A; B]` |
06:22:49 | FromGitter | <rokups> i did same thing with `untyped` macro args and it worked, but then i figured i need to inspect type a bit and with `typed` i can no longer make it work |
06:24:04 | Araq | if gen.kind == nnkGenericParams: |
06:24:04 | Araq | 10 gen.add(genSym(nskGenericParam, "_:type")) |
06:24:10 | Araq | ^ harmful, delete it |
06:24:48 | FromGitter | <rokups> alright. but it still doesnt work ^_^ |
06:25:09 | Araq | macro ctor*(args: varargs[typed]): auto <-- varargs? |
06:25:42 | FromGitter | <rokups> i was using `callsite()` and comment suggested `varargs` ¯\_(ツ)_/¯ |
06:26:15 | Araq | don't use varargs here. nor callsite |
06:26:37 | Araq | and I don't know whether it can work with 'typed' usually 'untyped' works much better for macros :P |
06:27:21 | * | fjellfras joined #nim |
06:27:49 | FromGitter | <rokups> i started doing typed thing because i figured i want to see if return type is a ref type and if so - remove that ref part and insert non-ref typedesc as first parameter |
06:28:23 | Araq | this 'when T is ref' is a terrible idea IMO |
06:29:12 | FromGitter | <rokups> you may be right, but i would still love to get this working :D |
06:32:04 | * | hoijui quit (Ping timeout: 252 seconds) |
06:33:46 | * | hoijui joined #nim |
06:36:06 | FromGitter | <rokups> well issue was something way more trivial. macro result must be nnkStmtList containing other nodes \o/ |
06:38:03 | * | laaron- quit (Quit: ZNC 1.7.1 - https://znc.in) |
06:40:53 | * | laaron joined #nim |
06:41:04 | FromGitter | <rokups> Araq one more thing. if we attach a proc to a type by having a first parameter `_:typedesc[T]` and then make a mistake calling this proc - error message will show overloads of this proc attached to all types. this is a special case though, chances are we did not make a mistake specifying a type so it would be useful to show only possible overloads with first parameter that matches `_:typedesc[T]`. do you think this |
06:41:04 | FromGitter | ... problem is within the scope of compiler? |
06:41:55 | Araq | doesn't 0.20 do this out of the box? |
06:42:16 | FromGitter | <rokups> guess not, since i bumped into it just yesterday |
06:46:06 | Araq | well watch my youtube video, it should work :P |
06:46:51 | FromGitter | <rokups> if it should, then it will eventually. thanks :] |
06:47:21 | Araq | compiler/semcall.nim, have a look |
06:50:43 | * | laaron quit (Remote host closed the connection) |
06:52:40 | * | laaron joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:40 | * | gmpreussner joined #nim |
07:19:16 | FromGitter | <rokups> it seems inserting first parameter works, but..: `Error: type mismatch: got / but expected one of: proc init(_: typedesc[string]; capacity: Natural; zfill = false): string / first type mismatch at position: 1 / required type: Natural but expression 'string' is of type: type string / expression: init(string, 10, true)` http://ix.io/1Mha/nim |
07:20:07 | FromGitter | <rokups> for some reason signature has `_: typedesc[string]` as first parameter but compiler thinks first parameter is `Natural` |
07:20:09 | * | PMunch joined #nim |
07:20:59 | FromGitter | <rokups> is this somehow related to when typed vs untyped macros are executed or something? |
07:23:35 | leorize | I think it's easier to paste code to the playground and share it... |
07:24:35 | PMunch | leorize, since he's using ix you can load it into the prayground if you'd like |
07:24:50 | PMunch | play.nim-lang.org/index.html?ix=1Mha |
07:24:52 | leorize | oh, didn't notice the link :p |
07:25:31 | FromGitter | <rokups> wew more magic url parameters ^_^ |
07:27:25 | leorize | PMunch: does the playground removes indentation? |
07:27:32 | leorize | in the output value |
07:27:36 | leorize | box* |
07:27:45 | PMunch | If you think that is magic rokups you should see this: play.nim-lang.org/newfrontend/index.html#tour=https://uploads.peterme.net/article.html |
07:27:54 | PMunch | leorize, yes. It's a bug, I'm fixing it |
07:28:33 | PMunch | But currently I have two different front-ends, and I want to migrate to the new one written in Nim. But that requires 0.20.0, which I'm unable to build on the server for some reason.. |
07:28:49 | leorize | can't you just use the docker image? |
07:29:10 | leorize | if you can give me the build log, I might be able to help |
07:29:43 | PMunch | Well the playground already uses the docker image |
07:29:56 | PMunch | But to build the playground itself it's currently using 0.19.6 |
07:30:47 | leorize | so.. what's the problem with building the newer Nim? |
07:31:02 | PMunch | I think the machine runs out of memory or something.. |
07:31:25 | leorize | what? |
07:31:32 | PMunch | It builds for a while, then stops, complaining that GCC returned an error. Running the GCC command in the terminal it runs fine |
07:31:48 | leorize | can I have the log then? |
07:31:52 | leorize | also check your ulimits |
07:31:59 | PMunch | Yeah, it's building now |
07:32:16 | Zevv | PMunch: you get no output at all from gcc right, it's just nim telling you it failed to execute gcc? |
07:32:23 | PMunch | Yup |
07:32:33 | PMunch | And running the GCC command myself works just fine |
07:32:37 | PMunch | And the error code is 0 |
07:33:16 | PMunch | This is from choosenim: http://ix.io/1Mhh |
07:33:17 | Zevv | --verbosity:3 gives any more output? |
07:34:10 | PMunch | http://ix.io/1Mhi |
07:34:16 | Zevv | check your dmesg/journalctl if the kernel did an OOM kill |
07:34:20 | Zevv | otherwise, strace -f is your friend |
07:34:22 | PMunch | And that is from the cloned repo (checked out at the 0.20.0 tag) |
07:34:22 | leorize | PMunch: you should just bootstrap the compiler normally... |
07:34:45 | leorize | this is troublesome :p |
07:35:01 | narimiran | PMunch: this is some low-RAM system, right? do you have to run `choosenim` or would `koch -d:leanCompiler` work for you? |
07:35:06 | Zevv | I've seen similar problems with a guy trying to boot on a rpi I believe, oom |
07:35:24 | leorize | since it's on the playground server, I doubt the ram problem :p |
07:35:29 | PMunch | leorize, isn't that what build_all.sh does? |
07:35:53 | Zevv | pmunch: dd if=/dev/zero of=/swap bs=1G count=1 && mkswap /swap && swapon /swap |
07:36:11 | PMunch | leorize, why? It only has 1 Gig.. |
07:36:29 | leorize | Nim tops at 330mb for my builds so... |
07:36:38 | leorize | but you can try :p |
07:36:43 | * | Vladar joined #nim |
07:41:12 | PMunch | Hmm |
07:41:44 | PMunch | Looking at strace I get a lot of ENOENT for files like /home/pmunch/Nim/nimcache/d_linux_amd64/stdlib_dynlib.nim.c.o |
07:42:03 | PMunch | But the command that fails is for a file n the r_linux_amd64 directory.. |
07:42:44 | PMunch | The weird thing is that if I run the GCC command itself it fails on the next file on the next run |
07:43:02 | PMunch | Well that's not so strange, since GCC doesn't rebuild if the output is younger than the source |
07:43:56 | leorize | gcc doesn't have any caching features... |
07:45:04 | PMunch | It doesn't? |
07:45:12 | leorize | yea |
07:45:16 | PMunch | Why on earth does it get further then :S |
07:45:28 | PMunch | Oh yeah, I was thinking of Make |
07:45:32 | leorize | race condition? but seems unlikely |
07:45:56 | PMunch | Tried to turn on swap, and sure enough it is now chugging along and compiling the files |
07:46:17 | leorize | ENOENT is weird for out of memory :p |
07:46:42 | PMunch | Yeah.. |
07:46:54 | PMunch | But those were in a different folder, so that might just be some normal thing |
07:46:55 | FromGitter | <rokups> you arent out of disk space right? |
07:47:11 | PMunch | Like try to read this file, then if that fails read another file. |
07:47:28 | PMunch | rokups, good question |
07:47:38 | PMunch | But making a 1G swap on disk seems to have fixed it |
07:47:47 | leorize | open an another terminal with `watch -n1 free -h` :p |
07:47:51 | PMunch | So in that case I must have different partitions |
07:48:00 | FromGitter | <rokups> ah well if you could make 1G swap then you werent out of space :] |
07:48:11 | PMunch | It could be the partition |
07:48:55 | FromGitter | <rokups> failing disks also do weird things sometimes |
07:49:29 | PMunch | leorize, looking at it now, dips as low as 60M free memory :S, and swap is at 209M used |
07:49:55 | Araq | koch boot -d:leanCompiler -d:danger |
07:50:04 | Araq | it helps |
07:50:25 | leorize | is the js backend in leanCompiler? |
07:50:27 | PMunch | I didn't try with -d:danger, but -d:leanCompiler gave the same error |
07:51:37 | Araq | leorize, yeah, the docgen and 'parallel' is missing then iirc |
07:51:52 | * | chimez joined #nim |
07:52:07 | PMunch | Same error with ./koch boot -d:leanCompiler -d:danger |
07:52:22 | leorize | you need a bigger swap :p |
07:52:34 | PMunch | I turned swap off for that |
07:52:37 | PMunch | Just to try |
07:52:43 | leorize | ah |
07:53:02 | Araq | you can also do a "jsonbuild" but I forgot how it works |
07:53:17 | PMunch | So yeah, apparently you need more than 1G of RAM to build Nim.. |
07:53:20 | leorize | looks like the compiler is rather fat now :p |
07:53:37 | Araq | on my machine it takes 400MB |
07:53:42 | leorize | still less RAM needed than rust :) |
07:53:43 | Araq | with -d:leanCompiler |
07:53:59 | Araq | the only problem is that we don't release the memory before calling GCC |
07:54:05 | Araq | but the jsonbuild fixes that |
07:54:31 | Araq | the idea is that Nim writes a project.json build file that you can then use for building via 'nim jsonbuild' |
07:54:43 | Araq | 2 step process so that the memory is freed in between |
07:54:49 | PMunch | Aah |
07:55:12 | PMunch | Maybe choosenim should do that by default? |
07:55:23 | leorize | choosenim just use koch I think |
07:55:40 | leorize | maybe a `koch leanBoot`? |
07:55:43 | Araq | ok so koch should do that hmmm |
07:55:47 | PMunch | I can see people being interested in Nim because they can optimise stuff on their crappy hardware, just to be unable to install Nim itself because it takes too much :P |
07:56:12 | Araq | well GCC is memory hungy too |
07:56:16 | Araq | it's the nature of compilers |
07:56:37 | PMunch | Oh, and by the way Zevv, using bs=1G with 1G memory doesn't work that well :P It puts that it a buffer before it writes it |
07:56:55 | PMunch | bs=256M count=4 worked a bit better :) |
07:57:06 | PMunch | Araq, yeah true |
07:57:15 | Araq | I actually have a compiler design in mind that would improve memory usage and compile-times by a factor of 10 *cough* |
07:57:21 | PMunch | I mean, it is GCC that is failing :P |
07:57:22 | Araq | but it's for Nim v2 :P |
07:57:38 | leorize | depends on newruntime? :p |
07:57:44 | PMunch | Oh really? I mean the Nim compiler is already really fast :) |
07:57:49 | Araq | no. just a much better architecture |
07:58:27 | Araq | I applied the lessons from DOD to compilers |
07:58:54 | PMunch | I talked to some C# people at work, and they asked if I could do some change to my code, just to say "oh no wait, then you would have to recompile". To which I added that while we were talking I had already recompiled the program the 5 or 10 times I had run it |
07:59:19 | PMunch | I think I run my Nim code more often with "nim c -r myprogram" than with "./myprogram" :P |
07:59:43 | PMunch | Okay, with swap choosenim was able to install Nim :) |
07:59:56 | PMunch | Maybe I should just keep some swap on this machine.. |
08:00:07 | Tanger | hey folks, with object variants, is there a way to specify the `kind` at type definition? ie https://play.nim-lang.org/index.html?ix=1Mhk |
08:00:25 | leorize | nope |
08:00:44 | Tanger | Easy, thanks leorize :D |
08:01:09 | Araq | Tanger, but here is what you can do: |
08:01:13 | Araq | ... |
08:01:26 | Araq | of value: field: SpecialType |
08:01:35 | Araq | ... |
08:01:42 | Araq | prop: SpecialType |
08:01:59 | Araq | if you know the kind there is no need for the case object |
08:02:22 | Araq | might not be applicable though |
08:02:43 | * | Trustable joined #nim |
08:03:28 | FromDiscord_ | <SychoRyn> I just got my friend to install nim and play around with it |
08:03:36 | FromDiscord_ | <SychoRyn> feels good |
08:03:38 | Tanger | Yeah, I can write it like that Araq, thanks for that. |
08:07:14 | FromGitter | <rokups> Araq so any idea why compiler would thing first parameter is `Natural` when macro inserted new one which is `typedesc[string]`? https://play.nim-lang.org/index.html?ix=1Mhn |
08:07:59 | PMunch | SychoRyn, nice :) |
08:08:20 | PMunch | rokups, I looked at that and it doesn't look right.. |
08:08:28 | Araq | rokups: some half-assed way trying to hide "anon" generic parameters |
08:08:39 | Araq | would be my guess. |
08:09:11 | Araq | which is btw one pretty big design mistake in Nim, trying to be too clever in hiding crap. unsuccessfully |
08:09:41 | Araq | it's a bad idea for an introspective language |
08:09:47 | FromGitter | <rokups> well i did not do consciously. you also told me compiler ought to insert that generic param automatically ^_^ |
08:10:00 | Araq | yeah and it does |
08:10:11 | Araq | and then that confuses her |
08:10:34 | FromGitter | <rokups> any idea if there is something i could to to clear the confusion? |
08:10:54 | * | dwdv quit (Quit: quit) |
08:12:59 | FromGitter | <rokups> PMunch are you in charge of nim playground? |
08:13:04 | PMunch | Yes |
08:13:24 | FromGitter | <rokups> i know you love tabs, but nim compiler doesnt. maybe make it so pressing tab inserts 2 spaces instead? |
08:13:47 | PMunch | It should already do that.. |
08:13:55 | PMunch | It does so on my machine at least.. |
08:14:19 | PMunch | Oh wait.. |
08:14:28 | FromGitter | <rokups> odd, does not work here. no console errors either |
08:14:29 | PMunch | It inserts one 2-wide tab... |
08:14:32 | Araq | rokups: looking into it |
08:14:39 | Araq | btw use macros.newTree |
08:14:49 | FromGitter | <rokups> thanks! and i will |
08:15:15 | PMunch | rokups, I'll fix that |
08:15:21 | FromGitter | <rokups> <3 :) |
08:18:53 | Araq | still using 'typed' huh? |
08:20:33 | FromGitter | <rokups> well yes. untyped works already, but i still would like to look into type |
08:23:29 | * | hoijui quit (Quit: Leaving) |
08:23:51 | FromDiscord_ | <Stuffe> I am a completely noob, but the "for" loop is always supposed to iterate over every single element of an orderedTable, right? If so I think I found a bug |
08:24:38 | FromDiscord_ | <Stuffe> like: |
08:24:38 | FromDiscord_ | <Stuffe> for key, val in mytable: |
08:24:38 | FromDiscord_ | <Stuffe> echo key |
08:27:04 | leorize | uhm, what's the bug? |
08:27:23 | FromDiscord_ | <Stuffe> Here is a simple POC |
08:27:30 | FromDiscord_ | <Stuffe> import tables |
08:27:30 | FromDiscord_ | <Stuffe> |
08:27:30 | FromDiscord_ | <Stuffe> var test : OrderedTable[string, string] |
08:27:30 | FromDiscord_ | <Stuffe> |
08:27:30 | FromDiscord_ | <Stuffe> test["verb_past_tense"] = "asd" |
08:27:31 | FromDiscord_ | <Stuffe> test["verb_es"] = "asd" |
08:27:31 | FromDiscord_ | <Stuffe> |
08:27:32 | FromDiscord_ | <Stuffe> var i = 0 |
08:27:34 | FromDiscord_ | <Stuffe> for word, value in test: |
08:27:35 | FromDiscord_ | <Stuffe> i += 1 |
08:27:36 | leorize | please paste to the playground |
08:27:36 | FromDiscord_ | <Stuffe> |
08:27:38 | leorize | not here |
08:27:38 | FromDiscord_ | <Stuffe> assert(test.len == i, "bug?") |
08:28:14 | leorize | code pasted to discord is sent directly to IRC, resulting in this https://irclogs.nim-lang.org/20-06-2019.html#08:27:23 |
08:28:44 | FromDiscord_ | <Stuffe> sorry |
08:28:45 | FromDiscord_ | <Stuffe> https://play.nim-lang.org/index.html?ix=1Mhr |
08:29:00 | leorize | we need a warning on the discord channel I guess :p |
08:29:19 | FromDiscord_ | <Stuffe> yeah 😃 |
08:29:32 | FromDiscord_ | <Stuffe> Anyway, that assert is not supposed to fail, right? |
08:29:48 | leorize | seems to be a bug |
08:29:53 | leorize | narimiran: ^ |
08:31:28 | narimiran | uh oh |
08:31:51 | FromDiscord_ | <Stuffe> it seems like it only happens for ordered tables |
08:32:00 | FromDiscord_ | <Stuffe> and it depends on the key, not the value |
08:32:16 | Araq | rokups: want some black magic? |
08:32:23 | FromGitter | <rokups> i love black magic |
08:32:28 | PMunch | Huh, what a strange bug.. |
08:33:12 | FromDiscord_ | <Stuffe> I am pretty new to nim, is there any temporary alternative I can use? |
08:33:24 | Araq | https://play.nim-lang.org/index.html?ix=1Mhu |
08:33:38 | narimiran | Stuffe: this happens *only* for your combination of keys. just changing one of them is ok. this is *very* strange |
08:34:31 | * | neceve joined #nim |
08:35:06 | Araq | workaround: |
08:35:07 | Araq | var test = initOrderedTable[string, string]() |
08:35:16 | Araq | narimiran, your bug :P |
08:35:48 | narimiran | Araq: yep, seems like it. i'll definitely investigate |
08:35:51 | FromGitter | <rokups> Araq i have a feeling this is something like PMunch did yesterday which was reparsing `prc.repr` |
08:35:54 | FromDiscord_ | <Stuffe> Ok, thanks |
08:36:27 | FromGitter | <rokups> why is black magic required though? would be useful to understand |
08:37:35 | * | leorize quit (Remote host closed the connection) |
08:37:59 | Araq | please look at my proc undoSem |
08:38:43 | Araq | let n be an untyped AST, after sem(n) it becomes a typed AST (it's "typed" aka "semchecked") |
08:38:50 | PMunch | rokups, yeah it appears to have about the same result as my parseStmt(prc.repr) |
08:39:10 | PMunch | Oh wait, then it does the opposite.. |
08:39:32 | Araq | in a language designed for this, this holds: sem(sem(n)) == sem(n) |
08:40:05 | Araq | in the current Nim, you need to sem(undoSem(sem(n)) |
08:40:15 | FromGitter | <rokups> PMunch opposite? looks same to me. result is untyped tree as i understand |
08:40:22 | FromGitter | <rokups> same as with reparing `prc.repr` |
08:40:30 | PMunch | Oh right, yeah I read Araqs statement the wrong way |
08:40:40 | Araq | and of course macros.nim doesn't have 'undoSem' so I had to implement it :P |
08:41:10 | FromGitter | <rokups> so is this something that should be fixed so we dont need to do it in the future or is this set in stone now? |
08:41:45 | Araq | it'll be fixed but don't hold your breath |
08:43:07 | narimiran | @Stuffe, Araq: i think i have a fix, but let me test a bit more |
08:43:16 | * | alexander92 joined #nim |
08:43:54 | FromGitter | <rokups> if it will be eventually fixed it is all that matters |
08:44:26 | Araq | currently the 'typed' version of the AST is unspecified |
08:44:54 | Araq | for this reason, it's terrible :P |
08:46:56 | * | leorize joined #nim |
08:47:16 | Araq | it's an iterative process, you start with an idea, then you implement it, then you learn that the implementation is bad and how the spec should really be, then you write the spec, then you slowly adapt the compiler to the spec and then your users tell you that you suck :P |
08:47:36 | leorize[m] | narimiran: https://www.dannyadam.com/blog/2019/05/debugging-in-vim/ |
08:47:44 | leorize[m] | soon will be in neovim and it looks interesting :p |
08:48:22 | * | alexander92 quit (Ping timeout: 245 seconds) |
08:48:45 | * | alexander92 joined #nim |
08:50:07 | narimiran | leorize[m]: that looks quite nice! do you think it might work with nim files too? (if somebody writes a plugin :)) |
08:50:34 | * | chimez quit (Quit: chimez) |
08:50:41 | leorize | with nim-gdb it should already support that :) |
08:50:57 | leorize | not sure about the evaluate expression at cursor though :p |
08:52:38 | * | alexander92 quit (Client Quit) |
08:52:54 | * | alexander92 joined #nim |
08:54:44 | alexander92 | awesome |
08:54:50 | narimiran | setting breakpoints in nim file already works? |
08:54:58 | alexander92 | btw guys |
08:55:06 | alexander92 | when you do this and you change your files, editing something |
08:55:49 | alexander92 | do you expect your current debugging process to continue working, or do you expect to recompile+restart it |
08:55:49 | leorize | narimiran: yea, I used to debug with an old gdb plugin |
08:58:22 | leorize | narimiran: are you using neomake? |
08:58:59 | * | Acid147 joined #nim |
08:59:23 | narimiran | nope |
09:02:52 | PMunch | Okay, playground going down for maintenance |
09:04:30 | Zevv | !eval os.execShellCommand("shutdown -h now") |
09:04:30 | NimBot | Compile failed: <no output> |
09:05:25 | alexander92 | that's why people should write their own os-es |
09:05:43 | alexander92 | other people wouldn't even know what to do even with root access |
09:10:04 | PMunch | !eval echo "And we're back!" |
09:10:06 | NimBot | And we're back! |
09:10:33 | PMunch | Some changes, ix linxs are now #ix= and not ?ix= |
09:10:36 | PMunch | Some for tours |
09:10:41 | alexander92 | sorry that was stupid from me |
09:10:45 | alexander92 | ohh nice |
09:10:46 | PMunch | Tour links don't need to be escaped any longer |
09:11:02 | alexander92 | we should write a concurrency tour , a lot of people |
09:11:09 | alexander92 | want to see the go tour equivalent |
09:11:09 | PMunch | And you don't need index.html |
09:11:11 | alexander92 | afaik |
09:11:25 | PMunch | So you can do play.nim-lang.org#ix=1Mhr |
09:12:08 | PMunch | Debug output is now only the output from the compiler, and output output is only from the program |
09:12:23 | alexander92 | btw |
09:12:27 | alexander92 | its strange |
09:12:31 | PMunch | And tabs are converted to spaces |
09:12:42 | PMunch | Plus, the front-end is now written in Nim :) |
09:12:46 | alexander92 | i can delete other people's irc message previews in gitter |
09:12:47 | * | leorize quit (Ping timeout: 256 seconds) |
09:13:02 | alexander92 | and it seems that it's not only for me, i open it in incognito and i still cant seem them |
09:13:18 | PMunch | Uhm, that is strange |
09:13:19 | alexander92 | but its possible that they somehow hide them for my local storage or ip |
09:13:46 | alexander92 | PMunch do you see in gitter the "<no output>" nimbot message now |
09:15:01 | FromGitter | <alehander42> hm it seems i can only do that in nim-lang's channels |
09:15:01 | leorize[m] | alexander92: I can't see it |
09:15:10 | PMunch | Neither can I.. |
09:15:18 | FromGitter | <alehander42> probably its connected to the github team thing |
09:15:23 | FromGitter | <alehander42> ahh i see |
09:15:42 | PMunch | Yeah for me the delete option is grayed out |
09:15:46 | FromGitter | <alehander42> so probably everybody with access to the nim-lang team can admin it |
09:16:14 | FromGitter | <alehander42> ok, still strange but makes some sense i guess, i almost thought i've found a great bug |
09:16:43 | FromGitter | <alehander42> sorry for the confusion |
09:17:09 | PMunch | Hmm, dom96 in Jester can I do something other than `get "/": redirect("/index.html")` to serve index.html as /? |
09:17:26 | PMunch | I would like for people to not see the index.html part of the url.. |
09:17:47 | FromGitter | <alehander42> btw dom96 i use karax server side templates in my jester-based web lib |
09:17:58 | FromGitter | <alehander42> should i try to add such a templating engine to karax itself |
09:17:59 | leorize[m] | PMunch: resp /path/to/index.html? |
09:18:22 | leorize[m] | resp readFile "/path/to/index.html" to be precies |
09:18:29 | leorize[m] | precise* |
09:19:08 | PMunch | Hmm, that seems like it would be bad for caching.. |
09:19:17 | FromGitter | <alehander42> because i remember somebody was asking for static karax in github |
09:21:07 | leorize[m] | PMunch: that's how the forum did it so.. |
09:21:16 | PMunch | leorize[m], ah okay |
09:21:24 | PMunch | `nimble build` does that create a release build? |
09:21:57 | alexander92 | hm PMunch good question, but dont the other frameworks do the same |
09:22:20 | alexander92 | a friend is working on a small python framework, i should ask what do they do |
09:22:36 | leorize[m] | PMunch: looks like it's a bit more complicated, see: https://github.com/nim-lang/nimforum/blob/b65fccd41652c1f5c3eaf93f9755aaf66f100c7f/src/forum.nim#L267 |
09:22:47 | alexander92 | i wanted to write a nim one but too lazy |
09:22:48 | leorize[m] | and https://github.com/nim-lang/nimforum/blob/b65fccd41652c1f5c3eaf93f9755aaf66f100c7f/src/forum.nim#L1454 |
09:23:41 | * | leorize joined #nim |
09:24:27 | PMunch | leorize[m], did the change now |
09:24:55 | PMunch | So now you can do play.nim-lang.org and it won't redirect you. Meaning that links copied shouldn't have index.html in them either :) |
09:25:59 | alexander92 | i checked flask and they have an optional cache_timeout parameter to send_file |
09:26:05 | leorize | make the `/index.html` redirect to `/` :p |
09:35:09 | leorize | PMunch: no internet in docker? :p |
09:35:10 | Araq | closure iterators work with --newruntime |
09:35:44 | alexander92 | nice |
09:35:52 | alexander92 | what is the biggest feature left for newrutime |
09:36:08 | Araq | it's now "feature complete", whatever that means |
09:36:16 | Araq | "only" bugfixes remain |
09:36:26 | lqdev[m] | and documentation |
09:37:05 | Araq | well the number of bugs will rise to astonishing levels |
09:37:29 | Araq | to the point that "feature complete" means "we finished the 80% and now are working on the remaining 80%" |
09:37:32 | * | solitudesf quit (Ping timeout: 245 seconds) |
09:38:02 | Araq | lqdev[m], well I wrote a spec. which doesn't reflect reality |
09:38:12 | * | Trustable quit (Remote host closed the connection) |
09:38:38 | lqdev[m] | you're saying that many changes were made? |
09:38:38 | Araq | but I think we should change the spec back to '=sink' ... we can do '=move' for 1.1 |
09:40:26 | * | Trustable joined #nim |
09:42:22 | alexander92 | so now one can write full blown projects without gc :P |
09:42:52 | * | nc-x joined #nim |
09:43:07 | alexander92 | it would be interesting to compare performance |
09:43:17 | alexander92 | of some existing smaller programs |
09:43:17 | leorize | don't do self assignments or you would lose your data :p |
09:43:38 | alexander92 | why do people need self assignments |
09:43:40 | nc-x | Araq: isn't the move PR mostly done? Also the bug with sink is pretty bad. |
09:43:44 | alexander92 | ah conditionals |
09:44:03 | alexander92 | and indirect assignments |
09:47:59 | * | nc-x quit (Ping timeout: 256 seconds) |
09:50:42 | Araq | nc-x: the PR has failing tests and lacks the required codegen patches |
09:54:02 | leorize | https://play.nim-lang.org/#ix=1MhO |
09:54:53 | laaron | how can i know where raised the exception: Error: can raise an unlisted exception: Exception |
09:56:54 | FromGitter | <alehander42> i like the length leorize went through |
09:57:11 | FromGitter | <alehander42> to somehow make newruntime builds in the playground |
09:58:07 | leorize | I also have a macro for nimble, but PMunch disabled internet access on playground |
09:59:19 | FromGitter | <alehander42> so why is a = a different |
09:59:24 | FromGitter | <alehander42> from b = a; a = b |
09:59:33 | FromGitter | <alehander42> in this case |
09:59:55 | leorize | well, the codegen generates a "zeroMem" for moved variable |
10:00:01 | leorize | it's triggered unconditionally |
10:00:39 | FromGitter | <alehander42> but if i write b = a |
10:00:42 | FromGitter | <alehander42> a isn't zeroed |
10:01:24 | FromGitter | <alehander42> ah that is because |
10:01:39 | FromGitter | <alehander42> a = a means (zero `left` a, copy `right` a to `left` a) |
10:01:41 | FromGitter | <alehander42> ? |
10:02:37 | leorize | no, it's: move left a -> right a, zero right a |
10:02:55 | * | NimBot joined #nim |
10:03:09 | FromGitter | <alehander42> but then why doesn;t |
10:03:10 | FromGitter | <alehander42> b = a |
10:03:12 | FromGitter | <alehander42> zero a |
10:03:32 | leorize | if you `echo a` afterwards, then it'll be converted to a copy instead of a `=sink` |
10:03:50 | leorize | it's really weird :p |
10:04:50 | Araq | not really |
10:05:13 | Araq | I understand it :P |
10:06:08 | FromGitter | <alehander42> yeah indeed |
10:06:18 | FromGitter | <alehander42> so it does function-level analysis |
10:07:22 | * | leorize quit (Quit: WeeChat 2.3) |
10:07:27 | FromGitter | <alehander42> so that's why we need =move i see |
10:08:17 | FromGitter | <alehander42> but does this function |
10:08:18 | FromGitter | <alehander42> for a[2] |
10:11:09 | dom96 | PMunch: you don't even need this `resp readFile` thing, you can just put your index.html inside the `public` dir and Jester should handle that automagically |
10:13:13 | dom96 | alehander42: you should implement server-side templates for Karax :D |
10:13:25 | FromGitter | <alehander42> i've implemented them |
10:13:31 | FromGitter | <alehander42> and i use them :P |
10:14:04 | dom96 | Araq: so async works with new runtime now? |
10:14:19 | dom96 | alehander42: make them available as a package, and make it super easy to integrate for karax |
10:14:24 | Araq | dom96, give me a couple of weeks for that :P |
10:14:39 | dom96 | Araq: not feature complete then :P |
10:14:43 | dom96 | This is hilarious: https://github.com/vlang/v/issues/284 |
10:15:01 | FromGitter | <alehander42> @dom96 yeah i will probably |
10:15:09 | FromGitter | <alehander42> all i do is a very simple function |
10:16:59 | * | Trustable quit (Remote host closed the connection) |
10:18:00 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
10:18:28 | * | laaron joined #nim |
10:50:16 | FromGitter | <alehander42> ah awesome |
10:50:29 | FromGitter | <alehander42> finally will gonna see v, love that they use my name as a system component |
10:51:08 | FromGitter | <alehander42> soo did somebody download it meanwhil |
10:51:29 | * | stefanos82 joined #nim |
11:03:23 | * | alexander92 quit (Ping timeout: 258 seconds) |
11:14:25 | PMunch | dom96, I tried that but it didn't work |
11:14:38 | PMunch | leorize[m], internet has always been disabled in the playground |
11:14:53 | PMunch | It's for security reasons, but I'm not sure if it's actually needed.. |
11:15:03 | * | vlad1777d_ joined #nim |
11:15:57 | Araq | it's a good idea |
11:19:41 | Zevv | PMunch: the second you enable it I will stard sending mass spam |
11:23:46 | federico3 | or implement a remote shell and so on |
11:25:43 | * | fjellfras quit (Quit: Leaving) |
11:37:58 | * | Vladar quit (Remote host closed the connection) |
11:42:05 | * | Vladar joined #nim |
11:42:55 | * | deech joined #nim |
12:01:22 | dom96 | PMunch: there is a test for it, so it should work |
12:02:57 | PMunch | Zevv, yeah that's the thing I'm afraid of |
12:03:09 | PMunch | Not so much that it downloads something and does bad stuff to the docker container |
12:03:17 | PMunch | It is limited in runtime anyways |
12:03:41 | PMunch | dom96, hmm. I'll have to retry it then |
12:04:03 | dom96 | and yeah, definitely don't allow internet access |
12:05:26 | PMunch | But leorize[m], I am considering to build a docker image with all the nimble packages installed |
12:05:35 | PMunch | But it got a bit too big.. |
12:06:03 | PMunch | It would be really nice to have something like that though.. |
12:07:44 | PMunch | dom96, I just get a "400 Bad Request" |
12:08:02 | PMunch | When I try to go to localhost:5000 with an index.html in public |
12:08:02 | dom96 | Do you have latest jester/httpbeast? |
12:08:21 | PMunch | 0.4.1 and 0.2.0 |
12:08:30 | dom96 | try HEAD |
12:09:40 | PMunch | Same thing |
12:13:10 | * | envoyt joined #nim |
12:20:25 | PMunch | Hmm, I guess I should do that article on writing the playground now that the new Nim-based front-end is live |
12:27:59 | Zevv | and the articles on nim concurrenc you promised :) |
12:28:17 | PMunch | Yes, of course |
12:28:28 | PMunch | That needs some more research on my part though :) |
12:28:41 | FromGitter | <rokups> btw PMunch nim playground theme is just about perfect. there, i said something nice instead of only complaining :] |
12:28:53 | PMunch | rokups, haha thanks :) |
12:29:03 | PMunch | I tried to make it as consistent as possible with the main site |
12:29:22 | PMunch | Down to the syntax highlighting theme |
12:30:17 | FromGitter | <rokups> well... i was wondering if you will say you just copied style from the main site. i guess that means you totally succeeded |
12:37:53 | * | AndChat|624225 joined #nim |
12:39:28 | * | envoyt quit (Ping timeout: 252 seconds) |
12:40:00 | FromGitter | <alehander42> narimiran i agree people with questions misuse github issues, but sometimes questions might still be answetred imho |
12:40:18 | FromGitter | <alehander42> e.g. the hosted thing is an interesting thing to define, so it might be useful for others who search for it |
12:40:59 | narimiran | yeah, i'm not sure how to correctly answer that. i'm sure they'll have more luck asking it here |
12:43:23 | FromGitter | <alehander42> yes |
12:43:35 | FromGitter | <alehander42> me either that's why i a interested |
12:45:41 | * | alexander92 joined #nim |
12:51:02 | * | Snircle joined #nim |
12:57:07 | * | alexander92 quit (Ping timeout: 245 seconds) |
12:57:23 | * | dddddd joined #nim |
12:58:53 | FromGitter | <alehander42> BTW I get an empty module |
12:59:03 | FromGitter | <alehander42> NimMainModule |
12:59:07 | FromGitter | <alehander42> Function |
12:59:16 | FromGitter | <alehander42> Sometimes and I can't understand why |
12:59:47 | FromGitter | <alehander42> I start the build as a child process shell process in a node app |
13:00:07 | FromGitter | <alehander42> I winder if anybody hit this somehow in a situation |
13:00:25 | FromGitter | <alehander42> Maybe some race condition |
13:05:12 | * | deech quit (Ping timeout: 272 seconds) |
13:06:20 | FromGitter | <mratsim> Interesting read on how someone perceived Rust when he tried it for the first time: https://www.reddit.com/r/rust/comments/c2ufha/tried_learning_rust/ |
13:09:47 | * | laaron quit (Remote host closed the connection) |
13:12:05 | * | AndChat|624225 quit (Read error: Connection reset by peer) |
13:12:21 | * | envoyt joined #nim |
13:12:45 | * | laaron joined #nim |
13:37:24 | Zevv | I had a similar experience. It is nice to do the things from the examples, but trying to do real life things keeps throwing me back. Nim is definitaly more forgiving in this. |
13:41:20 | * | dwdv joined #nim |
13:46:44 | Araq | Nim is getting a --strict mode. when enabled Nim tells you your program is wrong and refuses to compile it. We're beating Rust on its home ground! :-) |
13:52:36 | Araq | nobody got the joke, ok |
13:52:48 | FromGitter | <rokups> what home ground is that? cult-like following? :D |
13:53:03 | * | envoyt quit (Ping timeout: 244 seconds) |
13:53:05 | FromGitter | <rokups> because thats what rust does best |
13:53:20 | narimiran | rokups nah, we don't have enough volunteers to post all those "have you tried rewriting it in Nim?" comments |
13:53:21 | * | envoyt joined #nim |
13:56:43 | CcxWrk | Pfft, not even Rust can compare with C++ error messages. It not only tells your program is bad but does so in secret ancient tongue that you might risk your sanity trying to decipher. |
14:03:35 | Araq | can I use a vector in a C++ destructor? |
14:04:03 | Araq | does the vector's destructor get called then? I think so, but who knows for sure |
14:10:40 | * | clyybber joined #nim |
14:11:35 | * | PMunch quit (Remote host closed the connection) |
14:13:35 | stefanos82 | Araq: when vector object gets out of scope of course |
14:13:51 | * | laaron quit (Remote host closed the connection) |
14:14:20 | * | laaron joined #nim |
14:16:50 | * | d10n-work joined #nim |
14:23:09 | * | nsf quit (Quit: WeeChat 2.4) |
14:40:56 | * | elrood joined #nim |
14:43:49 | shashlick | Araq how come I can override `&=` but not `=` for a `ptr object` |
14:47:29 | Araq | because overloading of the assignment operator is hard to implement, it's tied to a nominal type |
14:48:24 | * | jxy quit (Quit: leaving) |
14:49:36 | * | envoyt quit (Ping timeout: 248 seconds) |
14:49:57 | * | envoyt joined #nim |
14:57:56 | WilhelmVonWeiner | join #fennel |
14:57:58 | WilhelmVonWeiner | whoops |
14:58:24 | Araq | shashlick: the solution is to wrap your pointers in an 'object' |
14:58:56 | * | leorize joined #nim |
15:02:39 | * | gangstacat quit (Ping timeout: 258 seconds) |
15:07:19 | shashlick | But then that object will be problematic to share across threads |
15:07:41 | shashlick | Since it will be thread local |
15:08:25 | shashlick | A similar concern with =destroy which is only allowed for objects |
15:13:23 | * | abm joined #nim |
15:14:39 | FromGitter | <xmonader> @Araq is true that you can't implement generics without a runtime? |
15:15:27 | Araq | shashlick: that's not how it works... |
15:15:41 | Araq | xmonader: what? gosh stop reading HN |
15:16:14 | FromGitter | <xmonader> I truly don't know if they are saying it for a fact or not :D |
15:17:17 | FromGitter | <mratsim> generics are a compile-time thing, you don't need a runtime for those |
15:17:23 | FromGitter | <mratsim> you are mixing that up with AST |
15:18:15 | FromGitter | <xmonader> @mratsim i always thought u generate specific functions based on the params on the compile time, hence why their comment confused me. specially that they are the authors of zig/odin |
15:18:19 | shashlick | @Araq - what am I missing? |
15:18:45 | FromGitter | <mratsim> I'm pretty sure they were talking about AST not runtime |
15:18:51 | Araq | and to answer that question: No, you don't need an AST for generic instantiations. |
15:19:12 | FromGitter | <mratsim> the runtime drama is on Github |
15:19:19 | Araq | an AST helps but it's not required. |
15:19:19 | FromGitter | <mratsim> the AST/generics stuff on HN |
15:20:17 | FromGitter | <xmonader> thank you ^_^ |
15:22:01 | * | jmiven joined #nim |
15:23:35 | Araq | shashlick: the object is just a thin container that implements the lifetime hooks |
15:26:34 | shashlick | so do I take that to mean that there's no concerns with `var abc = new(ObjType)` and then sharing abc with another thread? presumably because I'm not changing the address to that object through the lifetime of that object |
15:27:00 | shashlick | and i don't need to allocShared() and cast to ObjType? |
15:28:07 | Araq | depends. |
15:29:37 | shashlick | so I am making sure the object only has fixed size fields - int and ptr so that there will be no memory changes at runtime |
15:29:48 | shashlick | will that make it safe or it still depends? |
15:30:09 | Araq | why do you want to overload '=' for 'ptr'? |
15:30:45 | shashlick | trying to gist my code, but basically cause if i reassign something else to my sharedString var, the old shared memory needs to be freed |
15:34:47 | * | dGtlc3 quit (Ping timeout: 258 seconds) |
15:35:15 | * | dGtlc3 joined #nim |
15:35:35 | disruptek | it would probably be helpful to transition from calling newruntime `newruntime` so that increasingly, the language in the historical record refers to `owned refs`. |
15:40:11 | Araq | transition to what? |
15:41:50 | shashlick | @Araq - https://pastebin.com/341HjxWT (cc @rayman22201) |
15:43:11 | shashlick | are you saying I can get rid of sharedString and just use sharedStringObj directly and share it across threads without any concerns |
15:43:37 | shashlick | then I can implement `=` and `=destroy` which will make this much cleaner for a consumer |
15:44:14 | Araq | well probably not because then the length field is copied around and not updated on resizes |
15:44:17 | shashlick | obviously this is still single threaded so there's no check for multiple refs across threads |
15:45:01 | shashlick | so I should make len also allocShared? |
15:45:15 | Araq | it depends on whether your string can have multiple owners/writers or not |
15:45:51 | * | gangstacat joined #nim |
15:46:03 | shashlick | i would want multiple writers to make it more useful, so will have to add locks and what not |
15:46:43 | shashlick | my needs are quite simple, but i'm hoping to add something that can help share across threads until newruntime becomes mainstream |
15:47:02 | leorize | I think you can just rip off the newruntime's string and add some locks :p |
15:47:49 | leorize | https://github.com/nim-lang/Nim/blob/devel/lib/core/strs.nim |
15:48:52 | * | laaron quit (Remote host closed the connection) |
15:51:56 | * | laaron joined #nim |
15:55:49 | * | nimblepoultry_ joined #nim |
15:56:24 | * | zyklon joined #nim |
15:56:25 | shashlick | looks like if I have sharedString = object which just has a pointer in it to sharedStringObj, which has all the string details (effectively 3 levels), i could get what i want |
15:56:57 | Araq | that's what I'm saying. however |
15:56:59 | shashlick | create a sharedString object and it stays the same for the lifetime of the string |
15:57:49 | Araq | it's unclear how/when sink/= is involved in multi-threading |
15:58:17 | Araq | in theory, it's easy. what was =deepCopy becomes 'move' |
15:58:29 | * | envoyt quit (Read error: Connection reset by peer) |
15:58:36 | * | envoyt joined #nim |
16:00:33 | Araq | in practice we have createThread (terrible) and 'spawn' (bad) |
16:01:14 | * | BaldEagleX02_ joined #nim |
16:01:24 | shashlick | createThread is stable for me, spawn crashes |
16:03:13 | * | BaldEagleX02 quit (*.net *.split) |
16:03:14 | * | nimblepoultry quit (*.net *.split) |
16:03:18 | * | enthus1ast quit (*.net *.split) |
16:03:19 | * | uvegbot quit (*.net *.split) |
16:03:19 | * | mattisme quit (*.net *.split) |
16:03:23 | * | vegax87 quit (*.net *.split) |
16:03:30 | * | nimblepoultry_ is now known as nimblepoultry |
16:03:55 | Araq | interesting |
16:04:04 | * | vegax87 joined #nim |
16:05:26 | leorize | @yglukhov's threadpool is superior to stdlib's threadpool, at least from what I tried :p |
16:06:01 | shashlick | so now I need to figure out how to maintain refs in the string so that I don't go through with a =destroy when another thread is still using the string |
16:06:17 | shashlick | looks like i'll have to manually increment refs when object is copied into another thread |
16:06:20 | * | envoyt quit (Ping timeout: 272 seconds) |
16:06:30 | shashlick | any way to override the deepCopy |
16:07:10 | leorize | define a `=deepCopy` proc? |
16:09:22 | shashlick | does deepCopy get implicitly called when making a copy? like when I pass the object to createThread |
16:10:02 | * | enthus1ast joined #nim |
16:10:10 | * | mattisme joined #nim |
16:11:45 | Araq | tbh I don't remember. =deepCopy is used by 'spawn' |
16:12:10 | shashlick | I'll try it out |
16:12:29 | shashlick | If it works, will be even more seamless |
16:13:16 | * | envoyt joined #nim |
16:16:39 | * | Senketsu quit (Quit: WeeChat 2.5) |
16:17:43 | * | Senketsu joined #nim |
16:31:15 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
16:31:36 | * | laaron joined #nim |
16:35:18 | dom96 | why is 'spawn' "bad"? |
16:38:58 | * | laaron quit (Remote host closed the connection) |
16:40:57 | shashlick | I have ```proc `=`*(ss: var sharedString, sn: sharedString) =``` but it doesn't get called during assignment |
16:41:01 | * | laaron joined #nim |
16:42:00 | * | clyybber quit (Ping timeout: 244 seconds) |
16:45:50 | * | clyybber joined #nim |
16:47:52 | * | Kaivo quit (Quit: WeeChat 2.5) |
16:51:32 | Araq | shashlick: report it |
16:53:24 | shashlick | yep - 0.19.6 works, 0.20.0 broken |
16:53:56 | shashlick | testing devel |
16:54:26 | clyybber | Hey Araq, sry for the hiatus on the sink to move thing, can you point me to where I would patch the codegen to pass tySink by a hidden address? |
16:54:40 | Araq | ccgtypes.nim |
16:54:46 | clyybber | ok, thanks |
16:55:10 | Araq | proc ccgIntroducedPtr |
16:58:19 | shashlick | yep - still broken on devel |
16:59:48 | * | Trustable joined #nim |
17:00:54 | shashlick | https://github.com/nim-lang/Nim/issues/11553 |
17:07:15 | shashlick | how do you test implicit deepCopy - what's a scenario where nim automatically calls deepCopy, besides spawn |
17:07:52 | * | jxy joined #nim |
17:08:31 | * | jxy quit (Client Quit) |
17:09:32 | leorize | there's a deepCopy proc iirc |
17:10:02 | * | jxy joined #nim |
17:11:45 | shashlick | Ya I'm overriding it but I've only explicitly called it |
17:12:11 | shashlick | When does Nim implicitly call it to make copies |
17:17:56 | leorize | shashlick: https://nim-lang.org/docs/manual_experimental.html#type-bound-operations-deepcopy |
17:19:23 | clyybber | Araq: Regarding const temporaries, should I try to replicate the logic in handleConstExpr/isDeepConstExpr or just naively generate a temporary for all objconstructors, literals and so on? |
17:19:49 | Araq | look at this |
17:20:26 | Araq | https://github.com/nim-lang/Nim/issues/11524 |
17:20:38 | Araq | we need to get consts right... :-/ |
17:25:46 | clyybber | yep, the above issue would be fixed with the nfNoConst flag method afaict. |
17:27:19 | Araq | ok |
17:27:32 | clyybber | We need either a way to influence when the codegen is allowed to generate consts (nfNoConst), or have the rules according to which a const is generated available in injectdestructors. |
17:31:36 | Araq | well in s = @[1, 2, 3] we should copy, not move |
17:32:01 | * | nsf joined #nim |
17:36:01 | shashlick | neat @leorize |
17:36:22 | * | neceve quit (Read error: Connection reset by peer) |
17:37:40 | * | solitudesf joined #nim |
17:38:58 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
17:39:06 | * | laaron- joined #nim |
17:48:58 | lqdev[m] | is there a way of checking whether two `ref object`s are the same pointer? |
17:49:50 | leorize | lqdev[m]: `==` |
17:50:44 | lqdev[m] | I thought there was a special operator for that. Maybe I just confused it with some other language 🤔 |
17:54:10 | lqdev[m] | ah, it's Groovy which has the `is` method. It gets really confusing when you know so many languages |
17:57:35 | * | laaron- quit (Quit: ZNC 1.7.1 - https://znc.in) |
17:59:24 | * | laaron joined #nim |
18:05:31 | * | laaron quit (Remote host closed the connection) |
18:07:16 | * | laaron joined #nim |
18:12:52 | * | Jesin quit (Quit: Leaving) |
18:15:40 | * | natrys joined #nim |
18:15:50 | FromDiscord_ | <Núkley> |
18:15:50 | FromDiscord_ | <Núkley> https://cdn.discordapp.com/attachments/371759389889003532/591330372370038799/unknown.png |
18:16:11 | FromDiscord_ | <Núkley> sorry for the imatureness |
18:16:18 | FromDiscord_ | <Núkley> but it doesnt work |
18:16:50 | lqdev[m] | you need to indent the lines |
18:16:50 | FromDiscord_ | <Núkley> help pls |
18:17:05 | lqdev[m] | how's the compiler supposed to know where's the end of your if branch? |
18:17:14 | narimiran | read some tutorials |
18:17:19 | FromDiscord_ | <SychoRyn> Like at the beginning of like |
18:17:43 | FromDiscord_ | <SychoRyn> if pop == “no”: |
18:17:44 | FromDiscord_ | <SychoRyn> echo “damnit i wanted the poop” |
18:17:49 | FromDiscord_ | <SychoRyn> if poop == “no”: |
18:17:50 | FromDiscord_ | <SychoRyn> echo “damnit i wanted the poop” |
18:17:55 | FromDiscord_ | <SychoRyn> Indent echo |
18:17:58 | FromDiscord_ | <SychoRyn> With tab |
18:18:00 | FromDiscord_ | <SychoRyn> On vsc |
18:18:07 | narimiran | with spaces. |
18:18:19 | FromDiscord_ | <SychoRyn> Is it spaces? |
18:18:35 | lqdev[m] | tabs are forbidden |
18:18:44 | FromDiscord_ | <SychoRyn> Huh |
18:18:45 | narimiran | here, go through this: https://narimiran.github.io/nim-basics/ |
18:18:57 | * | Jesin joined #nim |
18:18:58 | FromDiscord_ | <SychoRyn> Vsc must’ve like automatically fixed my stuff |
18:19:07 | FromDiscord_ | <Núkley> tabs worked |
18:19:22 | FromDiscord_ | <Núkley> because vscode auto makes it spaces |
18:19:26 | FromDiscord_ | <SychoRyn> Ah |
18:19:37 | FromDiscord_ | <SychoRyn> Cool |
18:19:46 | FromDiscord_ | <Núkley> |
18:19:47 | FromDiscord_ | <Núkley> https://cdn.discordapp.com/attachments/371759389889003532/591331363777544242/unknown.png |
18:20:19 | FromDiscord_ | <SychoRyn> Run it |
18:20:22 | FromDiscord_ | <Núkley> |
18:20:22 | FromDiscord_ | <Núkley> https://cdn.discordapp.com/attachments/371759389889003532/591331520627736607/unknown.png |
18:20:26 | FromDiscord_ | <SychoRyn> I must see this masterpiece of a program |
18:20:28 | FromDiscord_ | <Núkley> i did it worked |
18:20:35 | FromDiscord_ | <SychoRyn> Show the output please |
18:20:37 | FromDiscord_ | <Núkley> i can send it if you want |
18:20:43 | FromDiscord_ | <Núkley> output doesnt want to work |
18:20:48 | FromDiscord_ | <SychoRyn> Damn |
18:20:52 | FromDiscord_ | <Núkley> i can screenshot cmd |
18:21:01 | FromDiscord_ | <SychoRyn> That’s what I’m sayin maaaan |
18:21:18 | FromDiscord_ | <Núkley> |
18:21:18 | FromDiscord_ | <Núkley> https://cdn.discordapp.com/attachments/371759389889003532/591331752820080661/unknown.png |
18:21:22 | narimiran | you cannot have interactivness in vscode 'output' window, you need to use terminal |
18:21:54 | FromDiscord_ | <Núkley> i honestly didnt think about the code i sent until after i had sent it |
18:21:58 | FromDiscord_ | <SychoRyn> Yeah use terminal |
18:22:05 | FromDiscord_ | <Núkley> i guess its too late now |
18:22:13 | FromDiscord_ | <SychoRyn> Anyway quality program |
18:22:26 | FromDiscord_ | <Núkley> it was a test for strings |
18:22:28 | FromDiscord_ | <SychoRyn> Send it to microsoft, get rich. |
18:27:46 | lqdev[m] | narimiran: I'm just reading through this guide you sent, I think it might prove useful for teaching my friend how to program :) |
18:28:50 | narimiran | lqdev[m]: nice to hear that. if you'll have any feedback, please let me know |
18:29:19 | lqdev[m] | sure |
18:29:51 | * | Jesin quit (Quit: Leaving) |
18:33:09 | * | Jesin joined #nim |
18:38:53 | FromGitter | <kaushalmodi> About a day or two back, I saw someone getting confused with the "tabulators not allowed" error message |
18:39:05 | FromGitter | <kaushalmodi> I was confused too when I saw that for the first time.. so https://github.com/nim-lang/Nim/pull/11554 |
18:50:23 | shashlick | how do you print a pointer or addr X |
18:51:20 | shashlick | good old cast[int] |
18:51:38 | FromGitter | <kaushalmodi> repr? |
18:59:09 | * | jjido joined #nim |
19:01:03 | * | Tyresc joined #nim |
19:05:24 | Araq | clyybber: https://github.com/nim-lang/Nim/issues/11217 congrats we're blocked by you :P |
19:08:04 | * | natrys quit (Quit: natrys) |
19:11:20 | FromDiscord_ | <treeform> Can I convert between seq[uint8] to string and back without copying the data? |
19:11:43 | Araq | yes |
19:11:52 | FromDiscord_ | <treeform> how? |
19:11:55 | Araq | you can 'cast' it |
19:12:14 | Araq | it's compatible under the hood, even for the --newruntime |
19:12:42 | FromDiscord_ | <treeform> neat i'll try |
19:17:19 | FromDiscord_ | <treeform> Araq, casting is exactly what I wanted, I just did not think they were compatible. |
19:18:20 | lqdev[m] | I just noticed a mistake in the tutorial: |
19:18:21 | lqdev[m] | > By default the Nim compiler generates a large amount of runtime checks aiming for your debugging pleasure. With -d:release these checks are turned off and optimizations are turned on. |
19:18:29 | lqdev[m] | those checks are always present in 0.20.0 |
19:18:51 | lqdev[m] | (unless you compile with `-d:danger`, of course) |
19:20:21 | shashlick | is it possible to override the default constructor like =destroy |
19:23:22 | * | Acid147 quit (Quit: No Ping reply in 180 seconds.) |
19:27:53 | * | laaron quit (Remote host closed the connection) |
19:27:53 | * | Acid147 joined #nim |
19:28:51 | rayman22201 | Nim doesn't really have "constructors", it has initializer procs, that are just regular procs. Just implement your own? |
19:30:33 | * | laaron joined #nim |
19:31:55 | FromDiscord_ | <djazz> Only difference with -d:release seems to be it puts cache in .cache/nim/project_r instead of project_d (tested with nimble build and toggling the switch with config.nims) |
19:32:05 | FromDiscord_ | <djazz> Thw C code is identical |
19:32:26 | FromDiscord_ | <djazz> The C code is identical |
19:33:56 | FromDiscord_ | <djazz> Oh right, its in the release notes. |
19:34:12 | * | PMunch joined #nim |
19:34:22 | * | Acid147 quit (Ping timeout: 258 seconds) |
19:34:44 | FromDiscord_ | <djazz> I was a little confused at first, I expected something to change with d:release. This is my first time using Nim :) |
19:36:49 | PMunch | djazz, the release mode should remove debugging information such as which line number in your Nim code the C code maps to, and other such things |
19:37:02 | * | Acid147 joined #nim |
19:37:15 | PMunch | Before 0.20.0 it also implied -d:danger, which turned off various range checks and such |
19:37:45 | PMunch | Not sure how performance has been impacted with the change of splitting -d:release and -d:danger into two separate flags though |
19:38:11 | * | Acid147 quit (Client Quit) |
19:38:13 | PMunch | Oh, lqdev[m] already explained this :P |
19:38:37 | FromDiscord_ | <djazz> I see |
19:38:49 | FromDiscord_ | <djazz> I still see a bunch of line number annotations though |
19:39:02 | FromDiscord_ | <djazz> And absolute file paths to my nim files |
19:39:18 | FromDiscord_ | <djazz> Had to use other flags to disable those |
19:40:49 | PMunch | Hmm, are you sure you're looking at the right files? |
19:42:26 | * | abm quit (Remote host closed the connection) |
19:42:53 | * | abm joined #nim |
19:43:08 | * | abm quit (Client Quit) |
19:43:52 | PMunch | Doing this: http://ix.io/1Mkk results in this diff http://ix.io/1Mkj between nimcache/example.nim.c and nimcache_release/example.nim.c |
19:44:52 | * | Trustable quit (Remote host closed the connection) |
19:45:27 | PMunch | And enabling -d:danger to the -d:release flag yields this: http://ix.io/1Mkl |
19:45:47 | PMunch | 285 lines in the first diff, 695 lines in the second |
19:47:56 | FromDiscord_ | <djazz> hmm |
19:48:04 | FromDiscord_ | <djazz> i was using `switch("define", "release")` |
19:48:11 | FromDiscord_ | <djazz> guess that don't work |
19:48:23 | FromDiscord_ | <djazz> `-d:release` works |
19:48:41 | FromDiscord_ | <djazz> any idea how to do a release build with nimble without using install? |
19:49:12 | solitudesf | nimble build -d:release |
19:49:15 | PMunch | nimble build -d:release |
19:49:20 | PMunch | Haha, yeah |
19:49:31 | PMunch | Or create your own target in the nimble file |
19:49:43 | solitudesf | `nimble build` forwards cli arguments to compiler |
19:50:12 | FromDiscord_ | <djazz> ah! |
19:51:02 | PMunch | If you look here https://github.com/nim-lang/nimble#creating-packages (scroll down a bit) you will see how to create your own tasks as well |
19:51:25 | PMunch | And of course you could add a nim.cfg file with -d:release in it |
19:51:30 | FromDiscord_ | <djazz> Yeah I tried to make a release task, but unsure how to run nim itself |
19:51:32 | PMunch | (or any other flags) |
19:51:41 | FromDiscord_ | <djazz> Yeah I tried to make a release task, but unsure how to run nim itself from it |
19:53:02 | FromDiscord_ | <djazz> i thought only `nimble c` supported passing flags to nim, as the docs for `nimble c` states that. `nimble build` doesnt state that. |
19:54:05 | FromDiscord_ | <djazz> no idea why my `config.nims` with `switch("define", "release")` doesnt work though. nim does say it is making a Release build! |
19:55:29 | * | nsf quit (Quit: WeeChat 2.4) |
19:57:06 | FromDiscord_ | <djazz> `switch("define", "danger")` doesnt work either |
19:57:38 | FromDiscord_ | <djazz> even though nim says it made a "Dangerous Release Build" |
19:58:55 | FromDiscord_ | <djazz> setting opt to speed/size does work from the config.nims file |
19:59:11 | PMunch | Huh, yeah the documentation for `build` is a bit lacking |
19:59:35 | PMunch | That is strange, is there a bug for it on GitHub? |
20:00:06 | FromDiscord_ | <djazz> this makes it sound like build always does a debug build, and if you want to do a release, use install task. "The install command will build the package in release mode instead." |
20:00:50 | PMunch | Install also puts the resulting binary into the Nimble bin folder, which is usually in peoples path |
20:01:18 | FromDiscord_ | <djazz> yeah, I don't want that while developing |
20:05:38 | FromDiscord_ | <djazz> hmm, `nim -v` seems to always output `active boot switches: -d:release` |
20:05:46 | FromDiscord_ | <djazz> what does that mean? |
20:06:44 | solitudesf | that means that compiler was built using these switches |
20:06:50 | FromDiscord_ | <djazz> ah |
20:07:17 | * | narimiran_ joined #nim |
20:07:56 | FromGitter | <kayabaNerve> I'm surprised my FR didn't get any comments |
20:08:54 | FromGitter | <kayabaNerve> I guess everyone's focused on issues? |
20:09:38 | * | narimiran quit (Ping timeout: 258 seconds) |
20:10:27 | FromDiscord_ | <djazz> if i do `echo defined(release), " ", defined(danger)` in my code i get `true true` even though nim didnt make the C code using those defines (when using the config). So something is weird with config.nims and defines... maybe it's loaded too late or something? |
20:11:07 | * | narimiran_ is now known as narimiran |
20:12:23 | FromDiscord_ | <djazz> ah, `.choosenim/toolchains/nim-0.20.0/config/nim.cfg` seems to load before my config.nims file. |
20:12:59 | narimiran | lqdev[m]: about wrong stuff in tutorial1 about d:release and checks - that has already been fixed: https://nim-lang.github.io/Nim/tut1.html |
20:13:58 | lqdev[m] | ah right, I'm currently referring to the 0.20.0 docs (since that's the version I use) |
20:15:48 | FromDiscord_ | <djazz> using a nim.cfg local to the project didnt work either |
20:16:08 | FromDiscord_ | <djazz> since it gets loaded after nim's own cfg |
20:17:02 | lqdev[m] | > SmallLshouldNotBeUsed The letter 'l' should not be used as an identifier. |
20:17:03 | lqdev[m] | what's that warning? I sometimes use `l` as an identifier and it never appears |
20:17:39 | narimiran | lqdev[m]: that's disabled since v0.18, or something like that. i remember it being annoying |
20:17:59 | lqdev[m] | why was it here in the first place? |
20:18:29 | narimiran | lqdev[m]: because Araq doesn't know how to use proper fonts in his code editor? :P |
20:18:36 | lqdev[m] | lol |
20:20:12 | narimiran | (he also doesn't like snake_case because of how _ is rendered on his end :)) |
20:21:18 | FromDiscord_ | <djazz> ah, found an issue about the setting release flag in config: https://github.com/nim-lang/Nim/issues/6319 |
20:21:26 | FromDiscord_ | <djazz> it's been closed |
20:21:47 | FromDiscord_ | <djazz> "You cannot add -d:release to the config file because this flag is actually defined inside the main nim.cfg file. This is an unfortunate gotcha, what you can do is copy the flags that -d:release sets from nim.cfg into your own file." |
20:39:00 | * | krux02 joined #nim |
20:39:44 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:44:29 | Calinou | oh, hey @djazz, long time no see :P |
20:45:36 | Calinou | by the way, you can further improve performance and decrease binary size by enabling LTO: nimble build -d:release --passc:"-flto" |
20:45:59 | FromDiscord_ | <djazz> hey, another ponydev ^^ |
20:46:12 | FromDiscord_ | <djazz> where have we met though? |
20:52:44 | clyybber | Araq: Oh no, gotta go fast :P |
20:52:56 | FromDiscord_ | <SychoRyn> Wait is that THE CALINOU |
20:53:35 | Calinou | @djazz probably the Godot server |
20:53:44 | Calinou | @SychoRyn yep, the one and only :^) |
20:53:47 | * | narimiran quit (Ping timeout: 245 seconds) |
20:54:12 | FromDiscord_ | <djazz> we don't have any common server Calinou, although two mutual friends on discord |
20:54:21 | Calinou | I remember you being there a while ago |
20:54:24 | FromDiscord_ | <djazz> @SychoRyn we have 4 common servers |
20:54:28 | FromDiscord_ | <djazz> yeah long ago |
20:55:19 | FromDiscord_ | <SychoRyn> @djazz yeah I see |
20:56:51 | FromDiscord_ | <djazz> anyway, found Nim, going to try to get the base of my game ported to it ^^ |
20:57:08 | FromDiscord_ | <djazz> already got one C library working |
20:57:14 | Calinou | as we say: "Choose a job. Choose a mortgage. Choose life. Choose Nim." :P |
20:57:22 | FromDiscord_ | <SychoRyn> I made this image last night |
20:57:22 | Calinou | (it's in the "choosenim" help message) |
20:57:26 | FromDiscord_ | <SychoRyn> |
20:57:26 | FromDiscord_ | <SychoRyn> https://cdn.discordapp.com/attachments/371759389889003532/591371044485333002/unknown.png |
20:57:46 | Calinou | what's the one on the far right? |
20:57:49 | FromDiscord_ | <SychoRyn> elm |
20:57:50 | FromDiscord_ | <SychoRyn> here are the lovely responses: |
20:57:53 | lqdev[m] | oh no, not the Rust! |
20:57:57 | FromDiscord_ | <SychoRyn> "the future is PAINN!" |
20:58:02 | FromDiscord_ | <SychoRyn> "I wanna throw up" |
20:58:11 | FromDiscord_ | <SychoRyn> "can we have this but the C++ logo 5 times?" |
20:58:16 | FromDiscord_ | <SychoRyn> "oh my God it's so cursed" |
20:58:21 | FromDiscord_ | <SychoRyn> "what the fuck is this shit" |
20:58:26 | FromDiscord_ | <SychoRyn> "This but with actual good langauges" |
20:58:27 | dom96 | Calinou, it's what happens when I develop an application after watching Trainspotting :P |
20:58:41 | lqdev[m] | Nim should really have a `--strict` switch, like Araq suggested |
20:58:41 | lqdev[m] | that would basically destroy Rust |
20:58:49 | FromDiscord_ | <djazz> first I installed Nim from my distro's package manager, later realized it was almost a year outdated. #choosenim |
20:58:53 | dom96 | Trivia: choosenim was initially called picknim, but then I went to see Trainspotting 2 and got inspired to call it "choosenim" :D |
20:59:00 | dom96 | (Araq wasn't happy :P) |
20:59:15 | Araq | yeah thanks for reminding me |
20:59:32 | FromDiscord_ | <djazz> unsafe { } |
20:59:39 | Araq | the *only* thing I cared about was the name... |
20:59:48 | Calinou | I use Choosenim equivalents for almost any programming language these days, so I'm not bound by distribution repositories |
20:59:59 | FromDiscord_ | <djazz> yeah |
21:00:03 | lqdev[m] | `(2 + 2).unwrap("Could not add 2 + 2")` |
21:01:50 | Calinou | heh |
21:01:56 | * | Vladar quit (Remote host closed the connection) |
21:02:24 | lqdev[m] | `when defined(strict): {.fatal: "There's an error somewhere in your code, go fix it".}` |
21:02:32 | lqdev[m] | ^ Rust mode for Nim |
21:02:43 | dom96 | So I have a crazy idea. I'll create a guerilla marketing campaign for Nim: I'll just create a shiny website promising a lot of things (just like V) and letting people know that I will release the source code in a month or so. |
21:02:52 | dom96 | Then once the time comes I'll just point people to Nim :P |
21:03:23 | dom96 | (The website I have in mind would of course have some random name for this imaginary language that would in reality just be Nim) |
21:03:39 | lqdev[m] | oh yes, brilliant idea |
21:04:03 | FromDiscord_ | <djazz> V stands for Vaporware |
21:04:05 | FromDiscord_ | <djazz> 😉 |
21:04:46 | FromDiscord_ | <djazz> Code releaes in 2 days. It was thanks to V I found Nim heh. I like Nim more. |
21:05:05 | FromDiscord_ | <SychoRyn> Are people actually interested in the shitstain that is V |
21:06:05 | Araq | so ... here is a real topic for you |
21:06:21 | PMunch | dom96, just try not to appear too salty :P |
21:06:24 | Araq | how come my twitch setup doesn't work anymore? |
21:06:26 | dom96 | rayman22201: again, thanks for writing that forum thread about async + spawn. Excited to see your progress :) |
21:06:42 | PMunch | dom96, link? |
21:06:46 | FromDiscord_ | <djazz> you use OBS, right? Araq |
21:06:52 | dom96 | PMunch, I might have done that already on twitter, oops |
21:06:54 | PMunch | Might be useful for the articles I'm writing |
21:06:56 | Araq | yes |
21:07:02 | PMunch | dom96, nah that was fine |
21:07:12 | dom96 | PMunch, https://forum.nim-lang.org/t/4952 |
21:07:13 | FromDiscord_ | <djazz> I use OBS a lot |
21:07:20 | FromDiscord_ | <djazz> What's the issue? |
21:08:16 | PMunch | I have honestly not been keeping tabs on V, although I have noticed there's a huge amount of hype around it. |
21:08:40 | * | natrys joined #nim |
21:09:01 | FromDiscord_ | <djazz> The V binaries were supposed to release today, but the creator delay them two days so they release with source. |
21:09:10 | FromDiscord_ | <SychoRyn> and I still wonder why the fuck nim isn't popular |
21:09:19 | PMunch | And the shoutout to Zig and Odin made it seem much more like a "look there are other, actually released, cool languages out there" than salt |
21:09:31 | lqdev[m] | it's just another language without any outstanding, revolutionary features, it's just a mix of the "best" things other languages brought |
21:09:32 | lqdev[m] | I'm not that hyped about it |
21:09:39 | PMunch | SychoRyn, it's getting there, slowly |
21:10:14 | * | FromDiscord_ <djazz> Nim. Since 2008. |
21:10:20 | Araq | I think ParaSail deserves some hype |
21:10:42 | PMunch | lqdev[m], yeah. TBH what I miss the most in other languages than Nim is the metaprogramming, sure the performance is great, it's easy to work with, and the type system is great. But Nims killer feature for me is the metaprogramming |
21:10:52 | dom96 | PMunch, yay, good :) |
21:11:04 | * | Araq is stealing stuff from ParaSail |
21:11:13 | PMunch | (In case that wasn't clear from all the stuff I use (and probably misuse) macros for :P) |
21:11:17 | dom96 | I'm also wondering if that company is even suspicious, I guess people living outside UK can somehow create a UK company |
21:11:29 | PMunch | dom96, yeah that's a thing |
21:11:34 | FromDiscord_ | <djazz> Nim needs a REPL. That seems to be what the kids like these days. |
21:11:49 | dom96 | Araq, 2019 is the year of COBOL |
21:11:56 | Araq | we have a REPL! |
21:12:09 | lqdev[m] | djazz: `nim secret` |
21:12:14 | Araq | no, we have hot code reloading |
21:12:15 | dom96 | Guess we need to show it off like V website :P |
21:12:17 | PMunch | It's super cheap to create a UK company, and many countries (mine included) allow you to create a "local office" sub-corporation that's cheaper than an actual corporation as long as you have a foreign "main" corporation |
21:12:20 | FromDiscord_ | <djazz> 😮 |
21:12:32 | Araq | I recently improved its documentation |
21:12:37 | FromDiscord_ | <djazz> Coolio! |
21:12:52 | dom96 | PMunch, cool, I suppose that has some nice tax benefits? |
21:13:01 | * | dom96 is way too much of a noob with this stuff |
21:13:22 | FromDiscord_ | <SychoRyn> hot code reloading is still pretty epic |
21:14:08 | * | vlad1777d_ quit (Ping timeout: 248 seconds) |
21:14:23 | dom96 | Do we have docs for hot code reloading? |
21:14:35 | FromDiscord_ | <djazz> so, what is the state of the repl? |
21:14:37 | rayman22201 | @dom96: np... I almost feel like I need to help @narimiran[m] and @PMunch write an async tutorial first lol.... |
21:14:49 | * | krux02 quit (Remote host closed the connection) |
21:14:57 | FromDiscord_ | <SychoRyn> Julia, nim and Kotlin are all I care about anymore. |
21:15:00 | FromDiscord_ | <djazz> @Araq need help with obs/twitch? |
21:15:02 | FromDiscord_ | <SychoRyn> lol |
21:15:04 | rayman22201 | We have a cool demo video of HCR lol |
21:15:12 | rayman22201 | Not much docs I think |
21:15:24 | Araq | well I wrote some |
21:15:34 | dom96 | Never mind docs, where are the articles? |
21:15:43 | PMunch | dom96, well I think it's less about tax reasons and more about being able to create a joint-stock company without a large up-front cost |
21:15:55 | dom96 | "Hot code reloading in Nim v0.20.0", come on, I can smell the HN upvotes |
21:16:08 | dom96 | /Someone/ just needs to write ittttt |
21:16:18 | Araq | it may surprise you but a day only has 24 hours |
21:16:38 | dom96 | PMunch, ahh, makes sense. |
21:17:10 | rayman22201 | Lol. What @Araq said... And we need sleep. |
21:17:22 | FromGitter | <Vindaar> Well, I played around with HCR just this morning to try to build a basic REPL with it. I failed miserably :P |
21:18:09 | dom96 | Araq, indeed, it's what you do with that day that counts |
21:18:18 | dom96 | It's time to prioritise marketing at least one a week |
21:18:22 | dom96 | even once a month would be an improvement |
21:18:29 | dom96 | you could surely write an article in one day |
21:20:13 | lqdev[m] | hot code reloading will be pretty useful for my game dev |
21:20:32 | FromDiscord_ | <djazz> ^ same |
21:20:43 | Araq | dom96, well "hot code reloading" is better done with a video demonstration |
21:21:05 | Calinou | oh wow, `nim secret` is actually a thing |
21:21:10 | Calinou | I expected an easter egg or something |
21:22:27 | FromDiscord_ | <SychoRyn> Guys lets go become patrons to V |
21:22:31 | FromDiscord_ | <SychoRyn> I love empty promises |
21:22:58 | rayman22201 | .... Give Araq your money instead lol |
21:23:58 | lqdev[m] | Calinou: I stumbled upon it by pressing shift + enter in VS Code. It's painful when I'm writing docs, I suddenly press the key combo and the terminal gets focused >:( |
21:26:42 | * | go|dfish quit (Ping timeout: 245 seconds) |
21:34:14 | FromDiscord_ | <Núkley> dude when V "comes out" i gotta compile poop.exe in it |
21:34:29 | FromDiscord_ | <djazz> I'm new to Nim and I'm wrapping a C lib with a converted header to nim. Should I keep the library's method prefix or remove them? `proc somelib_create*(...` or without the `somelib_` part? |
21:35:06 | lqdev[m] | depends on your preferences |
21:35:20 | dom96 | not really preferences |
21:35:21 | FromDiscord_ | <djazz> what do most other modules do? |
21:35:28 | dom96 | you're recommended to remove them |
21:35:35 | dom96 | Nim has modules so there is no need for them |
21:35:40 | lqdev[m] | you could convert all names to camel case if you really wanted |
21:35:41 | dom96 | c2nim can even remove them automatically for you |
21:35:52 | dom96 | there is a switch in there somewhere for that |
21:35:54 | FromDiscord_ | <djazz> yeah, can always `import nil` |
21:36:25 | FromDiscord_ | <djazz> I used nimterop, worked much better than c2nim |
21:36:43 | FromDiscord_ | <djazz> well, the toast tool it comes with |
21:36:57 | lqdev[m] | then you can use cPlugin to modify the names |
21:37:26 | shashlick | @rayman22201 - reason i asked about constructors is that saying `var x: sharedString` just initializes to nil but still seems okay so far |
21:37:46 | FromDiscord_ | <djazz> I don't like the output of it, I am changing quite a lot manually. |
21:38:02 | FromDiscord_ | <djazz> Will try make a nimterop script for it later when I got something I like |
21:38:22 | shashlick | what don't you like @djazz |
21:39:24 | FromDiscord_ | <djazz> `{.importc: "struct SomeStructFromLib", header: headersomelib, bycopy.}` for example |
21:39:40 | FromDiscord_ | <djazz> requires loading the .h into nim's C code |
21:40:08 | FromDiscord_ | <djazz> and the way enums are outputted with some macro |
21:40:42 | rayman22201 | @shashlick, I figured as much. There really isn't a way around that behavior. As you have already seen lol, Nim has special treatment for the built in String, Seq, (and recently Table). Those types get "auto-initialized". That was mainly for convenience, and because people got confused when these types didn't just magically auto-init. |
21:40:45 | shashlick | only way to support C enums in nim world |
21:41:01 | FromDiscord_ | <djazz> Someone already made this lib a nim module so I'm comparing it to what I've got. |
21:41:12 | FromDiscord_ | <djazz> https://github.com/ul/soundio/blob/master/src/soundio.nim |
21:41:17 | * | go|dfish joined #nim |
21:41:22 | FromDiscord_ | <djazz> (this is the existing one) |
21:41:26 | lqdev[m] | hey, I made a soundio wrapper |
21:41:35 | FromDiscord_ | <djazz> soundio ❤ |
21:41:40 | * | solitudesf quit (Ping timeout: 244 seconds) |
21:41:41 | lqdev[m] | see https://github.com/liquid600pgm/rapid/blob/master/src/rapid/lib/soundio.nim |
21:42:05 | lqdev[m] | I use it for sound output in rapid/audio, pretty nice library |
21:42:17 | FromDiscord_ | <djazz> ah nice, it compiles it too without cmake? heh |
21:42:43 | lqdev[m] | yes, I use pkg-config to check for available backends on Linux |
21:42:46 | FromDiscord_ | <SychoRyn> LOL I GOT THE ENTIRE |
21:42:48 | FromDiscord_ | <SychoRyn> HOPSON DISCORD |
21:42:51 | FromDiscord_ | <SychoRyn> TO ARGUE |
21:42:52 | FromDiscord_ | <SychoRyn> OVER V |
21:43:02 | shashlick | nice @lqdev |
21:43:04 | lqdev[m] | nice |
21:43:26 | FromDiscord_ | <djazz> @lqdev[m] nice I havent seen rapid before |
21:43:54 | lqdev[m] | it's still a wip, I'm developing it mainly for my own usage |
21:44:09 | FromDiscord_ | <djazz> I'm making a little game too |
21:44:17 | FromDiscord_ | <djazz> It's in C++ currently. |
21:44:33 | lqdev[m] | my game's currently in Lua (Love2D) |
21:44:45 | dom96 | SychoRyn: Hopson? |
21:44:51 | FromDiscord_ | <djazz> Looking forward to link libmpv to nim! heh |
21:44:52 | lqdev[m] | see https://github.com/liquid600pgm/planet-overgamma |
21:44:54 | shashlick | @rayman22201 - here's where i am so far - http://ix.io/1Ml3/nim |
21:45:06 | FromDiscord_ | <SychoRyn> Hopson, he's like the youtuber who's like |
21:45:11 | FromDiscord_ | <SychoRyn> YO GUYS I MADE MINECRAFT IN C++ |
21:45:13 | FromDiscord_ | <SychoRyn> I'M SO EPIC |
21:45:22 | FromDiscord_ | <djazz> ahahah |
21:45:46 | FromGitter | <kayabaNerve> So why is V so controversial? |
21:45:59 | Araq | guys, this is #nim |
21:46:26 | lqdev[m] | kayabaNerve: it promises a lot and the deadline is constantly getting pushed around |
21:46:44 | Araq | to argue about V you can join HN/reddit/mambachat |
21:47:26 | FromDiscord_ | <djazz> @lqdev[m] > TODO: retrieve version from CMakeLists.txt? |
21:47:39 | FromDiscord_ | <djazz> I link to an already compiled .so |
21:47:59 | lqdev[m] | could be a thing to do in the future |
21:48:12 | lqdev[m] | shouldn't be difficult to add, but I don't really need it |
21:48:14 | FromDiscord_ | <djazz> How well does this crosscompile? |
21:48:48 | lqdev[m] | well, nimterop does not support crosscompiling from Linux to Windows so I have no way of checking 🤷♂️ |
21:48:58 | FromDiscord_ | <djazz> ah |
21:49:38 | lqdev[m] | I tried compiling rapid's t_window on my sister's Windows laptop, toast couldn't run because of some missing DLLs |
21:49:46 | dom96 | Araq, some conversation here doesn't hurt. It builds a sense of community. |
21:50:03 | FromDiscord_ | <djazz> MingW is pretty cool tho |
21:50:35 | dom96 | kayabaNerve: https://twitter.com/d0m96/status/1141811379407425537 |
21:51:02 | lqdev[m] | rapid's gfx module did run before I switched to nimterop, though |
21:51:37 | dom96 | SychoRyn: You should get them to chat about Nim :D |
21:52:01 | rayman22201 | @shashlick, I just did a quick look, but looks good. The wrapper object for the pointer is the way to go. I tried to explain that to you yesterday, but @Araq did a better job of explaining it lol. |
21:52:14 | rayman22201 | well, remember your locks of course :-P |
21:52:16 | Araq | hardly |
21:52:27 | FromDiscord_ | <djazz> that Volt thing, stealing cookie/credentials, I don't even |
21:52:31 | PMunch | Hmm, parent.neighbours.len works fine, but parent.neighbours[corner] = newneighbour fails with a nil exception.. |
21:55:51 | FromDiscord_ | <SychoRyn> I tried but they said it was bad language :((( @dom96 |
21:56:04 | FromDiscord_ | <SychoRyn> I tried but they said it was bad language :((( `@dom96` |
21:56:05 | FromDiscord_ | <treeform> Who said this? |
21:56:28 | FromDiscord_ | <SychoRyn> |
21:56:29 | FromDiscord_ | <SychoRyn> https://cdn.discordapp.com/attachments/371759389889003532/591385905005068318/unknown.png |
21:57:17 | FromDiscord_ | <djazz> Here is a tip for those using dynlib and don't want to mess with LD_LIBRARY_PATH or RPATH: `dynlib: "$ORIGIN/libs/somelib.so"` 😉 |
21:57:50 | FromDiscord_ | <treeform> I do `dynlib: "somelib.so"` then copy it into the root. |
21:57:54 | FromDiscord_ | <djazz> then you can ship libs in a folder next to exe |
21:58:00 | FromDiscord_ | <treeform> then commit it so it does not change on me. |
21:58:03 | dom96 | SychoRyn: did they elaborate? |
21:58:10 | FromDiscord_ | <SychoRyn> nope |
21:58:19 | * | PMunch quit (Remote host closed the connection) |
21:58:19 | dom96 | SychoRyn: push them then :) |
21:58:44 | * | skaruts joined #nim |
21:59:09 | FromDiscord_ | <treeform> @djazz what is the difference between `dynlib: "$ORIGIN/libs/somelib.so"` vs `dynlib: "libs/somelib.so"`? Where does `$ORIGIN` the OS? |
21:59:11 | FromDiscord_ | <SychoRyn> there's like 20 people in the chat rn flaming over V rn, what have I done. |
21:59:15 | FromDiscord_ | <treeform> @djazz what is the difference between `dynlib: "$ORIGIN/libs/somelib.so"` vs `dynlib: "libs/somelib.so"`? Where does `$ORIGIN` come from the OS? |
21:59:26 | FromDiscord_ | <djazz> @treeform it comes from `ld` |
21:59:37 | FromDiscord_ | <djazz> http://man7.org/linux/man-pages/man8/ld.so.8.html |
21:59:57 | FromDiscord_ | <treeform> I see. |
22:00:20 | Araq | wow |
22:00:31 | FromDiscord_ | <djazz> $ORIGIN is not turned into a variable by the progam, but by ld |
22:00:38 | Araq | $ORIGIN is what I've been looking for all these years |
22:00:47 | FromDiscord_ | <treeform> probably will not work on windows/vcc? |
22:00:48 | FromDiscord_ | <djazz> and if it fails you get `could not load: $ORIGIN/somelib.so` |
22:00:59 | FromDiscord_ | <djazz> works on linux and probably macos |
22:01:16 | FromDiscord_ | <treeform> But will `dynlib: "libs/somelib.so"` do the same thing? |
22:01:23 | Araq | no |
22:01:25 | FromDiscord_ | <djazz> 🤷 |
22:01:42 | * | nolanv quit (Read error: Connection reset by peer) |
22:01:59 | FromDiscord_ | <treeform> I guess i always used only `dynlib: "somelib.so"` |
22:02:11 | FromDiscord_ | <treeform> and put my dll/so/dylib into same folder |
22:02:18 | FromDiscord_ | <djazz> on macos, try these https://wincent.com/wiki/%40executable_path%2C_%40load_path_and_%40rpath |
22:02:44 | FromDiscord_ | <SychoRyn> After I get experienced with nim I wanna write a mod player. |
22:02:49 | FromDiscord_ | <djazz> @Araq you're welcome!! 😃 |
22:02:58 | FromDiscord_ | <SychoRyn> I love amiga mods |
22:03:09 | FromDiscord_ | <djazz> tracker music ftw |
22:03:37 | FromDiscord_ | <SychoRyn> is it just me or are trackers easier to use than DAWs |
22:04:02 | FromDiscord_ | <djazz> make a nim module of libopenmpt |
22:04:11 | FromDiscord_ | <djazz> if it doesnt exist already |
22:04:17 | lqdev[m] | SychoRyn: they are |
22:04:36 | FromDiscord_ | <SychoRyn> like I was messing with one called SunVox the other day |
22:04:51 | FromDiscord_ | <SychoRyn> and it was so much easier than FL studio I thought "why do people even bother with DAWs?" |
22:04:59 | FromDiscord_ | <djazz> 😄 |
22:05:01 | zestyr | SychoRyn: What language is Volt written in? |
22:05:03 | zestyr | V. It's a new language I created to develop Volt. You can read about it here. |
22:05:05 | zestyr | Volt uses native UI APIs: (Cocoa on macOS, Win32 API on Windows, GTK+ on Linux). |
22:05:08 | zestyr | woops, pasted wrong text |
22:05:10 | zestyr | https://github.com/johnnovak/nim-mod |
22:05:20 | lqdev[m] | DAWs are more powerful, that's the thing |
22:05:42 | FromDiscord_ | <djazz> nimmod? nimrod reference? ;D |
22:06:16 | shashlick | @Araq is there something equivalent to addQuitProc() for threads - when the thread is done |
22:06:25 | FromDiscord_ | <djazz> got a collection of xm mod s3m it j2b and other formats somewhere... |
22:06:48 | shashlick | meh - onThreadDestruction |
22:06:52 | shashlick | should read the manual man |
22:07:14 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
22:08:16 | FromDiscord_ | <SychoRyn> aw someone already made a tracker :(((((( |
22:08:17 | FromDiscord_ | <SychoRyn> lol |
22:08:50 | skaruts | hey guys, is there a way to have a proc argument of type bool with nil as default value? |
22:08:50 | * | nolanv joined #nim |
22:08:52 | lqdev[m] | that doesn't prevent you from writing your own one |
22:08:57 | FromDiscord_ | <djazz> This is the (WIP) game I'm trying to port to Nim. Quite light code and a couple of C lib dependencies. https://djazz.se/nas/screencapture/singsing.mp4 @lqdev[m] @Calinou |
22:09:00 | skaruts | like, proc new_tile(obstacle:bool, opaque:bool=nil) |
22:09:07 | lqdev[m] | skaruts: no, `bool` cannot be nil. |
22:09:31 | skaruts | I mean, is there a workaround to get nil or bool |
22:09:59 | Araq | yeah, use a custom enum with better names |
22:10:00 | FromDiscord_ | <djazz> (I'm rewriting a game written in Pascal) |
22:10:20 | Araq | type Opaqueness = enum yes, no, maybe |
22:10:28 | FromDiscord_ | <SychoRyn> broh |
22:10:32 | FromDiscord_ | <SychoRyn> pony games,.,..,,.,, |
22:10:40 | FromDiscord_ | <SychoRyn> rad |
22:11:01 | FromDiscord_ | <SychoRyn> also I'm learning to use vim to be the ultimate neet |
22:11:06 | skaruts | might be overkill, this is basically so that if the opacity argument is ignored in the call, tile.opaque takes the same value as 'obstacle' |
22:11:08 | FromDiscord_ | <djazz> it is whatever you feeds it with. This was a song from My Little Karaoke yes. |
22:11:18 | FromDiscord_ | <djazz> basically Singstar clone |
22:11:45 | FromDiscord_ | <djazz> my version is very WIP tho, basic pitch detection, video/music playing |
22:11:48 | lqdev[m] | skaruts: you can make an overload |
22:11:58 | skaruts | oh yea... |
22:12:02 | skaruts | forgot that! |
22:12:08 | skaruts | :) thanks |
22:12:21 | FromDiscord_ | <SychoRyn> I'm trying to backup my stuff on my C: drive |
22:12:45 | FromDiscord_ | <SychoRyn> but last night my pc went to sleep and like I lost all my progress and I'm getting real sick of it |
22:12:45 | FromDiscord_ | <SychoRyn> https://cdn.discordapp.com/attachments/371759389889003532/591390004731969536/unknown.png |
22:12:51 | FromDiscord_ | <SychoRyn> I might just format it and say fuck it who knows |
22:13:22 | FromDiscord_ | <djazz> rsync ftw |
22:13:33 | lqdev[m] | welcome to NTFS, where drives have letters and you cannot have a /home mount point |
22:13:52 | FromDiscord_ | <djazz> No place like $HOME |
22:14:01 | FromDiscord_ | <djazz> or ~ |
22:14:16 | lqdev[m] | ~ sweet ~ |
22:14:21 | FromDiscord_ | <djazz> ⭐ |
22:14:33 | lqdev[m] | we should make this into a poster |
22:15:18 | FromGitter | <kayabaNerve> Can I write a macro for a key word? |
22:15:29 | FromGitter | <kayabaNerve> Specifically, I want to write my own case statement. |
22:15:45 | lqdev[m] | I don't think so |
22:16:22 | Araq | you can do that, somewhat |
22:17:04 | FromDiscord_ | <SychoRyn> I'm literally getting ready to wipe my windows partition and get linux |
22:17:07 | FromDiscord_ | <SychoRyn> lol |
22:17:12 | FromGitter | <kayabaNerve> macro case*(instance: MyType, codeBlock: untyped) |
22:17:19 | * | FromDiscord_ <djazz> Do it |
22:17:21 | FromDiscord_ | <SychoRyn> OH SORRY |
22:17:24 | FromDiscord_ | <SychoRyn> GNU PLUS LINUX |
22:17:31 | Araq | https://nim-lang.org/docs/manual.html#macros-case-statement-macros |
22:17:41 | FromDiscord_ | <SychoRyn> I've messed with a dualboot for a while but I wanna get it to be my main |
22:17:45 | Araq | for some reason that wasn't moved to the experimental manual |
22:18:09 | FromDiscord_ | <djazz> Speaking of GNU, anyone here dealt with linking to older GLIBC? |
22:18:23 | FromDiscord_ | <djazz> To get program running on older distros |
22:18:24 | FromGitter | <kayabaNerve> Thanks Araq |
22:18:41 | FromDiscord_ | <djazz> musl is out of the question, I need to load SDL2 etc. |
22:18:43 | Araq | it can give us "real" pattern matching |
22:18:54 | Calinou | I haven't, personally I just build on an older distro. What about using https://github.com/wheybags/glibc_version_header directly with Nim? I haven't tried |
22:19:08 | FromDiscord_ | <djazz> I tried that with C++ and ran into some issues |
22:19:28 | FromDiscord_ | <djazz> rn i got a docker env for my C++ game that is based on centos:7 |
22:20:29 | FromDiscord_ | <djazz> remember, all dependencies need to be compiled on older glibc as well |
22:20:41 | FromGitter | <kayabaNerve> Looks to be exactly what I wanted. |
22:21:03 | FromDiscord_ | <djazz> I think I had issues with ffmpeg or something using that Calinou |
22:21:14 | Calinou | I can imagine that |
22:21:21 | FromGitter | <kayabaNerve> I'm working with an object heierarchy; I want to take in a root object, match for sub types, and provide it with a silent cast. |
22:21:25 | Calinou | https://github.com/intoli/exodus is pretty nice too, but you can't use it if your program needs OpenGL libraries at one point :'( |
22:21:33 | FromGitter | <kayabaNerve> *hierarchy |
22:21:55 | Calinou | @djazz what about building a Flatpak? |
22:22:14 | Calinou | it might be a good alternative, provided your app reacts well to sandboxing |
22:22:30 | FromDiscord_ | <djazz> Flatpak have issues with accessing nvidia OpenGL |
22:23:08 | FromDiscord_ | <djazz> exodus looks like magic. is it real? 😄 |
22:23:46 | * | jasper joined #nim |
22:24:06 | zestyr | Have a look at this: https://gist.github.com/flibitijibibo/b67910842ab95bb3decdf89d1502de88 |
22:24:22 | FromDiscord_ | <djazz> Read that many times |
22:25:00 | FromDiscord_ | <djazz> I got a something working already (docker env), just wondering if anyone else had to deal with it |
22:27:12 | FromDiscord_ | <djazz> I should rewrite the bundling script in Nim sometime. Currently in python https://github.com/UltraStar-Deluxe/USDX/blob/master/dists/linux/scan_libs.py |
22:28:00 | FromDiscord_ | <djazz> wont work with dynlib/dlopen though, libs need to be linked |
22:28:32 | FromDiscord_ | <djazz> it will copy libs recursively for bundling |
22:30:18 | FromDiscord_ | <djazz> was inspired by macdylibbundler |
22:37:45 | * | clyybber quit (Quit: WeeChat 2.5) |
22:43:21 | * | dGtlc3 quit (Quit: Leaving) |
22:48:57 | FromGitter | <kayabaNerve> How do I convert a nnkSymbol to nnkIdent? StrVal? |
22:49:56 | * | natrys quit (Quit: natrys) |
22:49:57 | FromGitter | <kayabaNerve> Asking because I know there's a reason they're different and I figure strval won't work correctly 100% of the time, if at all. |
22:51:02 | * | elrood quit (Remote host closed the connection) |
22:51:24 | * | abm joined #nim |
23:08:57 | FromDiscord_ | <SychoRyn> Guys Discord officially supports syntax highlighting for nim |
23:08:58 | FromDiscord_ | <SychoRyn> rad |
23:09:15 | * | jasper quit (Ping timeout: 256 seconds) |
23:11:11 | dom96 | :o |
23:12:56 | * | gangstacat quit (Ping timeout: 258 seconds) |
23:13:42 | lqdev[m] | it did support it back when I started using Nim (December 2018), so it should've been here for a while now |
23:15:54 | FromDiscord_ | <exelotl> Yeah I'm sure I've used it before |
23:17:44 | * | gangstacat joined #nim |
23:18:08 | FromGitter | <Vindaar> @kayabaNerve strVal is fine. Take it from Araq himself ;) https://irclogs.nim-lang.org/20-06-2019.html#08:33:24 (gotta replace that `?` with `#` in the playground link now; line 7) |
23:20:08 | dom96 | if only the playground followed convention... |
23:20:28 | dom96 | ?ix=... makes far more sense than #ix=.... |
23:20:44 | dom96 | (Sorry PMunch) |
23:21:26 | * | dwdv quit (Ping timeout: 272 seconds) |
23:21:35 | * | arecaceae quit (Remote host closed the connection) |
23:21:39 | FromDiscord_ | <SychoRyn> That server is still actually like arguing over V |
23:21:41 | FromDiscord_ | <SychoRyn> what have I done |
23:21:44 | FromDiscord_ | <SychoRyn> this is amazing |
23:22:14 | * | arecaceae joined #nim |
23:24:58 | FromGitter | <alehander42> Offtopic |
23:25:05 | FromGitter | <alehander42> :P |
23:25:43 | * | abm quit (Quit: Leaving) |
23:30:31 | FromGitter | <kayabaNerve> Thanks @Vindaar |
23:31:02 | FromGitter | <kayabaNerve> SychoRyn: It has for a while, but I'm convinced it's not a dedicated highlighter vs one ripped from another lang like Python. |
23:32:06 | * | PrimHelios quit (Ping timeout: 268 seconds) |
23:33:09 | FromGitter | <kayabaNerve> I think I found a bug in an experimental feature. |
23:33:57 | FromGitter | <kayabaNerve> ```code paste, see link``` ⏎ ⏎ Commenting out the * in loadHolders places the error ten lines lower. :thinking: [https://gitter.im/nim-lang/Nim?at=5d0c17e5e7267a62a90ffee1] |
23:34:17 | * | PrimHelios joined #nim |
23:34:19 | FromGitter | <kayabaNerve> I did check what I rewrote the case to. Nothing looks off. |
23:39:06 | * | PrimHelios quit (Ping timeout: 252 seconds) |
23:41:45 | * | PrimHelios joined #nim |
23:42:36 | FromGitter | <kayabaNerve> Issue created with a MWE :D |