<< 16-01-2022 >>

00:00:13FromDiscord<ajusa> In reply to @C7c3r0 "hi again, I see": float64, though I believe float by default is a double
00:00:43FromDiscord<ajusa> if you're looking for a float the way Java defines it I think you'd want a float32
00:00:50FromDiscord<C7c3r0> thank you!
00:05:47FromDiscord<leorize> small nit\: Nim is a word, please use normal casing for it \:p
00:19:20arkanoidIsofruit, thanks!
00:22:46FromDiscord<ajusa> In reply to @Elegantbeef "Well i'm off to": Hm, I think I have another bug with constr? Renaming the field doesn't seem to have worked, so it seems that the `result.field = default` syntax doesn't actually work at all?
00:23:17FromDiscord<Elegantbeef> Are you sure?
00:24:18FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Mk0
00:24:43FromDiscord<ajusa> hope that's not a bug on my end
00:24:44FromDiscord<Elegantbeef> Can you give me an example i can run ๐Ÿ™‚
00:25:07FromDiscord<ajusa> Yeah, that would be helpful wouldn't it. Give me a sec ๐Ÿ˜„
00:27:35FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Mk1
00:33:56FromDiscord<Elegantbeef> Hmm yea weird AST here
00:52:03*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzโ€ฆ)
01:30:44FromDiscord<retkid> is there any 3d plottig libraris
01:30:47FromDiscord<retkid> (edit) "libraris" => "libraries"
01:30:49FromDiscord<retkid> (edit) "plottig" => "plotting"
01:31:00FromDiscord<retkid> Jesus i need to stop editing sorry
01:32:12*adigitoleo quit (Remote host closed the connection)
01:32:55*adigitoleo joined #nim
01:37:55arkanoidany1 has experience with nimqml here? I've a simple question
01:45:17FromDiscord<Elegantbeef> @ajusa\: 1.0.3 is out now should resolve your issues
01:45:23FromDiscord<Elegantbeef> Hopefully there arent any more issues
01:48:19*krux02 quit (Remote host closed the connection)
02:06:03FromDiscord<The Bron Jame (real)> How to make the default output source not the vscode output window
02:06:13FromDiscord<The Bron Jame (real)> i cant enter anything with the output window
02:10:48FromDiscord<Elegantbeef> What do you mean?
02:16:50FromDiscord<huantian> try the terminal option in your launch.json https://media.discordapp.net/attachments/371759389889003532/932096024833572934/unknown.png
02:17:03FromDiscord<huantian> assuming that's what you mean
02:25:08*neurocyte0917095 joined #nim
02:27:24*neurocyte091709 quit (Ping timeout: 250 seconds)
02:27:24*neurocyte0917095 is now known as neurocyte091709
02:36:31FromDiscord<ynfle> sent a code paste, see https://paste.rs/wMx
02:52:33NimEventerNew Nimble package! grab - grab statement for importing Nimble packages, similar to Groovy's Grape, see https://github.com/hlaaftana/grab
02:52:33NimEventerNew Nimble package! astdot - Prints a dot graph of a nim ast dumped using the `dumpTree` macro., see https://github.com/Rekihyt/astdot
02:55:32FromDiscord<ynfle> In reply to @ynfle "<@!696333749570371585> (Which is the": I guess that's the wrong one
02:57:23FromDiscord<Elegantbeef> I think he's been using matrix a bit so you've probably pinged him
03:03:46*arkurious quit (Quit: Leaving)
03:05:45arkanoidis defer a good idiom or should I avoid it
03:05:47arkanoid?
03:06:24FromDiscord<Elegantbeef> I think it's fine, though i dont generally use it
03:07:24arkanoidk
03:15:43*adigitoleo quit (Read error: Connection reset by peer)
03:16:08*adigitoleo joined #nim
03:45:11nixfreaknim[m]How would you create a proc for converting Celcius to Fahrenheit ? Does it make sense to try to create a proc ?
03:46:07FromDiscord<Elegantbeef> Depending on what you're after might want to use distincts
03:48:38nixfreaknim[m]just a simple gui , label , textbox label, textbox , user inputs a number and calculate to Fahrenheit
03:49:00FromDiscord<Elegantbeef> Ah then yea a proc is fine
03:50:23nixfreaknim[m]ok so proc cToF*(c: int): = ?
03:50:39nixfreaknim[m]then var the formula
03:53:16FromDiscord<that_dude> I mean consider using a float instead of int
03:53:24FromDiscord<that_dude> (edit) "I mean" => "I'd"
03:55:12nixfreaknim[m]Its a user so I was thinking int then parseFloat
03:56:39FromDiscord<Elegantbeef> What i'd do is https://play.nim-lang.org/#ix=3Mlm cause i'm a silly bastard that likes distincts ๐Ÿ˜›
03:56:42FromDiscord<that_dude> Why not just keep it float? it allows much better accuracy if needed/wanted
03:59:48nixfreaknim[m]oh lol , ok so you can put the formula in the proc
04:00:07FromDiscord<Elegantbeef> Have you written Nim before?
04:00:23FromDiscord<huantian> In reply to @Elegantbeef "What i'd do is": I mean distincts are pretty neato
04:00:27nixfreaknim[m]yep , just not formulas in the proc
04:00:47FromDiscord<Elegantbeef> Well they're callable code
04:00:58FromDiscord<Elegantbeef> Yea i love distincts huan
04:01:09FromDiscord<Elegantbeef> Which reminds me @SirOlaf have you got any further?
04:01:21nixfreaknim[m]I just thought there was a better way
04:02:27FromDiscord<Elegantbeef> nah procs are for when you want to put a nice package on callable code
04:04:15nixfreaknim[m]great
04:04:32nixfreaknim[m]thanks for clearing that up for me
04:05:05FromDiscord<that_dude> I still struggle to find reasons to use distincts :/ I just use their nondistinct versions or custom objects.
04:05:06*Guest10 joined #nim
04:05:32FromDiscord<Elegantbeef> I use them all the time they have so many different usages
04:05:53FromDiscord<Elegantbeef> Dont want to pass a `isX` flag make two distincts
04:06:21FromDiscord<that_dude> I guess I don't use overloading much either tbh
04:06:27FromDiscord<that_dude> I don't use a lot of things lol
04:06:45FromDiscord<huantian> overloading is greatโ†ตalso `type or type` and `when is` is also fun
04:06:59FromDiscord<Elegantbeef> I typically use distinct for safety or clarity
04:07:11FromDiscord<Elegantbeef> Like for instance a trig function that takes radian
04:07:18FromDiscord<Rika> i dont use distincts too often
04:07:27FromDiscord<Elegantbeef> Clarity and safety, no one can accidently pass the wrong value in
04:08:17FromDiscord<Elegantbeef> I cant overstate how much i love them
04:08:47FromDiscord<Rika> if you overuse them they can be annoying
04:09:05FromDiscord<Elegantbeef> I think that's not overused and incorrectly used
04:09:05*Guest10 quit (Client Quit)
04:09:15FromDiscord<Rika> overuse is incorrect use.................
04:09:34FromDiscord<Elegantbeef> Tomato tomato
04:09:48FromDiscord<Rika> pomegranate pomme grenade?
04:10:12FromDiscord<huantian> POM Granite table top
04:10:57FromDiscord<Elegantbeef> Anywho they're lovely, and use them where they make sense and you make a nicer API/happier coders
04:11:29FromDiscord<Elegantbeef> To me `script: NimScriptFile or NimScriptPath` instead of `script: string, isFile: bool` is just a much nicer api
04:13:14arkanoidI'm using collect to loop a JsonNode that's a sequence of nodes and return a filtered JsonNode, what should I put in place of newSeq?
04:13:43FromDiscord<Elegantbeef> `newJsObject()`?
04:13:53FromDiscord<Elegantbeef> I dont know if collect can be used on non generic procedures, dont recall
04:14:18arkanoidwait, just found it's newJArray
04:14:54arkanoidwait, no, it doesnt like it
04:14:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Mly
04:24:11arkanoidthanks! it works even with newJArray instead of newJObject (not sure about the difference here)
04:40:46FromDiscord<treeform> In reply to @arkanoid "is defer a good": https://github.com/nim-lang/RFCs/issues/236
04:46:57*Jjp137 quit (Quit: Leaving)
04:48:14*noeontheend quit (Ping timeout: 250 seconds)
04:50:22*Jjp137 joined #nim
04:53:02*adigitoleo_ joined #nim
04:53:31*adigitoleo quit (Ping timeout: 250 seconds)
05:13:44arkanoidtreeform, oh, that's something important
05:16:03FromDiscord<Rika> Please read the whole discussion though xd
05:22:59*adigitoleo_ is now known as adigitoleo
05:42:46FromDiscord<Bung> @ElegantBeef I see new update, what about procs in fields ?
05:47:30*adigitoleo_ joined #nim
05:48:55FromDiscord<Elegantbeef> They're nil'd on conversion
05:48:59*adigitoleo quit (Ping timeout: 250 seconds)
05:50:30*adigitoleo_ quit (Remote host closed the connection)
05:51:13*adigitoleo joined #nim
05:52:00FromDiscord<Elegantbeef> I messed up a bit, now they're properly Nil'd
05:52:14FromDiscord<Bung> okay it haven't been done right ? I'd like to what happen after that
05:52:28FromDiscord<Elegantbeef> What do you mean?
05:52:50FromDiscord<Bung> oh , I see you push code 37 seconds ago
05:53:08FromDiscord<Elegantbeef> Yea i thought i had them working but i realized just now i didnt handle them properly
05:53:17FromDiscord<Elegantbeef> need to make a test for it
05:55:07*ad_absurdum joined #nim
05:57:08*ad-absurdum quit (Ping timeout: 250 seconds)
05:57:16FromDiscord<Bung> found new error `/Users/bung/.nimble/pkgs/karax-#master/karax/vdom.nim(159, 5) Error: Nimscripter cannot support objects that use when statments. A proc that uses this object is the issue.`
05:58:12FromDiscord<Bung> sent a code paste, see https://paste.rs/HL8
05:59:27FromDiscord<Elegantbeef> When statements are complicated to support, i do need to make `parseObject` not messy but i stand by that error atm
06:00:41FromDiscord<Bung> can simply ignore this part as `when false` ?
06:00:52FromDiscord<Elegantbeef> I guess i can technically support `when false` or `when true` but the issue is that there are no guarantees that objects on both sides match signatures after the when statement goes through
06:01:37FromDiscord<Elegantbeef> Indeed in this case
06:08:39FromDiscord<Bung> another thinking , with ast parser I think the returnType can be automatically filled
06:08:55FromDiscord<Elegantbeef> How can the returnType be filled?
06:09:07FromDiscord<Elegantbeef> It can only be filled in the case you supply do `addCallable`
06:09:42FromDiscord<Elegantbeef> I mean you're sorta right i guess it can be filled but the Nim programs types do not match the VM's types
06:09:54FromDiscord<Elegantbeef> So you can technically have different names and it'll work fine
06:11:04FromDiscord<Bung> in this case can assuming they're same name in both side.
06:11:25FromDiscord<Elegantbeef> I mean that cannot be done anyway
06:11:36FromDiscord<Elegantbeef> The types on Nim have to be statically known
06:12:50FromDiscord<Elegantbeef> Remember the that nimscript program is 100% detatched from the Nim program
06:13:05FromDiscord<Elegantbeef> There is no way to intuit the type from a program you dont have at CT
06:19:02FromDiscord<Bung> I dont know , I think you can attach a pragma to handle this or just emit same name on script side
06:20:30FromDiscord<Elegantbeef> Or just manually supply the return type so we can have multiple nimscript modules implemented and dont have to track where they are
06:22:26FromDiscord<Bung> yeah , nvm , handle `when false` first.
06:24:27FromDiscord<Elegantbeef> Well that was done but i was trying to support `when true` aswell but that's nobueno
06:25:32FromDiscord<Bung> oh god, so quick
06:27:58FromDiscord<Bung> ` Error: type mismatch: got 'NimNode' for 'โ†ตnil' but expected 'Node = ref Node:ObjectType'`
06:28:46FromDiscord<Elegantbeef> You distracted me with the demanding tone ๐Ÿ˜›
06:29:55FromDiscord<Elegantbeef> Actually i dont know what code causes that
06:30:00FromDiscord<Bung> is this suppose to be error or bug ?
06:30:08FromDiscord<Elegantbeef> My test passes
06:30:28FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/Jf5
06:31:00FromDiscord<Bung> I think it occurs when handle `dom: Node`
06:33:02FromDiscord<Elegantbeef> Well i guess i dont properly handle these complex objects still
06:33:20FromDiscord<Elegantbeef> Someone gets to rewrite my parsing logic soon i suppose
06:34:02FromDiscord<Bung> okay, that's a bug
06:35:11FromDiscord<Elegantbeef> Well the parsing should work on any object
06:36:14FromDiscord<Bung> Do u think I can done my project with nimscripter ? I dont know what problem I'll face to
06:36:24*ad_absurdum quit (Quit: Leaving)
06:37:02FromDiscord<Elegantbeef> I mean it's worked fine for my stuff, but it's always been less complex
06:37:39FromDiscord<Elegantbeef> Large complex objects are good tests for the interface
06:37:57FromDiscord<Bung> okay, I'll be your test man
06:38:42FromDiscord<Bung> anyway ,I dont have alternative solution.
06:39:39FromDiscord<Elegantbeef> Well you could use another scripting language ๐Ÿ˜›
06:40:26FromDiscord<Bung> I dont know any other script language intergrate well with ni m
06:40:55FromDiscord<Rika> Lua
06:41:02FromDiscord<Bung> also use nim both sides cooler.
06:41:04FromDiscord<Rika> Lua works relatively well
06:41:27FromDiscord<Bung> which lib ?
06:41:33FromDiscord<Rika> In reply to @Bung "also use nim both": I mean yes sure but if you have requirements you donโ€™t really have a choice no?
06:41:55FromDiscord<Bung> yeah, I also interested in
06:42:13FromDiscord<Elegantbeef> Technically Nimscript isnt that magical here all i've done is use macros to automate the bridge
06:42:19FromDiscord<Elegantbeef> You can do the same thing with any VM
06:44:15FromDiscord<Bung> that's harder , as nimscripter provide simple api for me.
06:45:06FromDiscord<Elegantbeef> Yea i mean ideally nimscripter works, but you clearly like to hit the wall of what it can presently handle ๐Ÿ˜€
06:45:53FromDiscord<Elegantbeef> I can say for certainty it does handle JSON now ๐Ÿ˜€
06:49:51FromDiscord<Bung> that's wonderfull thing
07:40:24*vicecea quit (Remote host closed the connection)
07:40:52*vicecea joined #nim
08:46:15FromDiscord<evil> is there a format proc that takes in a string and a seq[string]?
08:51:13FromDiscord<Rika> https://nim-lang.org/docs/strutils.html#%25%2Cstring%2CopenArray%5Bstring%5D
09:29:09*jjido joined #nim
09:29:49*krux02_ joined #nim
09:44:58FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Mpe
09:45:23FromDiscord<Isofruit> (edit) "https://play.nim-lang.org/#ix=3Mpe" => "https://play.nim-lang.org/#ix=3Mpf"
09:45:58FromDiscord<Rika> You can always use the hack called โ€œcompilesโ€
09:46:13FromDiscord<Isofruit> That... is actually fair
09:46:16FromDiscord<Isofruit> Not beautiful
09:46:17FromDiscord<Isofruit> But fair
09:46:53FromDiscord<Rika> Well unfortunately I donโ€™t know of any other way or method to do what you want
09:49:22FromDiscord<Elegantbeef> You can do some funky stuff like `proc(id: T)(triggerDeleteSignals)`
09:49:44FromDiscord<Elegantbeef> It's still a when
09:50:17FromDiscord<Isofruit> What happens in that block? I don't think I'm familiar with that syntax
09:50:41FromDiscord<Elegantbeef> I have an example in nimscripter somewhere
09:50:46FromDiscord<Elegantbeef> One second
09:52:50FromDiscord<Elegantbeef> You can do `when declared(triggerDeleteSignals) and (proc(id: T)(triggerDeleteSignals)) != nil:` i think
09:53:24FromDiscord<Elegantbeef> Is that any better than when compiles probably not
09:55:12FromDiscord<Isofruit> but what does this `proc(id: T)(triggerDeleteSignals)` say? A proc in brackets directly after an unfinished proc signature?
09:55:26FromDiscord<Elegantbeef> Converts the symbol to that proc if it can
09:56:52FromDiscord<Isofruit> And nil if it can't i assume, so "when there is any proc called "triggerDeleteSignals" declared and my proc(id:T) can be converted to "triggerDeleteSignals" , then do XY" ?
09:57:31FromDiscord<Elegantbeef> Yea
09:57:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Mpm
09:59:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Mpn
09:59:27FromDiscord<Isofruit> Now on to philosophize about what has the better readability
09:59:41FromDiscord<Rika> If you comment it the latter could be better
10:00:02FromDiscord<Elegantbeef> Personally i'm of party just use `when compiles`
10:01:48FromDiscord<Isofruit> I'm tempted to, simply because the above is the simplified version. I'm trying to imitate Django's signal system so I'll likely have at least 2 signal calls every time
10:02:05*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzโ€ฆ)
10:02:12FromDiscord<Isofruit> Which means less reading with "when compiles"
10:02:17FromDiscord<mratsim> In reply to @Isofruit "Is there a when-check": https://github.com/numforge/laser/blob/master/laser/lux_compiler/frontend/lux_sigmatch.nim#L18
10:02:38FromDiscord<Elegantbeef> Yea a macro also works
10:03:27FromDiscord<Elegantbeef> You also could add a new overload `deleteEntry[Character](entryId, SignalDelete)`
10:04:02FromDiscord<Elegantbeef> Where signal delete is `type SignalDelete = distinct void` just cause fuck yea distinct! ๐Ÿ˜›
10:04:22FromDiscord<Elegantbeef> Or name it `deleteEntryWithSignal` If you prefer that
10:04:46FromDiscord<Isofruit> I was about to have a SignalType enum
10:05:20FromDiscord<Isofruit> And pass that as first parameter, which could have `preDelete, postDelete, preCreate, postCreate, preUpdate, postUpdate` values
10:05:42FromDiscord<Rika> Ew
10:06:26FromDiscord<Elegantbeef> So what you'd send a set
10:07:23FromDiscord<Isofruit> signal(signalType, ... wait no that idea is silly, the Django way is likely highly inefficient since they literally cycle over a list of signals and filter them out based in these inputs
10:07:36FromDiscord<Isofruit> While I can just insert the right one with generics
10:07:38FromDiscord<Elegantbeef> I mean you can do it statically
10:08:19FromDiscord<Elegantbeef> You can do `signal(sigTyp: static SignalType)` and do `when sigType == preDelete`
10:08:21FromDiscord<Isofruit> In reply to @Elegantbeef "Or name it `deleteEntryWithSignal`": The goal is for me to not have to think about signals for the most part, that bit of Django magic I'd like to replicate
10:08:34FromDiscord<Elegantbeef> This isnt shit i know so i dont know
10:08:51FromDiscord<Rika> โ€œI donโ€™t know so I donโ€™t knowโ€: what you just said
10:09:06FromDiscord<Elegantbeef> Thanks capt
10:23:51*Gustavo6046 quit (Quit: Leaving)
10:24:04FromDiscord<ynfle> Is the only way to write at compiel time staticexec?
10:24:36FromDiscord<evoalg> I'm glad I'm not the only one who doesn't like defer ... I only saw it a few days ago and I thought to me myself "I'm not gonna use that because it's horrible"
10:25:38FromDiscord<Rika> In reply to @evoalg "I'm glad I'm not": Why?
10:27:09FromDiscord<ynfle> Is there any issue with writefile and compile time? why do we have staticread then?
10:29:21FromDiscord<Rika> Afaik itโ€™s fine to do static: write
10:29:25FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3MpG
10:29:36FromDiscord<Rika> In reply to @Isofruit "<@!259277943275126785> <@!145405730571288577> ": Congratulations
10:29:44FromDiscord<evoalg> In reply to @Rika "Why?": The reason I didn't like it was because it made things unclear (to me) as opposed to some sort of block (like try finally), and if I didn't use it in a proc it wouldn't close for ages etc ... and that's bad enough, but then I found out today it doesn't have a new scope (like try finally does)
10:29:46FromDiscord<Isofruit> (edit) "https://play.nim-lang.org/#ix=3MpG" => "https://play.nim-lang.org/#ix=3MpH"
10:30:33FromDiscord<Rika> I donโ€™t like either, Iโ€™d prefer RAII
10:30:43FromDiscord<Rika> And destructors are pretty close to it
10:30:45FromDiscord<Rika> Hehe close
10:31:25FromDiscord<evoalg> RAII?
10:31:49FromDiscord<Elegantbeef> Arc basically
10:31:59FromDiscord<Elegantbeef> Where you have destructors that are called when objects are done with
10:32:30FromDiscord<evoalg> ohhh
10:32:36FromDiscord<Rika> When something goes out of scope it also does close and stuff is how I explain
10:32:55FromDiscord<Rika> โ€œResource allocation is instantiationโ€ or something
10:33:02FromDiscord<evoalg> nice ๐Ÿ™‚
10:33:06FromDiscord<Rika> Making variables == using resource
10:33:08FromDiscord<Elegantbeef> intialization?
10:33:21FromDiscord<Rika> Whatever, same banana
10:34:18FromDiscord<evoalg> I've also gone off `collect` for the same reason
10:43:14FromDiscord<Isofruit> Is this not how you're supposed to get the compiler to shut up about unreachable code:โ†ต{.hint[UnreachableCode]: off.} ?
10:53:53FromDiscord<evoalg> I suspect a template has it's own scope, even though it's all in-lined into the place it's called
10:54:36FromDiscord<evoalg> and that's why it's var aren't accessible ... but I also suspect it's more complicated than that
10:54:58FromDiscord<Rika> โ€œOwn scopeโ€ no
10:55:18FromDiscord<Rika> โ€œItโ€™s variables are essentially inaccessible from the outside unless forced toโ€ yes
10:55:27FromDiscord<evoalg> ok
10:55:47FromDiscord<Rika> The variable names are โ€œobfuscatedโ€
10:56:10FromDiscord<evoalg> ok I see ... and they aren't freed
10:56:15FromDiscord<evoalg> of mem
10:57:43FromDiscord<Rika> Itโ€™s usually negligible anyway
10:58:29FromDiscord<evoalg> ok thx!
11:24:01FromDiscord<01> when interoping with Python/Java, can i also use pip installed modules, and java packages from maven central?
11:24:49FromDiscord<01> (edit) "Python/Java," => "Python/Java (pynim, jnim),"
11:24:54FromDiscord<01> (edit) "(pynim," => "(nimpy,"
11:26:17FromDiscord<Recruit_main707> i think you can with nimpy at least
11:28:52FromDiscord<01> what about C interop, can i just work with regular functions in C file, or do i need a DLL?
11:29:43FromDiscord<Recruit_main707> you can do both
11:33:42FromDiscord<01> neat
11:34:27*jjido joined #nim
12:23:09NimEventerNew Nimble package! nimkov - Text generator, based on Markov Chains (Markov text generator), see https://github.com/bit0r1n/nimkov
12:59:29adigitoleohow can I go from `r"\tfoo"` to `"\tfoo"` (applying the escaping rules to the raw string)
13:00:54adigitoleoraw string is coming in from a stream
13:09:41adigitoleouse case is reading single byte char from command line into an option argument
13:14:07FromDiscord<demotomohiro> How about to replace "\\t" to "\t" using some proc in strutils module.
13:14:35FromDiscord<demotomohiro> "\\\\t" to "\t"
13:17:47FromDiscord<demotomohiro> !eval import strutils; echo r"foo\tbar".replace("\\\\t", "\t")
13:17:50NimBotfoo\tbar
13:19:09FromDiscord<demotomohiro> !eval import strutils; echo r"foo\tbar".replace("\\t", "\t")
13:19:12NimBotfoo bar
13:22:11FromDiscord<demotomohiro> Discord automatically convert "\\\\t" to "\t" and Nimbot takes text as I wrote. It confusing.
13:27:16adigitoleoyeah thanks for the tips, looks like it could work once I clean up some other bugs I just found in my code :)
13:37:02adigitoleoI guess what I really want to do is `r"foo\tbar".replace("\\\\t", '\t')` but there's no method, I'll have to detect the `\` and replace `t` instead. Not too bad I suppose
13:43:29NimEventerNew thread by Piyushrungta25: Program does not compile with ARC/ORC, see https://forum.nim-lang.org/t/8812
14:01:49*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzโ€ฆ)
14:24:32*NeoCron joined #nim
14:31:04FromDiscord<auxym> Anyone know if there's a way to get the nimcache path in a static/compile-time context? Like getting a macro or compiletime proc to write a file in the nimcache dir?
14:31:51FromDiscord<xflywind> In reply to @auxym "Anyone know if there's": https://nim-lang.org/docs/compilesettings.html#querySetting%2CSingleValueSetting
14:33:07FromDiscord<auxym> thanks @xflywind
14:33:22FromDiscord<xflywind> no problem
14:58:30*arkurious joined #nim
15:40:31FromDiscord<enthus1ast> i wish there where a resonable orm for nim, or at least a\: map db return strings to objects thing
15:40:45FromDiscord<enthus1ast> databases with nim are terrible imho
15:42:11FromDiscord<enthus1ast> best is to still write everything by hand, also map everything by hand \:/
15:45:15*yann-kaelig joined #nim
15:52:55*jjido joined #nim
15:53:11FromDiscord<Isofruit> ?โ†ตLike, I know norm has its limitations, but it's at lot saner in my eyes than parsing your entire db input by hand
15:54:10FromDiscord<Isofruit> The only "hash" limitation I see currently is that you can't properly fetch across multiple many-to-many relationships in one go
15:54:15FromDiscord<Isofruit> (edit) ""hash"" => ""harsh""
15:55:50FromDiscord<Isofruit> But I guess that's from the standpoint that you only use norm for DML and do DDL by hand
15:56:45FromDiscord<Isofruit> (edit) "that's" => "my position is"
16:02:04FromDiscord<enthus1ast> norm is full of hacks; buggy/different between sqlite and postgres; ormin would be nice when some more "manual" queries would be allowed
16:02:17FromDiscord<enthus1ast> i'll try gatebase now, lets see what this can offer
16:03:24FromDiscord<enthus1ast> in general, i find it quite amusing, that in todays world, databases still are that $hit to use, everything is string, but all the applications use structures and objects etc...
16:04:18FromDiscord<enthus1ast> databases do not reflect the normal useage at all its funny
16:05:48FromDiscord<leorize> ndb is a db module that lets you get non-string out of db
16:13:40yann-kaeligHello
16:15:11yann-kaeligWell, so I'm learning C++ and Nim in parallel as a beginner in both languages, I found a very good course in my native language for C++ and my idea is to port it to Nim as possible.
16:16:12yann-kaeligA very good pedagogical book I'm going to use as material for the Nim language.
16:21:51yann-kaeligSo, this book start with the header file <iostream> I suppose that in Nim it's : system/io
16:22:09FromDiscord<Rika> no
16:22:19FromDiscord<Rika> you do not import system or io manually in nim
16:22:28FromDiscord<Rika> they are implicitly imported
16:28:19FromDiscord<demotomohiro> You can use echo or stdout without importing system/io.
16:28:25NimEventerNew thread by Aquachain: Closure and for loop problem, see https://forum.nim-lang.org/t/8813
16:28:31FromDiscord<demotomohiro> !eval stdout.write("Hello world")
16:28:33NimBotHello world
16:31:06yann-kaeligThat was exaclty my next questions. First I found this link about stdout https://nim-lang.org/docs/io.html#stdout but I don't find the stdout.write, where it comes from ? And second , maybe it's a stupid question because I'm noob, but what's the difference between echo and stdout.write
16:32:07FromDiscord<Rika> echo also adds line end \n
16:32:12FromDiscord<Rika> and has a few other differences
16:32:24FromDiscord<Rika> here is write https://nim-lang.org/docs/io.html#write%2CFile%2Cvarargs%5Bstring%2C%5D
16:35:58FromDiscord<demotomohiro> echo is a proc you can easily print message on stdout. `write` proc is for write text to file.
16:36:49FromDiscord<enthus1ast> write can also print on stdout, but does not append a newline, good for prompts etc
16:38:52yann-kaeligwell, I missed something because how do you know that you can construct stdout.write. Each VARS can be completed with a PROCS with a form VARS.PROCS ? Where is this explained
16:39:50FromDiscord<Rika> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax
16:43:01FromDiscord<demotomohiro> !eval echo("foo"); "foo".echo; echo "foo"; echo"foo"
16:43:03NimBotfooโ†ตfooโ†ตfooโ†ตfoo
16:43:11FromDiscord<Rika> "foo".echo is so cursed
16:45:01FromDiscord<demotomohiro> If you learn C++ and Nim in parallel, you will encounter same words used in different meaning.โ†ตTemplate in C++ is similar to generics in Nim.โ†ตTemplate in Nim is similar to macro in C++.โ†ตAs far as I know, there is nothing in C++ that corresponding to the macro in Nim.
16:46:21FromDiscord<Rika> brand new custom preprocessor :inatehe:
17:06:12*kayabaNerve joined #nim
17:26:41Amun-Rademotomohiro: like a definition of object in C andโ€ฆ everywhere else ;)
17:55:46yann-kaeligSo, I'm testing this code stdout.writeline 'CDE' which is wrong and I understand that but I was curious to see the error output during the compilation and I get that: "Error: missing closing ' for character literal" The poitn is that Ido not understand what does that mean, there is nothing missing in my point of view about the signle quotes ?!
17:56:13yann-kaeligsingle*
18:00:09Amun-Rahm?
18:00:18yann-kaeligthe same error message output happen if I run echo 'ABC'
18:02:01yann-kaeligrun/compile my code
18:02:04Amun-Ramulti-character literals are not supported in Nim
18:03:53Amun-Ra(they were inherited in C from B, and are, thankfully, long gone)
18:05:25Amun-Rayann-kaelig: a character literal is a sequence of charactes/escape sequences enclosed in single quotation mars, the number of allowed characters enclosed in Nim is 1
18:06:24yann-kaeligok, I see. Also is there any difference in Nim between echo "A" and echo 'A' or also stdout.write "B" and stdout.write 'B'
18:06:47Amun-Ra'A' is char, "A" is string
18:07:06Amun-Rathere's no difference when echoing
18:07:21Amun-Rawell, almost no difference
18:07:48Amun-Raproc echo*(x: varargs[typed, `$`]) {.magic: "Echo", benign, sideEffect.}
18:10:40FromDiscord<demotomohiro> !eval typeof('A'), " ", typeof("A")
18:10:41NimBotCompile failed: /usercode/in.nim(1, 12) Error: invalid indentation
18:11:09FromDiscord<demotomohiro> !eval echo typeof('A'), " ", typeof("A")
18:11:11NimBotchar string
18:11:35FromDiscord<demotomohiro> !eval echo typeof("A"[0])
18:11:37NimBotchar
18:12:15FromDiscord<demotomohiro> So string is like array of chars.
18:12:22FromDiscord<mlokis> In reply to @demotomohiro "!eval echo typeof("A"[0])": what? shouldn't that be a byte? or char is alias for byte here
18:13:08Amun-Ramlokis: byte is an alias for uint8
18:13:23Amun-Rachars and bytes are different kind of octets
18:13:40FromDiscord<mlokis> I just remembered that nim does not have char as u32
18:14:15FromDiscord<demotomohiro> !eval echo char.low, " ", byte.low
18:14:17NimBot 0
18:14:47FromDiscord<mlokis> In reply to @Amun-Ra "chars and bytes are": whats the difference? they are both 8bit wide, is there a sign difference?
18:15:33FromDiscord<mlokis> !eval askjdalskdjl
18:15:35NimBotCompile failed: /usercode/in.nim(1, 1) Error: undeclared identifier: 'askjdalskdjl'
18:15:55FromDiscord<mlokis> !eval echo char.low
18:15:56NimBot
18:16:08FromDiscord<mlokis> hmmm?
18:16:17FromDiscord<mlokis> bot has a bug i guess
18:16:40FromDiscord<demotomohiro> !eval echo char.low.int, " ", char.high.int
18:16:40nrds<Prestige99> maybe it's down?
18:16:42NimBot0 255
18:16:50nrds<Prestige99> oh weird
18:17:40Amun-Ramlokis: the difference is pretty a type
18:17:48nrds<Prestige99> https://play.nim-lang.org/#ix=3MtY does not output anything lol
18:17:59FromDiscord<demotomohiro> Output of `echo char.low` is empty and NimBot do nothing?
18:18:19FromDiscord<demotomohiro> !eval char.low
18:18:20NimBotCompile failed: /usercode/in.nim(1, 5) Error: expression 'low(char)' is of type 'char' and has to be used (or discarded)
18:18:22Amun-Ramlokis: a char is kinda distinct uint8
18:18:30FromDiscord<demotomohiro> !eval char.low.int
18:18:31NimBotCompile failed: /usercode/in.nim(1, 9) Error: expression 'int(low(char))' is of type 'int' and has to be used (or discarded)
18:18:46FromDiscord<demotomohiro> !eval echo char.low
18:18:47NimBot
18:18:57FromDiscord<demotomohiro> !eval echo char.low.int
18:18:59NimBot0
18:22:55FromDiscord<mlokis> In reply to @Amun-Ra "<@343028072095809536>: a char is": well, what i have done in my language is that when you use `'c'` it will be the UTF code-point but it will have type `uint32` might that be a bad thing? this makes adding code-points more natural at least but mainly its simpler.
18:23:27FromDiscord<mlokis> (edit) "`uint32` might" => "`uint32`. Can"
18:25:18FromDiscord<demotomohiro> That sound like char in rust lang.
18:25:54FromDiscord<mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3Mu7
18:26:55FromDiscord<mlokis> In reply to @demotomohiro "That sound like char": well it would make 'ฤ' invalid if it were byte
18:27:05FromDiscord<mlokis> (edit) "'ฤ'" => "`'ฤ'`"
18:27:37FromDiscord<mlokis> !eval import osproc
18:27:40NimBot<no output>
18:28:09FromDiscord<mlokis> !eval import osproc;runCmd("echo hello")
18:28:11NimBotCompile failed: /usercode/in.nim(1, 15) Error: undeclared identifier: 'runCmd'
18:28:23FromDiscord<demotomohiro> !eval import osproc; execCmd("echo hello")
18:28:25NimBotCompile failed: /usercode/in.nim(1, 23) Error: expression 'execCmd("echo hello")' is of type 'int' and has to be used (or discarded)
18:28:43FromDiscord<mlokis> !eval import osproc; discard execCmd("echo hello")
18:28:46NimBothello
18:29:06FromDiscord<mlokis> hmm what if i use little bit more agressive command
18:29:19FromDiscord<mlokis> !eval import osproc; discard execCmd("echo exit")
18:29:22NimBotexit
18:29:33FromDiscord<mlokis> !eval import osproc; discard execCmd("exit")
18:29:35NimBot<no output>
18:29:52FromDiscord<mlokis> too bad
18:30:30FromDiscord<demotomohiro> exit command just quits shell
18:31:04FromDiscord<mlokis> well i guess it runs it in separate environment
18:31:57FromDiscord<mlokis> !eval import osproc; discard execCmd("cd \\ | rm -rf")
18:31:59NimBotsh: cd: line 1: can't cd to
18:32:25FromDiscord<demotomohiro> !eval import osproc; echo execProcess("nim", args = ["-v"], options = {poUsePath})
18:32:28NimBotCompile failed: Nim Compiler Version 1.4.8 [Linux: amd64]โ†ตCompiled at 2022-01-14โ†ตCopyright (c) 2006-2021 by Andreas Rumpfโ†ตโ†ตgit hash: 44e653a9314e1b8503f0fa4a8a34c3380b26fff3โ†ตactive boot switches: -d:releaseโ†ต
18:33:11FromDiscord<mlokis> !eval import osproc; discard execCmd("cd / | rm -rf")
18:33:12FromDiscord<demotomohiro> !eval echo NimVersion
18:33:14NimBot1.4.8
18:33:15NimBot<no output>
18:33:40FromDiscord<mlokis> !eval import osproc; echo execCmd("cd / | rm -rf")
18:33:43NimBot0
18:34:10FromDiscord<mlokis> is this a right command, well i guess its in virtual enviroment
18:34:30FromDiscord<mlokis> it would be really unfortunate
18:34:30FromDiscord<Rika> its a docker container
18:34:38FromDiscord<Rika> not much you can do from there
18:34:56FromDiscord<mlokis> In reply to @Rika "not much you can": thats goot i just hed some fun
18:35:05FromDiscord<mlokis> (edit) "hed" => "had"
18:35:17FromDiscord<mlokis> (edit) "thats goot" => "that's good"
18:36:40FromDiscord<mlokis> !eval import osproc; discard execCmd("cat > program.txt")
18:36:43NimBotsh: can't create program.txt: Permission denied
18:36:55FromDiscord<mlokis> oh no
18:41:52FromDiscord<demotomohiro> !eval echo staticExec("gcc -v")
18:41:53NimBotCompile failed: /usercode/in.nim(1, 16) Error: 'staticExec' can only be used in compile-time context
18:42:15FromDiscord<demotomohiro> !eval static: echo staticExec("gcc -v")
18:42:17NimBot<no output>
18:44:23FromDiscord<demotomohiro> !eval echo static staticExec("gcc -v")
18:44:25NimBotUsing built-in specs.โ†ตCOLLECT_GCC=gccโ†ตCOLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/6.4.0/lto-wrapperโ†ตTarget: x86_64-alpine-linux-muslโ†ตConfigured with: /home/buildozer/aports/main/gcc/src/gcc-6.4.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 6.4.0' --enable-checking=relea...
18:46:04*Lord_Nightmare joined #nim
18:53:01yann-kaeligSomething which I'm not sure I'm interpreting correctly.1) echo len "abc" > the lenght of the string, right?. 2) echo len {'a', 'b', 'c'} > the lenght of ? What's the brackets meaning ? 3) echo len 'a' > Error: type mismatch: got <char>. Is it possible to get the lenght of a char ?
18:54:28yann-kaeligI was expecting that echo len 'a' gives me something like 1, but it's not the case
18:56:10Amun-Ralen != sizeof
18:57:07Amun-Ra{โ€ฆ} is a set
18:57:37*Lord_Nightmare quit (Ping timeout: 256 seconds)
18:57:40FromDiscord<huantian> Chars are always 1 char so len has no meaning
18:57:58FromDiscord<huantian> Or rather is useless
19:01:54yann-kaeligThat was I guessed before I run the compilation, but now I don't understand in this case why it is seen as an error even if it's useless.
19:02:49FromDiscord<huantian> Because there is no len price defined for char
19:02:55FromDiscord<huantian> proc
19:03:54FromDiscord<demotomohiro> !eval echo typeof({'a', 'b'})
19:03:55NimBotset[char]
19:04:20Amun-Ra!eval typeof({'a'})
19:04:21NimBotCompile failed: /usercode/in.nim(1, 7) Error: expression 'typeof({'a'})' is of type 'type set[char]' and has to be used (or discarded)
19:05:16FromDiscord<demotomohiro> !eval echo len {'a', 'b', 'a', 'b'}
19:05:18NimBot2
19:05:28Amun-Rafairen enough (just wanted to check whether echo is the default)
19:07:03FromDiscord<demotomohiro> If you want to learn about set type: https://nim-lang.org/docs/manual.html#types-set-type
19:09:52NimEventerNew thread by Jf1: Cleanup at program end - open files automatically closed?, see https://forum.nim-lang.org/t/8814
19:15:33*Lord_Nightmare joined #nim
19:34:02*Lord_Nightmare quit (Ping timeout: 240 seconds)
19:49:45*Lord_Nightmare joined #nim
19:54:17*noeontheend joined #nim
19:57:31yann-kaeligpretty nice that in Nim a division of two integer like 9 / 2 give a floating point result. I can not find how to use modulo in Nim
19:58:10yann-kaelig9 % 2 doesn't work
20:02:08FromDiscord<that_dude> It's mod not %
20:03:08FromDiscord<that_dude> So 9 mod 2
20:04:30FromDiscord<huantian> And floor division is div
20:04:47FromDiscord<huantian> In case you wanted that too
20:05:05FromDiscord<that_dude> Actually though, why isn't % mapped to mod?
20:13:03*Lord_Nightmare quit (Ping timeout: 240 seconds)
20:14:20FromDiscord<yallxe> In reply to @that_dude "Actually though, why isn't": i think mod is like more readable
20:19:47*Lord_Nightmare joined #nim
20:41:08*noeontheend quit (Ping timeout: 250 seconds)
20:45:19yann-kaelig I'm pretty suprise that the size of Nim binary from a simple "Hello World!" is a lot bigger than C++ even after passing the option -d:release. 87K for Nim and 16K for C++
20:47:58Amun-Ranim c -d=release --opt=size --passL=-s hello.nim && ls -lh hello
20:48:00Amun-Ra35K
20:48:26nrds<Prestige99> --gc:arc made it smaller on mine as well
20:48:44Amun-Raright, 27K
20:49:06nrds<Prestige99> 23k with danger
21:05:32*Lord_Nightmare quit (Ping timeout: 240 seconds)
21:07:53*Lord_Nightmare joined #nim
21:13:10yann-kaeligwhat type I have to use if I want something similary as double pi { 3.1415926 }; in Nim?
21:13:41yann-kaeligI can not find something about that on the doc https://euantorano.gitbooks.io/nim-docs/content/syntax/variables.html
21:14:22euantoranoyann-kaelig: that book is very old and nowhere near complete Iโ€™m afraid
21:15:39*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzโ€ฆ)
21:18:37euantoranoIf you just want pi, try the math module: https://nim-lang.org/docs/math.html#PI
21:19:53yann-kaeligeuantorano: not only pi, it was an example, Iwas asking in fact about floating point
21:20:53yann-kaelignumber
21:20:59euantoranoWell float32 and float64 are built in
21:21:13euantoranoThereโ€™s also the std/complex module too: https://nim-lang.org/docs/complex.html
21:22:01euantoranoFloat32 and 64 are defined in system: https://nim-lang.org/docs/system.html#float32
21:23:57euantoranoSo you can do things like this: https://play.nim-lang.org/#ix=3MuV
21:32:22yann-kaeligwouaou! Very nice. That was a very good idea to learn Nim with C++. I can see only in my simple cases how Nim is very interesting language, easy to write and to read + more other complicated things I will discover in a future
21:32:47FromDiscord<โƒŸโƒŸ> i found it very hard to read
21:33:54FromDiscord<evoalg> In reply to @yann-kaelig "I can not find": The docs / tutorials on the nim website are (should be) up to date
21:35:47FromDiscord<Yardanico> In reply to @yann-kaelig "I'm pretty suprise that": Have you tried striping the binary?
21:36:36yann-kaeligNo, to be honest I just applied what the output of the compilation gives me , which is the -d:release option
21:37:20FromDiscord<evoalg> In reply to @Yardanico "Have you tried striping": How does one do this?
21:37:53FromDiscord<Yardanico> strip -s binary
21:38:42FromDiscord<Yardanico> In reply to @yann-kaelig "No, to be honest": fair enough, for a more direct comparison with C/C++ you can use -d:danger
21:40:34FromDiscord<demotomohiro> Nim do runtime checks in default. -d:danger option disable all runtime checks.
21:42:24FromDiscord<demotomohiro> I forget how to enable/disable runtime checks in C++. Maybe -DDEBUG to enable or -DNDEBUG to disabple runtime checks.
21:42:32NimEventerNew thread by Boia01: Topfew - a Nim port of Tim Bray's logfile utility, see https://forum.nim-lang.org/t/8815
21:44:26FromDiscord<Elegantbeef> I mean i get 23kb without anything fancy
21:44:26FromDiscord<Elegantbeef> Ah sorry 32kvb
21:44:27FromDiscord<Elegantbeef> 32kb even, jeez i cannot type
21:44:27FromDiscord<Elegantbeef> `nim c -d:release --opt:size --gc:arc -d:lto ./test.nim`
21:46:20FromDiscord<Elegantbeef> Ah yes danger was how i got it down to 23kb ๐Ÿ˜›
21:56:14FromDiscord<demotomohiro> On windows, compile `echo "Hello world"` with `nim c --mm:arc -d:lto -d:danger --opt:size test.nim` and `strip -s test.exe` result in 57,870 bytes.โ†ตCompiling "std::cout << "Hello world\n"; with `g++ -O3 test.cpp` and `strip -s a.exe` result in 20,494 bytes.
21:58:47FromDiscord<demotomohiro> Calling `setConsoleOutputCP` and `setConsoleCP` makes Nim windows console program bigger?
21:59:27FromDiscord<evoalg> In reply to @Elegantbeef "`nim c -d:release --opt:size": what does `-d:lto` do, and is there a clang equivalent?
22:00:26FromDiscord<demotomohiro> LTO = Link Time Optimization
22:01:12FromDiscord<Elegantbeef> link time optimization
22:01:23FromDiscord<evoalg> thank you both
22:01:25FromDiscord<demotomohiro> Ask backend linker to optimize whole program
22:01:33FromDiscord<Elegantbeef> on clang you do `--passC:"-flto"`
22:01:51FromDiscord<Elegantbeef> Or `--passL:"-flto"` dont recall
22:02:55FromDiscord<mratsim> it's both
22:03:14FromDiscord<evoalg> thank you all!
22:05:12FromDiscord<Elegantbeef> Due to the generated Nim code LTO is very good for increasing optimizations both for size and performance
22:05:46FromDiscord<Elegantbeef> Matrix bridge i see is being slow
22:06:20yann-kaeligwell, time to take a break, even if i want to go on :) Very friendly Nim community. Thank you all, cu later
22:07:50*yann-kaelig left #nim (#nim)
22:10:21FromDiscord<demotomohiro> Even simple hello world program, Nim generate 4 .c files. I think that is why LTO is good for size and performance.
22:10:43FromDiscord<Elegantbeef> Indeed
22:11:16FromDiscord<Elegantbeef> That and i think how Nim compiles the code
22:19:48FromDiscord<ynfle> Beef, can you help me with some design stuff?
22:20:00FromDiscord<Elegantbeef> Perhaps
22:22:10FromDiscord<01> is nim worth my time learning, i'm mostly working with networks (rest apis) and frontend (angular)
22:22:21FromDiscord<01> or is it not exactly hot in the world of web
22:22:44FromDiscord<Elegantbeef> It's not really hot anywhere ๐Ÿ˜›
22:23:14FromDiscord<01> was afraid so...
22:23:18FromDiscord<Hamid_Bluri> heyโ†ตI found a wierd thing that i dont know how to explainโ†ตโ†ตhttps://play.nim-lang.org/#ix=3Mv7
22:23:44FromDiscord<01> it has a lot of appealing features but if i'll never get to use it at work or uni, it kinda feels awful to invest time in it ; _ ;
22:25:28FromDiscord<Hamid_Bluri> In reply to @hamidb80 "hey I found a": beef, what title do you suggest for the this issue? ๐Ÿ˜•
22:26:20FromDiscord<Elegantbeef> Dont put the a insidie the scope
22:27:49FromDiscord<Elegantbeef> Can always use it for your personal stuff, not like using it is useless it can teach you a bunch ๐Ÿ˜›โ†ต(@01)
22:29:00FromDiscord<ynfle> I'm trying to go from json schema to nim test code. Most of the schema is well defined except for 2 main partsโ†ต1. the input to the test routineโ†ต2. the expected outputโ†ตI'm trying to come up with a way to extract the parts of input in to valid nim untyped ast stuff. The main issue having a way to return a JsonNode from a routine that will convert it to it's ast representation for input to the routine.
22:29:29FromDiscord<ynfle> I'm trying to come up with a way to return a json array such that it is `superquote`able
22:29:40*jjido joined #nim
22:30:13FromDiscord<ynfle> In reply to @ynfle "I'm trying to go": Any ideas @ElegantBeef
22:30:21FromDiscord<ynfle> In reply to @hamidb80 "hey I found a": It's not an issue
22:30:40FromDiscord<ynfle> Macros and template are hygenic by default so they obscure the name to protect name clashes
22:30:57FromDiscord<Elegantbeef> No macros are not
22:31:17FromDiscord<Elegantbeef> The issue is that they do not return the body of the macro
22:31:21FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> In reply to @01 "it has a lot": I use Nim for personal projects because I like the feel, it's worth learning new languages just to get yourself exposure to things you wouldn't from uni or work. That said, exclusively focusing on something like Nim early in your career is most likely a Bad Idea, as it's not super likely you're going to find jobs looking for Nim devs
22:31:43FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Mva
22:31:45FromDiscord<ynfle> In reply to @Elegantbeef "The issue is that": I meant idents in name s
22:32:04FromDiscord<Elegantbeef> Macros do not gensym
22:32:05FromDiscord<Elegantbeef> You have to gensym manually
22:32:33FromDiscord<Hamid_Bluri> In reply to @ynfle "I meant idents in": look at the evaluated `def` constant in debug consoleโ†ตโ†ตhttps://play.nim-lang.org/#ix=3Mv7
22:32:43FromDiscord<ynfle> In reply to @hamidb80 "look at the evaluated": Ya i realized sorry
22:32:47FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> Has anyone found/written a 'rich' (https://github.com/Textualize/rich) style lib for Nim? I'm familiar with std/colors and std/terminal, I'm just wondering if anyone's wrapped those in a higher-level sugar layer yet?
22:32:49FromDiscord<ynfle> In reply to @Elegantbeef "You have to gensym": Not in quote
22:32:58FromDiscord<Hamid_Bluri> for `proc` works fine
22:33:05FromDiscord<Elegantbeef> Even in quote
22:33:11FromDiscord<Hamid_Bluri> yeah
22:33:14FromDiscord<Hamid_Bluri> look https://play.nim-lang.org/#ix=3Mv7
22:33:53FromDiscord<Elegantbeef> The issue is you dont emit the code
22:33:57FromDiscord<Elegantbeef> So yes that's expected
22:34:11FromDiscord<Elegantbeef> Anyway ynfle can you give more of an example
22:34:17FromDiscord<Elegantbeef> I dont follow what you're after
22:34:35FromDiscord<ynfle> Ya one second
22:39:48FromDiscord<01> In reply to @๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ "I use Nim for": I already have a job, it's not an issue
22:40:04FromDiscord<ynfle> In reply to @01 "I already have a": I just really enjoy programming in nim
22:40:08FromDiscord<ynfle> It's really fun
22:40:16FromDiscord<01> i can believe that
22:40:31FromDiscord<ynfle> That's worth it for me
22:40:34FromDiscord<01> i like the fact i can call procedures like regular functions, commands, or methods
22:40:46FromDiscord<01> and i also like the fact it has macros
22:41:10FromDiscord<ynfle> I've contributed to Exercism.io in nim but I don't use it for work or school unless it's just a small script or something like that for school
22:41:26FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> If you've got a job then you should use stuff you're interested in outside of it then ๐Ÿ™‚ :akkoShrug:
22:41:58FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> mono-culturing yourself is a great way to burn out in one hell of a hurry, ask me how I know :/
22:42:13FromDiscord<01> i am not mono, more like 2
22:42:25FromDiscord<01> C# and TS are surely my strong points
22:42:47FromDiscord<01> neither of them can interop with python, or java though
22:42:49FromDiscord<ynfle> Nim's less OOP nature is very different and could broaden horizons
22:42:56FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> Let me rephrase, keep your work tech at work, use different stuff you're interested in outside of work
22:43:09FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> Thus, if you like Nim, use nim
22:43:34FromDiscord<01> I can't say if i like it, but i am highly interested in a language that'd dip into python and java interop
22:43:49FromDiscord<01> Nim and Julia are the only 2 i could find
22:43:57FromDiscord<ynfle> Java interop is a little harder though
22:44:01FromDiscord<01> mhm
22:44:04FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> C# can interop with Python BTW, it's just a godawful mess which doesn't pay to figure out ๐Ÿคฃ
22:44:35FromDiscord<01> so i can use numpy and arbitrary pip package with C#?
22:45:04FromDiscord<01> cause just executing a python "string" isn't what i deem sufficient ๐Ÿ˜‚
22:45:11FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> Ok you mean interop in a different way from what I mean
22:45:17FromDiscord<01> yea
22:45:26FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> I'm talking about taking the Python interpreter and embedding it
22:45:34FromDiscord<01> because if i dont get access to the ecosystem, it's not much of an interop
22:45:44FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> with bi-directional data marshalling
22:45:54FromDiscord<01> by interop i imagine CLojure with Java
22:45:57FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> (Something I've spent a lot of time on in the past)
22:45:57FromDiscord<01> Kotlin with Java
22:46:13FromDiscord<01> TypeScript with JavaScript (altho that's a stretch)
22:46:43FromDiscord<01> F# with .NET (nothing special)
22:47:27FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> In my experience, when people say interop they mean along API boundaries
22:47:27FromDiscord<01> actually the last one is hardly interop
22:47:38FromDiscord<01> yea
22:47:44FromDiscord<01> but that's not tapping into the ecosystem
22:47:47FromDiscord<01> that's more or less a niche
22:47:47FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> That said, I don't have a good alternative term because my brain is pudding atm ๐Ÿ™‚
22:48:13FromDiscord<huantian> In reply to @๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ "I'm talking about taking": Actually, how is IronPython, assuming thatโ€™s what youโ€™re talking about
22:48:20FromDiscord<01> Kotlin for example has perfect interop with Java (JVM), so it actually gets the whole Maven central package library
22:48:54FromDiscord<01> Julia also allows to add python packages as far as i know
22:48:56FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> In reply to @huantian "Actually, how is IronPython,": I haven't touched IP in years TBH, I was more referring to actual embedding of Python's interpreter within a foreign process
22:49:11FromDiscord<huantian> Oh interesting, how does that even work
22:49:19FromDiscord<Hamid_Bluri> it just wierd ๐Ÿ˜• https://play.nim-lang.org/#ix=3Mvd
22:49:21FromDiscord<01> you asking for julia?
22:49:32FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> The example most people would click with would probably be, embedding Python within a C++ engine for gamedev/engine work
22:49:35FromDiscord<Hamid_Bluri> (edit) "it" => "it's"
22:49:39FromDiscord<Elegantbeef> Again it's not weird hamid
22:49:47FromDiscord<Elegantbeef> You're not emitting code so what do you expect
22:50:08FromDiscord<Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3Mve
22:50:23FromDiscord<Hamid_Bluri> even though if i emit the code
22:50:28FromDiscord<Hamid_Bluri> the result is the same
22:50:28FromDiscord<01> In reply to @๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ "The example most people": C interop isn't very special, just about every serious language has it
22:50:40FromDiscord<huantian> In reply to @01 "you asking for julia?": Kinda asking for both
22:50:40FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> Wasn't saying it was ๐Ÿ™‚
22:51:00FromDiscord<01> In reply to @huantian "Kinda asking for both": https://github.com/JuliaPy/PyCall.jlโ†ตjulia handles it with conda
22:51:10FromDiscord<Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3Mvf
22:51:17FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> although C++ / Python interop _is_ somewhat special because of C++ vtables, and some other tripping hazzards
22:51:24*Lord_Nightmare quit (Read error: Connection reset by peer)
22:51:56FromDiscord<Hamid_Bluri> (edit) "https://play.nim-lang.org/#ix=3Mvf" => "https://play.nim-lang.org/#ix=3Mvg"
22:52:22*Lord_Nightmare joined #nim
22:52:34FromDiscord<01> true
22:52:43FromDiscord<ynfle> In reply to @Elegantbeef "You're not emitting code": This should work https://play.nim-lang.org/#ix=3Mvh
22:52:44FromDiscord<huantian> In reply to @01 "https://github.com/JuliaPy/PyCall.jl julia handles ": Looks pretty neat
22:53:05FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> In reply to @huantian "Kinda asking for both": To overly simplify it, it involves running the Python interpreter within the address space of a containing program. That allows the Python interpreter to communicate with and be communicated with by the containing program (assuming you're marshaling data structures to the appropriate types back and forth)
22:53:18FromDiscord<01> i guess a better way would be to just make a "killer language" that's able to instead compile to all the major ones: JS, Java, C, C#, Python
22:53:31FromDiscord<01> one language, all libraries, but in separate applications
22:53:39FromDiscord<01> would be more realistic
22:53:48FromDiscord<huantian> Relevant xkcd: https://xkcd.com/927/
22:54:08*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzโ€ฆ)
22:54:16FromDiscord<01> there is actually a lot of languages that want to compile to "name X" and "JS"
22:54:24FromDiscord<01> clojure, kotlin, scala, F#
22:54:26FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> There's a lot of potential for footguns in scenarios where you're trying to be everything to everyone
22:54:38FromDiscord<01> can you explain?
22:54:59FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> Example: Nim does compile down to JS, right?
22:55:09FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> However there are limitations, some things simply will not work
22:55:17FromDiscord<01> yea, hence "trying"
22:55:19FromDiscord<Elegantbeef> And actually ynfle i'm wrong quote does gen sym
22:55:19FromDiscord<Elegantbeef> genast is better quote do
22:55:20FromDiscord<Elegantbeef> If you want to use quote you'd have to do `let a = ident"a"` and the same for `b` then inside quote you'd acc quote teh values
22:55:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Mvj
22:55:27FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> And there are solid reasons behind why, and why they're left like that
22:55:38FromDiscord<huantian> In reply to @๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ "To overly simplify it,": Hm interesting, I was looking at how viable python would be for unity game modding/scripting, ie for users to create python scripts which would allow them to mod the game
22:55:45FromDiscord<01> what are such reasons?
22:55:52FromDiscord<01> why is it in such poor shape?
22:55:55FromDiscord<Elegantbeef> No
22:55:57FromDiscord<Elegantbeef> `quote` gensyms
22:56:25FromDiscord<Elegantbeef> Jeez matrix bridge is being slooooow
22:56:30FromDiscord<01> especially in a macro language like nim, i don't see any reason why interop with java should be painstakign
22:56:34FromDiscord<ElegantBeef> I guess i'm in discord!
22:56:34FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> In reply to @huantian "Hm interesting, I was": I can tell you from personal experience that's a massive undertaking that even very experienced developers will generally shy away from
22:56:39FromDiscord<ynfle> Beef what's better code here or a gist or something like that for my question
22:56:55FromDiscord<ynfle> In reply to @01 "especially in a macro": Because java
22:56:59FromDiscord<ElegantBeef> I need some example input and output logic
22:57:15FromDiscord<01> that's not a very thorough reason
22:58:36FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> In reply to @01 "why is it in": I'm not a good person to answer why Nim makes architecture choices around JS transpiles, I don't use that aspect of the language :D. It's not that it's in poor shape either, it's that Araq and others have made design decisions that lead to things being implemented a certain way. In other areas, 1:1 translation is actually impossible at this time.
22:58:54FromDiscord<ElegantBeef> In reply to @๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ "However there are limitations,": What do you mean
22:59:07FromDiscord<01> i don't expect 1:1 translation
22:59:10FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> In reply to @ElegantBeef "What do you mean": That was directed at @01 ๐Ÿ™‚
22:59:14FromDiscord<ElegantBeef> Nim doesnt target the most recent ES, but it does work fine
22:59:18FromDiscord<01> you can have great development experience without 1:1
22:59:21FromDiscord<01> imo
22:59:28FromDiscord<ElegantBeef> You can interact with any JS code afaik
22:59:44FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3Mvk
22:59:52FromDiscord<ynfle> But input and expected can be any valid json
23:00:26FromDiscord<ElegantBeef> Well this is doable but might be a bit messy
23:00:35FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> Agreed, however to this day (at least as far as I know) certain features within Nim do not have 1:1 parity, or in some cases do not work with JS transpiling. I was just trying to provide an example of why expanding the scope of transpile/interop doesn't always provide greater benefits
23:00:36FromDiscord<01> the C interop with nim i would consider pretty good (from what I've seen that is)
23:00:43*l1x joined #nim
23:00:47FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> Nim compiles to C natively
23:00:53FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> So I'd say that's 100% ๐Ÿ˜‰
23:00:58FromDiscord<ElegantBeef> In reply to @๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ "Agreed, however to this": Yea things like closure iterators do not work in JS land
23:01:03FromDiscord<01> this looks just about the best way possible https://media.discordapp.net/attachments/371759389889003532/932409140117110784/unknown.png
23:01:04FromDiscord<ElegantBeef> well closures in general
23:01:09FromDiscord<01> for a statically typed language that is
23:01:20FromDiscord<01> and i DO want myself all the static typing
23:01:22FromDiscord<01> ๐Ÿ™‚
23:01:27l1xhi ppl. could i used this (std/asynchttpserver) in an embedded environment? the board has 512M ram and a pretty good arm64 cpu
23:01:57FromDiscord<01> i guess a lot of it comes down to the fact C is also pretty dang simple
23:02:13FromDiscord<01> functions, structs... no weird classes interfaces properties or any nonesense like that
23:02:33FromDiscord<01> no dependency injection!! ๐Ÿ˜  I'm looking at you C#
23:02:41FromDiscord<ElegantBeef> So ynfle what i'd do parse the json file, then emit a call assuming `[]` is a sequence so you get that call out the end
23:02:42FromDiscord<01> DI pisses me off
23:03:09FromDiscord<ynfle> sent a code paste, see https://play.nim-lang.org/#ix=3Mvn
23:03:09FromDiscord<ElegantBeef> Hell no
23:03:12FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> C is also the rail-gun of languages when it comes to the capability to cause massive amounts of damage if you're not very careful ๐Ÿ˜„
23:03:23FromDiscord<01> that is correct
23:03:42FromDiscord<ynfle> In reply to @ElegantBeef "Hell no": ?
23:03:50FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> I wrote C and C++ for years, I'm immensely happy that languages like Rust and Nim are gaining steam
23:04:06FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> So much less fuckery for me to keep track of day-to-day ๐Ÿคฃ
23:04:21FromDiscord<01> i'm not interested in rust at all
23:04:35FromDiscord<01> the syntax was just awful when i tried it
23:04:59FromDiscord<01> it'd be great if someone could make me enthusiastic about it though
23:05:23FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> I like what Rust stands for, not necessarily how it gets there ๐Ÿ˜‰
23:05:36FromDiscord<01> what does it stand for
23:05:51FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> There's a reason my personal projects are in Nim, not rust, also why I'm in the Nim Discord, not Rust's
23:06:20FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> In reply to @01 "what does it stand": Safety
23:06:26FromDiscord<01> riiiight
23:06:59FromDiscord<01> memory safety i assume you mean
23:07:08FromDiscord<Isofruit> Fully support Benumbed's reasoning there.
23:07:10FromDiscord<Isofruit> It's not just that
23:07:13FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> I mean that's one area
23:07:21FromDiscord<Isofruit> Options and Result force you a lot more to deal with every possible path your code can take
23:07:31FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> In general Rust forces you into patterns of programming that result in safer code
23:07:32FromDiscord<01> that's not unique to rust
23:07:36FromDiscord<01> Promises exist in JS
23:08:07FromDiscord<Isofruit> It isn't, but it is part of the larger pattern: Cover every eventuality consciouslyand do so while staying memory safe.
23:08:10FromDiscord<Isofruit> (edit) "consciouslyand" => "consciously and"
23:08:11FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> In reply to @01 "Promises exist in JS": ๐Ÿคข ๐Ÿคฃ :aniCry:
23:08:31FromDiscord<01> In reply to @Isofruit "It isn't, but it": well, it's partial at it
23:08:37FromDiscord<Isofruit> I don't think I see the connection of Promises to Option and Result
23:08:50FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> <-- unfortunately writes JS for money, is very depressed about that
23:09:13FromDiscord<01> i can still get runtime error with rust if i write an index out of bounds, it's not like it forces me to write a case where it's out of bounds
23:09:26FromDiscord<01> it's all partial, just like in all langs
23:09:29FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> I look at it this way, the more a compiler can do to keep me from doing stupid shit, and shipping stupid shit, the happier I am
23:09:37FromDiscord<01> i agree
23:09:37FromDiscord<ynfle> @ElegantBeef any cleanish suggestions?
23:09:40FromDiscord<01> i totally agree with that
23:09:45FromDiscord<ElegantBeef> I'm making one now
23:09:50FromDiscord<01> as long as compiler can help me, it's great
23:09:52FromDiscord<ynfle> In reply to @ElegantBeef "I'm making one now": Oh wow! Thanks
23:10:00FromDiscord<01> and i want to offload as much as possible to the compiler to check
23:10:16FromDiscord<Isofruit> I think this might be a good offtopic debate
23:10:21FromDiscord<01> that's why I'm avid hater of python
23:10:23FromDiscord<01> sure
23:10:28FromDiscord<01> #offtopic right?
23:10:31FromDiscord<Isofruit> Yeh
23:10:36FromDiscord<๐“‘๐“ฎ๐“ท๐“พ๐“ถ๐“ซ๐“ฎ๐“ญ> Yeah @Isofruit I think this is starting to spam main haha
23:11:44FromDiscord<ynfle> In reply to @ElegantBeef "So ynfle what i'd": input and expected can have different types (arrays and basic types) and there can be 0 or more inputs
23:16:29FromDiscord<Isofruit> erm... I'm starting to realize that implementing database connection pools may be a couple leagues outside of my skill level
23:18:14FromDiscord<Isofruit> Do we have gatabase for connection pooling and nothing else?
23:18:42FromDiscord<Isofruit> I've seen mratsim's post about weaver but that seems still a bit out of my wheelhouse
23:19:51FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=3Mvp here's the basis ynfle
23:20:16FromDiscord<ElegantBeef> You'll want to put conditionals around getting input/expected and also fill in the `convertToNimArg` and use it recursively
23:21:29FromDiscord<ElegantBeef> The nim playground got downgraded to 1.4.8 now which is why genast wont work there
23:22:11FromDiscord<ynfle> In reply to @ElegantBeef "The nim playground got": Why'd they do that?
23:22:31FromDiscord<ElegantBeef> I think pmunch had to fix it the otherday and it hasnt fetched the most recent versions again
23:22:36FromDiscord<ElegantBeef> It wasnt purposely done
23:22:43FromDiscord<ynfle> Ah ok
23:22:46FromDiscord<Elegantbeef> Hmm bridge seems back to speed
23:23:25FromDiscord<Elegantbeef> You can summon pmunch by saying his name three times i think
23:23:38FromDiscord<ynfle> Do I have to meditate first?
23:23:43FromDiscord<ynfle> Will he haunt me?
23:24:13FromDiscord<Elegantbeef> Anyway jokes aside does my solution work for you?
23:24:24FromDiscord<Elegantbeef> Not that i really see the benefit in using json for tests
23:24:25arkanoidI've a closed-source nim project that requires to link dynamically to an external LGPL nim project, what's the best approach to comply with this? In C I can use headers and then do the linking, but what's the way to go with nim?
23:26:02FromDiscord<Zed> With dynamic linking it's only a problem if you distribute the LGPL library
23:32:09FromDiscord<ynfle> In reply to @Elegantbeef "*Not that i really": Not my choice
23:32:20FromDiscord<ynfle> Working on tooling for the nim track for Exercism.org
23:32:24FromDiscord<ynfle> (edit) "Exercism.org" => "exercism.org"
23:32:29FromDiscord<ynfle> (edit) "exercism.org" => "https://exercism.org"
23:32:41FromDiscord<ynfle> In reply to @Elegantbeef "Anyway jokes aside does": Ya
23:32:55FromDiscord<ynfle> If it's an array inside an array I call it recursively?
23:32:57FromDiscord<Elegantbeef> Goood
23:33:11FromDiscord<Elegantbeef> I mean really you should just call the proc recursively regardless
23:33:23FromDiscord<ynfle> In reply to @Elegantbeef "I mean really you": Lol why?
23:33:35FromDiscord<Elegantbeef> To reduce redundant code
23:34:00FromDiscord<ynfle> ๐Ÿ‘
23:34:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Mvr
23:34:28FromDiscord<Elegantbeef> Then you dispatch on the other kinds in the other case
23:42:04arkanoidZed, the LGPL library is written in nim
23:42:51FromDiscord<ynfle> In reply to @ElegantBeef "https://play.nim-lang.org/#ix=3Mvp here's the basis": What's with `case` not have a `:` at the end before the `of` branches
23:43:07FromDiscord<Elegantbeef> You dont need `:` on case
23:43:22FromDiscord<Elegantbeef> The only reason that works is cause of reccases inside types
23:43:23FromDiscord<leorize> arkanoid\: you have to find another one, or fork the library so that it can be used as a dynamic library
23:43:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Mvt
23:43:59FromDiscord<Elegantbeef> That's the only time you should do `case a:`
23:44:21FromDiscord<ynfle> In reply to @Elegantbeef "The only reason that": https://giphy.com/gifs/amine-mind-blown-mindblown-blowing-SACoDGYTvVNhZYNb5a
23:44:31FromDiscord<ynfle> I've been doing it wrong this whole time
23:45:07FromDiscord<Elegantbeef> Yep
23:45:15FromDiscord<Elegantbeef> You'll learn eventually
23:45:32arkanoidleorize, why forking? If this would be C I would compile the LGPL as .dll, include the headers in my closed source project and -lotherlgpl at linking phase. No need to fork
23:46:58FromDiscord<ynfle> In reply to @Elegantbeef "You'll learn eventually": What does that mean?
23:47:09FromDiscord<ynfle> That I'm doing everything wrong?
23:47:11FromDiscord<ynfle> Nooooooooo
23:47:21FromDiscord<Elegantbeef> You will learn eventually
23:47:26FromDiscord<usagii0> Just came across Nim. Is the native FFI for interoperability with C really good? (c++ I can understand there being more problems haha)
23:47:40FromDiscord<leorize> yes
23:47:50FromDiscord<usagii0> Good to hear!
23:47:50FromDiscord<leorize> arkanoid\: this is nim
23:48:14FromDiscord<Elegantbeef> It uses C as it's backend so if it had bad C FFI we'd be in trouble ๐Ÿ˜€
23:48:16FromDiscord<ynfle> In reply to @Elegantbeef "You will learn eventually": Learn what?
23:48:32FromDiscord<Elegantbeef> It was just a joke ynfle no need to look into it further
23:48:33FromDiscord<leorize> arkanoid\: the issue is that nim libraries must be prepared in order to be used as a dynamic library
23:48:44FromDiscord<ynfle> In reply to @Elegantbeef "It was just a": But I want to learn the beef ways
23:48:52FromDiscord<ynfle> Make my nim skills more beefy
23:48:53arkanoidso nim is technically not compatible with LGPL dynamic linking?
23:49:08FromDiscord<ynfle> Or take the form of a tree
23:49:11FromDiscord<ynfle> Either is fine
23:49:14FromDiscord<leorize> at the moment, yes
23:50:35FromDiscord<Elegantbeef> I mean it is but the library author has to support it
23:50:52FromDiscord<Elegantbeef> Or you fork it yourself
23:52:18arkanoidwhich changes do I have to implement to support it? I mean, do I have to wrap each function with importc?
23:52:52FromDiscord<Elegantbeef> https://github.com/treeform/genny you could also use this
23:54:15arkanoidthanks!
23:56:56arkanoidbtw I was not aware of this linkage/licensing issue until today, it's difficult to consider nim closed-source friendly if LGPL nim libraries cannot be use as-is like you'd expect in other languages