00:00:29 | FromDiscord | <krab4t> https://www.youtube.com/user/kiloneie/videos 😮 |
00:03:43 | * | NicQ joined #nim |
00:04:28 | * | nif_ quit (Quit: ...) |
00:04:37 | * | nif joined #nim |
00:12:17 | * | nif quit (Quit: ...) |
00:12:27 | * | nif joined #nim |
00:16:53 | * | NicQ quit (Quit: Quit) |
00:42:57 | * | lritter joined #nim |
00:55:51 | * | me7 joined #nim |
01:02:11 | * | krux02_ quit (Remote host closed the connection) |
01:07:44 | FromGitter | <mratsim> @me7 “nim c myproject.nim" |
01:08:05 | * | NimBot joined #nim |
01:08:10 | FromGitter | <mratsim> it’s the same as any computer |
01:12:35 | * | skoude joined #nim |
01:17:07 | * | skoude quit (Ping timeout: 250 seconds) |
01:21:59 | * | doesntgolf quit (Read error: Connection reset by peer) |
01:24:29 | * | Hideki joined #nim |
01:38:12 | * | laaron joined #nim |
02:06:45 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
02:11:30 | * | laaron joined #nim |
02:15:18 | * | laaron quit (Client Quit) |
02:15:45 | * | laaron joined #nim |
02:18:52 | * | laaron quit (Client Quit) |
02:19:16 | * | laaron joined #nim |
02:23:34 | * | laaron quit (Remote host closed the connection) |
02:40:14 | * | laaron joined #nim |
02:43:57 | * | laaron quit (Client Quit) |
02:44:30 | * | laaron joined #nim |
02:45:42 | * | laaron quit (Client Quit) |
02:46:05 | * | laaron joined #nim |
02:46:27 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
02:46:56 | * | pbb joined #nim |
02:51:47 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
02:52:55 | * | doesntgolf joined #nim |
02:53:50 | * | laaron joined #nim |
02:54:26 | * | lritter quit (Ping timeout: 240 seconds) |
02:55:16 | * | lritter joined #nim |
02:56:56 | * | theelous3 joined #nim |
03:00:19 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
03:00:36 | * | laaron joined #nim |
03:02:21 | * | laaron quit (Remote host closed the connection) |
03:41:51 | * | chemist69 quit (Ping timeout: 250 seconds) |
03:43:59 | * | chemist69 joined #nim |
04:34:09 | * | zahary joined #nim |
04:58:09 | * | theelous3 quit (Ping timeout: 268 seconds) |
05:05:09 | * | rockcavera quit (Remote host closed the connection) |
05:13:14 | * | doesntgolf quit (Ping timeout: 240 seconds) |
05:17:12 | * | radsoc joined #nim |
05:28:21 | * | zahary quit (Quit: Leaving.) |
05:31:24 | * | solitudesf joined #nim |
05:36:35 | * | narimiran joined #nim |
05:53:19 | * | zahary joined #nim |
06:11:22 | * | thomasross quit (Read error: Connection reset by peer) |
06:12:00 | * | thomasross joined #nim |
06:13:33 | * | dddddd quit (Read error: Connection reset by peer) |
06:18:32 | * | me7 quit () |
06:19:45 | * | me7 joined #nim |
06:20:00 | * | alexander92 joined #nim |
06:20:43 | * | me7 quit (Client Quit) |
06:22:09 | * | me7 joined #nim |
06:24:14 | * | solitudesf quit (Ping timeout: 246 seconds) |
06:40:34 | * | skoude joined #nim |
06:47:55 | FromDiscord | <arnetheduck> @me7 https://github.com/status-im/nimbus/#raspberry-pi for some tips to make nim itself compile |
06:48:21 | FromDiscord | <arnetheduck> (on arm/rpi) |
06:49:15 | Zevv | If your image is already expanded to SD size you can make a swap file instead of increasing swap size |
06:49:38 | Zevv | worth mentioning that as well? |
06:59:08 | FromDiscord | <MeatPony> Hey, uh. Coincidentally, on the topic of compiling and nim, I'm trying to compile a nim file with nim in the same directory but its saying it cant find my .nim file. |
06:59:08 | FromDiscord | <MeatPony> https://cdn.discordapp.com/attachments/371759389889003532/632472300171689984/unknown.png |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:01:28 | Araq | MeatPony: get your relative addressing right, it's downloader.nim, not ../../downloader.nim |
07:01:39 | FromDiscord | <MeatPony> ok |
07:01:57 | FromDiscord | <MeatPony> thank you |
07:04:38 | * | gmpreussner joined #nim |
07:10:17 | * | skoude quit (Ping timeout: 276 seconds) |
07:14:28 | * | radsoc quit (Quit: radsoc) |
07:18:34 | * | Trustable joined #nim |
07:30:30 | * | asymptotically joined #nim |
07:33:15 | * | Trustable quit (Remote host closed the connection) |
07:33:15 | * | alexander92 quit (Read error: Connection reset by peer) |
07:47:49 | * | nsf joined #nim |
08:02:08 | * | zahary quit (Quit: Leaving.) |
08:05:54 | * | filcuc joined #nim |
08:08:53 | * | narimiran quit (Ping timeout: 246 seconds) |
08:08:54 | * | me7 quit (Read error: Connection reset by peer) |
08:47:56 | * | lritter quit (Ping timeout: 240 seconds) |
08:50:47 | FromGitter | <mratsim> @Zevv afaik that’s what raspbian does |
09:01:00 | * | me7 joined #nim |
09:01:34 | Zevv | ah ok |
09:06:38 | * | Traviss__ joined #nim |
09:06:40 | * | PMunch joined #nim |
09:08:31 | * | radsoc joined #nim |
09:10:17 | * | traviss quit (Ping timeout: 265 seconds) |
09:12:44 | * | me7 quit (Remote host closed the connection) |
09:18:40 | * | laaron joined #nim |
09:20:30 | * | sealmove joined #nim |
09:30:14 | * | radsoc quit (Quit: radsoc) |
09:33:51 | * | laaron quit (Remote host closed the connection) |
09:38:16 | * | laaron joined #nim |
09:40:54 | * | PMunch quit (Remote host closed the connection) |
09:43:36 | * | laaron quit (Remote host closed the connection) |
09:53:45 | * | Trustable joined #nim |
10:04:35 | * | filcuc quit (Read error: Connection reset by peer) |
10:29:12 | federico3 | what happened with csize going from int to uint? |
10:33:08 | Zevv | well, csize went from int to uint it seems :) |
10:33:27 | federico3 | just after 1.0 tho |
10:33:39 | Zevv | https://github.com/nim-lang/Nim/issues/12187 |
10:33:40 | federico3 | this is breaking a lot of stuff |
10:33:40 | Zevv | yes |
10:34:39 | Zevv | don't know the whole story - araq said 'no it will break too much', but still it got merged |
10:40:00 | federico3 | ...without any explanation. Maybe it was merged by mistake |
10:43:37 | leorize | it's no mistake imo |
10:44:04 | federico3 | what's the status with the new release? |
10:44:20 | leorize | clyybber made a series of PRs to prepare for this |
10:44:37 | leorize | and since the eventual switch passed CI, I guess that's why it was merged |
10:45:22 | leorize | some new fixes has been picked up recently |
10:49:59 | * | asymptotically quit (Remote host closed the connection) |
10:50:24 | * | asymptotically joined #nim |
10:52:26 | federico3 | leorize: any way to add build and jump-to-error to nim.nvim ? |
11:02:07 | * | radsoc joined #nim |
11:11:05 | * | krux02 joined #nim |
11:11:58 | * | radsoc quit (Quit: radsoc) |
11:14:11 | FromGitter | <sheerluck> may I have a slice of tuple? or maybe all slices have to be seq[T] so obv I can not put tuple of (int, float64, string) into seq[T] :^( |
11:16:45 | FromDiscord | <juan_carlos> Tuple is compile time fixed size. |
11:17:41 | * | zahary joined #nim |
11:18:34 | lqdev[m] | damn, python programmers have rather weird habits. glad I came from java |
11:19:05 | lqdev[m] | like, why would you even want to slice a tuple? |
11:20:31 | Zevv | I see use cases. A proc returning a tuple with 5 elements, but I'm only interested in the middle three |
11:20:48 | Zevv | I now need to assign to (a, b, c, d, e) and leave a and e unused |
11:26:32 | FromDiscord | <Rika> i dont see the weird habit here |
11:26:32 | FromDiscord | <juan_carlos> https://play.nim-lang.org/#ix=1Yp4 |
11:26:41 | * | evilkhaoskat joined #nim |
11:27:50 | * | evilkhaoskat quit (Client Quit) |
11:28:12 | * | zahary quit (Quit: Leaving.) |
11:33:34 | FromDiscord | <juan_carlos> https://play.nim-lang.org/#ix=1Ypb |
11:36:14 | * | zahary joined #nim |
11:39:34 | * | radsoc joined #nim |
11:44:51 | * | krux02 quit (Remote host closed the connection) |
11:54:09 | * | solitudesf joined #nim |
12:03:35 | * | dddddd joined #nim |
12:03:49 | * | superbia joined #nim |
12:04:06 | * | skoude joined #nim |
12:05:47 | * | radsoc quit (Quit: radsoc) |
12:08:03 | leorize[m] | federico3: it's already there :make |
12:08:25 | * | skoude quit (Ping timeout: 250 seconds) |
12:08:29 | * | radsoc joined #nim |
12:08:39 | leorize[m] | see :h makeprg if you want to customize it |
12:09:34 | federico3 | it's not nim-aware by default |
12:09:49 | lqdev[m] | Zevv: (a, b, c, , ) = someTuple |
12:10:09 | lqdev[m] | crap, riot.im is messing with my message |
12:10:18 | leorize[m] | federico3: wdym? |
12:10:36 | * | lqdev joined #nim |
12:10:52 | lqdev | I meant `(a, b, c, _, _) = myTuple` |
12:14:30 | FromDiscord | <juan_carlos> Black hole variable. |
12:21:23 | FromGitter | <sheerluck> @lqdev thank you |
12:30:22 | FromDiscord | <exelotl> I turned off unused variable warnings in my project, cause I hate seeing it complain about `(dir, name, ext) = splitPath(p)` when I'm only using `name` |
12:31:09 | FromDiscord | <exelotl> I don't want to change them into underscores because it's more readable this way, and maybe I'll want to use them later |
12:31:38 | FromDiscord | <juan_carlos> `{.used.}` |
12:31:40 | * | nsf quit (Quit: WeeChat 2.5) |
12:34:08 | FromDiscord | <exelotl> Hmm that makes things ugly but I it works |
12:35:53 | sealmove | echo ^(1010_1010'u1) |
12:35:58 | sealmove | !eval echo ^(1010_1010'u1) |
12:35:59 | NimBot | Compile failed: /usercode/in.nim(1, 17) Error: invalid number: '1010_1010'u1' |
12:36:12 | FromDiscord | <juan_carlos> You get *used* to it. Badum-Tish |
12:36:13 | FromDiscord | <Rika> u1? |
12:36:23 | sealmove | !eval echo ^(1010_1010'u8) |
12:36:25 | NimBot | Compile failed: /usercode/in.nim(1, 8) Error: number out of range: '1010_1010'u8' |
12:36:35 | sealmove | !eval echo ^(0b1010_1010'u8) |
12:36:36 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: type mismatch: got <uint8> |
12:36:50 | sealmove | binary operator for inverting bits? |
12:36:59 | FromDiscord | <Rika> try not? |
12:37:10 | sealmove | !eval echo not(0b1010_1010'u8) |
12:37:12 | NimBot | 85 |
12:37:20 | sealmove | oh great |
12:37:49 | FromDiscord | <Rika> its odd |
12:57:35 | * | crem quit (Quit: WeeChat 1.9) |
12:57:54 | * | crem joined #nim |
13:03:26 | Zevv | lqdev[m]: what, you can just omit vars between the commas! |
13:06:26 | FromDiscord | <Rika> ? |
13:06:29 | FromDiscord | <Rika> what do you mean? |
13:07:10 | Zevv | (a, b, c, , ) = someTuple |
13:08:35 | FromDiscord | <exelotl> :O |
13:08:56 | * | Hideki quit (Remote host closed the connection) |
13:09:16 | FromDiscord | <Rika> 😮 |
13:11:32 | FromDiscord | <juan_carlos> 😱 |
13:13:39 | jken | Kind of a general design question, I have a rendering system that I want to use native "nim types", and I want to have multiple rendering backends, opengl expects "opengl types" like GLuint, GLint, etc. |
13:14:39 | jken | Does anyone have any design suggestions regarding casting native nim types to the expected types or N number of other sysems without completely filling my code with conversions everywhere? |
13:15:05 | jken | I am new to nim, still wrapping my head around macros, but I feel like the language can help me here and I just don't know how yet. |
13:16:12 | FromDiscord | <juan_carlos> overload some templates |
13:18:50 | * | solitudesf quit (Ping timeout: 240 seconds) |
13:19:57 | * | crem quit (Quit: WeeChat 2.6) |
13:22:11 | * | crem joined #nim |
13:25:44 | * | skoude joined #nim |
13:28:22 | * | stefantalpalaru joined #nim |
13:32:27 | * | skoude quit (Ping timeout: 268 seconds) |
13:35:42 | jken | Unrelated, can anyone explain to me what is in this line: |
13:35:50 | jken | cast[pointer](0) |
13:37:15 | disruptek | null pointer |
13:39:44 | jken | Is that different than nil? |
13:39:51 | Zevv | lqdev[m]: why "Parse with prec = 9 to avoid any binary operators" |
13:50:23 | * | asymptotically is now known as mooman12 |
13:54:46 | lqdev[m] | Zevv: you're looking at object defs right? because this `object Vec2 * Vec3 {}` doesn't make sense |
13:54:55 | lqdev[m] | and that's how types were parsed up to now |
13:55:03 | lqdev[m] | it's actually different from now on |
13:55:19 | lqdev[m] | I just haven't pushed the changes yet. |
13:57:42 | * | alexander92 joined #nim |
13:58:56 | * | fanta1 joined #nim |
13:58:56 | * | alexander92 quit (Read error: Connection reset by peer) |
13:59:37 | * | onionhammer joined #nim |
14:02:26 | * | ng0 joined #nim |
14:04:00 | * | alexander92 joined #nim |
14:09:22 | * | rockcavera joined #nim |
14:10:18 | * | solitudesf joined #nim |
14:12:57 | * | onionhammer quit (Quit: WeeChat 2.4) |
14:14:23 | Zevv | no that's vardefs IIRC |
14:15:08 | Zevv | I was using your grammar as a test case: http://ix.io/1YpP |
14:15:43 | Zevv | parsing expresions with recursive descent is nasty, so this is a nice time to see if I can get precedence climbing / Pratt supported at the grammar level |
14:15:50 | * | onionhammer joined #nim |
14:15:57 | * | nsf joined #nim |
14:16:40 | Zevv | but my conclusion for today is that I lack brainpower for these things |
14:16:49 | disruptek | bummer. |
14:18:32 | Zevv | and here is this guy already figured that out at telling me "Pratt algorithm is very easy to embed into pretty much any kind of Packrat or any other PEG implementation" |
14:20:12 | Zevv | https://dev.to/combinatorylogic/peg-and-pratt-play-well-together-2i20 |
14:27:47 | * | radsoc quit (Quit: radsoc) |
14:28:26 | * | gangstacat quit (Quit: Ĝis!) |
14:30:55 | lqdev[m] | Zevv: still doesn't matter, `var x: number * string = 10` still doesn't make sens |
14:31:01 | lqdev[m] | s/sens/sense/ |
14:32:38 | Zevv | true, I mentally was somewhere else in the parse tree |
14:40:10 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
14:43:17 | * | lqdev quit (Quit: Leaving) |
14:48:40 | * | gangstacat joined #nim |
14:49:00 | * | onionhammer quit (Quit: WeeChat 2.4) |
14:49:01 | * | D4663R joined #nim |
14:49:08 | * | D4663R left #nim ("WeeChat 2.6") |
14:54:26 | leorize | Zevv, disruptek, federico3, narimiran: please pull the latest commits from nim.nvim's master branch. I've merged the project finding feature as well as fixed a terrible bug. |
14:55:45 | Zevv | "a terrible bug" |
14:56:02 | Zevv | this involves shame? |
14:56:17 | leorize | yes, read the latest commit :P |
14:56:44 | FromDiscord | <juan_carlos> The walk of shame, `walkDir(shame)` |
14:56:58 | Zevv | leorize: well, pretty harmless |
14:57:06 | Zevv | it's not like, crashing my nvim or anything |
14:57:13 | Zevv | and if it did, I wouldn't even notice |
14:59:23 | leorize | can someone merge #12419? |
15:00:13 | leorize | actually, I'm gonna close it :P |
15:02:09 | * | Hideki joined #nim |
15:02:16 | * | Hideki quit (Remote host closed the connection) |
15:02:31 | * | Hideki joined #nim |
15:16:26 | * | rockcavera quit (Remote host closed the connection) |
15:21:24 | * | radsoc joined #nim |
15:29:43 | disruptek | Zevv: your nvim is so buggy that you don't even attribute crashes? |
15:32:37 | * | zahary quit (Quit: Leaving.) |
15:36:12 | * | zahary joined #nim |
15:40:34 | Zevv | :) |
15:42:40 | disruptek | btw i'm on 4.x and no issues yet. |
15:42:53 | disruptek | i don't suppose you have a repro? |
15:47:01 | Zevv | nah I'm still on 3.8. its not that bad, only when starting a new nim project when there is no file on disk yet. leorize pinned this down to a bug in nvim, i should just update |
15:48:00 | disruptek | ah, well 0.4.2 +acl +iconv +tui is problem-free for me. |
15:48:08 | leorize | well it can't be a bug elsewhere if its an assertion error lol |
15:57:45 | * | superbia1 joined #nim |
16:01:07 | * | superbia quit (Ping timeout: 265 seconds) |
16:04:41 | * | hami joined #nim |
16:06:34 | FromGitter | <Varriount> Hrm, what new feature should I add to my shell language... |
16:07:53 | hami | Hello everyone. Quick question: let f = 0.0; type(f) returns "float64" not "float". Is this the expected behaviour? |
16:08:42 | * | onionhammer joined #nim |
16:09:01 | Yardanico | hami: float is a arch-dependent type, it's float64 on 64bit, and float32 on 32bit |
16:09:11 | Yardanico | So if you compile for 64-bit, "float" will be 64-bit by default - "float64" |
16:09:32 | Yardanico | If you want to explicitly specify float32 or float64, use let f: float32 = 0.0 or let f: float64 = 0.0 |
16:09:49 | solitudesf | is it? i thought that was the case only for ints |
16:09:52 | * | leorize quit (Remote host closed the connection) |
16:09:55 | sealmove | Varriount: depends on what you want it to be |
16:09:57 | solitudesf | https://nim-lang.github.io/Nim/manual.html#types-preminusdefined-floating-point-types |
16:10:02 | solitudesf | float is always float64 |
16:10:20 | Yardanico | solitudesf: oh |
16:10:25 | Yardanico | Then excuse me :P |
16:10:33 | hami | Tutorial says float is always float 64 in this implemantation |
16:11:16 | hami | but consider this: let i = 0; type(i) always returns "int" not "int32" or "int64" |
16:11:45 | solitudesf | because int is arch dependant |
16:12:00 | Yardanico | hami: yeah, solitudesf corrected me, float is always float64 unless |
16:12:09 | Yardanico | *unless you explicitly specify float32 |
16:13:11 | * | leorize joined #nim |
16:13:46 | * | superbia1 left #nim ("WeeChat 2.4") |
16:14:05 | hami | Ooh. I think I get it now. The difference is in being arch dependent for int but always being float64 independent of arch |
16:14:16 | hami | Thanks |
16:17:33 | * | narimiran joined #nim |
16:18:06 | * | hami quit (Quit: Leaving) |
16:20:17 | * | zahary quit (Quit: Leaving.) |
16:25:13 | leorize | narimiran: please switch back to nim.nvim master branch :) |
16:25:21 | leorize | I've fixed some bugs + merged find-project |
16:25:21 | narimiran | will do |
16:25:43 | * | NimBot joined #nim |
16:39:16 | leorize | narimiran: looks like norm is failing |
16:39:25 | narimiran | where? |
16:41:47 | leorize | my PR to Nim |
16:43:45 | narimiran | maybe it is on their side because there were some commits yesterday and today? |
16:44:33 | * | mooman12 quit (Remote host closed the connection) |
16:44:58 | * | mooman12 joined #nim |
16:45:47 | leorize | probably, can you give it a check? |
16:46:09 | narimiran | not before tomorrow morning, sorry |
16:46:13 | * | Hideki quit (Remote host closed the connection) |
16:47:06 | * | Hideki joined #nim |
16:51:38 | * | Hideki quit (Ping timeout: 268 seconds) |
17:05:21 | * | fanta1 quit (Quit: fanta1) |
17:12:43 | FromGitter | <Varriount> sealmove: I think I'll try adding job support |
17:14:59 | Zevv | Is there a shorthand for array slicing where the high end is 'X or array.len, whichever is smaller'? |
17:15:55 | Yardanico | Zevv: I think not, only arr[0..min(X, array.len)] probably |
17:16:44 | Zevv | yeah, I though so - thanks! |
17:17:41 | * | mooman12 is now known as asymptotically |
17:18:59 | FromDiscord | <sealmove> Varriount: Meh, do you use job control in practice? |
17:20:33 | FromDiscord | <sealmove> Proper command logging is cool (for example sqlite or json files, like xonsh does it). |
17:21:52 | FromDiscord | <sealmove> As for the language itself, this depends on your goal. Some shells aim to be full fledged programming languages (with even exceptions), others want to be kept minimal. |
17:23:54 | disruptek | what would be cool is built-in process persistence using criu or similar. |
17:25:12 | Zevv | like ^Z on steroids! |
17:26:45 | * | Hideki joined #nim |
17:38:25 | * | radsoc quit (Quit: radsoc) |
17:40:12 | * | Hideki quit (Ping timeout: 265 seconds) |
17:41:01 | * | literal_ is now known as literal |
17:42:26 | disruptek | it doesn't really seem so outlandish an idea. |
17:50:43 | * | Ekho- is now known as Ekho |
17:53:15 | * | krux02 joined #nim |
17:59:07 | zedeus | narimiran: you can ignore norm failing, tests weren't updated after a recent change |
17:59:18 | sealmove | does the Nim compiler make use of https://nim-lang.org/docs/pegs.html ? |
17:59:18 | narimiran | leorize: ^ |
17:59:26 | narimiran | thanks zedeus |
18:05:19 | Zevv | sealmove: no, only for generatinc some internal documentation |
18:08:42 | sealmove | oh btw, is there nimgrep integration for VSCode? |
18:08:53 | Yardanico | sealmove: I think no |
18:09:18 | sealmove | that's a bit surprising |
18:09:24 | Yardanico | why so? |
18:09:40 | sealmove | seems useful enough, and Araq uses VSCode extensively |
18:09:45 | Yardanico | it uses nimsuggest |
18:17:21 | * | minierolls quit (Ping timeout: 268 seconds) |
18:17:47 | * | minierolls joined #nim |
18:23:33 | * | solitudesf- joined #nim |
18:25:14 | * | solitudesf quit (Ping timeout: 246 seconds) |
18:36:43 | * | solitudesf- quit (Quit: Leaving) |
18:37:00 | * | solitudesf joined #nim |
18:38:31 | sealmove | is there a way to convert each element of a seq easily? |
18:38:33 | leorize | to be fair no Nim code around actually need nimgrep |
18:39:04 | sealmove | for example if you have the literal @[1, 2, 3] it's a seq[int] by default, and seq[byte](@[1, 2, 3]) doesn't work. |
18:39:34 | leorize | sealmove: sequtils.map |
18:39:37 | * | FromGitter quit (Remote host closed the connection) |
18:39:40 | disruptek | you can write a converter, but they are a little too magical for my tastes. |
18:39:41 | Yardanico | sealmove: map or mapIt |
18:39:51 | sealmove | leorize: mine happened to need it :P but it's probably bad style and I should change it. |
18:39:55 | * | FromGitter joined #nim |
18:40:12 | leorize | sealmove: --styleCheck:error |
18:40:30 | sealmove | :O seems useful, ty |
18:45:47 | sealmove | would be nice if seq[byte](@[1, 2, 3]) worked though |
18:46:19 | * | FromGitter quit (Remote host closed the connection) |
18:46:37 | * | FromGitter joined #nim |
18:46:47 | sealmove | worth requesting it? |
18:46:59 | leorize | nope :P |
18:47:26 | leorize | @[1, 2, 3].mapIt(it.byte) should be around the same amount of characters |
18:48:17 | sealmove | but you have to import sequtils :P |
18:49:44 | leorize | worth it :P |
18:49:52 | leorize | also @[1'u8, 2, 3] works too |
18:49:59 | disruptek | do you really want your int literals to be typed as 8-bit? |
18:52:06 | sealmove | i have to be very specific with typing to avoid compile errors. the code is auto-generated with scala :S |
18:52:18 | disruptek | all the more reason... |
18:53:59 | FromDiscord | <Generic> don't use @[1,2,3].mapIt(it.byte) |
18:54:08 | FromDiscord | <Generic> it allocates a new seq |
18:54:47 | FromDiscord | <Generic> this code allocates a seq of ints, fills it with 1,2,3 and |
18:54:55 | leorize | sealmove: generate uint 8 literal |
18:55:23 | FromDiscord | <Generic> then allocates a new seq and casts individual members of the original seq to uint8 |
18:55:28 | FromDiscord | <Generic> and places them in the new seq |
18:55:53 | leorize | @Generic it's the only way to do so on runtime |
18:56:33 | sealmove | the problem I've been dealing with 1 week now is that I can't generate precise literals, so I rely on conversion |
18:56:50 | leorize | why can't you generate precise literals? |
18:57:14 | leorize | alright there's a way to avoid more runtime costs: assign them to consts |
18:57:23 | sealmove | the type system of the language I map from doesn't have seperate types for 1, 2, 4 or 8 byte integers |
18:58:04 | FromDiscord | <Generic> oh, that's bad |
18:58:17 | FromDiscord | <Generic> if you're dealing with bytes isn't there even some kind of "blob" container |
18:58:38 | FromDiscord | <Generic> ? |
18:59:20 | sealmove | there is. also I realized the equivelant implementation for C++ uses std::string everywhere :P |
18:59:58 | leorize | sealmove: what are you generating? |
19:00:11 | leorize | is it too complex to be done completely in nim? |
19:01:12 | sealmove | not sure, would be cool as a Nim project indeed, but for now it's part of https://kaitai.io/. you can track progress here: https://ci.kaitai.io/ |
19:01:33 | sealmove | there is a Nim 1.0.0 column |
19:02:39 | leorize | why does this feel like NESM? :P |
19:03:33 | sealmove | it's not serialization, it's arbitary file format description |
19:03:56 | sealmove | take a look here https://formats.kaitai.io/ |
19:04:48 | leorize | at first glance this looks like yaml |
19:06:13 | sealmove | it is an extended version of yaml |
19:06:21 | sealmove | called ksy (Kaitai Struct Yaml) |
19:07:19 | sealmove | but the catch is... for serialization you need less features because your format should be simple, so serializations tools like NESM don't suffice for describing complex (already-existing) formats. |
19:09:26 | leorize | iirc someone managed to parse tcp packets with nesm |
19:09:29 | * | superbia joined #nim |
19:10:16 | leorize | well but I don't work on binary things much so can't say much about it |
19:12:22 | sealmove | you can make do with serialization tools, there are even extendable ones. but they are not designed for this purpose so a specialized tool like KS is more sane in cases where you are trying to reverse engineer a weird format (say custom formats of a AAA game) |
19:13:06 | leorize | if ksy is just yaml with extras then can't you just build the parser in nim? |
19:13:30 | sealmove | sure, would be cool. |
19:14:18 | sealmove | but in KS i have this ready and my task is to simply generate the Nim code using already filled-in structures |
19:14:43 | sealmove | but you are right, I might just implement the parser in Nim, sick of scala, lol |
19:15:05 | leorize | there's already nimyaml, so you got a good starting point :P |
19:26:08 | * | gangstacat quit (Ping timeout: 245 seconds) |
19:34:16 | * | alexander92 quit (Read error: Connection reset by peer) |
19:40:28 | * | gangstacat joined #nim |
19:48:40 | FromGitter | <AiguyGary_twitter> @AiguyGary_twitter ⏎ Does anyone have an example of declaring an anonymous procedure (no name just address) saving a procedure pointer to it to a variable for later execution. I will have thousands of if conditions and will not know until I have matched against them all which function is the best match to execute so I'd like to store the address of the best fit so far in a variable as I progress through the |
19:48:40 | FromGitter | ... tests. ⏎ I was going to post the question in the forum but even though I have a login it did not seem to be accepting new threads. |
19:54:02 | * | narimiran quit (Ping timeout: 240 seconds) |
19:57:14 | Yardanico | @AiguyGary_twitter well, there's manual moderation on the forum AFAIK (maybe it changed now, IDK). Check https://play.nim-lang.org/#ix=1Yrx |
19:57:16 | leorize[m] | !eval var function = proc (a: int): int = a + 1 |
19:57:18 | NimBot | <no output> |
19:58:05 | Yardanico | Ah, sorry, https://play.nim-lang.org/#ix=1Yry |
19:58:34 | rayman22201 | https://play.nim-lang.org/#ix=1Yrz |
19:59:20 | rayman22201 | @AiguyGary_twitter ^ |
19:59:34 | Yardanico | rayman22201: check my example :P |
19:59:35 | rayman22201 | Yardanico, same thing. You are just a bit faster than me :-P |
20:00:22 | Yardanico | rayman22201: although you don't really need to declare {.nimcall.} here I think, and no need for specifying seq type explicitly, but yeah, it's basically the same |
20:00:39 | rayman22201 | I get an error if I don't specify nimcall |
20:01:54 | rayman22201 | I think you don't because you don't specify the type of `data`, so Nim just infers the type. |
20:02:00 | Yardanico | rayman22201: yeah |
20:02:17 | rayman22201 | I'm one of those people who likes to be extra explicit and specify all my types :-) |
20:06:10 | FromGitter | <AiguyGary_twitter> @yardanico Thanks! |
20:08:14 | * | ng0 joined #nim |
20:21:45 | * | sealmove quit (Quit: WeeChat 2.6) |
20:42:34 | FromGitter | <Lecale> Beginner question to bore y'all with. Is there an option to split strings by a string array, or can i only use by string, by char, by char array? |
20:43:01 | Yardanico | well, there's multiReplace proc |
20:43:10 | Yardanico | (from strutils), which probably does what you want |
20:43:22 | Yardanico | ah, split |
20:46:22 | FromDiscord | <juan_carlos> The `split` of `re` takes a Regex, is easy to make a simple regex from string array. |
20:46:22 | FromGitter | <Lecale> I was parsing ply in an sgf file, really lazily. I wanted to split by ;B[ and ;W[ but had to just split by ; instead, which took a whole extra few lines of code |
20:46:33 | * | nsf quit (Quit: WeeChat 2.5) |
20:47:38 | Yardanico | You can also try using scanf macro from strscans module |
20:48:20 | FromGitter | <Lecale> ok thanks |
20:53:44 | * | clyybber joined #nim |
21:00:18 | * | nsf joined #nim |
21:05:04 | * | superbia left #nim ("WeeChat 2.4") |
21:07:48 | * | Ven`` joined #nim |
21:32:22 | * | asymptotically quit (Quit: Leaving) |
21:35:18 | * | solitudesf quit (Ping timeout: 268 seconds) |
21:37:05 | * | Hideki joined #nim |
21:41:17 | * | Hideki quit (Ping timeout: 250 seconds) |
21:44:25 | FromDiscord | <juan_carlos> Whats the best way to check if string contains a float?. `try: parseFloat("42.0") except:...` ?. |
21:46:13 | * | fanta1 joined #nim |
21:49:29 | * | Trustable quit (Remote host closed the connection) |
22:02:22 | * | clyybber quit (Quit: Quit) |
22:24:22 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
22:26:09 | * | fanta1 quit (Quit: fanta1) |
22:27:13 | dom96 | How's everyone doing? Been away for a week, did I miss anything interesting? |
22:29:22 | krux02 | dom96: I rewrote the json.to macro. |
22:29:29 | krux02 | PR is still pending, but it is looking good. |
22:29:35 | dom96 | cool |
22:29:42 | krux02 | I thought you might be interested since you wrote the original version. |
22:30:03 | dom96 | yeah, I'll try to take a look |
22:30:11 | dom96 | Waiting for a flight so not sure how much time I'll have |
22:30:16 | dom96 | also looking at rayman's PR |
22:30:26 | rayman22201 | @dom96, check my async PR's if you can. I would appreciate it :-) |
22:30:31 | dom96 | ^^ :) |
22:30:41 | krux02 | dom96: here is the PR https://github.com/nim-lang/Nim/pull/12391 |
22:30:46 | dom96 | tbh json.to is IMO the wrong approach to serializing in Nim |
22:30:51 | krux02 | most important change, it is now based on overloads |
22:30:54 | dom96 | but we're stuck with it now :) |
22:31:00 | krux02 | not a single all generating macro |
22:31:22 | krux02 | what is wrong with it? |
22:31:51 | krux02 | apart from that it is json, I don't see it structurally wrong. |
22:32:00 | krux02 | maybe the implementation, but that can be changed. |
22:32:06 | krux02 | (as I did) |
22:32:11 | rayman22201 | I have a fun bug... when I declare a `{.warning.}` pragma inside a stdlib module, it does not print the warning :/ |
22:32:22 | dom96 | oooh, if you used overloading then that is precisely what I meant |
22:32:33 | dom96 | well, depends how you did it |
22:32:53 | dom96 | I've got a thrift package I wrote (not open source) that doesn't use any macros and serialization using it works very nicely |
22:33:01 | dom96 | it just uses the fields iterator plus some overloading |
22:33:18 | dom96 | so I was thinking that the JSON `to` would work better if it used the same approach |
22:33:21 | krux02 | rayman22201, it probably has to do with the fact that many messages from the standard library are prohibited. Pretty annoying if you ask me. It should be to not bother user with internal warning of the standard library, but it also prevents me from actually seeing them in the first place so they can be fixed. |
22:34:09 | krux02 | yea that is exactly what I did. |
22:34:22 | krux02 | assignFromJson is the magic proc that is overloaded for everything. |
22:34:36 | rayman22201 | bah... Puts me in a tough spot... I was trying to redo this PR using a warning instead, but the warning never shows: https://github.com/nim-lang/Nim/pull/12231 |
22:34:42 | krux02 | I just had to to make it work with everything, object, distinct etc. |
22:35:35 | krux02 | rayman22201, yea you should create an issue report for it. |
22:35:43 | * | thomasross_ joined #nim |
22:35:43 | * | thomasross quit (Killed (card.freenode.net (Nickname regained by services))) |
22:35:43 | * | thomasross_ is now known as thomasross |
22:35:47 | krux02 | with a nice description of why it is bad the way it is. |
22:36:46 | rayman22201 | 😢 ok |
22:37:36 | krux02 | thanks |
22:41:14 | krux02 | dom96: I guess the thrift package doesn't support object variants. |
22:45:35 | * | Hideki joined #nim |
22:49:12 | FromDiscord | <treeform> I wrote my own json to that does not use macros |
22:49:24 | FromDiscord | <treeform> Just the field itarator |
22:49:27 | dom96 | krux02, it does |
22:50:35 | dom96 | It seems like your PR also has VM fixes? |
22:50:47 | dom96 | If so, ideally that should be in a separate PR |
22:51:18 | FromDiscord | <speckledlemon> Is there a reason why some procs in `algorithms` can operate on slices, but `sort` can't? |
22:54:09 | FromDiscord | <treeform> Field pairs made the json to and from code very clean: https://github.com/treeform/jsutils/blob/de812327fa7dd6cd7851a11932de2ea9d41c71a0/src/jsutils/jsons.nim#L89 |
22:54:25 | krux02 | dom96, no it doesn't have any vm fixes |
22:54:54 | dom96 | krux02, you've changed parseJson to check for `nimvm`. |
22:55:21 | krux02 | ah, that's what you mean. |
22:55:22 | dom96 | treeform: yep, that looks like how I've coded my thrift package |
22:55:53 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:55:57 | krux02 | well the problem is, on the js target there was some disabled code, even though it was very usable at compile time. |
22:56:29 | FromDiscord | <treeform> Dom96, cool I also have a thrift parser. I don't like thrift. |
22:56:38 | krux02 | dom96, here: https://github.com/nim-lang/Nim/issues/11988 |
22:56:47 | dom96 | treeform: I skipped that part :D |
22:56:57 | dom96 | treeform: I just implemented the thrift binary protocol |
22:57:12 | dom96 | and tried to keep things consistent so that in the future I can implement proper thrift |
22:57:26 | dom96 | for my game serializing and deserializing using the `fields` approach works very well |
22:57:42 | FromDiscord | <treeform> I just needed to parse thrift, to get the type info out |
22:58:07 | FromDiscord | <treeform> We for some crazy reason store a ton of info in thrift comments |
22:58:48 | FromDiscord | <treeform> So I wrote a thrift comment parser. |
22:59:01 | dom96 | krux02, looks like you've still got quite a bit of macro code in there |
22:59:20 | krux02 | yep |
22:59:23 | dom96 | maybe you could follow treeform's example? I think that will result in a much better implementation |
22:59:34 | krux02 | the macro is basically the fieldPairs iterator |
22:59:54 | FromDiscord | <treeform> I did run into isses, generics cand do everything |
23:00:15 | FromDiscord | <treeform> Like distinct float types I still can't do |
23:01:28 | krux02 | dom96: an you give me a link to thrift? |
23:03:06 | krux02 | I can't find it |
23:03:33 | Araq | speckledlemon: use toOpenArray and then 'sort' can do it too |
23:06:55 | dom96 | krux02, it's not open sourced |
23:09:43 | shashlick | Any suggestions for a library that I should wrap as part of the wrapping article I'm working on? |
23:11:06 | dom96 | shashlick, have a browse through needed-libraries |
23:11:46 | FromDiscord | <speckledlemon> thank you Araq! it works. one more question: is it memory-efficient, or does it do a copy under the hood? |
23:12:17 | Araq | it doesn't copy |
23:13:42 | shashlick | Zevv suggests ffmpeg but it is probably too ambitious |
23:13:55 | FromDiscord | <speckledlemon> I'm obviously a beginner...is there a way to know that explicitly from the documentation? |
23:15:58 | Araq | hmm toOpenArray doesn't even have any doc comment, so ... |
23:18:23 | disruptek | shashlick: lz4 |
23:18:36 | disruptek | or pigz |
23:18:50 | disruptek | or zstd |
23:19:25 | shashlick | Could then add those to nimarchive |
23:19:32 | disruptek | that's the idea. |
23:24:36 | * | laaron joined #nim |
23:29:26 | * | laaron quit (Client Quit) |
23:30:04 | * | laaron joined #nim |
23:32:13 | shashlick | Sneaky, but that's why I was thinking libssh2 since nimgit2 can get ssh support |
23:32:26 | * | krux02_ joined #nim |
23:33:12 | disruptek | thing is, libssh2 will probably be pretty challenging. i guess you can start off with it and if the going gets rough, abandon plans to document the process. |
23:33:39 | disruptek | i just see it as being burdensome from a x-platform angle. |
23:34:49 | * | krux02 quit (Ping timeout: 250 seconds) |
23:36:22 | * | luis_ joined #nim |
23:38:48 | * | luis_ quit (Remote host closed the connection) |
23:39:16 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
23:39:35 | * | laaron- joined #nim |
23:40:49 | * | laaron- quit (Client Quit) |
23:41:19 | * | laaron joined #nim |
23:46:30 | * | laaron quit (Quit: ZNC 1.7.4 - https://znc.in) |
23:46:50 | * | laaron joined #nim |
23:48:44 | * | laaron quit (Client Quit) |
23:49:07 | * | Hideki quit (Ping timeout: 268 seconds) |
23:50:37 | * | laaron joined #nim |
23:55:32 | * | stefantalpalaru quit (Quit: stefantalpalaru) |