00:00:45 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Thats not gonna work if my file changes↵(@voidwalker) |
00:01:13 | FromDiscord | <voidwalker> well how are we supposed what you consider to be wrong ? the input data ? The toHex implementation ? your computer ? |
00:01:22 | FromDiscord | <voidwalker> (edit) "well how are we supposed ... what" added "to know" |
00:02:41 | FromDiscord | <@thatrandomperson5-6310e3b26da03> The tohex result is the part that is changing. The orginal data stays the same. Im asking why it changed and how to fix it↵(@voidwalker) |
00:03:44 | FromDiscord | <voidwalker> how are we supposed to know what your code does, with no context ? |
00:04:06 | FromDiscord | <voidwalker> ok then, blame it on the cosmic rays messing with your memory : ) |
00:07:14 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Have some bytes as input then apply toHex, what else do you need?↵(@voidwalker) |
00:08:01 | FromDiscord | <Karspep> Hello, I would like to know if someone can help me to configure a debugger for Nim in Windows 10 |
00:32:23 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
00:35:16 | * | jmdaemon joined #nim |
00:38:19 | * | Ziw quit (Quit: WeeChat 2.8) |
00:43:02 | FromDiscord | <voidwalker> Is it possible to define a proc that defines what value should be returned when accessing an object variable of a certain type (just the var name, no fields) ? |
00:43:27 | FromDiscord | <Elegantbeef> What? |
00:44:23 | arkanoid | is it possible to convert a flat object to a tuple? |
00:45:05 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4gSv |
00:46:04 | FromDiscord | <Elegantbeef> What doesnt work there? |
00:46:20 | FromDiscord | <voidwalker> well, for echo I can define a string return proc, but in general, would it be possible to alias x to return a certain seq ? |
00:46:49 | arkanoid | I mean, convert an object to a named tuple without manually copying each field. Even better would be to cast it to avoid copy |
00:46:55 | FromDiscord | <Elegantbeef> You can make a converter but no you cannot make `x` do something different |
00:47:08 | FromDiscord | <Elegantbeef> Objects and tuples might not be the same size↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>) |
00:48:12 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4gSw |
00:49:11 | FromDiscord | <Elegantbeef> If you just want to convert an object to a tuple i'd say make a macro, or use something like `assigns` |
00:49:20 | FromDiscord | <Elegantbeef> https://github.com/metagn/assigns |
00:49:55 | FromDiscord | <voidwalker> still don't get why I should convert it into a tuple ? |
00:50:12 | FromDiscord | <Elegantbeef> Arkanoid is also asking a question |
00:50:18 | FromDiscord | <Elegantbeef> The world doesnt revolve around you VOID! 😛 |
00:50:21 | arkanoid | thanks Elegantbeef. Let me explain why I need it |
00:51:01 | FromDiscord | <voidwalker> ah lol great timing |
00:55:09 | arkanoid | I'm writing nim code meant to be called from python, using nimpy {.exportpy.} macro. If I create "func test(foo: MyObject): MyOtherObject {.exportpy.}" what I get in python is "test(foo: dict): dict". If I write instead "func test(a: float, b: float, c: float): tuple[a: float, b: float, c: float] {.exportpy.}" in python I get "test(a: float, b: float, c: float): tuple[float, float, float]", which is |
00:55:11 | arkanoid | much more "pythonish". So what I need is a converter from MyObject/MyOtherObject to tuple, to make python happy |
00:55:34 | FromDiscord | <Elegantbeef> Well then a macro is what you need |
00:56:02 | FromDiscord | <voidwalker> so I was talking about dictionary encoding earlier, if there's any libs.. didn't get any reply, so I thought to try write a basic generic one. dictComp object is supposed to keep a sequence compressed using an index seq and a dictionary sequence of the type to be stored. Of course storing the original data itself would defeat the purpose of having lower memory usage. |
00:57:42 | FromDiscord | <voidwalker> So it seems I could write a `[]` proc for that object even though it's not a seq. Now what I want is some way to return the whole "decoded" sequence of data. One way would be to define a proc and a proc var inside the object, that returns it. |
00:58:14 | FromDiscord | <voidwalker> But I was asking if there is a way to return it simply by giving the var name |
00:59:09 | NimEventer | New thread by RodSteward: Initial OS porting experience, see https://forum.nim-lang.org/t/9656 |
01:02:01 | FromDiscord | <voidwalker> If I write a converter, that can only be used in places where the converted-to type is expected, right ? |
01:06:33 | FromDiscord | <Elegantbeef> Correct |
01:06:41 | FromDiscord | <Elegantbeef> I'm still uncertain what you're after |
01:07:01 | FromDiscord | <Elegantbeef> You could always use a sink parameter to give the memory to this new object then interface with it |
01:07:09 | FromDiscord | <Elegantbeef> This way you dont copy memory but dont reallocate |
01:07:40 | * | disso_peach joined #nim |
01:09:16 | FromDiscord | <voidwalker> don't comprehend the sink concept yet : ( |
01:11:03 | FromDiscord | <Elegantbeef> sink is just an annotation which gives up memory instead of copying |
01:12:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gSy |
01:12:57 | FromDiscord | <Elegantbeef> Compiling with arc/orc there is no copy here which is confirmed by checking the address of the first element of data |
01:14:54 | FromDiscord | <voidwalker> gives up memory, as in, transfers the "ownership" ? |
01:15:03 | FromDiscord | <Elegantbeef> yes |
01:16:05 | FromDiscord | <Elegantbeef> Of course the above code isnt correct due to having `a` as top level |
01:16:38 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gSz |
01:16:51 | FromDiscord | <voidwalker> what's wrong with top level ? |
01:17:01 | FromDiscord | <Elegantbeef> Move semantics dont work with top level data |
01:17:09 | FromDiscord | <Elegantbeef> It's global data |
01:17:20 | FromDiscord | <Elegantbeef> Moving the data is just wrong |
01:18:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/A4L |
01:18:15 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4gSA |
01:18:27 | FromDiscord | <Elegantbeef> other than naming the type with a lowecase name 😛 |
01:18:56 | FromDiscord | <Elegantbeef> What's wrong? |
01:19:02 | FromDiscord | <Elegantbeef> That code compiles, no clue if it runs |
01:19:12 | FromDiscord | <voidwalker> sent a code paste, see https://paste.rs/5sv |
01:19:18 | FromDiscord | <voidwalker> it compiles, but when i try to do an echo x, I get that |
01:20:05 | FromDiscord | <Elegantbeef> Your `[]` takes a `uint32` |
01:20:32 | FromDiscord | <Elegantbeef> Works fine |
01:20:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gSB |
01:20:43 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Seriously, what other info do you need, ive been stuck on this too long. It happens every time, i don’t think it is a biflip |
01:21:20 | FromDiscord | <Elegantbeef> !eval import std/strutils; echo 24u8.toHex |
01:21:27 | NimBot | 18 |
01:21:34 | FromDiscord | <Elegantbeef> Works fine |
01:23:31 | FromDiscord | <Elegantbeef> Provide a case that causes the issue and we can help |
01:23:38 | FromDiscord | <Elegantbeef> Otherwise we cannot say anything but "it works" |
01:29:30 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
01:32:10 | FromDiscord | <voidwalker> alright, so now I can do echo "2" & x, or echo x. Or x.toSeq to get the actual seq |
01:34:13 | FromDiscord | <voidwalker> how come this is not in a lib somewhere though. Nobody cares about saving memory ? |
01:35:43 | FromDiscord | <Elegantbeef> Tables already sink values |
01:37:17 | FromDiscord | <voidwalker> What does sinking have to do with dictionary encoding ? |
01:37:31 | FromDiscord | <Elegantbeef> It doesnt copy the value when you move it to a dictionary |
01:37:55 | FromDiscord | <Elegantbeef> It then makes it so it's not as costly to just iterate the table |
01:38:52 | FromDiscord | <Elegantbeef> And the `values` iterator yields `lent` values |
01:40:51 | FromDiscord | <voidwalker> are we talking about the same thing here ? :\ |
01:41:37 | FromDiscord | <voidwalker> I was talking about dictionary coding, that is, efficiently (space-wise) storing a large array of relateively few distinct values |
01:42:05 | FromDiscord | <Yepoleb> @voidwalker it seems like you're way overcomplicating this. just make seq of your strings, deduplicate it with the deduplicate proc, make a table which maps a string to its seq index and then encode using that table |
01:42:42 | FromDiscord | <Elegantbeef> Or continue making your own variant of dictionary coding |
01:43:12 | FromDiscord | <voidwalker> @Yepoleb how exactly I am overcomplicating it ? 🙂 |
01:43:47 | FromDiscord | <voidwalker> that's what I am doing, more or less |
01:45:16 | FromDiscord | <voidwalker> @ElegantBeef as opposed to whose variant ? |
01:45:40 | FromDiscord | <Elegantbeef> Did i imply there was another version? |
01:46:13 | FromDiscord | <voidwalker> I guess not. But why isn't there one ? |
01:46:27 | FromDiscord | <Elegantbeef> All things start off unimplemented |
01:46:28 | FromDiscord | <voidwalker> This is the second non trivial project I am starting, and the second time I need this |
01:46:43 | FromDiscord | <Elegantbeef> I've literally never needed this datatype |
01:48:31 | FromDiscord | <Elegantbeef> Though `sets` really needs `sink` annotations |
01:52:57 | FromDiscord | <Yepoleb> In reply to @voidwalker "<@144300201857777664> how exactly I": i see you are ending up with quite a simple solution, sorry for my comment then |
02:05:14 | arkanoid | do you know how can I use valgrind to check if my wannabe stack-only application accidentally performs allocations? I want to test my program to be allocation free |
02:07:04 | FromDiscord | <Elegantbeef> The dumb thing would be to use `-d:useMalloc` + patchfile to error when the allocator is called 😄 |
02:08:18 | arkanoid | well, I've never handled an allocator in my life, I guess it's kinda advanced stuff, isnt it? |
02:08:33 | FromDiscord | <Elegantbeef> In your case you dont need to allocate do you? |
02:09:24 | FromDiscord | <Elegantbeef> You can just use patchfile with this https://github.com/nim-lang/Nim/blob/141b76e36519219915ada9086d1c9b1d0b465659/lib/system/mm/malloc.nim |
02:10:37 | FromDiscord | <Elegantbeef> You probably can also use valgrind |
02:10:46 | FromDiscord | <Elegantbeef> This is just a dumb response 😄 |
02:11:47 | arkanoid | nope, it's very interesting response. I'll try this route |
02:12:50 | arkanoid | in the meantime, I've just found a weird behaviour. My program compiles with --panics:off, if I enable panics it fails to compile due to "myfunc can have side effects" |
02:12:57 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/7588#48280 should help |
02:13:14 | arkanoid | so apparently my funcs gain side effect powers by enabling panics? |
02:13:43 | FromDiscord | <Elegantbeef> Huh |
02:16:20 | arkanoid | let's me try to reduce it to minimal example |
02:16:27 | arkanoid | thanks for the forum link! exactly what I need |
02:20:14 | * | wallabra quit (Ping timeout: 260 seconds) |
02:20:57 | * | wallabra joined #nim |
02:23:31 | arkanoid | here it is: works with --panics:off (default), error: side effects with --panics:on https://play.nim-lang.org/#ix=4gSZ |
02:24:09 | arkanoid | should I open an issue on github for this? |
02:25:24 | arkanoid | uh, wait, I'm also using some config.nims, it might be relevant, let me isolate the test |
02:28:13 | arkanoid | the error persists even when using --skipUserCfg --skipParentCfg --skipProjCfg, so the link is still valid |
02:28:50 | FromDiscord | <Elegantbeef> Yea the issue is that with panics on a procedure calls `sysFatal` which isnt properly sideeffect free |
02:29:46 | FromDiscord | <Elegantbeef> Update to 1.6.10 |
02:29:50 | arkanoid | Elegantbeef, I've just found out it is solved in 1.6.10! I was still on 1.6.8 |
02:30:14 | FromDiscord | <Yepoleb> apparently setting a breakpoint on `malloc` with gdb also works to trap malloc calls |
02:30:55 | FromDiscord | <Yepoleb> you can then print a backtrace to find out where it was called |
02:31:03 | FromDiscord | <voidwalker> I'm still on 1.6.6 https://archlinux.org/packages/community/x86_64/nim/ :\ |
02:31:17 | FromDiscord | <Elegantbeef> Oh wow 1.6.10 got my VM `toOpenArray` work 😄 |
02:31:22 | FromDiscord | <Elegantbeef> Time to use choosenim void |
02:31:39 | FromDiscord | <voidwalker> nah it's okay, I'm not bleeding edge following nim limits |
02:31:51 | arkanoid | voidwalker, use choosenim. I've never installed nim from package, and choosenim is great for moving around versions |
02:32:04 | FromDiscord | <Elegantbeef> 1.6.10 isnt bleeding edge |
02:32:08 | FromDiscord | <Elegantbeef> It's stable |
02:32:10 | FromDiscord | <Elegantbeef> Bleeding edge is devel |
02:32:13 | * | wallabra quit (Ping timeout: 265 seconds) |
02:32:20 | FromDiscord | <voidwalker> I'd really like to not have to use anything but pacman, if it can be avoided. And with nim, so far it can : ) |
02:32:27 | * | wallabra_ joined #nim |
02:32:55 | FromDiscord | <voidwalker> I used pascal's equivalent of choosenim cause there were always bugs and features missing from stable |
02:33:25 | arkanoid | voidwalker, usually it is even better to have software installed as user in user folder. More secure, easier to move around, no root involved |
02:33:50 | FromDiscord | <Yepoleb> how is it more secure? |
02:34:18 | FromDiscord | <voidwalker> @Arkanoid indeed, I used to do that when I was on windows.. had all my software on a separate usb SSD, portable mode. On Linux, you have to have your whole ~ partition to achieve that |
02:34:21 | arkanoid | because you don't need admin to install it and execute it |
02:34:26 | * | wallabra_ is now known as wallabra |
02:34:48 | FromDiscord | <voidwalker> lol since when installing a package on your computer a security risk. anyway it runs as your user, not as root |
02:36:35 | arkanoid | voidwalker, from your words I feel you're not an experienced sysadmin. It is always a security risk to move a finger as root on a shared system. Btw this is offtopic. Btw there are plenty of ways to install everything as user in user folder without messing up shared system |
02:36:59 | FromDiscord | <voidwalker> lfmao, nobody ever touches my computers, ever. shared system haha |
02:37:47 | arkanoid | not all users on an unix system are humans :) |
02:38:40 | FromDiscord | <Yepoleb> we caring about the security of system users now? |
02:42:37 | FromDiscord | <Yepoleb> i too use nim from package |
02:43:58 | arkanoid | good for you! There's also nix if you want best of both worlds |
02:48:49 | FromDiscord | <voidwalker> is there no macro to replace `for i in low(aSeq)..high(aSeq): dowhatever(aseq[i])` ? |
02:49:21 | FromDiscord | <voidwalker> with `aSeq.justDo(dowhatever(it))` |
02:49:23 | FromDiscord | <Yepoleb> do you even need the index? |
02:49:26 | FromDiscord | <voidwalker> no |
02:50:43 | FromDiscord | <Yepoleb> just use `for element in aSeq: doWhatever(elkement)` |
02:50:48 | FromDiscord | <Yepoleb> (edit) "doWhatever(elkement)`" => "doWhatever(element)`" |
02:51:00 | FromDiscord | <voidwalker> the ones in sequtils all seem to want to mutate the original seq or yield another seq |
02:52:20 | FromDiscord | <Yepoleb> do you not want some result from your operation? |
02:52:43 | FromDiscord | <voidwalker> in this case, obviously not |
02:52:53 | FromDiscord | <huantian> What’s wrong with just a for looo |
02:52:56 | FromDiscord | <huantian> Loop |
02:53:11 | FromDiscord | <Yepoleb> hello huantian |
02:53:24 | FromDiscord | <huantian> Ello |
02:53:50 | FromDiscord | <voidwalker> Ever since I discovered map and the other macros, I feel I am doing it wrong with the fors. Also, for takes two lines for no reason |
02:54:30 | FromDiscord | <huantian> If you’re calling the function for it’s side effect, a normal for is the idiomatic way to do it |
02:54:45 | FromDiscord | <huantian> And you can put it on one line if you want, personally I don’t but you do you |
02:56:08 | FromDiscord | <voidwalker> nah it feels wrong, it was not meant to be on one line : ) |
02:56:28 | FromDiscord | <Yepoleb> 🤔 |
03:07:10 | * | neceve quit (Quit: ZNC - https://znc.in) |
03:08:28 | * | neceve joined #nim |
03:15:25 | arkanoid | damn, valgrind (massif) is able to tell me the total heap allocation bytes during program execution, but not the total number of allocations. Using arc I might be allocating/deallocating very fast and not catching the mallocs |
03:15:36 | * | arkurious quit (Quit: Leaving) |
03:16:01 | arkanoid | I just see a constant use of 72712B if heap |
03:16:28 | arkanoid | does this ring a bell? is 72712B the heap size required by nim runtime? |
03:22:54 | FromDiscord | <scarf> can i request rfc to be reviewed again? |
03:25:20 | FromDiscord | <Elegantbeef> You can always bump it |
03:30:15 | FromDiscord | <Yepoleb> Why do you even care about heap allocations? |
03:30:31 | * | rockcavera quit (Remote host closed the connection) |
04:22:49 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4gTm |
04:34:32 | FromDiscord | <voidwalker> looks good to me |
04:34:35 | FromDiscord | <sOkam!> well it seems like that example is correct. so the issue must be with the function im calling↵https://play.nim-lang.org/#ix=4gTr |
04:38:39 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4gTs |
04:42:49 | FromDiscord | <sOkam!> if I say `TileType.spike.ord` manuallly, the issue goes away. so it seems to be failing at resolving the converter 🤷♂️ |
04:43:43 | FromDiscord | <Elegantbeef> Does turning `genSpike` into a proc fix anything? |
04:45:20 | FromDiscord | <sOkam!> it changes the nimsuggest error position to the genSpike line, instead of the call to it. but the rest stays the same (errors too) |
04:45:47 | FromDiscord | <Elegantbeef> is there a generic `mset` procedure? |
04:45:56 | FromDiscord | <Elegantbeef> converters are not used in generic procedures |
04:46:04 | FromDiscord | <sOkam!> i have no clue |
04:47:23 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4gTt |
04:48:20 | FromDiscord | <Elegantbeef> is Pint a generic? |
04:49:29 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4gTu |
04:49:40 | FromDiscord | <Elegantbeef> Then i dont know what to say |
04:51:46 | FromDiscord | <sOkam!> if i call for the converter directly, it also seems to work 🤷♂️ |
04:51:56 | FromDiscord | <sOkam!> (edit) "directly," => "directly by name," |
04:56:04 | FromDiscord | <Elegantbeef> Something is causing the converter dispatch to not fire |
05:01:46 | FromDiscord | <voidwalker> today I learned that you can have a typedesc as proc parameter, and thus be able to call a proc like `var x = DictComp.init(data)`. Sort of feels like it's a class : ) thx beef |
05:05:54 | * | Jjp137 quit (Ping timeout: 260 seconds) |
05:13:28 | * | Jjp137 joined #nim |
05:27:27 | FromDiscord | <yrashk> sent a code paste, see https://play.nim-lang.org/#ix=4gTC |
05:31:34 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gTE |
06:57:07 | * | rockcavera joined #nim |
07:40:45 | NimEventer | New thread by void09: Any libraries for dictionary coding (compression) of array structures ?, see https://forum.nim-lang.org/t/9657 |
07:45:41 | * | tiorock joined #nim |
07:45:41 | * | tiorock quit (Changing host) |
07:45:41 | * | tiorock joined #nim |
07:45:41 | * | rockcavera is now known as Guest5445 |
07:45:41 | * | Guest5445 quit (Killed (lead.libera.chat (Nickname regained by services))) |
07:45:41 | * | tiorock is now known as rockcavera |
08:29:06 | * | junaid_ joined #nim |
08:29:28 | FromDiscord | <SteveGremory> sent a code paste, see https://play.nim-lang.org/#ix=4gU6 |
08:30:07 | FromDiscord | <SteveGremory> weird how it actually works with `ForegroundColor` but not just any `Color` even though it has a declaration for it |
09:53:37 | * | pro joined #nim |
10:01:26 | * | pro left #nim (#nim) |
10:05:30 | * | dnh joined #nim |
10:12:01 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:21:51 | * | pro1 joined #nim |
10:28:27 | * | pro1 quit (Quit: pro1) |
10:28:42 | * | pro joined #nim |
10:35:08 | FromDiscord | <Corazone> Hi all, recently i posted on nim subbredit about file transfer and TCP, long story short, file transfer is working, however im not sure im doing it the right way. Here is the code: |
10:35:44 | FromDiscord | <Corazone> sent a long message, see http://ix.io/4gUp |
10:36:43 | * | dnh joined #nim |
10:37:15 | FromDiscord | <Corazone> i know for sure that client.recv(10000000) should not hold that number but i dont know how to send the file size from the client, because send() function takes socket and a string as an argument |
10:38:12 | FromDiscord | <Corazone> is there any way to send a struct or and object containing file name, file size and file content? |
10:38:26 | FromDiscord | <Corazone> any help is more than appreciated |
10:40:30 | * | pro quit (Quit: pro) |
10:50:00 | * | jmdaemon quit (Ping timeout: 264 seconds) |
10:54:58 | * | jjido joined #nim |
10:59:35 | * | jjido quit (Ping timeout: 264 seconds) |
11:16:37 | FromDiscord | <hotdog> In reply to @Corazone "i know for sure": What about sending the content length first, http header style? |
11:23:37 | pbotfullerton | Do you control the client and the server, just the server, just the client? |
11:25:23 | * | junaid_ quit (Remote host closed the connection) |
11:28:43 | FromDiscord | <Corazone> In reply to @hotdog "What about sending the": I will try that, thanks |
11:28:54 | FromDiscord | <Corazone> In reply to @pbotfullerton "Do you control the": Both |
11:29:43 | pbotfullerton | Oh in that case why not send the first 4-8 bytes as the size of the rest of the content? |
11:30:15 | pbotfullerton | You do a recv(4), get the size and recv the rest |
11:37:48 | NimEventer | New thread by japplegame: Weird ICE, see https://forum.nim-lang.org/t/9658 |
11:39:24 | FromDiscord | <Phil> ... I kinda wanna have enums with multiple values now |
11:39:46 | FromDiscord | <Phil> I know I can achieve that kind-of by doing a hashmap which takes an enum as keys, but that still feels kinda indirect |
11:40:12 | FromDiscord | <Phil> (edit) "... I kinda wanna have enums ... with" added "that I can directly associate" |
11:44:51 | FromDiscord | <Phil> sent a long message, see http://ix.io/4gUR |
11:55:49 | FromDiscord | <untoreh> sent a code paste, see https://play.nim-lang.org/#ix=4gUV |
12:11:28 | FromDiscord | <auxym> In reply to @Isofruit "... I kinda wanna": Ha, I had the same thought in a fully different context. Implementing bindings to TinyUSB, there are constants (eg device subclass) where the meaning of a value is dependent on another (eg device subclass). The best I could come up with is distinct int types and consts of that type. |
12:13:55 | NimEventer | New thread by RodSteward: Plans for improving tagged enum (ADT) syntax?, see https://forum.nim-lang.org/t/9659 |
12:21:04 | FromDiscord | <Jessa> sent a code paste, see https://paste.rs/Mzy |
12:24:36 | FromDiscord | <Rika> https://nim-lang.org/docs/strutils.html#parseEnum%2Cstring |
12:25:05 | FromDiscord | <Jessa> ah ,thank you |
12:37:18 | * | Guest8783 joined #nim |
12:38:51 | * | Guest8783 quit (Client Quit) |
12:40:24 | FromDiscord | <sOkam!> if nim is pass by reference default, when is `proc thing(num :var int)` needed? |
12:50:16 | FromDiscord | <ShalokShalom> In reply to @Isofruit "... I kinda wanna": You mean.. discriminated unions? |
13:48:08 | FromDiscord | <Rika> In reply to @sOkam! "if nim is pass": Pass by reference != mutable pass |
13:58:47 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:01:06 | FromDiscord | <Phil> In a sense but not quite. A specific page enum only makes sense with that one specific controller for example, even though the type of all controller procs is identical. |
14:01:51 | * | dnh joined #nim |
14:06:47 | * | dnh quit (Ping timeout: 264 seconds) |
14:13:05 | FromDiscord | <Corazone> In reply to @pbotfullerton "Oh in that case": I tried it, however if the file is bigger than 4-8 digits in bytes it won't send propertly |
14:13:45 | FromDiscord | <Corazone> So if the file is lets say 55000 in bytes and i do recv(4) it will read up to 5500 |
14:17:07 | * | pro joined #nim |
14:18:42 | * | xet7 quit (Read error: Connection reset by peer) |
14:26:01 | * | phaleth joined #nim |
14:29:07 | FromDiscord | <ShalokShalom> In reply to @Isofruit "In a sense but": How is that not served by a DU? |
14:31:52 | FromDiscord | <Phil> By the fact (from my very superficial understanding of DU) that either whatever I'm unifying would just have the general controller type, or I'm making a distinct controller proc type for one specific proc that doesn't really enshrine into the type system that page enum X shall only be associated with that one specific controller proc |
14:32:57 | FromDiscord | <Phil> Because if I do a distinct type I am still technically able to convert other controller procs into that type |
14:33:24 | * | kotrcka joined #nim |
14:34:19 | FromDiscord | <Phil> If my understanding is wrong please describe DU in Nim specific terminology, my current association is variant objects |
14:42:14 | * | xet7 joined #nim |
14:43:11 | FromDiscord | <maria_rodriguez> Start small with a minimum of $50 for BITCOIN MINING, answer YES to be added 👇👇👇↵↵https://t.me/Stevecoldham001 |
14:43:11 | FromDiscord | <ShalokShalom> Idk how object variants are implemented in Nim |
14:43:19 | FromDiscord | <ShalokShalom> <@&371760044473319454> |
14:45:31 | FromDiscord | <rakgew> is there a way of iterating over all procs↵at compile time to collect the procs with↵custom pragma without typing them all out? |
14:45:36 | FromDiscord | <Phil> <@&371760044473319454> the Bots are infiltrating! |
14:46:41 | FromDiscord | <ChocolettePalette> @Moderator hi |
14:46:51 | FromDiscord | <Phil> In reply to @rakgew "is there a way": Are the procs all with the same signature? Or are they wildly different? |
14:47:57 | FromDiscord | <yrashk> Is there a way to run a compile-time block "on exit": that is when everything is done? I am modifying some compile-time variables in my macros, and I want to capture the final results. |
14:48:01 | FromDiscord | <rakgew> the ones I am looking for have all the same custom pragma and signature (no args no returns) |
14:49:17 | FromDiscord | <Yepoleb> In reply to @Corazone "I tried it, however": can you show the code? i don't see how it wouldn't work in theory |
14:49:57 | FromDiscord | <Phil> In reply to @rakgew "the ones I am": I think then you might be able to make a seq of procs, sadly that still demands you hand write that seq though |
14:51:17 | FromDiscord | <Phil> You could write a template for these kinds of procs that, when defining the proc also adds it to such a global seq, I haven't tried such a thing so far but should be feasible |
14:51:21 | FromDiscord | <rakgew> oh ok, thx.↵I hoped there was some general collector possible (like looking through global() for functions in python) |
14:52:16 | FromDiscord | <rakgew> huh? that sounds intrigueing.. |
14:53:42 | FromDiscord | <rakgew> @Phil so the proc to be registered registers itself? \:-D |
14:55:44 | FromDiscord | <Phil> In reply to @rakgew "<@180601887916163073> so the proc": Pretty much, this goes a bit into metaprogramming.↵↵If that saves you that much writing is questionable though, you'd still write it somewhat like a context manager in python |
14:55:55 | FromDiscord | <rakgew> so the template would need be able to understand from inside which proc it was called |
14:56:05 | FromDiscord | <Phil> At least that's the solution I can currently envision |
14:56:52 | FromDiscord | <rakgew> thx for the inspiration - I had not thought of that. |
14:56:56 | * | junaid_ joined #nim |
14:56:56 | FromDiscord | <Phil> You pass the template a body, you'd need to figure out how to get your actual proc from that body and call seq.add proc |
14:57:15 | FromDiscord | <Phil> Again, might not work well |
14:57:48 | FromDiscord | <rakgew> worth a try I guess - hand-typing the procs gets old quick.. |
14:57:55 | FromDiscord | <yrashk> sent a code paste, see https://paste.rs/JbO |
14:58:35 | FromDiscord | <Phil> Can't really say much about that one, I don't do much coding on the level of interfacing with c |
14:58:47 | FromDiscord | <hotdog> In reply to @Corazone "So if the file": Uint32 (4 bytes) goes up to 4,294,967,295 |
14:59:07 | FromDiscord | <hotdog> Are you writing the number as a string instead? |
15:00:08 | FromDiscord | <Corazone> In reply to @hotdog "Are you writing the": I am yes, i can't send the int |
15:00:30 | FromDiscord | <hotdog> In reply to @Corazone "I am yes, i": Why not? |
15:00:45 | FromDiscord | <Corazone> Send() takes socket and the string |
15:01:01 | FromDiscord | <Corazone> I take the file size and send it as a string |
15:01:35 | FromDiscord | <hotdog> In reply to @Corazone "Send() takes socket and": In the context of sockets it may help to think of sequences of bytes instead of strings |
15:01:47 | FromDiscord | <hotdog> You can send whatever bytes you want |
15:03:21 | FromDiscord | <Corazone> In reply to @Yepoleb "can you show the": I will post it later, can't right now |
15:03:23 | FromDiscord | <hotdog> But if you want to send the stringified number, do it http header style and send a line per header (e.g content-length and filename) and use recvLine on the server |
15:09:15 | FromDiscord | <Corazone> sent a long message, see http://ix.io/4gVY |
15:09:42 | FromDiscord | <hotdog> In reply to @Corazone "Can you maybe explain": Sure let me write up an example for both styles one sec |
15:10:02 | FromDiscord | <Corazone> In reply to @hotdog "Sure let me write": God bless you man |
15:13:53 | FromDiscord | <hotdog> sent a code paste, see https://play.nim-lang.org/#ix=4gW3 |
15:21:59 | * | arkurious joined #nim |
15:25:04 | FromDiscord | <Jessa> sent a code paste, see https://paste.rs/GpE |
15:33:56 | FromDiscord | <demotomohiro> I think you can use block expression that returns `test2` to initialize const variable. |
15:39:59 | NimEventer | New post on r/nim by Dry-Sweet7045: is it possible to use react libraries on nim, since it compiles to JS?, see https://reddit.com/r/nim/comments/z5adcx/is_it_possible_to_use_react_libraries_on_nim/ |
15:40:01 | FromDiscord | <hotdog> sent a long message, see http://ix.io/4gWc |
15:40:48 | FromDiscord | <Rika> This is why it is important to use the appropriate type… |
15:41:21 | FromDiscord | <Rika> That API really should have accepted either sequence or string (wink wink nudge nudge) |
15:42:04 | FromDiscord | <hotdog> In reply to @Rika "That API really should": Yeah I agree, it is obviously a bit misleading |
16:04:06 | FromDiscord | <fwsgonzo> There seems to have been a change in Nim recently where it is pruning functions it thinks doesn't get called |
16:04:12 | FromDiscord | <fwsgonzo> it broke my shit |
16:06:18 | FromDiscord | <auxym> dead code elim has been mandatory for a while, but if its killing stuff it shouldnt, definitely report an issue |
16:07:21 | FromDiscord | <auxym> is that 1.6.10 or devel? |
16:07:39 | FromDiscord | <fwsgonzo> it's 1.6.8 |
16:07:49 | FromDiscord | <fwsgonzo> I can't get it to reliably export a function in a static executable |
16:08:52 | FromDiscord | <auxym> is that function called in your code? |
16:09:55 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=4gWf |
16:10:20 | FromDiscord | <fwsgonzo> it gets called at some later point - it's fine that dead code elimination can happen, but there should always be an off button |
16:10:56 | FromDiscord | <auxym> report an issue, ideally wth minimal repro code |
16:10:58 | FromDiscord | <fwsgonzo> this symbol is force-kept in the linker, so its not a massive Nim issue |
16:11:08 | FromDiscord | <fwsgonzo> (edit) "massive" => ""massive" | "issue" => "issue"" |
16:11:16 | FromDiscord | <fwsgonzo> im using static executables in funny ways |
16:11:26 | * | arkanoid quit (Ping timeout: 268 seconds) |
16:11:38 | FromDiscord | <fwsgonzo> I have a CMake build system that builds the sources produced by Nim |
16:12:15 | FromDiscord | <fwsgonzo> it just seems like Nim sees it doesn't get called and removes it before I have a chance to keep it |
16:12:16 | FromDiscord | <auxym> /is the function actually called in your nim code though? before linking? if not, the nim compiler will kill it |
16:12:23 | FromDiscord | <fwsgonzo> right |
16:12:32 | FromDiscord | <auxym> you can mark it exportc though to keep it |
16:12:49 | FromDiscord | <fwsgonzo> Yep, that used to work: `proc start() {.cdecl, exportc.}` |
16:13:03 | FromDiscord | <auxym> should still work afaik |
16:13:24 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=4gWg |
16:13:35 | FromDiscord | <fwsgonzo> but `hello_nim`is never exported |
16:14:03 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=4gWh |
16:20:52 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=4gWj |
16:41:48 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
16:45:01 | * | ehmry joined #nim |
16:46:12 | * | phaleth quit (Quit: WeeChat 3.0) |
16:52:56 | FromDiscord | <auxym> it might be that the pragmas in the fwd declaration aren't used? Try adding them to the actual function definition maybe. If that's the case, I'm not sure if it's expected or a bug |
17:48:55 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=4gWF |
18:04:04 | * | xet7 quit (Ping timeout: 260 seconds) |
18:10:35 | FromDiscord | <Generic> iirc there are some secret optimisations to transform the first case into the second one |
18:11:38 | FromDiscord | <Generic> though be aware that if they exist, they can only transform this exact thing |
18:12:03 | FromDiscord | <Generic> so if it's not `a = a & something`, but e.g. `a = b & something` |
18:12:10 | FromDiscord | <Generic> it would do a copy |
18:12:40 | FromDiscord | <Generic> so summasumarum, if you care for performance better use add/&= from the start |
18:13:31 | FromDiscord | <hmmm> hmm no it's just that I've been using type 1) and just wondered, what if type 2) was better all along and I'm doing it wrong since the start? lol 😃 |
18:14:06 | FromDiscord | <Generic> well `&` is very handy |
18:14:18 | FromDiscord | <Generic> though I'd never write `a = a & "cream"` |
18:14:29 | FromDiscord | <Generic> I always write `a &= "cream"`, simply because it's shorter |
18:14:40 | FromDiscord | <hmmm> I see |
18:16:04 | pbotfullerton | @Corazone you're regularly sending files that are larger than the max size for a 32 or 64 bit unsigned integer? |
18:28:17 | FromDiscord | <arkanoid> I've finally ordered mastering Nim! Glad to support the project this way |
18:30:09 | FromDiscord | <jos> i'm trying to find a macro to generate an equality operator for ref types |
18:30:30 | FromDiscord | <jos> i want the equality operator to check deep equality of each field, like value types |
18:30:38 | FromDiscord | <jos> does anybody know where i can find a macro that does that |
18:33:28 | FromDiscord | <jos> i found this discussion but it doesn't look like anyone here knows, was last updated 2 years ago |
18:33:29 | FromDiscord | <jos> https://forum.nim-lang.org/t/6781 |
18:34:14 | * | arkanoid joined #nim |
18:40:21 | * | kotrcka quit (Remote host closed the connection) |
18:51:44 | * | jmdaemon joined #nim |
18:58:09 | FromDiscord | <mantielero (mantielero)> Hello |
18:58:59 | FromDiscord | <mantielero (mantielero)> sent a code paste, see https://play.nim-lang.org/#ix=4gWX |
18:59:39 | FromDiscord | <mantielero (mantielero)> I wrapped `factory` that returns `ptr AbstractState`. |
19:00:34 | FromDiscord | <mantielero (mantielero)> sent a code paste, see https://play.nim-lang.org/#ix=4gWZ |
19:00:52 | FromDiscord | <mantielero (mantielero)> It is not working. |
19:02:31 | FromDiscord | <mantielero (mantielero)> sent a code paste, see https://play.nim-lang.org/#ix=4gX2 |
19:03:41 | FromDiscord | <mantielero (mantielero)> sent a code paste, see https://paste.rs/7BM |
19:12:06 | FromDiscord | <demotomohiro> @mantielero On discord, your posted code contains html tags and hard to read.↵Could you post your code on other text sharing service? |
19:49:44 | FromDiscord | <demotomohiro> In reply to @jos "i'm trying to find": If this is what you want, you don't need to use macro:↵https://play.nim-lang.org/#ix=4gXm↵But it is not much tested.↵It might fails in more complicated types. |
19:50:17 | * | pbsds quit (Quit: The Lounge - https://thelounge.chat) |
19:50:51 | * | pbsds joined #nim |
19:54:12 | * | pro quit (Ping timeout: 264 seconds) |
19:55:44 | * | pro joined #nim |
20:01:16 | * | kenran joined #nim |
20:02:23 | * | junaid_ quit (Remote host closed the connection) |
20:02:43 | * | kenran quit (Remote host closed the connection) |
20:10:18 | FromDiscord | <Phil> Okay, adding links for nimble docs is kind of a massive pain in the keister |
20:16:47 | * | kenran joined #nim |
20:20:30 | * | junaid_ joined #nim |
20:20:52 | FromDiscord | <nixfreak> Can you use .to\_upper() to only Capitalize the first Letter ? Or would you have to do a case statement or using if logic ? |
20:21:40 | * | kenran quit (Remote host closed the connection) |
20:23:43 | FromDiscord | <Jessa> woo, made my own color printing thing for terminals |
20:23:46 | FromDiscord | <Jessa> https://media.discordapp.net/attachments/371759389889003532/1046159347111174154/unknown.png |
20:24:31 | FromDiscord | <nixfreak> Cool , https://nim-lang.org/docs/strutils.html#toUpperAscii,char nm |
20:25:50 | FromDiscord | <wick3dr0se> would std/os walkDir be the best route to get directory content. will eventually need to do something for each file returned |
20:28:28 | FromDiscord | <wick3dr0se> In reply to @Jessa "": You could use ANSI escape sequences as well. Would be neat to see this implemented in Nim. I did this script in BASH to output possible VT100 color sequences |
20:28:48 | FromDiscord | <wick3dr0se> (edit) "In reply to @Jessa "": You could use ANSI escape sequences as well. Would be neat to see this implemented in Nim. I did this script in BASH to output possible VT100 color sequences" => "sent a code paste, see https://play.nim-lang.org/#ix=4gXw" |
20:28:51 | FromDiscord | <Jessa> yes, that's what i'm using |
20:29:19 | FromDiscord | <wick3dr0se> Well maybe that can be some help then |
20:29:38 | FromDiscord | <Jessa> help for what lol?↵i'm using ANSI escape sequences in the backend |
20:30:08 | FromDiscord | <wick3dr0se> Outputting them more dynamically instead of just creating variables for each color code |
20:31:13 | pbotfullerton | In case anyone else runs into this, I wasn't able to get nim-jwt to compile because of a bunch of errors in the crypto.nim file. bearssl-nim changed their API slightly in June and nim-jwt hasn't been updated to reflect that. Using a bearssl-nim commit before June 2022 makes it work. |
20:31:18 | FromDiscord | <wick3dr0se> I output 273 colors with only a few printf calls. It can be streamlined to accept parameters easily |
20:31:28 | FromDiscord | <Jessa> In reply to @wick3dr0se "Outputting them more dynamically": i'm not |
20:31:32 | FromDiscord | <Jessa> i'm allowing rgb & hex |
20:31:42 | FromDiscord | <Jessa> https://media.discordapp.net/attachments/371759389889003532/1046161347924205599/image.png |
20:32:33 | FromDiscord | <wick3dr0se> In reply to @Jessa "i'm allowing rgb &": i didnt see that. i saw the first line with &red; and figured you had hard named them all |
20:32:49 | FromDiscord | <wick3dr0se> thats pretty cool |
20:35:01 | FromDiscord | <Jessa> In reply to @wick3dr0se "i didnt see that.": Did it that way with an older version of it, in python↵↵which still works okay-ish, but yeah |
20:36:19 | FromDiscord | <Jessa> and that also had an entirelyy different syntax, actually↵`[R]Red, [P]Purple... [E]Reset, etc` |
20:36:21 | FromDiscord | <Phil> Anyone set up on github a pipeline to automatically generate `nimble docs` and serve them on github? |
20:37:02 | FromDiscord | <Phil> If so, I would like to copy paste that work, I know prologue does it but I'm staring at the repo and not understanding a single thing, apparently there's a docker-compose yaml somewhere and I'm not seeing where |
20:38:27 | FromDiscord | <jos> In reply to @demotomohiro "If this is what": oh cool, I didn't know this was possible |
20:38:41 | FromDiscord | <jos> I just spent two hours adding value type equality operators to every node in my AST |
20:38:44 | FromDiscord | <jos> :cartired: |
20:38:52 | FromDiscord | <jos> but at least I don't have to maintain them now ahaha |
20:38:54 | FromDiscord | <jos> thanks!! |
20:41:04 | FromDiscord | <GoMpow2> i have a problem\:↵got a array with ref items, when I iterate over them with for iv in seq\: return iv iv is the dereferenced object, not the ref, how to return a ref from a function? |
20:42:02 | FromDiscord | <GoMpow2> (I want to iterate over something and return it in a function) |
20:44:55 | FromDiscord | <GoMpow2> https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types this doesnt help me \:( |
20:45:56 | FromDiscord | <Phil> As it is late where I'm from and I'm tired, I'd need to see a minimal code example |
20:47:01 | FromDiscord | <Phil> In reply to @jos "I just spent two": I raise, I wrote an entire package over several days, I aided another package to include the entire functionality of mine, making it basically obsolete |
20:47:11 | FromDiscord | <Phil> (edit) "mine," => "mine recently," |
20:47:17 | FromDiscord | <Phil> (edit) "it" => "my own" |
20:48:10 | pbotfullerton | @GoMpow2 what's the proc declaration for the function like? Are you declaring the return value as a ref <object> or as <object>? |
20:48:15 | FromDiscord | <GoMpow2> ah I got a solution |
20:48:44 | FromDiscord | <fwsgonzo> So, Nim has gotten some kind of incremental builds now, that's super nice |
20:48:45 | FromDiscord | <GoMpow2> didnt use the ref type in the declaration of the variable iterated over |
20:48:57 | FromDiscord | <fwsgonzo> is it going to be improved in the next major version? it seems to be working OK already |
20:50:50 | FromDiscord | <Phil> In reply to @fwsgonzo "So, Nim has gotten": It does? I'm using devel and I noticed a seeming speed up since.... weeks ago I guess, but I didn't know they already had IC |
20:52:17 | FromDiscord | <fwsgonzo> maybe it got removed again, I switched to .10 and now I don't see any .ndi files anymore |
20:52:37 | FromDiscord | <fwsgonzo> (edit) "maybe it got removed again, I switched ... to" added "from .8" |
20:54:34 | FromDiscord | <fwsgonzo> I really needed incremental because I want to have hundreds of levels in a game engine, and I am currently using CMake with a C++ API (for the games script), and I am considering using Nim |
20:56:01 | FromDiscord | <ShalokShalom> @fwsgonzo which game engine? |
20:56:11 | FromDiscord | <fwsgonzo> I am making my own - this is all research |
20:56:17 | FromDiscord | <ShalokShalom> Cool |
20:56:40 | FromDiscord | <fwsgonzo> I am using a RISC-V emulator to allow systems languages as game script, and I am writing all kinds of silly things in order to make it nice, automatic and convenient |
20:57:17 | FromDiscord | <huantian> if I was beef I would say something about wasm right about now |
20:57:47 | FromDiscord | <fwsgonzo> You can read about some of the insanity here: https://fwsgonzo.medium.com/using-c-as-a-scripting-language-part-5-d60b87556562 |
20:58:00 | FromDiscord | <fwsgonzo> WASM is great and all, but it's not as fun when someone already made everything for you |
20:58:14 | FromDiscord | <fwsgonzo> not to mention WASM isn't the solution to every problem 😛 |
20:58:23 | FromDiscord | <huantian> yeah risc-v emulator sounds neato |
20:59:11 | FromDiscord | <fwsgonzo> you're right of course - anyone who just wants the damn thing to Just Work should use something well established |
21:07:52 | FromDiscord | <jos> wasm is cool but the spec moves sloooow and the obsession with sandboxing and security isn't ideal for every application |
21:11:35 | FromDiscord | <ShalokShalom> In reply to @huantian "if I was beef": Comment of the day 😅 |
21:11:51 | FromDiscord | <Yepoleb> i am glad to see people experimenting with risc-v and wasm as scripting languages |
21:11:51 | FromDiscord | <ShalokShalom> @fwsgonzo why RISC-V exactly |
21:11:59 | FromDiscord | <ShalokShalom> I understand wasm |
21:12:21 | FromDiscord | <ShalokShalom> I just try to implement the Nim LSP into Lapce and they are using wasm |
21:12:27 | FromDiscord | <Yepoleb> we all love risc-v |
21:12:37 | FromDiscord | <ShalokShalom> I do too |
21:12:57 | FromDiscord | <ShalokShalom> I just dont understand how a CPU architecture can be used as a scripting runtime |
21:13:15 | FromDiscord | <ShalokShalom> You mean, because system level languages can compile to it? |
21:13:31 | FromDiscord | <ShalokShalom> They can to other architectures as well. What's the point? |
21:14:28 | FromDiscord | <Yardanico> probably because risc-v is fully open and new and exciting :P |
21:14:46 | FromDiscord | <Yardanico> In reply to @ShalokShalom "I just dont understand": you can just use an emulator as a "scripting runtime" |
21:14:50 | FromDiscord | <Yardanico> there won't be much difference really |
21:15:03 | FromDiscord | <Yardanico> WASM itself can be considered a "cpu architecture" |
21:15:10 | FromDiscord | <fwsgonzo> RISC-V is fairly simple, and you can implement parts of it - it's made up of extensions |
21:15:19 | FromDiscord | <Yepoleb> arm or mips would probably work just as well to be fair, but it does not have the coolness associated with it |
21:15:36 | FromDiscord | <ShalokShalom> In reply to @Yardanico "probably because risc-v is": Ah, that makes sense. |
21:15:37 | FromDiscord | <fwsgonzo> WASM is more like a wrapper around a linear arena, which is nice if you don't care about a virtual address space, which again enables languages like Go |
21:15:57 | FromDiscord | <Yardanico> good thing Nim has ARC/ORC since those work well with WASM |
21:16:03 | FromDiscord | <ShalokShalom> In reply to @fwsgonzo "RISC-V is fairly simple,": Yeah, that makes sense as well |
21:16:05 | FromDiscord | <Yardanico> refc doesn't work at all due to how it works |
21:17:53 | FromDiscord | <nixfreak> are you not allowed to assign a var to stdout.styledWriteLine({styleBright, styleBlink, styleUnderscore}, "styled text ") |
21:18:26 | FromDiscord | <Yardanico> as in? |
21:18:44 | FromDiscord | <Yardanico> `stdout.styledWriteLine` writes the line to the stdout as the code says directly |
21:18:55 | FromDiscord | <Yardanico> it doesn't return the string as a result if you mean it that way |
21:20:58 | FromDiscord | <Yardanico> terminal module doesn't really have a way to give you a ansi color-formatted string directly, there are some procs that give you the ansi codes for specific colors, but that's it |
21:22:48 | FromDiscord | <nixfreak> Ahh ok , I'm just looking to have colors for output strings |
21:43:58 | FromDiscord | <Phil> In reply to @Yardanico "WASM itself can be": WASM optimized risc-v CPU when |
21:44:34 | FromDiscord | <Phil> They always told us to optimize our code to run fast on the CPU, now we're turning the tables |
21:44:34 | FromDiscord | <Yardanico> then it will be a wasm cpu, not a risc-v cpu |
21:44:54 | FromDiscord | <Yardanico> I mean yeah it's possible to add WASM instructions directly to the RISC-V |
21:44:55 | FromDiscord | <Yardanico> like https://en.wikipedia.org/wiki/Jazelle |
21:45:14 | FromDiscord | <Phil> Was about to say, wouldn't it still be risc-v, just with a larger instructionset? |
22:04:22 | FromDiscord | <nixfreak> Ok , I figured it out kind of. Is it possible to get the first and last on one line using the colors ? https://play.nim-lang.org/#ix=4gXP |
22:06:00 | * | junaid_ quit (Remote host closed the connection) |
22:13:03 | * | krux02 joined #nim |
22:22:09 | FromDiscord | <Yardanico> In reply to @nixfreak "Ok , I figured": `stdout.styledWriteLine {styleBright}, fgBlue, $first, " ", {styleBright}, fgGreen, $last` |
22:22:29 | FromDiscord | <Yardanico> or actually just `stdout.styledWriteLine {styleBright}, fgBlue, $first, " ", fgGreen, $last` |
22:22:40 | FromDiscord | <Yardanico> `stdout.styledWriteLine styleBright, fgBlue, $first, " ", fgGreen, $last` |
22:34:45 | * | pro quit (Ping timeout: 265 seconds) |
22:43:44 | FromDiscord | <Yepoleb> In reply to @Isofruit "Was about to say,": that would go against the entire philosophy of risc because you'd just be creating a new microcode monster |
22:43:57 | FromDiscord | <.tochka> should i use implicit dereferencing? like, its planned for nim 2.0 as i understand, but is it stable enough in nightly |
22:52:00 | FromDiscord | <Elegantbeef> It's planned to be removed in 2.0 😄 |
22:52:10 | FromDiscord | <.tochka> oh i read it badly then |
22:52:16 | FromDiscord | <.tochka> so dont use it then |
22:52:55 | FromDiscord | <Elegantbeef> Indeed, you can always use `dotOperators` in it's place |
22:54:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gXU |
22:55:25 | FromDiscord | <fwsgonzo> is incremental builds ready to use in 2.0? |
22:55:53 | FromDiscord | <Elegantbeef> Nope |
22:55:57 | FromDiscord | <fwsgonzo> (edit) "is" => "Will" | "Willincremental builds ... ready2.0?" added "be" | "2.0?" => "2.0?" |
22:56:01 | FromDiscord | <Elegantbeef> planned for 2.x |
22:56:13 | FromDiscord | <fwsgonzo> ah ok, well, that sounds good too |
22:56:32 | FromDiscord | <.tochka> its funny to use it rn and see all the crashes ;p |
23:22:02 | FromDiscord | <albassort> im having this weird problem |
23:22:54 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gY1 |
23:29:49 | FromDiscord | <albassort> is there any viable gui platforms in nim |
23:29:52 | FromDiscord | <albassort> or should i move to node or c |
23:30:03 | FromDiscord | <albassort> well just for this segement |
23:30:05 | FromDiscord | <albassort> (edit) "segement" => "segment" |
23:30:26 | FromDiscord | <albassort> thinking of doing in C Because I may have to d a lot of stuff with x |
23:32:02 | FromDiscord | <.tochka> can always bind c to nim |
23:32:11 | FromDiscord | <albassort> ofc |
23:32:13 | FromDiscord | <albassort> thats the end goal |
23:32:28 | FromDiscord | <albassort> but working with c in nim is kinda tedious so I like to write c code and bind the high level functions to nim |
23:32:42 | FromDiscord | <albassort> (edit) "but working with c in nim is kinda tedious so I like to write c code and bind the high level functions ... to" added "i write" |
23:32:59 | FromDiscord | <Yardanico> In reply to @albassort "but working with c": there are X bindings for Nim already, there are even two X11 WMs in Nim |
23:33:05 | FromDiscord | <Yardanico> so I don't think it'd be too hard if you want to use X |
23:33:21 | FromDiscord | <Yardanico> <https://github.com/codic12/worm> and <https://github.com/avahe-kellenberger/nimdow> |
23:33:44 | FromDiscord | <albassort> I already have some code for x in c |
23:35:07 | FromDiscord | <albassort> i feel like less can go wrong if you just use C with c libraries |
23:35:33 | FromDiscord | <Yepoleb> but you need to write C 😢 |
23:35:40 | FromDiscord | <albassort> C's not too bad |
23:36:01 | FromDiscord | <albassort> it could be better, and im not use why the better languages made around that time didn't prevail, but its ok |
23:38:15 | FromDiscord | <Elegantbeef> Equally as much can go wrong writing Nim as C |
23:38:53 | FromDiscord | <ShalokShalom> In reply to @albassort "is there any viable": Godot 3. |
23:39:07 | FromDiscord | <albassort> HMMMMMMMMMMMMK |
23:39:09 | FromDiscord | <albassort> maybe |
23:39:29 | FromDiscord | <albassort> Idk |
23:39:30 | FromDiscord | <Yepoleb> is that a serious suggestion? |
23:39:39 | FromDiscord | <albassort> its getting serious consideration |
23:40:05 | FromDiscord | <Yepoleb> then i'm gonna throw in sdl2 |
23:40:15 | FromDiscord | <ShalokShalom> In reply to @Yepoleb "is that a serious": https://medium.com/swlh/what-makes-godot-engine-great-for-advance-gui-applications-b1cfb941df3b |
23:40:22 | FromDiscord | <albassort> godot is way easier and productive than sdl2 |
23:40:25 | FromDiscord | <ShalokShalom> So serious as it can get |
23:40:27 | FromDiscord | <albassort> I don't know godot is a good fit |
23:40:36 | FromDiscord | <ShalokShalom> Godot is to sdl2 what Nim is to C |
23:40:37 | FromDiscord | <Yepoleb> In reply to @albassort "godot is way easier": yes |
23:40:51 | FromDiscord | <albassort> i need something very simple and easily controllable |
23:40:54 | FromDiscord | <ShalokShalom> In reply to @albassort "I don't know godot": See the link, then decide 🙂 |
23:41:00 | FromDiscord | <albassort> i actually just need something to go like this |
23:41:16 | FromDiscord | <ShalokShalom> It doesnt go simpler, also the support and tutorials are good |
23:41:30 | FromDiscord | <ShalokShalom> 🙂 |
23:41:44 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gY2 |
23:41:59 | FromDiscord | <ShalokShalom> How simple has the UI to be? |
23:42:04 | FromDiscord | <albassort> that simple |
23:42:06 | FromDiscord | <ShalokShalom> Like, what elements do you like |
23:42:16 | FromDiscord | <ShalokShalom> Ok, then I go with KDialog |
23:42:17 | FromDiscord | <albassort> uhh |
23:42:26 | FromDiscord | <albassort> the elements will appear like this |
23:42:36 | FromDiscord | <albassort> on the top layer |
23:42:37 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4gY3 |
23:42:39 | FromDiscord | <albassort> with a white background |
23:42:42 | FromDiscord | <albassort> and blue selector |
23:42:48 | FromDiscord | <albassort> controllable with ``tab`` |
23:42:52 | FromDiscord | <ShalokShalom> https://develop.kde.org/deploy/kdialog/ |
23:43:10 | FromDiscord | <ShalokShalom> You can code this from shell languages |
23:43:18 | FromDiscord | <ShalokShalom> I would recommend fish |
23:43:26 | FromDiscord | <albassort> fish is cool |
23:43:32 | FromDiscord | <albassort> how flexable is this |
23:43:45 | FromDiscord | <ShalokShalom> KDialog? |
23:43:48 | FromDiscord | <ShalokShalom> See this docs |
23:44:03 | FromDiscord | <ShalokShalom> There are some features, who are documented at some other places |
23:44:33 | FromDiscord | <ShalokShalom> One of the features I am missing, is an interactive search box |
23:44:34 | FromDiscord | <albassort> hmmmmm |
23:44:40 | FromDiscord | <albassort> kinda doubt this is a good fit |
23:44:47 | FromDiscord | <ShalokShalom> Idk your use case |
23:44:55 | FromDiscord | <albassort> thinking about imgui |
23:44:55 | FromDiscord | <ShalokShalom> It certainly can do what you asked for |
23:44:59 | FromDiscord | <ShalokShalom> Also good |
23:45:19 | FromDiscord | <ShalokShalom> Good inbetween Godot and KDialog |
23:45:30 | FromDiscord | <ShalokShalom> But too much code for me |
23:45:43 | FromDiscord | <ShalokShalom> GUI stuff should be created by GUI |
23:45:47 | FromDiscord | <ShalokShalom> Or very little code |
23:46:04 | FromDiscord | <ShalokShalom> Visual things dont fit literal typing |
23:46:06 | FromDiscord | <ShalokShalom> Imho |
23:46:39 | FromDiscord | <Yepoleb> for your usecase anything on the list should work↵https://github.com/ringabout/awesome-nim#gui |
23:47:35 | FromDiscord | <ShalokShalom> Some of that is unmaintained |
23:48:40 | FromDiscord | <albassort> ur unmaintained |
23:48:47 | FromDiscord | <Yepoleb> damn |
23:50:09 | FromDiscord | <Generic> listing SDL under GUI is well daring |
23:51:27 | FromDiscord | <.tochka> maintain me uwu |
23:52:14 | FromDiscord | <Yepoleb> is that a call to assistance with body hygiene? |
23:52:17 | FromDiscord | <.tochka> there's probably some gui framework on top of sdl renderer given how common it is |
23:52:41 | FromDiscord | <Generic> then you could list OpenGL there too though |
23:52:44 | FromDiscord | <Yepoleb> there's probably more to maintaining a person |
23:53:31 | FromDiscord | <.tochka> In reply to @Yepoleb "is that a call": those language hippies first coming up with macro hygiene and now making it a thing in reality? thats fucked up |
23:54:09 | FromDiscord | <Yepoleb> it's actually pretty neat |