00:00:13 | FromDiscord | <ajusa> In reply to @C7c3r0 "hi again, I see": float64, though I believe float by default is a double |
00:00:43 | FromDiscord | <ajusa> if you're looking for a float the way Java defines it I think you'd want a float32 |
00:00:50 | FromDiscord | <C7c3r0> thank you! |
00:05:47 | FromDiscord | <leorize> small nit\: Nim is a word, please use normal casing for it \:p |
00:19:20 | arkanoid | Isofruit, thanks! |
00:22:46 | FromDiscord | <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:17 | FromDiscord | <Elegantbeef> Are you sure? |
00:24:18 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Mk0 |
00:24:43 | FromDiscord | <ajusa> hope that's not a bug on my end |
00:24:44 | FromDiscord | <Elegantbeef> Can you give me an example i can run ๐ |
00:25:07 | FromDiscord | <ajusa> Yeah, that would be helpful wouldn't it. Give me a sec ๐ |
00:27:35 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3Mk1 |
00:33:56 | FromDiscord | <Elegantbeef> Hmm yea weird AST here |
00:52:03 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzโฆ) |
01:30:44 | FromDiscord | <retkid> is there any 3d plottig libraris |
01:30:47 | FromDiscord | <retkid> (edit) "libraris" => "libraries" |
01:30:49 | FromDiscord | <retkid> (edit) "plottig" => "plotting" |
01:31:00 | FromDiscord | <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:55 | arkanoid | any1 has experience with nimqml here? I've a simple question |
01:45:17 | FromDiscord | <Elegantbeef> @ajusa\: 1.0.3 is out now should resolve your issues |
01:45:23 | FromDiscord | <Elegantbeef> Hopefully there arent any more issues |
01:48:19 | * | krux02 quit (Remote host closed the connection) |
02:06:03 | FromDiscord | <The Bron Jame (real)> How to make the default output source not the vscode output window |
02:06:13 | FromDiscord | <The Bron Jame (real)> i cant enter anything with the output window |
02:10:48 | FromDiscord | <Elegantbeef> What do you mean? |
02:16:50 | FromDiscord | <huantian> try the terminal option in your launch.json https://media.discordapp.net/attachments/371759389889003532/932096024833572934/unknown.png |
02:17:03 | FromDiscord | <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:31 | FromDiscord | <ynfle> sent a code paste, see https://paste.rs/wMx |
02:52:33 | NimEventer | New Nimble package! grab - grab statement for importing Nimble packages, similar to Groovy's Grape, see https://github.com/hlaaftana/grab |
02:52:33 | NimEventer | New Nimble package! astdot - Prints a dot graph of a nim ast dumped using the `dumpTree` macro., see https://github.com/Rekihyt/astdot |
02:55:32 | FromDiscord | <ynfle> In reply to @ynfle "<@!696333749570371585> (Which is the": I guess that's the wrong one |
02:57:23 | FromDiscord | <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:45 | arkanoid | is defer a good idiom or should I avoid it |
03:05:47 | arkanoid | ? |
03:06:24 | FromDiscord | <Elegantbeef> I think it's fine, though i dont generally use it |
03:07:24 | arkanoid | k |
03:15:43 | * | adigitoleo quit (Read error: Connection reset by peer) |
03:16:08 | * | adigitoleo joined #nim |
03:45:11 | nixfreaknim[m] | How would you create a proc for converting Celcius to Fahrenheit ? Does it make sense to try to create a proc ? |
03:46:07 | FromDiscord | <Elegantbeef> Depending on what you're after might want to use distincts |
03:48:38 | nixfreaknim[m] | just a simple gui , label , textbox label, textbox , user inputs a number and calculate to Fahrenheit |
03:49:00 | FromDiscord | <Elegantbeef> Ah then yea a proc is fine |
03:50:23 | nixfreaknim[m] | ok so proc cToF*(c: int): = ? |
03:50:39 | nixfreaknim[m] | then var the formula |
03:53:16 | FromDiscord | <that_dude> I mean consider using a float instead of int |
03:53:24 | FromDiscord | <that_dude> (edit) "I mean" => "I'd" |
03:55:12 | nixfreaknim[m] | Its a user so I was thinking int then parseFloat |
03:56:39 | FromDiscord | <Elegantbeef> What i'd do is https://play.nim-lang.org/#ix=3Mlm cause i'm a silly bastard that likes distincts ๐ |
03:56:42 | FromDiscord | <that_dude> Why not just keep it float? it allows much better accuracy if needed/wanted |
03:59:48 | nixfreaknim[m] | oh lol , ok so you can put the formula in the proc |
04:00:07 | FromDiscord | <Elegantbeef> Have you written Nim before? |
04:00:23 | FromDiscord | <huantian> In reply to @Elegantbeef "What i'd do is": I mean distincts are pretty neato |
04:00:27 | nixfreaknim[m] | yep , just not formulas in the proc |
04:00:47 | FromDiscord | <Elegantbeef> Well they're callable code |
04:00:58 | FromDiscord | <Elegantbeef> Yea i love distincts huan |
04:01:09 | FromDiscord | <Elegantbeef> Which reminds me @SirOlaf have you got any further? |
04:01:21 | nixfreaknim[m] | I just thought there was a better way |
04:02:27 | FromDiscord | <Elegantbeef> nah procs are for when you want to put a nice package on callable code |
04:04:15 | nixfreaknim[m] | great |
04:04:32 | nixfreaknim[m] | thanks for clearing that up for me |
04:05:05 | FromDiscord | <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:32 | FromDiscord | <Elegantbeef> I use them all the time they have so many different usages |
04:05:53 | FromDiscord | <Elegantbeef> Dont want to pass a `isX` flag make two distincts |
04:06:21 | FromDiscord | <that_dude> I guess I don't use overloading much either tbh |
04:06:27 | FromDiscord | <that_dude> I don't use a lot of things lol |
04:06:45 | FromDiscord | <huantian> overloading is greatโตalso `type or type` and `when is` is also fun |
04:06:59 | FromDiscord | <Elegantbeef> I typically use distinct for safety or clarity |
04:07:11 | FromDiscord | <Elegantbeef> Like for instance a trig function that takes radian |
04:07:18 | FromDiscord | <Rika> i dont use distincts too often |
04:07:27 | FromDiscord | <Elegantbeef> Clarity and safety, no one can accidently pass the wrong value in |
04:08:17 | FromDiscord | <Elegantbeef> I cant overstate how much i love them |
04:08:47 | FromDiscord | <Rika> if you overuse them they can be annoying |
04:09:05 | FromDiscord | <Elegantbeef> I think that's not overused and incorrectly used |
04:09:05 | * | Guest10 quit (Client Quit) |
04:09:15 | FromDiscord | <Rika> overuse is incorrect use................. |
04:09:34 | FromDiscord | <Elegantbeef> Tomato tomato |
04:09:48 | FromDiscord | <Rika> pomegranate pomme grenade? |
04:10:12 | FromDiscord | <huantian> POM Granite table top |
04:10:57 | FromDiscord | <Elegantbeef> Anywho they're lovely, and use them where they make sense and you make a nicer API/happier coders |
04:11:29 | FromDiscord | <Elegantbeef> To me `script: NimScriptFile or NimScriptPath` instead of `script: string, isFile: bool` is just a much nicer api |
04:13:14 | arkanoid | I'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:43 | FromDiscord | <Elegantbeef> `newJsObject()`? |
04:13:53 | FromDiscord | <Elegantbeef> I dont know if collect can be used on non generic procedures, dont recall |
04:14:18 | arkanoid | wait, just found it's newJArray |
04:14:54 | arkanoid | wait, no, it doesnt like it |
04:14:55 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Mly |
04:24:11 | arkanoid | thanks! it works even with newJArray instead of newJObject (not sure about the difference here) |
04:40:46 | FromDiscord | <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:44 | arkanoid | treeform, oh, that's something important |
05:16:03 | FromDiscord | <Rika> Please read the whole discussion though xd |
05:22:59 | * | adigitoleo_ is now known as adigitoleo |
05:42:46 | FromDiscord | <Bung> @ElegantBeef I see new update, what about procs in fields ? |
05:47:30 | * | adigitoleo_ joined #nim |
05:48:55 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> I messed up a bit, now they're properly Nil'd |
05:52:14 | FromDiscord | <Bung> okay it haven't been done right ? I'd like to what happen after that |
05:52:28 | FromDiscord | <Elegantbeef> What do you mean? |
05:52:50 | FromDiscord | <Bung> oh , I see you push code 37 seconds ago |
05:53:08 | FromDiscord | <Elegantbeef> Yea i thought i had them working but i realized just now i didnt handle them properly |
05:53:17 | FromDiscord | <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:16 | FromDiscord | <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:12 | FromDiscord | <Bung> sent a code paste, see https://paste.rs/HL8 |
05:59:27 | FromDiscord | <Elegantbeef> When statements are complicated to support, i do need to make `parseObject` not messy but i stand by that error atm |
06:00:41 | FromDiscord | <Bung> can simply ignore this part as `when false` ? |
06:00:52 | FromDiscord | <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:37 | FromDiscord | <Elegantbeef> Indeed in this case |
06:08:39 | FromDiscord | <Bung> another thinking , with ast parser I think the returnType can be automatically filled |
06:08:55 | FromDiscord | <Elegantbeef> How can the returnType be filled? |
06:09:07 | FromDiscord | <Elegantbeef> It can only be filled in the case you supply do `addCallable` |
06:09:42 | FromDiscord | <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:54 | FromDiscord | <Elegantbeef> So you can technically have different names and it'll work fine |
06:11:04 | FromDiscord | <Bung> in this case can assuming they're same name in both side. |
06:11:25 | FromDiscord | <Elegantbeef> I mean that cannot be done anyway |
06:11:36 | FromDiscord | <Elegantbeef> The types on Nim have to be statically known |
06:12:50 | FromDiscord | <Elegantbeef> Remember the that nimscript program is 100% detatched from the Nim program |
06:13:05 | FromDiscord | <Elegantbeef> There is no way to intuit the type from a program you dont have at CT |
06:19:02 | FromDiscord | <Bung> I dont know , I think you can attach a pragma to handle this or just emit same name on script side |
06:20:30 | FromDiscord | <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:26 | FromDiscord | <Bung> yeah , nvm , handle `when false` first. |
06:24:27 | FromDiscord | <Elegantbeef> Well that was done but i was trying to support `when true` aswell but that's nobueno |
06:25:32 | FromDiscord | <Bung> oh god, so quick |
06:27:58 | FromDiscord | <Bung> ` Error: type mismatch: got 'NimNode' for 'โตnil' but expected 'Node = ref Node:ObjectType'` |
06:28:46 | FromDiscord | <Elegantbeef> You distracted me with the demanding tone ๐ |
06:29:55 | FromDiscord | <Elegantbeef> Actually i dont know what code causes that |
06:30:00 | FromDiscord | <Bung> is this suppose to be error or bug ? |
06:30:08 | FromDiscord | <Elegantbeef> My test passes |
06:30:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/Jf5 |
06:31:00 | FromDiscord | <Bung> I think it occurs when handle `dom: Node` |
06:33:02 | FromDiscord | <Elegantbeef> Well i guess i dont properly handle these complex objects still |
06:33:20 | FromDiscord | <Elegantbeef> Someone gets to rewrite my parsing logic soon i suppose |
06:34:02 | FromDiscord | <Bung> okay, that's a bug |
06:35:11 | FromDiscord | <Elegantbeef> Well the parsing should work on any object |
06:36:14 | FromDiscord | <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:02 | FromDiscord | <Elegantbeef> I mean it's worked fine for my stuff, but it's always been less complex |
06:37:39 | FromDiscord | <Elegantbeef> Large complex objects are good tests for the interface |
06:37:57 | FromDiscord | <Bung> okay, I'll be your test man |
06:38:42 | FromDiscord | <Bung> anyway ,I dont have alternative solution. |
06:39:39 | FromDiscord | <Elegantbeef> Well you could use another scripting language ๐ |
06:40:26 | FromDiscord | <Bung> I dont know any other script language intergrate well with ni m |
06:40:55 | FromDiscord | <Rika> Lua |
06:41:02 | FromDiscord | <Bung> also use nim both sides cooler. |
06:41:04 | FromDiscord | <Rika> Lua works relatively well |
06:41:27 | FromDiscord | <Bung> which lib ? |
06:41:33 | FromDiscord | <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:55 | FromDiscord | <Bung> yeah, I also interested in |
06:42:13 | FromDiscord | <Elegantbeef> Technically Nimscript isnt that magical here all i've done is use macros to automate the bridge |
06:42:19 | FromDiscord | <Elegantbeef> You can do the same thing with any VM |
06:44:15 | FromDiscord | <Bung> that's harder , as nimscripter provide simple api for me. |
06:45:06 | FromDiscord | <Elegantbeef> Yea i mean ideally nimscripter works, but you clearly like to hit the wall of what it can presently handle ๐ |
06:45:53 | FromDiscord | <Elegantbeef> I can say for certainty it does handle JSON now ๐ |
06:49:51 | FromDiscord | <Bung> that's wonderfull thing |
07:40:24 | * | vicecea quit (Remote host closed the connection) |
07:40:52 | * | vicecea joined #nim |
08:46:15 | FromDiscord | <evil> is there a format proc that takes in a string and a seq[string]? |
08:51:13 | FromDiscord | <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:58 | FromDiscord | <Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Mpe |
09:45:23 | FromDiscord | <Isofruit> (edit) "https://play.nim-lang.org/#ix=3Mpe" => "https://play.nim-lang.org/#ix=3Mpf" |
09:45:58 | FromDiscord | <Rika> You can always use the hack called โcompilesโ |
09:46:13 | FromDiscord | <Isofruit> That... is actually fair |
09:46:16 | FromDiscord | <Isofruit> Not beautiful |
09:46:17 | FromDiscord | <Isofruit> But fair |
09:46:53 | FromDiscord | <Rika> Well unfortunately I donโt know of any other way or method to do what you want |
09:49:22 | FromDiscord | <Elegantbeef> You can do some funky stuff like `proc(id: T)(triggerDeleteSignals)` |
09:49:44 | FromDiscord | <Elegantbeef> It's still a when |
09:50:17 | FromDiscord | <Isofruit> What happens in that block? I don't think I'm familiar with that syntax |
09:50:41 | FromDiscord | <Elegantbeef> I have an example in nimscripter somewhere |
09:50:46 | FromDiscord | <Elegantbeef> One second |
09:52:50 | FromDiscord | <Elegantbeef> You can do `when declared(triggerDeleteSignals) and (proc(id: T)(triggerDeleteSignals)) != nil:` i think |
09:53:24 | FromDiscord | <Elegantbeef> Is that any better than when compiles probably not |
09:55:12 | FromDiscord | <Isofruit> but what does this `proc(id: T)(triggerDeleteSignals)` say? A proc in brackets directly after an unfinished proc signature? |
09:55:26 | FromDiscord | <Elegantbeef> Converts the symbol to that proc if it can |
09:56:52 | FromDiscord | <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:31 | FromDiscord | <Elegantbeef> Yea |
09:57:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Mpm |
09:59:02 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Mpn |
09:59:27 | FromDiscord | <Isofruit> Now on to philosophize about what has the better readability |
09:59:41 | FromDiscord | <Rika> If you comment it the latter could be better |
10:00:02 | FromDiscord | <Elegantbeef> Personally i'm of party just use `when compiles` |
10:01:48 | FromDiscord | <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:12 | FromDiscord | <Isofruit> Which means less reading with "when compiles" |
10:02:17 | FromDiscord | <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:38 | FromDiscord | <Elegantbeef> Yea a macro also works |
10:03:27 | FromDiscord | <Elegantbeef> You also could add a new overload `deleteEntry[Character](entryId, SignalDelete)` |
10:04:02 | FromDiscord | <Elegantbeef> Where signal delete is `type SignalDelete = distinct void` just cause fuck yea distinct! ๐ |
10:04:22 | FromDiscord | <Elegantbeef> Or name it `deleteEntryWithSignal` If you prefer that |
10:04:46 | FromDiscord | <Isofruit> I was about to have a SignalType enum |
10:05:20 | FromDiscord | <Isofruit> And pass that as first parameter, which could have `preDelete, postDelete, preCreate, postCreate, preUpdate, postUpdate` values |
10:05:42 | FromDiscord | <Rika> Ew |
10:06:26 | FromDiscord | <Elegantbeef> So what you'd send a set |
10:07:23 | FromDiscord | <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:36 | FromDiscord | <Isofruit> While I can just insert the right one with generics |
10:07:38 | FromDiscord | <Elegantbeef> I mean you can do it statically |
10:08:19 | FromDiscord | <Elegantbeef> You can do `signal(sigTyp: static SignalType)` and do `when sigType == preDelete` |
10:08:21 | FromDiscord | <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:34 | FromDiscord | <Elegantbeef> This isnt shit i know so i dont know |
10:08:51 | FromDiscord | <Rika> โI donโt know so I donโt knowโ: what you just said |
10:09:06 | FromDiscord | <Elegantbeef> Thanks capt |
10:23:51 | * | Gustavo6046 quit (Quit: Leaving) |
10:24:04 | FromDiscord | <ynfle> Is the only way to write at compiel time staticexec? |
10:24:36 | FromDiscord | <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:38 | FromDiscord | <Rika> In reply to @evoalg "I'm glad I'm not": Why? |
10:27:09 | FromDiscord | <ynfle> Is there any issue with writefile and compile time? why do we have staticread then? |
10:29:21 | FromDiscord | <Rika> Afaik itโs fine to do static: write |
10:29:25 | FromDiscord | <Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3MpG |
10:29:36 | FromDiscord | <Rika> In reply to @Isofruit "<@!259277943275126785> <@!145405730571288577> ": Congratulations |
10:29:44 | FromDiscord | <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:46 | FromDiscord | <Isofruit> (edit) "https://play.nim-lang.org/#ix=3MpG" => "https://play.nim-lang.org/#ix=3MpH" |
10:30:33 | FromDiscord | <Rika> I donโt like either, Iโd prefer RAII |
10:30:43 | FromDiscord | <Rika> And destructors are pretty close to it |
10:30:45 | FromDiscord | <Rika> Hehe close |
10:31:25 | FromDiscord | <evoalg> RAII? |
10:31:49 | FromDiscord | <Elegantbeef> Arc basically |
10:31:59 | FromDiscord | <Elegantbeef> Where you have destructors that are called when objects are done with |
10:32:30 | FromDiscord | <evoalg> ohhh |
10:32:36 | FromDiscord | <Rika> When something goes out of scope it also does close and stuff is how I explain |
10:32:55 | FromDiscord | <Rika> โResource allocation is instantiationโ or something |
10:33:02 | FromDiscord | <evoalg> nice ๐ |
10:33:06 | FromDiscord | <Rika> Making variables == using resource |
10:33:08 | FromDiscord | <Elegantbeef> intialization? |
10:33:21 | FromDiscord | <Rika> Whatever, same banana |
10:34:18 | FromDiscord | <evoalg> I've also gone off `collect` for the same reason |
10:43:14 | FromDiscord | <Isofruit> Is this not how you're supposed to get the compiler to shut up about unreachable code:โต{.hint[UnreachableCode]: off.} ? |
10:53:53 | FromDiscord | <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:36 | FromDiscord | <evoalg> and that's why it's var aren't accessible ... but I also suspect it's more complicated than that |
10:54:58 | FromDiscord | <Rika> โOwn scopeโ no |
10:55:18 | FromDiscord | <Rika> โItโs variables are essentially inaccessible from the outside unless forced toโ yes |
10:55:27 | FromDiscord | <evoalg> ok |
10:55:47 | FromDiscord | <Rika> The variable names are โobfuscatedโ |
10:56:10 | FromDiscord | <evoalg> ok I see ... and they aren't freed |
10:56:15 | FromDiscord | <evoalg> of mem |
10:57:43 | FromDiscord | <Rika> Itโs usually negligible anyway |
10:58:29 | FromDiscord | <evoalg> ok thx! |
11:24:01 | FromDiscord | <01> when interoping with Python/Java, can i also use pip installed modules, and java packages from maven central? |
11:24:49 | FromDiscord | <01> (edit) "Python/Java," => "Python/Java (pynim, jnim)," |
11:24:54 | FromDiscord | <01> (edit) "(pynim," => "(nimpy," |
11:26:17 | FromDiscord | <Recruit_main707> i think you can with nimpy at least |
11:28:52 | FromDiscord | <01> what about C interop, can i just work with regular functions in C file, or do i need a DLL? |
11:29:43 | FromDiscord | <Recruit_main707> you can do both |
11:33:42 | FromDiscord | <01> neat |
11:34:27 | * | jjido joined #nim |
12:23:09 | NimEventer | New Nimble package! nimkov - Text generator, based on Markov Chains (Markov text generator), see https://github.com/bit0r1n/nimkov |
12:59:29 | adigitoleo | how can I go from `r"\tfoo"` to `"\tfoo"` (applying the escaping rules to the raw string) |
13:00:54 | adigitoleo | raw string is coming in from a stream |
13:09:41 | adigitoleo | use case is reading single byte char from command line into an option argument |
13:14:07 | FromDiscord | <demotomohiro> How about to replace "\\t" to "\t" using some proc in strutils module. |
13:14:35 | FromDiscord | <demotomohiro> "\\\\t" to "\t" |
13:17:47 | FromDiscord | <demotomohiro> !eval import strutils; echo r"foo\tbar".replace("\\\\t", "\t") |
13:17:50 | NimBot | foo\tbar |
13:19:09 | FromDiscord | <demotomohiro> !eval import strutils; echo r"foo\tbar".replace("\\t", "\t") |
13:19:12 | NimBot | foo bar |
13:22:11 | FromDiscord | <demotomohiro> Discord automatically convert "\\\\t" to "\t" and Nimbot takes text as I wrote. It confusing. |
13:27:16 | adigitoleo | yeah thanks for the tips, looks like it could work once I clean up some other bugs I just found in my code :) |
13:37:02 | adigitoleo | I 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:29 | NimEventer | New 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:04 | FromDiscord | <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:51 | FromDiscord | <xflywind> In reply to @auxym "Anyone know if there's": https://nim-lang.org/docs/compilesettings.html#querySetting%2CSingleValueSetting |
14:33:07 | FromDiscord | <auxym> thanks @xflywind |
14:33:22 | FromDiscord | <xflywind> no problem |
14:58:30 | * | arkurious joined #nim |
15:40:31 | FromDiscord | <enthus1ast> i wish there where a resonable orm for nim, or at least a\: map db return strings to objects thing |
15:40:45 | FromDiscord | <enthus1ast> databases with nim are terrible imho |
15:42:11 | FromDiscord | <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:11 | FromDiscord | <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:10 | FromDiscord | <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:15 | FromDiscord | <Isofruit> (edit) ""hash"" => ""harsh"" |
15:55:50 | FromDiscord | <Isofruit> But I guess that's from the standpoint that you only use norm for DML and do DDL by hand |
15:56:45 | FromDiscord | <Isofruit> (edit) "that's" => "my position is" |
16:02:04 | FromDiscord | <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:17 | FromDiscord | <enthus1ast> i'll try gatebase now, lets see what this can offer |
16:03:24 | FromDiscord | <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:18 | FromDiscord | <enthus1ast> databases do not reflect the normal useage at all its funny |
16:05:48 | FromDiscord | <leorize> ndb is a db module that lets you get non-string out of db |
16:13:40 | yann-kaelig | Hello |
16:15:11 | yann-kaelig | Well, 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:12 | yann-kaelig | A very good pedagogical book I'm going to use as material for the Nim language. |
16:21:51 | yann-kaelig | So, this book start with the header file <iostream> I suppose that in Nim it's : system/io |
16:22:09 | FromDiscord | <Rika> no |
16:22:19 | FromDiscord | <Rika> you do not import system or io manually in nim |
16:22:28 | FromDiscord | <Rika> they are implicitly imported |
16:28:19 | FromDiscord | <demotomohiro> You can use echo or stdout without importing system/io. |
16:28:25 | NimEventer | New thread by Aquachain: Closure and for loop problem, see https://forum.nim-lang.org/t/8813 |
16:28:31 | FromDiscord | <demotomohiro> !eval stdout.write("Hello world") |
16:28:33 | NimBot | Hello world |
16:31:06 | yann-kaelig | That 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:07 | FromDiscord | <Rika> echo also adds line end \n |
16:32:12 | FromDiscord | <Rika> and has a few other differences |
16:32:24 | FromDiscord | <Rika> here is write https://nim-lang.org/docs/io.html#write%2CFile%2Cvarargs%5Bstring%2C%5D |
16:35:58 | FromDiscord | <demotomohiro> echo is a proc you can easily print message on stdout. `write` proc is for write text to file. |
16:36:49 | FromDiscord | <enthus1ast> write can also print on stdout, but does not append a newline, good for prompts etc |
16:38:52 | yann-kaelig | well, 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:50 | FromDiscord | <Rika> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
16:43:01 | FromDiscord | <demotomohiro> !eval echo("foo"); "foo".echo; echo "foo"; echo"foo" |
16:43:03 | NimBot | fooโตfooโตfooโตfoo |
16:43:11 | FromDiscord | <Rika> "foo".echo is so cursed |
16:45:01 | FromDiscord | <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:21 | FromDiscord | <Rika> brand new custom preprocessor :inatehe: |
17:06:12 | * | kayabaNerve joined #nim |
17:26:41 | Amun-Ra | demotomohiro: like a definition of object in C andโฆ everywhere else ;) |
17:55:46 | yann-kaelig | So, 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:13 | yann-kaelig | single* |
18:00:09 | Amun-Ra | hm? |
18:00:18 | yann-kaelig | the same error message output happen if I run echo 'ABC' |
18:02:01 | yann-kaelig | run/compile my code |
18:02:04 | Amun-Ra | multi-character literals are not supported in Nim |
18:03:53 | Amun-Ra | (they were inherited in C from B, and are, thankfully, long gone) |
18:05:25 | Amun-Ra | yann-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:24 | yann-kaelig | ok, 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:47 | Amun-Ra | 'A' is char, "A" is string |
18:07:06 | Amun-Ra | there's no difference when echoing |
18:07:21 | Amun-Ra | well, almost no difference |
18:07:48 | Amun-Ra | proc echo*(x: varargs[typed, `$`]) {.magic: "Echo", benign, sideEffect.} |
18:10:40 | FromDiscord | <demotomohiro> !eval typeof('A'), " ", typeof("A") |
18:10:41 | NimBot | Compile failed: /usercode/in.nim(1, 12) Error: invalid indentation |
18:11:09 | FromDiscord | <demotomohiro> !eval echo typeof('A'), " ", typeof("A") |
18:11:11 | NimBot | char string |
18:11:35 | FromDiscord | <demotomohiro> !eval echo typeof("A"[0]) |
18:11:37 | NimBot | char |
18:12:15 | FromDiscord | <demotomohiro> So string is like array of chars. |
18:12:22 | FromDiscord | <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:08 | Amun-Ra | mlokis: byte is an alias for uint8 |
18:13:23 | Amun-Ra | chars and bytes are different kind of octets |
18:13:40 | FromDiscord | <mlokis> I just remembered that nim does not have char as u32 |
18:14:15 | FromDiscord | <demotomohiro> !eval echo char.low, " ", byte.low |
18:14:17 | NimBot | |