00:22:03 | * | auxym joined #nim |
00:32:40 | * | auxym quit (Ping timeout: 258 seconds) |
00:37:27 | FromDiscord | <Elegantbeef> Afaik no, to pass as reference use `toOpenArray` |
00:59:56 | * | flynn quit (Read error: Connection reset by peer) |
01:01:05 | * | flynn joined #nim |
01:21:15 | * | auxym joined #nim |
01:34:04 | FromDiscord | <@bracketmaster-5a708063d73408ce4> so do s.toOpenArray? |
01:34:22 | FromDiscord | <Elegantbeef> well openArray is a non copy afaik |
01:34:22 | FromDiscord | <@bracketmaster-5a708063d73408ce4> you mean to tell me strings are usually copied? |
01:34:33 | FromDiscord | <Elegantbeef> Well slicing is a copying operation |
01:34:44 | FromDiscord | <Elegantbeef> Atleast i think atleast |
01:35:18 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Is there a way to tell? |
01:36:29 | * | rockcavera quit (Read error: Connection reset by peer) |
01:37:17 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3vq5 |
01:37:36 | FromDiscord | <Elegantbeef> If the address of a character is the same it means it borrowed memory instead of copying of course |
01:38:01 | * | rockcavera joined #nim |
01:38:01 | * | rockcavera quit (Changing host) |
01:38:01 | * | rockcavera joined #nim |
01:39:42 | * | auxym quit (Ping timeout: 272 seconds) |
01:40:06 | FromDiscord | <Elegantbeef> Due to a normal string slice returning a mutable string, it's a copy, but openArray is a borrow |
01:48:28 | FromDiscord | <@bracketmaster-5a708063d73408ce4> what if the original string is const? |
01:54:35 | FromDiscord | <Elegantbeef> Same thing |
01:54:52 | FromDiscord | <Elegantbeef> You use `toOpenArray` for borrowed slices |
01:56:29 | FromDiscord | <@bracketmaster-5a708063d73408ce4> well a const string would be immutable, so I'm imagining its slices should be too? |
01:56:49 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Anyways, this doesn't seem reasonable performance wise. Slices should be default immutable |
01:56:56 | FromDiscord | <Elegantbeef> The string slice is still returning a string |
01:57:40 | FromDiscord | <Elegantbeef> There is much in stable nim to do borrowed memory safely |
01:58:05 | FromDiscord | <@bracketmaster-5a708063d73408ce4> but slices of strings aren't borrowed, they're copied |
01:58:35 | FromDiscord | <Elegantbeef> Refer back to my last statement for why |
01:58:55 | FromDiscord | <Elegantbeef> If you want to have borrwed slices use openarray |
01:59:08 | FromDiscord | <@bracketmaster-5a708063d73408ce4> well - strings should be immutable by default |
02:02:35 | FromDiscord | <Elegantbeef> I think Araq is of that thought aswell, but they're presently mutable and copied, so you work with them as such |
02:03:05 | FromDiscord | <Elegantbeef> You can always make a template for a ergonomic slice and make life easier |
02:03:16 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I wrote a lexer that does passes around slices of a file and now I've got to rewrite it |
02:03:27 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3vqf |
02:03:32 | FromDiscord | <@bracketmaster-5a708063d73408ce4> cuz passing slices copies almost the entire file file every time |
02:04:15 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I'm curious to hear Araq's reasoning about default mutable string |
02:04:26 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I'm not seeing the advantages here |
02:05:46 | FromDiscord | <@bracketmaster-5a708063d73408ce4> thanks for that example, that's a good place to start |
02:07:20 | FromDiscord | <Elegantbeef> The advantages are they're much more efficient to write to |
02:08:17 | FromDiscord | <Elegantbeef> You can do concatenation cheaper due to the string already having allocated |
02:10:48 | FromDiscord | <Elegantbeef> Worth noting you can do immutable references assuming they arent slices |
02:11:05 | FromDiscord | <InventorMatt> if nim had another type for immutable strings then we'd be able have an option for both |
02:11:40 | FromDiscord | <Elegantbeef> Well time for someone to make a package \:D |
02:40:53 | * | arkurious quit (Quit: Leaving) |
02:49:57 | * | rockcavera quit (Remote host closed the connection) |
02:51:57 | FromDiscord | <undersquire> shouldnt a const string be an immutable string? |
02:59:20 | nrds | <Prestige99> Yes |
03:02:27 | FromDiscord | <undersquire> what about let? |
03:05:34 | FromDiscord | <Elegantbeef> Well they're immutable but generally speaking when people talk about immutable strings they're talking about ones that dont mutate the data at the pointer instead change where the pointer points |
03:19:57 | FromDiscord | <undersquire> yes thats what I mean |
03:20:36 | FromDiscord | <undersquire> are `const` and `let` strings fully immutable? (aka they dont mutate, pointer changes) |
03:22:27 | FromDiscord | <Elegantbeef> `const` is but `let` is only a compiler protection you can easily get around it |
03:22:32 | FromDiscord | <undersquire> ah ok |
03:23:04 | FromDiscord | <undersquire> also I just noticed you can compile nim programs without linking libc lol |
03:23:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3vqt |
03:24:14 | FromDiscord | <Elegantbeef> Useless cast is useless |
03:24:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3vqu |
03:27:05 | FromDiscord | <Elegantbeef> You cannot do the same with const since const is actually constant \:D |
03:29:59 | FromDiscord | <@bracketmaster-5a708063d73408ce4> i'm not liking this |
03:30:25 | FromDiscord | <Elegantbeef> Liking what? |
03:31:06 | FromDiscord | <@bracketmaster-5a708063d73408ce4> that a can be mutated that way |
03:31:31 | FromDiscord | <Elegantbeef> Well it's a systems language that values the programmer being right |
03:32:49 | FromDiscord | <undersquire> In reply to @@bracketmaster-5a708063d73408ce4 "that a can be": just dont mutate them then 😉 |
03:33:46 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I'm not - I'm slicing... |
03:33:54 | FromDiscord | <@bracketmaster-5a708063d73408ce4> anyways - no circular arguments needed |
03:33:57 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I know what I have to do |
03:34:03 | FromDiscord | <Elegantbeef> Is the code open? |
03:34:20 | FromDiscord | <@bracketmaster-5a708063d73408ce4> as in open source? |
03:34:20 | FromDiscord | <undersquire> https://tenor.com/view/kyloren-sad-star-wars-i-know-what-i-have-to-do-adam-driver-gif-11159545 |
03:34:25 | FromDiscord | <Elegantbeef> Yes |
03:34:37 | FromDiscord | <@bracketmaster-5a708063d73408ce4> yes - one moment |
03:34:54 | FromDiscord | <@bracketmaster-5a708063d73408ce4> need to clean up and then push |
03:41:26 | FromDiscord | <@bracketmaster-5a708063d73408ce4> https://gitlab.com/BracketMaster/rtlilcompiler/-/tree/master/ |
03:42:39 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I believe here is the first place slicing gets called\: https://gitlab.com/BracketMaster/rtlilcompiler/-/blob/master/src/rtlilCompiler.nim#L50 |
03:43:18 | FromDiscord | <@bracketmaster-5a708063d73408ce4> slicing also happens regularly in each automata\: https://gitlab.com/BracketMaster/rtlilcompiler/-/blob/master/src/rtlilCompiler/lexer/automata/attribute_automaton.nim#L18 |
03:43:31 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I mean really, its slicing galore |
03:43:35 | FromDiscord | <@bracketmaster-5a708063d73408ce4> But no modifications |
03:43:35 | FromDiscord | <Elegantbeef> That's not slicing |
03:44:07 | FromDiscord | <Elegantbeef> Indexing is a different operation to slicing \:D |
03:44:17 | FromDiscord | <@bracketmaster-5a708063d73408ce4> ok - well the first one is definitely slicing |
03:44:22 | FromDiscord | <Elegantbeef> yea |
03:44:49 | FromDiscord | <Elegantbeef> the alternative it to pass the string in as a parameter and pass start,end |
03:45:36 | FromDiscord | <Elegantbeef> Though the open array works as well assuming you dont use many things from strutils |
03:47:54 | FromDiscord | <@bracketmaster-5a708063d73408ce4> presumably, indexing doesn't copy - although, even if it did, indexing a character is pretty inexpensive |
03:48:02 | FromDiscord | <undersquire> what is rtlil? |
03:48:12 | FromDiscord | <@bracketmaster-5a708063d73408ce4> indexing a character -\> copying a character |
03:48:34 | FromDiscord | <Elegantbeef> Well there is no heap needed for copying a character so it's fine |
03:48:35 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Register Transfer Logic Intermediate Language |
03:48:41 | FromDiscord | <undersquire> ah |
03:49:12 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Its a nearly semantically unambiguous description format for digital logic circuits that the the open source circuit synthesizer yosys uses |
03:50:01 | FromDiscord | <undersquire> yeah |
03:52:20 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @\_discord\_372553949733060620\:t2bot.io , are you familiar with digital logic at all? |
03:54:40 | FromDiscord | <@bracketmaster-5a708063d73408ce4> yeah, @elegantbeef\:matrix.org , just timed the time spent lexing the first 5 tokens and got 200us, could be better |
03:54:46 | FromDiscord | <@bracketmaster-5a708063d73408ce4> will see how openarray does |
03:55:04 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I did d\:release |
03:57:32 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I've often heard, build first, optimize last... But I've often discovered that making code go faster while maintaining elegance requires massive restructures. So I've adopted, build a bit of the initial infrastructure, then see if things are too slow and consider optimizing... Especially with nim. |
03:57:57 | FromDiscord | <Elegantbeef> Suggest using a typeclass of `type StringLike = string or openArray[char]` |
03:59:25 | FromDiscord | <@bracketmaster-5a708063d73408ce4> ok |
03:59:32 | FromDiscord | <@bracketmaster-5a708063d73408ce4> well going to bed now, will try tomorrow |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:30 | * | supakeen joined #nim |
04:31:53 | FromDiscord | <brainproxy> sent a long message, see http://ix.io/3vqG |
04:32:12 | FromDiscord | <brainproxy> (edit) "http://ix.io/3vqG" => "http://ix.io/3vqH" |
04:37:11 | * | pyautogui joined #nim |
04:46:50 | pyautogui | Is there a really quick Nim implementation of the Chudnovsky algorithm for finding pi? |
04:47:51 | * | pyautogui quit (Quit: Connection closed) |
04:48:06 | * | pyautogui joined #nim |
04:51:04 | pyautogui | The rosetta-code version is a bit slow. |
04:58:48 | * | ozzz quit (*.net *.split) |
04:58:49 | * | Jjp137 quit (*.net *.split) |
04:58:49 | * | Mister_Magister quit (*.net *.split) |
04:58:49 | * | emery quit (*.net *.split) |
04:58:49 | * | oprypin quit (*.net *.split) |
04:59:07 | * | ozzz joined #nim |
04:59:07 | * | Jjp137 joined #nim |
04:59:07 | * | Mister_Magister joined #nim |
04:59:07 | * | emery joined #nim |
04:59:07 | * | oprypin joined #nim |
05:01:02 | * | mst_ joined #nim |
05:01:03 | * | mst quit (*.net *.split) |
05:01:03 | * | def- quit (*.net *.split) |
05:01:06 | * | def-- joined #nim |
05:01:29 | * | def-- is now known as def- |
05:02:34 | * | nixfreak_nim[m] quit (Ping timeout: 240 seconds) |
05:02:35 | * | Helios quit (Ping timeout: 250 seconds) |
05:03:03 | * | happycorsair[m] quit (Ping timeout: 276 seconds) |
05:04:55 | * | federico3 quit (*.net *.split) |
05:04:55 | * | pjzz quit (*.net *.split) |
05:04:55 | * | Ekho quit (*.net *.split) |
05:04:55 | * | greyrat_ quit (*.net *.split) |
05:04:55 | * | systemdsucks quit (*.net *.split) |
05:05:01 | * | federico3_ joined #nim |
05:05:03 | * | systemds1cks joined #nim |
05:05:22 | * | pjzz joined #nim |
05:05:46 | * | pyautogui quit (Ping timeout: 256 seconds) |
05:06:39 | * | greyrat joined #nim |
05:19:53 | * | Ekho joined #nim |
05:21:42 | * | pyautogui joined #nim |
05:27:27 | * | Vladar joined #nim |
05:39:58 | FromDiscord | <Rika> the main bottleneck of the rosetta code version is the bigint library |
05:41:24 | pyautogui | Is there a better bigint lib then? |
05:45:29 | FromDiscord | <Rika> https://github.com/ykoba1994/bignumber.nim or https://github.com/SciNim/megalo maybe? |
05:45:32 | nrds | <prestigebot99> itHub: 7"An implementation of arbitrary precision integers and floating point numbers for Nim." |
05:45:57 | pyautogui | Thanks |
05:53:24 | * | happycorsair[m] joined #nim |
06:02:37 | * | Helios joined #nim |
06:03:21 | FromDiscord | <arnetheduck> In reply to @top level await "it uses `chronos`": this is an optional dependency - the serialization library doesn't require chronos but can integrate with it |
06:32:21 | * | nixfreak_nim[m] joined #nim |
06:49:19 | * | max22- joined #nim |
06:53:09 | * | PMunch joined #nim |
06:54:04 | PMunch | Good morning everyone :) |
06:54:29 | max22- | 'morning PMunch |
06:54:55 | FromDiscord | <Elegantbeef> Hello pmunch |
06:56:05 | PMunch | Just got back from vacation, anything big happened while I was gone? |
06:56:40 | FromDiscord | <Elegantbeef> How long was your vacation like 3 months? 😀 |
06:57:26 | PMunch | Haha, more like three weeks |
06:57:30 | pyautogui | Reply to self: https://github.com/FedeOmoto/bignum is very fast is great. |
06:57:33 | nrds | <prestigebot99> itHub: 7"GMP wrapper for the Nim language" |
06:57:58 | FromDiscord | <Rika> In reply to @pyautogui "Reply to self: https://github.com/FedeOmoto/bignum": Does not work |
06:57:59 | FromDiscord | <Rika> Old |
06:58:04 | FromDiscord | <Rika> Use the ones I sent |
06:58:12 | pyautogui | Just used it with devel |
07:05:44 | FromDiscord | <Elegantbeef> Well overridable enums got merged into devel |
07:06:02 | FromDiscord | <Elegantbeef> So that's cool, nothing big though |
07:18:16 | * | pyautogui quit (Quit: Connection closed) |
07:23:08 | PMunch | Overridable enums? |
07:25:12 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/be39ab79902f0cf876be59bd84d050431e68d4d7/tests/enum/toverloadable_enums.nim |
07:25:36 | FromDiscord | <Elegantbeef> No longer need to specify where an enum comes from if it's not ambiguous and there is overlap |
07:26:13 | PMunch | Ooh nice |
07:26:17 | PMunch | I've been wanting that |
07:27:33 | PMunch | Still miss pure enums though.. |
07:29:13 | FromDiscord | <Elegantbeef> What's wrong with nim's pure? |
07:30:30 | * | pro joined #nim |
07:30:43 | PMunch | They got removed |
07:31:55 | * | pro quit (Client Quit) |
07:31:59 | FromDiscord | <Elegantbeef> they did? |
07:32:35 | PMunch | Yeah, ages ago :P |
07:33:25 | FromDiscord | <Elegantbeef> how did they differ from the pure pragma? |
07:34:49 | FromDiscord | <Rika> the pure pragma started to do nothing |
07:35:25 | FromDiscord | <Elegantbeef> Well it's needed for overlap |
07:35:58 | PMunch | Yeah it was the pure pragma, which currently doesn't do anything afaik |
07:36:29 | PMunch | It used to mean that you had to fully qualify access to them, so you could use short names that would otherwise be susceptible to overlap with other things |
07:37:31 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3vrf it does something, enables overlap |
07:37:31 | FromDiscord | <Elegantbeef> The way pure enums work now is you dont have to fully qualify them unless there is overlap |
07:38:24 | PMunch | Ah true, they still do something |
07:38:46 | FromDiscord | <Elegantbeef> Mentioned in it here https://nim-lang.org/docs/manual.html#types-enumeration-types |
07:38:51 | PMunch | It used to be that you always had to qualify them, even without overlap |
07:40:24 | PMunch | "However, it is then not ordinal anymore, so it is not possible to use these enums as an index type for arrays." |
07:40:30 | FromDiscord | <Elegantbeef> Yea the pure pragma's docs wasnt updated along side that change apparently |
07:41:00 | PMunch | Maybe it should be mentioned that normal ordinal enums can be used as array indices before we mention that holey enums can't` |
07:48:38 | FromDiscord | <Rika> In reply to @pyautogui "Just used it with": i am also on devel and am unable to compile |
07:54:33 | PMunch | Hmm, are there anyone here who uses NimLSP on Windows and would like to help out with bugs on the Windows platform? |
08:07:32 | FromDiscord | <generic bsd user> i dont know if this is smg that is only to me . but i cant compile koch bcz it cant find std/private/gitutils |
08:07:57 | FromDiscord | <generic bsd user> it was the same in termux . but in ignored as i thought i was the problem of the environtment |
08:08:01 | FromDiscord | <generic bsd user> but now in widnwos too? |
08:08:20 | PMunch | That's an impressive typo for the word Windows :P |
08:08:48 | FromDiscord | <generic bsd user> i didnt do on purpose |
08:08:49 | PMunch | How are you trying to compile koch? And is this a stable version like 1.4.8 or just the latest devel branch? |
08:08:59 | FromDiscord | <generic bsd user> stable 1.4.8 |
08:09:06 | FromDiscord | <generic bsd user> i cant get devel compiled |
08:09:14 | PMunch | Haha, I assumed it wasn't on purpose, just interesting to see it that jumbled up :P |
08:09:29 | FromDiscord | <generic bsd user> ohyes |
08:09:34 | PMunch | Well apparently you can't get this compiled either.. |
08:09:54 | PMunch | But let's stick to 1.4.8, it should be possible to compile at least |
08:10:02 | PMunch | devel can sometimes be broken |
08:10:10 | FromDiscord | <generic bsd user> now . i can clone the 1.4.8 and compile it though |
08:10:17 | FromDiscord | <generic bsd user> and any other version |
08:10:26 | PMunch | Wait, so what's the issue then? |
08:10:27 | FromDiscord | <generic bsd user> but not devel |
08:11:45 | FromDiscord | <generic bsd user> sent a code paste, see https://play.nim-lang.org/#ix=3vro |
08:11:59 | PMunch | Oh, so it works fine with 1.4.8, but on devel you can't build koch? |
08:12:04 | FromDiscord | <generic bsd user> when i do copy koch.nim to lib |
08:12:11 | FromDiscord | <generic bsd user> In reply to @PMunch "Oh, so it works": i am on 1.4.8 |
08:12:17 | FromDiscord | <generic bsd user> i ahave not compiled devel |
08:12:31 | PMunch | Well, according to those hints you are on 1.4.6.. |
08:12:45 | FromDiscord | <generic bsd user> wat |
08:12:46 | FromDiscord | <generic bsd user> ohyes |
08:12:51 | PMunch | "Hint: used config file 'C:\tools\Nim\nim-1.4.6\config\nim.cfg' [Conf]" |
08:12:51 | FromDiscord | <generic bsd user> 😔 |
08:12:55 | FromDiscord | <generic bsd user> choco is bad |
08:13:10 | PMunch | Oh yeah, I wouldn't install Nim via choco |
08:13:19 | FromDiscord | <generic bsd user> sorry and thonks |
08:13:33 | PMunch | Better grab choosenim if you don't need to build Nim from sources for some other reason |
08:13:57 | FromDiscord | <generic bsd user> i forgor choosenim as i was in phone all thses times |
08:14:12 | PMunch | But if you want to build from sources and it doesn't work you should try to build from the C sources instead of your current compiler. Those should always be able to build |
08:14:33 | FromDiscord | <generic bsd user> 👌. |
09:05:32 | * | neceve joined #nim |
09:54:16 | * | neceve quit (Read error: Connection reset by peer) |
10:29:06 | * | auxym joined #nim |
10:39:52 | * | auxym quit (Ping timeout: 272 seconds) |
10:57:57 | * | max22- quit (Ping timeout: 276 seconds) |
11:04:19 | * | auxym joined #nim |
11:27:56 | * | rockcavera joined #nim |
11:27:56 | * | rockcavera quit (Changing host) |
11:27:56 | * | rockcavera joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:30 | * | supakeen joined #nim |
12:10:52 | FromDiscord | <zetashift> In reply to @PMunch "Hmm, are there anyone": Ah just removed my dual boot setup haha, I can spin it up again, np |
12:11:01 | FromDiscord | <zetashift> (edit) "again, np" => "again" |
12:12:06 | PMunch | I mean I could test it in a VM or something, but I kinda wanted to find someone who actively uses it |
12:12:30 | FromDiscord | <top level await> Rat tye |
12:12:31 | FromDiscord | <top level await> (edit) "tye" => "type" |
12:12:36 | FromDiscord | <top level await> https://bigrat.monster |
12:13:46 | PMunch | What? |
12:19:12 | FromDiscord | <zetashift> In reply to @PMunch "I mean I could": ah I get that, lemme know if you need any help though, I don't use windows that much except gaming |
12:24:24 | * | auxym quit (Ping timeout: 276 seconds) |
12:28:19 | * | mst_ is now known as mst |
12:38:39 | FromDiscord | <hiros> What's the best profiler for nim? |
12:40:41 | PMunch | Depends on what you want to profile |
12:41:27 | FromDiscord | <hiros> Examples? |
12:42:07 | PMunch | Do you want to profile for speed, memory leaks, something else? |
12:53:54 | * | max22- joined #nim |
13:01:59 | * | kayabaNerve quit (Read error: Connection reset by peer) |
13:02:12 | * | kayabaNerve joined #nim |
13:10:14 | * | Vladar quit (Quit: Leaving) |
13:13:34 | * | arkurious joined #nim |
13:22:49 | * | auxym joined #nim |
13:31:02 | * | auxym quit (Read error: No route to host) |
13:31:15 | * | auxym joined #nim |
13:38:41 | * | auxym quit (Ping timeout: 248 seconds) |
13:47:42 | FromDiscord | <TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=3vsD |
13:48:26 | FromDiscord | <enthus1ast> for truely stand alone linux binaries have a look at musl |
13:50:43 | FromDiscord | <enthus1ast> for example one of my projects uses this line to build cross linux builds\:↵`nim --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc --passL:-static --passL:-s c -d:release --os:linux --opt:speed ./src/nimPepper/pepperslave`the binary then evens runs on ancient redhats and suse |
13:51:01 | FromDiscord | <TurtleP> mmm |
13:51:08 | FromDiscord | <TurtleP> I'm compiling through `nimble` |
13:51:19 | FromDiscord | <enthus1ast> yes me too |
13:51:53 | FromDiscord | <enthus1ast> https://github.com/enthus1ast/nimPepper/blob/7e6c83e165390c47f90d9447bcef9a31215b8b21/nimPepper.nimble#L35 |
13:52:12 | FromDiscord | <Mr Axilus> is there something similar to Go's interfaces in Nim? |
13:52:30 | FromDiscord | <TurtleP> I feel like I can just pass `--passL:-static` and that would solve it, no |
13:52:33 | FromDiscord | <TurtleP> (edit) "no" => "no?" |
13:52:38 | FromDiscord | <TurtleP> In reply to @mraxilus "is there something similar": there's iface |
13:52:47 | FromDiscord | <TurtleP> <https://github.com/yglukhov/iface> |
13:52:56 | FromDiscord | <enthus1ast> i dont know if the glib is then statically linked |
13:53:10 | FromDiscord | <Mr Axilus> In reply to @TurtleP "there's iface": awesome, thanks |
13:58:30 | FromDiscord | <TurtleP> In reply to @enthus1ast "i dont know if": adding that line it does build, just need to see if it works |
13:58:41 | * | PMunch quit (Quit: Leaving) |
13:59:07 | FromDiscord | <exelotl> I could've sworn there used to be an implementation of go-style interfaces that didn't require `ref` types |
13:59:48 | FromDiscord | <exelotl> but I haven't been able to find it |
14:00:37 | FromDiscord | <xflywind> In reply to @exelotl "I could've sworn there": I think you mean this one https://forum.nim-lang.org/t/2422 |
14:03:04 | FromDiscord | <Mr Axilus> Wait, I noticed there's also "concepts" in exeprimental features, does that accomplish the same thing? |
14:04:30 | FromDiscord | <Rika> not on runtime |
14:05:33 | FromDiscord | <exelotl> In reply to @flywind "I think you mean": oh yeah that's the one, thanks |
14:05:47 | FromDiscord | <xflywind> np |
14:13:05 | FromDiscord | <Mr Axilus> In reply to @Rika "not on runtime": So what are concepts used for in that case? |
14:13:20 | FromDiscord | <Rika> "static duck typing" |
14:13:32 | FromDiscord | <Rika> or "compile time type constraints" i guess is another name |
14:17:59 | FromDiscord | <sheerluck> In reply to @mraxilus "So what are concepts": https://www.youtube.com/watch?v=iPVoCTgvi8M |
14:18:52 | FromDiscord | <TurtleP> one other thing: I do get errors if I remove use of `passC:"-fcommon"` and was wondering why, could someone point me in the right direction? The error is `multiple definition of tab_typesZctr_143'` |
14:18:58 | FromDiscord | <TurtleP> (edit) "tab_typesZctr_143'`" => "'tab_typesZctr_143'`" |
15:29:26 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I would think this would work\:↵let a = "Hello world"↵var b = a.toOpenArray(3,5)↵echo b.type |
15:33:49 | FromDiscord | <@bracketmaster-5a708063d73408ce4> Or let me ask this, can I convert a const string to an array? |
15:48:08 | nrds | <Prestige99> maybe with sequtils you can do myString.items.toSeq() ? |
15:48:38 | nrds | <Prestige99> !eval import sequtils; echo repr "foo".items.teSeq() |
15:48:40 | NimBot | Compile failed: /usercode/in.nim(1, 33) Error: undeclared field: 'items' for type system.string [declared in /playground/nim/lib/system.nim(34, 3)] |
15:48:42 | nrds | <prestigebot99> /usercode/in.nim(1, 33) Error: undeclared field: 'items' for type system.string [declared in /playground/nim/lib/system.nim(34, 3)] |
15:48:51 | nrds | <Prestige99> oh nvm |
15:49:13 | FromDiscord | <xflywind> In reply to @@bracketmaster-5a708063d73408ce4 "Or let me ask": no builtin method |
15:49:45 | FromDiscord | <xflywind> known issue: https://github.com/nim-lang/Nim/issues/14810 |
15:50:15 | FromDiscord | <xflywind> use https://github.com/Clonkk/bytesequtils or nim-stew |
15:50:18 | nrds | <prestigebot99> itHub: 7"Some utility function to manipulate buffers as string or seq[byte]" |
15:50:55 | nrds | <Prestige99> do they want a byte array or a char array? |
15:51:02 | FromDiscord | <xflywind> In reply to @flywind "use https://github.com/Clonkk/bytesequtils or nim-s": https://github.com/status-im/nim-stew/blob/master/stew/byteutils.nim |
15:51:05 | nrds | <prestigebot99> itHub: 7"Some utility function to manipulate buffers as string or seq[byte]" |
15:56:33 | FromDiscord | <@bracketmaster-5a708063d73408ce4> > > ↵> > why do they want a byte array or a char array?↵> > because i need to slice stings without copying everytime↵> |
15:56:50 | FromDiscord | <@bracketmaster-5a708063d73408ce4> i'm writing a lexer which regularly slices from index to end of file |
16:04:16 | FromDiscord | <JonasL> Why do we have to specify the "sink" annotation and not make it the default like in rust? |
16:05:01 | FromDiscord | <JonasL> (edit) "default like in rust?" => "default?" |
16:06:14 | FromDiscord | <haxscramper> Because this would mean copying on call |
16:06:29 | FromDiscord | <haxscramper> Or rather it would mean this in more scenarios |
16:07:11 | FromDiscord | <haxscramper> Right now nim does not copy when passing arguments, but if you make it `sink` this might require copying data if it is used after the call |
16:07:38 | FromDiscord | <haxscramper> https://nim-lang.org/docs/destructors.html#rewrite-rules |
16:07:57 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vtE |
16:09:23 | FromDiscord | <JonasL> Ok I see |
16:10:18 | FromDiscord | <JonasL> So nim takes a reference by default to avoid coping? |
16:10:34 | * | auxym joined #nim |
16:18:09 | * | auxym quit (Ping timeout: 248 seconds) |
16:18:30 | FromDiscord | <dom96> In reply to @TurtleP "hey, so apparently when": you can either statically link glibs (or musl) or build on an older Ubuntu (that has an older glibc) |
16:18:50 | FromDiscord | <dom96> there is also another solution, that I cannot remember how to find right now 🙂 |
16:18:52 | FromDiscord | <TurtleP> Yeah I got it to statically link |
16:19:00 | FromDiscord | <TurtleP> It works 🙂 |
16:19:07 | FromDiscord | <enthus1ast> to musl or glibc? |
16:19:16 | FromDiscord | <TurtleP> glibc, I guess? |
16:19:24 | FromDiscord | <TurtleP> Whatever the default is |
16:22:05 | FromDiscord | <dom96> huh, didn't realise it's that easy to statically link glibc |
16:22:30 | FromDiscord | <enthus1ast> dont know there are dragons i guess |
16:22:52 | FromDiscord | <enthus1ast> maybe @TurtleP should look with strace if it still loads glibc |
16:35:28 | FromDiscord | <haxscramper> How does `from X import Y as Z` work exactly? I need to do `from fusion/matching import hasKind as fusionHasKind`, and it says `Error: identifier expected, but found 'hasKind as fusionHasKind'` |
16:37:10 | FromDiscord | <haxscramper> Alternatively, how do I `bindSym` specific proc from imported module |
16:37:20 | FromDiscord | <haxscramper> like `matching.hasKind` |
16:47:56 | * | koltrast quit (Ping timeout: 252 seconds) |
16:51:07 | * | koltrast joined #nim |
17:03:20 | FromDiscord | <planetis> i think matching.hasKind is the way to go. at least i havent seen any other vaiable way. |
17:04:04 | FromDiscord | <haxscramper> No, that does not work `bindSym("matching.hasKind")` `Error: undeclared identifier: 'matching.hasKind'` |
17:04:40 | FromDiscord | <planetis> relevant is https://github.com/nim-lang/RFCs/issues/380 |
17:05:05 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vtP |
17:05:08 | FromDiscord | <planetis> oh no idea then |
17:05:22 | FromDiscord | <planetis> you usually do mixin not bind |
17:05:34 | FromDiscord | <haxscramper> But they are different? |
17:05:42 | FromDiscord | <haxscramper> And I need to bind hasKind to closed symbol |
17:05:55 | FromDiscord | <planetis> yes ofc bind is the default |
17:07:04 | FromDiscord | <haxscramper> You mean wrapper template does not have to do it? Right |
17:07:21 | FromDiscord | <haxscramper> I'm just still in the `quote do/newCall/bindSym` mode so I got confused for a second here |
17:07:42 | FromDiscord | <planetis> wait are you writing a macro? so bindSym is needed |
17:08:05 | FromDiscord | <haxscramper> I'm writing a macro that has to call the template that wraps around imported proc |
17:08:19 | FromDiscord | <haxscramper> In macro I do `bindSym("fusionHasKind")` |
17:08:32 | FromDiscord | <haxscramper> I just wanted to avoid this extra layer of glue around imports |
17:08:46 | FromDiscord | <planetis> yea havent thought about it but its the opposite than generics/templates |
17:28:37 | * | nrds quit (Remote host closed the connection) |
17:28:54 | * | nrds joined #nim |
18:07:32 | * | drewr joined #nim |
18:08:37 | * | auxym joined #nim |
18:34:46 | * | max22- quit (Ping timeout: 268 seconds) |
18:35:32 | FromDiscord | <PsychoClay> should i flushFile after every time i write some data or is this very slow? |
18:36:27 | * | supakeen quit (Remote host closed the connection) |
18:36:51 | * | supakeen joined #nim |
18:56:47 | FromDiscord | <leorize> you shouldn't, it's very slow |
19:00:17 | * | auxym quit (Ping timeout: 248 seconds) |
19:09:17 | * | max22- joined #nim |
19:28:51 | FromDiscord | <TechnoRazor> I'm currently messing around with Nim's move semantics & `=destroy` to see how they work, and I'm a little confused by something.↵I have a proc, `myProc(obj : sink MyType)`, which takes ownership of any objects passed to it. So how come, even though `myProc` takes ownership of an object, and `=destroy` is called on it, `=destroy` is called again for the original object when it goes out of scope? |
19:31:06 | FromDiscord | <TechnoRazor> It seems like an unnecessary call, as its memory was already wiped when `myProc` took ownership of it. |
19:37:13 | FromDiscord | <TechnoRazor> Is it a bug? It definitely doesn't seem like intended behavior. |
19:41:32 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vuX |
19:41:39 | FromDiscord | <haxscramper> Do you use sinked object after? |
20:15:26 | FromDiscord | <TechnoRazor> I did not, and there was no compile-time warning about copying |
20:19:53 | FromDiscord | <TechnoRazor> In fact, I got a warning from running your code |
20:24:15 | FromDiscord | <haxscramper> Can you show your code? |
20:24:36 | * | pyautogui joined #nim |
20:33:48 | FromDiscord | <TechnoRazor> sent a code paste, see https://play.nim-lang.org/#ix=3vvg |
20:35:16 | * | ozzz quit (Ping timeout: 272 seconds) |
20:35:46 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vvh |
20:35:46 | FromDiscord | <haxscramper> this is really strange, yes |
20:36:11 | FromDiscord | <haxscramper> `--expandArc:main` |
20:37:46 | FromDiscord | <TechnoRazor> Should I open an issue about this or what? |
20:39:16 | FromDiscord | <haxscramper> I don't know, maybe it is expected, but I'm not really good with arc, so I'm not sure |
20:39:30 | FromDiscord | <haxscramper> But this does seem kind of unexpected to me |
21:40:35 | FromDiscord | <top level await> elegantbeef |
21:40:42 | FromDiscord | <top level await> i had a issue with the uhhh |
21:41:18 | FromDiscord | <top level await> json hook |
21:41:22 | FromDiscord | <top level await> i can't move it to a file for whatever reason |
21:42:48 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vvs |
21:42:48 | FromDiscord | <top level await> in useer.nim |
21:42:57 | FromDiscord | <top level await> `↵import lib/[animations, config, useer]↵` |
21:43:16 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vvt |
21:44:27 | FromDiscord | <Elegantbeef> What's the importing file look like? |
21:44:35 | FromDiscord | <top level await> wym |
21:44:39 | FromDiscord | <top level await> (edit) "wym" => "what do you mean?" |
21:45:00 | FromDiscord | <Elegantbeef> Well you're importing it so i want to see what that looks like |
21:45:06 | FromDiscord | <top level await> In reply to @top level await "` import lib/[animations, config,": here |
21:45:08 | FromDiscord | <top level await> oh |
21:45:11 | FromDiscord | <Elegantbeef> You're attempting to access `id` and it's not public |
21:45:22 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vvu |
21:45:27 | FromDiscord | <top level await> that's where I'm using it |
21:45:30 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vvv |
21:45:39 | FromDiscord | <Elegantbeef> Yea you're trying to acces `id` |
21:45:39 | FromDiscord | <Elegantbeef> Yea you're trying to accesd `id` |
21:45:42 | FromDiscord | <top level await> yes |
21:45:44 | FromDiscord | <Elegantbeef> It's not exported so you cannot access that |
21:45:55 | FromDiscord | <top level await> i've never used types lol |
21:45:58 | FromDiscord | <Elegantbeef> add an export marker to `id` |
21:46:01 | FromDiscord | <Elegantbeef> `id` |
21:46:07 | FromDiscord | <top level await> ohh |
21:46:08 | FromDiscord | <top level await> thank you |
21:46:20 | FromDiscord | <Elegantbeef> That's like a `public` field in other languages |
21:46:25 | FromDiscord | <top level await> ye syes |
21:46:33 | FromDiscord | <top level await> i also fixed that if statement to just crown = if statement |
21:47:35 | FromDiscord | <Elegantbeef> you know you can do `packet{"ch", "crown", "userId"}`? |
21:53:14 | FromDiscord | <top level await> no.. i didn't know that |
21:54:19 | FromDiscord | <top level await> how do I import a module one level below? |
21:54:58 | FromDiscord | <Elegantbeef> do you mean above? |
21:55:06 | FromDiscord | <top level await> ../ |
21:55:32 | FromDiscord | <top level await> that's below i think |
21:55:55 | FromDiscord | <Elegantbeef> `../` is above, below is `folderName/subModule` |
21:56:20 | FromDiscord | <top level await> above the |
21:56:22 | FromDiscord | <top level await> (edit) "the" => "then" |
21:56:25 | FromDiscord | <top level await> I don't know how to do it though |
21:56:29 | FromDiscord | <top level await> cause `../` doesn't work |
21:57:40 | FromDiscord | <Elegantbeef> `../moduleName` |
22:18:16 | FromDiscord | <top level await> is it possible to dynamically import a libary? |
22:18:21 | FromDiscord | <top level await> (edit) "libary?" => "module?" |
22:18:44 | FromDiscord | <Elegantbeef> you can put it in a `when defined(someFlag)` then do `-d:someFlag` at compile time |
22:18:54 | FromDiscord | <Elegantbeef> If you mean at runtime, no cause modules and the like do not exist there |
22:19:06 | FromDiscord | <top level await> well I have a folder |
22:19:09 | FromDiscord | <top level await> that's filled with modules |
22:19:22 | FromDiscord | <top level await> and if one of hte modules matches, the module needs to be imported and executed |
22:19:27 | FromDiscord | <top level await> (edit) "matches," => "matches a string," |
22:20:43 | FromDiscord | <top level await> what bout hot code reloading? |
22:21:34 | FromDiscord | <Elegantbeef> Well a plugin system/libraries make more sense but I dont know what you're doing |
22:22:52 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vvC |
22:34:36 | * | pyautogui quit (Quit: Connection closed) |
22:34:58 | FromDiscord | <ynfle (ynfle)> HOw can I see which part can have sideeffect in a fun and why? |
22:35:22 | FromDiscord | <top level await> What connection how I can? |
22:36:28 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vvE |
22:36:42 | FromDiscord | <top level await> bef |
22:36:45 | FromDiscord | <top level await> (edit) "bef" => "beef" |
22:36:50 | FromDiscord | <top level await> (edit) "https://play.nim-lang.org/#ix=3vvE" => "https://play.nim-lang.org/#ix=3vvF" |
22:44:06 | FromDiscord | <Elegantbeef> Like i said Nim doesnt care about modules at runtime |
22:44:22 | FromDiscord | <top level await> any other way this can be done? |
22:44:27 | FromDiscord | <Elegantbeef> Import all the modules you want to use, then either use a case statement, look up table or the macro system to annotate them so you can use them later |
23:08:15 | * | max22- quit (Remote host closed the connection) |
23:45:22 | * | stkrdknmibalz joined #nim |
23:55:18 | * | Pyautogui joined #nim |
23:56:59 | Pyautogui | Newbie question: Why does this code give a syntax error? https://play.nim-lang.org/#ix=3vvK |
23:58:19 | FromDiscord | <Elegantbeef> Cause you cannot have a generic procedure type |
23:58:50 | FromDiscord | <Elegantbeef> You'd want something like https://play.nim-lang.org/#ix=3vvM |
23:59:15 | Pyautogui | Got it. Thanks |
23:59:57 | * | Pyautogui quit (Client Quit) |