00:03:05 | * | natrys quit (Quit: natrys) |
00:23:00 | * | nemox joined #nim |
00:23:16 | * | nemox left #nim ("WeeChat 0.4.3") |
00:41:42 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
00:42:01 | * | njoseph joined #nim |
01:01:17 | * | vsantana joined #nim |
01:01:35 | * | vsantana quit (Client Quit) |
01:06:53 | * | Tanger joined #nim |
02:01:20 | * | krux02 quit (Remote host closed the connection) |
03:09:10 | * | wasted_youth2 quit (Read error: Connection reset by peer) |
03:50:01 | * | greaser|q quit (Changing host) |
03:50:02 | * | greaser|q joined #nim |
03:50:04 | * | greaser|q is now known as GreaseMonkey |
04:00:25 | * | spiderstew_ joined #nim |
04:01:37 | * | spiderstew quit (Ping timeout: 252 seconds) |
04:26:35 | * | letto joined #nim |
04:48:52 | FromDiscord | <Gennadiy> sent a code paste, see https://play.nim-lang.org/#ix=2WOy |
04:59:26 | * | narimiran joined #nim |
05:16:08 | ForumUpdaterBot | New Nimble package! rodster - rodster, see https://github.com/j-a-s-d/rodster |
05:26:52 | FromDiscord | <ElegantBeef> After looking at that package and it's dependancy `xam` i have to ask.... why? |
06:09:36 | * | arecaceae quit (Remote host closed the connection) |
06:09:56 | * | arecaceae joined #nim |
06:10:54 | ForumUpdaterBot | New thread by Stefan_Salewski: Finally ported the rubberband router from Ruby to Nim, see https://forum.nim-lang.org/t/7833 |
06:17:35 | * | narimiran quit (Ping timeout: 245 seconds) |
06:18:12 | * | filcuc joined #nim |
06:19:07 | * | fowl quit (Ping timeout: 245 seconds) |
06:20:40 | * | narimiran joined #nim |
06:21:57 | * | fowl joined #nim |
07:02:42 | * | PMunch joined #nim |
07:26:04 | * | wasted_youth2 joined #nim |
07:56:55 | FromGitter | <leelavg> hi, a newbie question. I was following Nim-in-Action and not able to figure out what exactly is the different between (`0 .. < list.len` vs `0 .. <list.len`). Can someone have a quick look at https://play.nim-lang.org/#ix=2WPj if possible? |
07:59:42 | PMunch | The spaces is the difference between a binary and a unary operator |
07:59:46 | FromDiscord | <haxscramper> `..<list` is parsed as prefix |
07:59:57 | FromDiscord | <haxscramper> `..< list` is an infix because there is a space |
08:00:50 | PMunch | Exactly, so `0 ..< list.len` is parsed as `..<(0, list.len)` while `0 ..<list.len` is parsed as `0 ..<(list.len` which isn't valid |
08:02:08 | FromGitter | <leelavg> ack, seems there was a change in between the compiler version. Thanks. |
08:02:30 | FromDiscord | <Rika> yes, the removal(?) of the `<` unary operator |
08:02:32 | PMunch | @leelavg, yes this is new from when the book was written. You can find the complete errata here: https://deepakg.github.io/nim/2019/09/28/nim-in-action-errata.html |
08:04:03 | FromGitter | <leelavg> Thanks, i was already referring the errata :) however this might have been mentioned later on in the errata. |
08:05:22 | PMunch | Hmm, it seems it was only deprecated when the errata was written |
08:05:28 | PMunch | Time for an errata errata? :P |
08:06:11 | FromGitter | <leelavg> hehe, might be. However it's good up-to now. |
08:26:11 | * | tiorock joined #nim |
08:26:11 | * | tiorock quit (Changing host) |
08:26:11 | * | tiorock joined #nim |
08:26:11 | * | rockcavera is now known as Guest76920 |
08:26:11 | * | Guest76920 quit (Killed (orwell.freenode.net (Nickname regained by services))) |
08:26:11 | * | tiorock is now known as rockcavera |
08:34:38 | PMunch | Hmm, I wonder if this kind of stuff will get worse now that people seem to have started using Nim for malware: https://forum.nim-lang.org/t/7830 |
08:41:39 | * | vicfred quit (Quit: Leaving) |
08:48:03 | FromDiscord | <Heav> hi. i'm looking at nim-by-example.github.io↵what do these asterisks represent? i do not see it explained. https://media.discordapp.net/attachments/371759389889003532/834349749578367027/unknown.png |
08:48:48 | PMunch | They are export markers |
08:49:11 | PMunch | https://nim-lang.org/docs/manual.html#procedures-export-marker |
08:49:49 | PMunch | Not sure why they are under the "Procedures" topic, they apply to every top-level thing in Nim |
08:50:12 | PMunch | It's how you make variables, types, procedures, etc. available to modules which import your module. |
08:50:20 | FromDiscord | <Heav> okay, thanks |
09:06:39 | * | Vladar joined #nim |
09:09:41 | * | Tanger quit (Remote host closed the connection) |
09:12:29 | * | krux02 joined #nim |
09:13:31 | * | sagax joined #nim |
09:20:04 | * | narimiran quit (Ping timeout: 252 seconds) |
09:35:21 | * | Clonkk[m] quit (Ping timeout: 245 seconds) |
09:35:21 | * | ckafi[m] quit (Ping timeout: 245 seconds) |
09:35:58 | * | ckafi[m] joined #nim |
09:35:59 | * | Clonkk[m] joined #nim |
09:40:39 | FromDiscord | <Heav> does nim have things like `|=`? |
09:44:14 | * | sagax quit (Ping timeout: 252 seconds) |
09:53:41 | FromDiscord | <haxscramper> ``proc `|=`(a: var bool, b: bool) = a = a | b`` |
09:54:25 | FromDiscord | <haxscramper> (edit) "|" => "or" |
09:55:50 | FromDiscord | <Heav> ok |
09:58:30 | FromDiscord | <haxscramper> Logical operators use kewords (`or`/`and`/`xor`) so there is no build-in in-place version of them. Math operators do have in-place versions |
09:58:35 | FromDiscord | <haxscramper> (edit) "kewords" => "keywords" | "build-in" => "built-in" |
10:55:16 | * | sagax joined #nim |
11:01:58 | ForumUpdaterBot | New thread by M33: Preferred mingw version to build nim on Windows, see https://forum.nim-lang.org/t/7834 |
11:03:24 | FromDiscord | <WSECU> Can I write shell script like code with nim? |
11:04:41 | FromDiscord | <Rika> wdym? example? |
11:04:56 | FromDiscord | <WSECU> Give me a second |
11:05:57 | FromDiscord | <WSECU> sent a code paste, see https://play.nim-lang.org/#ix=2WQ2 |
11:06:50 | FromDiscord | <Rika> cant use $, but there is `&` in strformat; usage: `echo &"{my_boost} is to {me} as "` |
11:07:15 | FromDiscord | <Rika> and the variables must be declared properly too, `let me = "Dave"`... |
11:12:11 | FromDiscord | <WSECU> sent a code paste, see https://play.nim-lang.org/#ix=2WQ5 |
11:13:03 | FromDiscord | <Rika> !eval import strutils; let me = "Dave"; let my_boost="Linux"; let him="Popeye"; let his_boost="Spinach"; let this_year=2019; echo &"{my_boost} is to {me} as {his_boost} is to {him} (c) {this_year}" |
11:13:05 | NimBot | Compile failed: /usercode/in.nim(1, 125) Error: type mismatch: got <string> |
11:13:14 | FromDiscord | <Rika> eeh |
11:13:29 | FromDiscord | <Rika> oph |
11:13:30 | FromDiscord | <Rika> strutils |
11:13:36 | FromDiscord | <Rika> its strformat lmao |
11:13:42 | FromDiscord | <Rika> !eval import strformat; let me = "Dave"; let my_boost="Linux"; let him="Popeye"; let his_boost="Spinach"; let this_year=2019; echo &"{my_boost} is to {me} as {his_boost} is to {him} (c) {this_year}" |
11:13:45 | NimBot | Linux is to Dave as Spinach is to Popeye (c) 2019 |
11:14:46 | FromDiscord | <Rika> In reply to @WSECU "Turns out I found": `echo "$var"` wont be as intended though i believe |
11:17:05 | FromGitter | <ynfle> Is there a way package (or stdlib proc) to generate the permutations of `seq[seq[int]]` |
11:17:55 | FromDiscord | <WSECU> What do you mean by that @Rika |
11:18:07 | FromDiscord | <Rika> it wont put the contents of var into a string |
11:21:22 | FromDiscord | <WSECU> It compiles fine without error |
11:22:24 | FromDiscord | <Rika> well yeah but is it doing as intended? |
11:22:38 | FromDiscord | <Rika> !eval let me = "Dave"; echo "$me" |
11:22:40 | NimBot | $me |
11:22:57 | FromDiscord | <WSECU> If I use perlish, it echoes back the variable. |
11:23:03 | FromDiscord | <Rika> huh, really |
11:23:17 | FromDiscord | <Rika> even inside a string? |
11:23:30 | FromDiscord | <WSECU> Even inside a string. Download and try this, import perlish. https://raw.githubusercontent.com/Araq/blog/master/perlish.nim |
11:23:35 | FromDiscord | <Rika> !eval let me = "Dave"; echo $me # this works even without perlish because $ is the toString of nim |
11:23:37 | NimBot | Dave |
11:23:43 | FromDiscord | <Rika> huh |
11:23:59 | FromDiscord | <Rika> well be careful on relying on that |
11:24:08 | FromDiscord | <WSECU> What's the worst that could happen? |
11:24:25 | FromDiscord | <Rika> sudden breakage |
11:24:40 | FromDiscord | <WSECU> It's a micro program, so I can rewrite it as necessary. |
11:26:30 | FromDiscord | <Rika> okay |
12:04:55 | * | narimiran joined #nim |
12:26:18 | ForumUpdaterBot | New thread by Miran: 4th Nim online meetup, see https://forum.nim-lang.org/t/7835 |
13:05:44 | * | filcuc_ joined #nim |
13:06:55 | * | filcuc quit (Ping timeout: 265 seconds) |
13:50:06 | * | liblq-devel joined #nim |
13:52:25 | * | natrys joined #nim |
14:19:16 | * | filcuc joined #nim |
14:20:39 | * | filcuc_ quit (Ping timeout: 268 seconds) |
14:27:02 | * | vsantana joined #nim |
14:30:43 | * | liblq-devel quit (Quit: WeeChat 3.1) |
14:46:54 | ForumUpdaterBot | New Nimble package! nim0 - Nim0 is a toy one-pass compiler for a limited subset of the Nim language, targetting a 32-bit RISC CPU. Compiled Nim0 programs can be executed in the RISC emulator. All this in 5 heavily-documented sources, totalling less than 4k LOC. It is a port of Niklaus Wirth's Oberon-0 compiler as described in his book Compiler construction (included in the package), cross-referenced in the sources, that you |
14:53:16 | FromDiscord | <haxscramper> Not sure why the link is missing but here it is - https://gitlab.com/pmetras/nim0 |
14:56:06 | * | Vladar quit (Quit: Leaving) |
15:00:56 | FromDiscord | <Mustache Man> sent a code paste, see https://play.nim-lang.org/#ix=2WRz |
15:01:39 | FromDiscord | <Mustache Man> (edit) "https://paste.rs/GnV" => "https://paste.rs/ha3" |
15:01:46 | FromDiscord | <Mustache Man> sent a code paste, see https://play.nim-lang.org/#ix=2WRF |
15:14:11 | * | lritter joined #nim |
15:31:05 | * | NimBot joined #nim |
15:45:38 | * | filcuc_ joined #nim |
15:46:54 | * | filcuc quit (Ping timeout: 265 seconds) |
16:01:26 | FromDiscord | <Mustache Man> Hmm, I see. i'm going to have to do a lot of locking before I can make this work. |
16:24:19 | giaco__ | I turned an int64 field to a times.DateTime field in my object, and now "proc `$`*(o: MyObj): string = p.repr" doesn't compile anymore: .choosenim/toolchains/nim-1.4.6/lib/system/repr_v2.nim(87, 8) Error: expression cannot be cast to pointer |
16:25:00 | giaco__ | typo, is * = o.repr |
16:45:35 | * | PMunch quit (Quit: leaving) |
16:46:58 | * | lritter quit (Quit: Leaving) |
16:48:16 | giaco__ | well, these 5 lines raises that error on my pc, but works with play.nim-lang https://play.nim-lang.org/#ix=2WSn, both using 1.4.6 |
16:49:38 | ForumUpdaterBot | New thread by Demotomohiro: How to set discard or empty statement to a default value of untyped parameter?, see https://forum.nim-lang.org/t/7836 |
16:50:00 | giaco__ | could you please try to compile it too? |
17:23:03 | * | letto quit (Quit: Konversation terminated!) |
17:25:08 | * | letto joined #nim |
17:39:04 | * | narimiran quit (Ping timeout: 252 seconds) |
17:41:38 | * | narimiran joined #nim |
17:55:50 | FromDiscord | <Ricky Spanish> is there a idiomatic way to fill a sequence to a particular length? |
17:56:24 | FromDiscord | <haxscramper> `newSeqOfCap()` or `newSeqWith()` |
17:56:31 | FromDiscord | <Ricky Spanish> ah awesome thank you |
18:00:51 | * | vicfred joined #nim |
18:11:02 | giaco__ | could you please try to compile this on your machine? I'm getting an error while play.nim-lang is not https://play.nim-lang.org/#ix=2WSn |
18:13:20 | FromDiscord | <haxscramper> Compiles fine for me. `nim 1.4.6.`, debian docker |
18:22:38 | giaco__ | this puzzles me a lot. I dont know what could make my env fail for same nim file |
18:23:14 | giaco__ | I've installed nim via choosenim and I'm nkt using any module here |
18:23:29 | FromDiscord | <haxscramper> What flags did you use for compilation? Just `nim r a.nim`? |
18:23:46 | * | vsantana quit (Quit: Leaving) |
18:23:53 | giaco__ | nim c -r file.nim |
18:25:02 | FromDiscord | <haxscramper> !eval import std/times; echo DateTime().repr |
18:25:08 | NimBot | [nanosecond = 0,↵second = 0,↵minute = 0,↵hour = 0,↵monthdayZero = 0,↵monthZero = 0,↵year = 0,↵weekday = Monday,↵yearday = 0,↵isDst = false,↵timezone = nil,↵utcOffset = 0]↵ |
18:26:26 | giaco__ | "import std/times; echo DateTime().repr" compiles correctly in my env |
18:26:35 | giaco__ | "import std/times; echo DateTime().repr" compiles correctly in my env |
18:26:44 | giaco__ | sorry double paste |
18:31:27 | giaco__ | if I move the nim file into a new empty folder it compiles correctly |
18:32:16 | giaco__ | now, what can modify compiler behaviour when moving nim file to other directory, given the fact that there are no nim.cfg *.nims file whatsoever? |
18:33:42 | FromDiscord | <haxscramper> You can try `nim c --verbosity:3 --skipParentCfg --skipUserCfg --skipProjCfg yourfile.nim` to make sure no compiler options are being passed |
18:34:10 | FromDiscord | <haxscramper> also `--skipCfg:on` |
18:35:09 | giaco__ | got the culprit. I was wrong, I had a cfg file parked in the wrong path after backup restore, and the problem is caused by --gc: orc |
18:35:29 | giaco__ | try to compile same file with --gc:orc, you should get same error |
18:36:38 | giaco__ | this is a nim bug, I suppose |
18:37:40 | giaco__ | sadly is not possible to pick GC with play.nim-lang |
18:38:06 | giaco__ | also arc fails same test |
18:38:22 | FromDiscord | <haxscramper> yes, now I can reproduce |
18:38:36 | FromDiscord | <exelotl> is `a = a.high` on the chopping block? |
18:38:58 | giaco__ | is this worth a ticket? |
18:42:33 | FromDiscord | <haxscramper> Maybe. orc cannot cast procedure to a `pointer` or something like that, though I cannot reproduce it using simple `cast` on proc (like it is done in `repr_v2.nim`) |
18:47:17 | giaco__ | not sure what would be a proper issue title here |
18:57:57 | giaco__ | here we go, my first issue on nim: https://github.com/nim-lang/Nim/issues/17812 I checked if there was another open with same error and I haven't found any, but I feel that this is one of those kind of errors with many different names |
19:39:41 | * | junland quit (Quit: %ZNC Disconnected%) |
19:40:42 | * | junland joined #nim |
19:46:24 | FromDiscord | <Ricky Spanish> how can you split at the first occurence of something in a string? is there any type of max split parameter |
19:57:03 | * | lritter joined #nim |
19:59:12 | * | filcuc_ quit (Ping timeout: 265 seconds) |
20:00:29 | FromDiscord | <Ricky Spanish> whats the simplest way to convert seq[int] to a string? |
20:02:01 | FromDiscord | <haxscramper> You need to convert it via byte-level representation of just stringifiy each element? |
20:02:21 | FromDiscord | <Ricky Spanish> i just want the string representation i.e 1 = "1" |
20:02:22 | FromDiscord | <haxscramper> !eval import std/strutils; echo @[1,2,3,4].mapIt($it).join("--") |
20:02:25 | NimBot | Compile failed: /usercode/in.nim(1, 37) Error: attempting to call undeclared routine: 'mapIt' |
20:02:50 | FromDiscord | <haxscramper> !eval import std/strutils; echo @[1,2,3,4].join("--") |
20:02:54 | NimBot | 1--2--3--4 |
20:03:03 | FromDiscord | <Ricky Spanish> nice i see thank you so much |
20:03:10 | FromDiscord | <haxscramper> $ converts anything to stirng |
20:11:39 | * | lritter quit (Quit: Leaving) |
20:23:33 | * | natrys quit (Quit: natrys) |
20:27:01 | * | narimiran quit (Ping timeout: 245 seconds) |
20:29:00 | FromDiscord | <Ricky Spanish> when i use $ it adds "@[" these to the beginning of each element is tthere a way to prevent that |
20:33:08 | FromDiscord | <ElegantBeef> you can override the `$` for your type or do `.join(",")` |
20:33:27 | * | PMunch joined #nim |
20:41:47 | FromDiscord | <ajusa> is there any way to get keycodes in Nim? Like is there an enum of them already defined? Asking for the JS target |
20:42:32 | FromDiscord | <reilly> I'm using nimscript to make a build task for once. Is it possible (and convenient) to have my custom build task still check that dependencies are satisfied, like the default `build` command? |
20:46:19 | * | Sembei joined #nim |
20:46:55 | FromDiscord | <reilly> Actually thought about it for more than half a second and realized I could just do `exec "nimble install -d"`. |
20:50:21 | FromDiscord | <zetashift> In reply to @ajusa "is there any way": maybe this https://nim-lang.org/docs/dom.html#KeyboardEventKey ? |
21:12:31 | FromDiscord | <ajusa> In reply to @zetashift "maybe this https://nim-lang.org/docs/dom.html#Keybo": that doesn't correspond to the actual keycodes :(, already checked it |
21:12:58 | FromDiscord | <ajusa> like the value for tab is 9, but it isn't even close to the start of the enum |
21:18:29 | FromDiscord | <Ricky Spanish> @ElegantBeef thank you it worked |
21:29:26 | FromDiscord | <zetashift> In reply to @ajusa "that doesn't correspond to": ah damn I didn't know |
21:35:55 | FromDiscord | <Mustache Man> how can I 'erase' the CLI, or otherwise cleanly update data on a CLI? |
21:36:14 | FromDiscord | <Mustache Man> I tried flushFile(stdout) but that doesn't seem to work |
21:41:41 | * | PMunch quit (Quit: leaving) |
21:48:37 | * | mjsir911 joined #nim |
22:00:53 | FromDiscord | <Hi02Hi> I found https://nim-lang.org/docs/terminal.html#eraseScreen%2CFile |
22:00:55 | FromDiscord | <zidsal> if I pass a variable to a macro I'll get the following value `Ident "testVar"` is there anyway to get the value held by that variable? |
22:02:19 | FromDiscord | <Mustache Man> In reply to @Hi02Hi "I found https://nim-lang.org/docs/terminal.html#era": that works! thank you. i couldn't find a way to move the cursor up |
22:02:24 | FromDiscord | <Mustache Man> (edit) "In reply to @Hi02Hi "I found https://nim-lang.org/docs/terminal.html#era": that works! thank you. i couldn't find a way to move the cursor up ... " added "a line" |
22:04:51 | FromDiscord | <ElegantBeef> @zidsal `static string` or `$yourNimNode` |
22:05:53 | * | nisstyre quit (Ping timeout: 258 seconds) |
22:06:16 | FromGitter | <ynfle> Is x copied over to y? If y is modified, is x also? ⏎ ⏎ ```let x = @[1, 3, 5, 7] ⏎ var y = x``` [https://gitter.im/nim-lang/Nim?at=6080a1d8a9dd556843f23675] |
22:07:03 | FromDiscord | <zidsal> @ElegantBeef ok so I have to pass the value in as static, rather then getting its nimNode. Final question lets say I parse an enum value to a macro (as a static value) is there an easy way to understand what its enum type is? or should I just be using the type traits module for that? |
22:07:33 | FromDiscord | <ElegantBeef> If you do `static enum` you can do `getImpl` on the nnkSym |
22:07:49 | FromDiscord | <ElegantBeef> Sequences are copied on assignment ynfle |
22:08:17 | FromDiscord | <Hi02Hi> In reply to @Mustache Man "that works! thank": cursur up? https://nim-lang.org/docs/terminal.html#cursorUp%2CFile%2Cint |
22:08:27 | FromDiscord | <Hi02Hi> (edit) "cursur" => "cursor" |
22:09:15 | FromDiscord | <Mustache Man> yeah! but i meant, i tried write(stdout, "\033[2A") and it just printed nonsense in the terminal |
22:09:22 | FromDiscord | <ElegantBeef> (edit) "`static enum`" => "`enum`" |
22:09:47 | FromDiscord | <Mustache Man> which was what was supposed to work for PHP, Python |
22:11:19 | FromGitter | <ynfle> Thanks @ElegantBeef |
22:11:56 | FromGitter | <ynfle> Is that different for the different gcs? If expand arc shows a copy will refc also? |
22:12:04 | FromDiscord | <ElegantBeef> @zidsal here you go https://play.nim-lang.org/#ix=2WTV |
22:12:12 | FromDiscord | <ElegantBeef> turns out it was `getTypeInst` |
22:12:48 | FromDiscord | <ElegantBeef> In reply to @Mustache Man "yeah! but i meant,": probably needed to do `r"\033[2A"` |
22:13:01 | FromDiscord | <ElegantBeef> Actually nevermind that's dumb 😄 |
22:13:18 | FromDiscord | <Mustache Man> looks like cursorUp's implementation is f.write("\e[" & $count & 'A') |
22:13:32 | FromDiscord | <ElegantBeef> Yea same thing |
22:14:11 | FromDiscord | <Mustache Man> this looks hardcore https://github.com/qqtop/nimdataframe |
22:14:16 | FromDiscord | <ElegantBeef> Ah yea the `\033` doesnt process the same as `\e` apparently |
22:16:25 | FromDiscord | <zidsal> sent a long message, see http://ix.io/2WTX |
22:17:22 | FromDiscord | <zidsal> nevermind its going be hard to do this with generics, as I won't know what the return type is when I query for it e.g the proc params should be query("bob", "is") and that will return an int |
22:19:20 | FromGitter | <ynfle> You could use an object variant I think |
22:22:22 | * | nisstyre joined #nim |
22:23:30 | FromDiscord | <zidsal> my only problem with that, is I'm going to require registering the different predicate types for safety. So I already know that "is" will always return a number. It also means I can fail if you give it an unknown predicate. e.g↵↵https://play.nim-lang.org/#ix=2WTY |
22:24:17 | FromDiscord | <zidsal> my plan is to store the predicate types in a CacheTable and from that read the type information so I know what I should be returning |
22:25:55 | FromDiscord | <carpal> In reply to @Ricky Spanish "whats the simplest way": is character's size 4 bytes in nim? |
22:26:36 | FromGitter | <ynfle> @zidsal, I would use and enum and an object variant |
22:27:15 | FromDiscord | <zidsal> is it not a bit sucky that any time you call query you have to unwrap the variant to get the raw type? thats already been defined with the register method |
22:27:25 | FromDiscord | <carpal> so why not a bitcast? since string is mutable, shouldn't it have the same implementation of seq? |
22:28:59 | FromGitter | <ynfle> @carpal, I'm pretty sure that isn't support and is buggy |
22:29:14 | FromGitter | <ynfle> Like with null terminating characters '\0' |
22:29:14 | FromDiscord | <ElegantBeef> A character is 1 byte in nim |
22:30:54 | FromDiscord | <ElegantBeef> Bitcasting also wouldnt work for `seq[byte]` -> `string` |
22:31:03 | FromDiscord | <ElegantBeef> Since they want `1` as `"1"` |
22:31:15 | FromDiscord | <ElegantBeef> which means they want the character representation which requires stringification |
22:32:12 | * | tefter joined #nim |
22:32:23 | FromDiscord | <ElegantBeef> !eval echo '1'.ord |
22:32:25 | FromDiscord | <carpal> In reply to @ElegantBeef "A character is 1": ah |
22:32:27 | NimBot | 49 |
22:32:35 | FromDiscord | <carpal> byte in nim is signed? |
22:32:39 | FromDiscord | <ElegantBeef> No |
22:32:49 | FromDiscord | <ElegantBeef> `byte` is an alias of `uint8` |
22:33:03 | FromDiscord | <carpal> so 254 characters |
22:33:08 | FromDiscord | <ElegantBeef> 255 |
22:33:09 | FromDiscord | <carpal> reppresentable |
22:33:15 | FromDiscord | <carpal> In reply to @ElegantBeef "255": ah yea right 😂 |
22:33:34 | FromDiscord | <ElegantBeef> and only what 20..255 are printable |
22:33:47 | FromDiscord | <carpal> so nim doesn't use ascii |
22:33:50 | FromDiscord | <ElegantBeef> It does |
22:34:06 | FromDiscord | <carpal> mhh but an extended table I think |
22:34:23 | FromDiscord | <carpal> because ascii table is at around 124 characters |
22:34:41 | FromDiscord | <carpal> there is the ascii table extended if I'm not wrong |
22:34:46 | FromDiscord | <ElegantBeef> Yea it ssupports extended |
22:34:50 | FromDiscord | <ElegantBeef> (edit) "ssupports" => "supports" |
22:34:52 | FromDiscord | <carpal> anyway not bitcastable |
22:34:55 | FromDiscord | <carpal> sadly |
22:35:09 | FromGitter | <ynfle> Why won't this compile? https://play.nim-lang.org/#ix=2WU1 |
22:36:09 | FromDiscord | <carpal> ahhhhh but he wanted to stringize a seq, not to make this `@[97, 98]` to `ab`? |
22:36:26 | FromDiscord | <zidsal> @ynfle don't yopu need to define the rsult type e.g. Result = ref object |
22:36:49 | FromDiscord | <ElegantBeef> yes |
22:36:55 | FromGitter | <ynfle> Why would it need to be a ref? |
22:37:06 | FromDiscord | <ElegantBeef> Well it needs to be an object |
22:37:27 | FromGitter | <ynfle> Oh haha. Thanks |
22:37:29 | FromDiscord | <zidsal> ya objevt, ref object whatever 😛 |
22:38:28 | FromGitter | <ynfle> So now why won't this compile https://play.nim-lang.org/#ix=2WU3? |
22:38:41 | FromDiscord | <ElegantBeef> helps if you say `proc query` |
22:39:09 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2WU5 |
22:39:11 | FromDiscord | <ElegantBeef> QED 😛 |
22:39:34 | FromGitter | <ynfle> Oh my |
22:39:41 | FromGitter | <ynfle> I must be way over tired |
22:39:43 | FromGitter | <ynfle> Ok |
22:39:57 | FromGitter | <ynfle> @zidsal Does that help your use case? |
22:40:55 | FromDiscord | <zidsal> kind of, I hoping to not need tp expose the variant to people. As in theory if you query with a predicate of "is" you shouldn't need to unwrap it. It must be an int as it was defined as such with the register |
22:42:04 | FromDiscord | <ElegantBeef> What's the intended api? |
22:42:12 | FromDiscord | <ElegantBeef> Like how do you expect this to work? |
22:42:25 | FromDiscord | <zidsal> https://play.nim-lang.org/#ix=2WTY |
22:42:52 | FromDiscord | <zidsal> let me add in some fake returns so it makes slightly more sense |
22:42:58 | FromDiscord | <ElegantBeef> Ok so i understand |
22:43:25 | FromDiscord | <ElegantBeef> Can we do `option(int)` instead of `nil`? |
22:43:30 | FromDiscord | <zidsal> ofc |
22:43:59 | FromDiscord | <ElegantBeef> Well quickly finish this so i can reason the macro required 😛 |
22:44:13 | FromDiscord | <ElegantBeef> Dont understand triplestore 😄 |
22:46:36 | FromDiscord | <zidsal> noooo play-nim has gone offine |
22:47:36 | * | def- quit (Quit: -) |
22:49:49 | FromDiscord | <zidsal> https://pastebin.com/CmrGAhhJ |
22:50:27 | * | def- joined #nim |
22:51:35 | FromDiscord | <demotomohiro> Nim playground is working now |
22:52:10 | FromDiscord | <zidsal> hurrah https://play.nim-lang.org/#ix=2WU9 |
22:55:05 | FromDiscord | <carpal> llvm |
22:55:12 | FromDiscord | <ElegantBeef> C |
22:55:52 | FromDiscord | <carpal> llvm |
22:58:47 | FromDiscord | <konsumlamm> C-- |
22:59:08 | FromDiscord | <uuuu> Is @zetashift here? I got a question for him. |
22:59:16 | FromDiscord | <ElegantBeef> Yea it's pretty odd to do this zidsal 😄 |
22:59:21 | FromDiscord | <zidsal> 😛 |
22:59:43 | FromDiscord | <zidsal> I can't see a good way of doing this without making the triple store a constant |
23:00:07 | FromDiscord | <zidsal> which is pretty sucky |
23:00:08 | FromDiscord | <ElegantBeef> Well the hard part accessing the underlying type |
23:00:44 | FromDiscord | <ElegantBeef> Like if these are not to be added/removed at runtime easy |
23:00:57 | FromDiscord | <zidsal> ya, thats not going to be the case :p |
23:04:24 | FromDiscord | <zidsal> so I was planning on doing something like this, so the internals know all the type info:↵↵https://play.nim-lang.org/#ix=2WUi |
23:04:39 | FromDiscord | <ElegantBeef> I think i have a way to do this with macros |
23:04:56 | FromDiscord | <zidsal> step 1. fork nim↵step 2. ??? |
23:05:03 | FromDiscord | <ElegantBeef> Kik |
23:05:05 | FromDiscord | <ElegantBeef> (edit) "Kik" => "lol" |
23:05:06 | FromDiscord | <ElegantBeef> Nah |
23:06:40 | * | Sembei quit (Quit: WeeChat 3.0) |
23:36:53 | FromDiscord | <retkid> is there any super notable things developed in nim? |
23:46:28 | * | Q-Master quit (Quit: No Ping reply in 180 seconds.) |
23:46:35 | * | Q-Master joined #nim |
23:47:35 | FromDiscord | <ElegantBeef> @zidsal not anything special but it does "work" https://play.nim-lang.org/#ix=2WUx |
23:47:50 | FromDiscord | <ElegantBeef> Nitter is probably the most popular thing aside from the compiler |
23:48:11 | FromDiscord | <ElegantBeef> But what do you mean by notable |
23:48:56 | FromDiscord | <zidsal> Amazing thanks elegant, will take a more detailed look at it, in a couple of hours |
23:51:10 | FromDiscord | <ElegantBeef> It clearly needs to be worked on but it almost does what you want |
23:52:02 | FromDiscord | <zidsal> Ya, I can take it from here, I suspect people trying to make a type safe ECS may also be interested in this kind of macro |
23:56:37 | FromDiscord | <retkid> hey guys |
23:56:38 | FromDiscord | <retkid> check out moe |
23:56:44 | FromDiscord | <retkid> its like nemo but cooler and written in nim |
23:58:39 | FromDiscord | <ElegantBeef> Advertising Nim programs in a Nim discord, to Nim users |
23:59:39 | Prestige | I thought nemo was a file manager |
23:59:50 | FromDiscord | <ElegantBeef> I thought it was a fish |