<< 12-11-2019 >>

00:01:20*tklohna quit (Ping timeout: 276 seconds)
00:05:01*krux02_ joined #nim
00:07:37*krux02 quit (Ping timeout: 250 seconds)
00:10:32*krux02_ quit (Quit: Leaving)
00:16:09skrylar[m]hrmm. seems like long doubles are a trouble when it comes to wrappers
00:33:39madpropsis proc order really important? seems i have to move my procs in the code a lot
00:35:23disruptekonly if you want it to work.
00:46:24madpropswhat's the proper way to round to two decimal numbers?
00:51:30madpropsok i have to use format
00:52:53*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:05:12*Kevin5 joined #nim
01:22:07madpropshow do i iterate over a list and expose the index at the same time?
01:26:15zedeusfor i, elem in list
01:26:55madpropsoh cool
01:28:18FromGitter<gogolxdong> Does QUIC protocol in Nim go well?
01:29:17zedeustheres a WIP here https://github.com/xflywind/windx
01:29:40zedeusoh barely has any code, ignore that
01:32:04*endragor joined #nim
01:34:47madpropshow can i join all except last item in a list?
01:35:54madpropsi guess i could make a clone and remove the item
01:36:10zedeuslist[0 .. ^2].join()
01:36:29madpropshmm
01:37:40zedeusor `list.toOpenArray(0, list.high - 1).join()` for better memory effiency (i think?)
01:38:31madpropsis there a shortcut to get the last item?
01:38:49madprops.last() doesn't work
01:38:49zedeus^1, backwards index
01:38:58zedeuslist[^1]
01:39:10madpropsyeah that works
01:39:29madpropsim impressed by how easy it was to start doing something with nim
01:42:52madpropshow can i split a long string into various lines?
01:43:42disrupteksplitLines
01:43:43*seni quit (Quit: Leaving)
01:44:14madpropsbut i mean, in the code itself?
01:44:45disruptekjust make a new line after a ,
01:45:11disruptekmost expressions can be interrupted with a newline.
01:45:14FromGitter<gogolxdong> latest version is 24
01:53:57*a_b_m quit (Quit: Leaving)
02:02:42*jva joined #nim
02:02:53*jva quit (Remote host closed the connection)
02:12:37disrupteki love it when a plan comes together.
02:26:49*mipri joined #nim
02:36:44Kevin5https://www.techempower.com/benchmarks/
02:37:15Kevin5when I look this benchmarks, haven't seen any Nim webframework
02:37:44nisstyrewhat is the best way to cast a uint32 to something I can concatenate to a string? the equivalent of (unsigned char*)my_int in C basically
02:38:09nisstyreor is there a better way of doing this maybe?
02:46:17mipriit sounds like you want https://nim-lang.org/docs/marshal.html
02:46:39FromGitter<kaushalmodi> !eval "abc" & $char(100)
02:46:42NimBotCompile failed: /usercode/in.nim(1, 7) Error: expression '"abcd"' is of type 'string' and has to be discarded
02:47:32FromGitter<kaushalmodi> eval echo("abc" & $char(100))
02:48:01nisstyremipri: yes, I hadn't seen that module yet
02:48:07FromGitter<kaushalmodi> !eval echo("abc" & $char(100))
02:48:10NimBotabcd
02:48:53FromGitter<kaushalmodi> nisstyre: ^
02:49:13nisstyreawesome, thanks
02:50:00*Romanson joined #nim
02:50:27FromGitter<kaushalmodi> Though, this will only be for uint8
02:50:40mipri!eval echo("abc" & 100.char)
02:50:44NimBotabcd
02:51:05nisstyreI could probably unroll it to 4 bytes
02:52:12*GordonBGood joined #nim
02:52:56*lritter quit (Ping timeout: 276 seconds)
02:53:11*lritter joined #nim
02:58:09mipri!eval let a: int16 = 0x6869; let b = cast[ptr array[0..1, char]](unsafeAddr(a)); echo b[1] & b[0] & " there"
02:58:11NimBothi there
03:02:09*uu91 quit (Read error: Connection reset by peer)
03:02:27*uu91 joined #nim
03:03:03nisstyremipri: that works, I just tried doing each byte individually with "var b1 : uint8 = cast[uint8](lengthLe and 0xff000000'u32)" and so on but it's ugly as hell
03:03:35*FromGitter quit (Remote host closed the connection)
03:03:53*FromGitter joined #nim
03:03:59miprialthough bitwise math is uglier, it does save you from having to care about endianness
03:04:18nisstyrealso true
03:04:29nisstyreI was already converting it to little endian, but if I do it that way it won't even matter I guess
03:08:56*rockcavera quit (Remote host closed the connection)
03:30:48*cwaydt left #nim ("The Lounge - https://thelounge.chat")
03:58:47Kevin5https://www.youtube.com/watch?v=VY26cNDeaKk
04:24:35*Kevin5 quit (Ping timeout: 276 seconds)
04:47:21*chemist69 quit (Ping timeout: 246 seconds)
04:48:16*nsf joined #nim
04:49:26*chemist69 joined #nim
05:08:25*Romanson quit (Quit: Connection closed for inactivity)
05:10:37madpropsfirst nim program https://github.com/madprops/nimbars
05:25:52*dddddd quit (Remote host closed the connection)
05:33:27snowolfThat'd be pretty cool as a library, madprops
05:43:11*nif quit (Quit: ...)
05:43:21*nif joined #nim
06:18:35*krux02 joined #nim
06:28:10*narimiran joined #nim
06:39:47*uu91 quit (Ping timeout: 276 seconds)
06:40:01*uu91 joined #nim
06:42:36*uu91 quit (Read error: Connection reset by peer)
06:42:50*uu91 joined #nim
06:44:18*uu91 quit (Read error: Connection reset by peer)
06:44:35*uu91 joined #nim
06:55:34*Kevin5 joined #nim
07:11:08*jjido joined #nim
07:18:24*solitudesf joined #nim
07:18:31*PMunch joined #nim
07:22:04*solitudesf quit (Client Quit)
07:22:42*solitudesf joined #nim
07:35:17*Kevin5 quit (Ping timeout: 268 seconds)
07:47:59FromGitter<zacharycarter> PMunch: nevermind about my question about binaryparse from last night - I'm going to use memfiles for writing and parsing my maps
07:48:01*Kevin5 joined #nim
07:53:55PMunchOh sorry, I haven't even seen your question :P
08:00:00*gmpreussner quit (Quit: kthxbye)
08:00:32FromGitter<zacharycarter> haha no worries - I was asking whether binaryparse would handle endianness for me
08:00:37FromGitter<zacharycarter> but I think memory mapped files are easier
08:01:06*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:01:26*Kevin5 quit (Remote host closed the connection)
08:03:11PMunchAh, binaryparse only does one endianess
08:04:47*gmpreussner joined #nim
08:11:43*ponyride1 joined #nim
08:12:44*ponyrider quit (Ping timeout: 276 seconds)
08:13:43FromGitter<zacharycarter> gotcha
08:22:01FromGitter<zacharycarter> https://play.nim-lang.org/#ix=21wB - is nice, didn't realize how easy this would be to do with mem mapped files
08:30:17*lritter quit (Ping timeout: 276 seconds)
08:31:52PMunchYeah binaryparse is more intended to read weird wire-formats
08:32:29PMunchThings like this field is 3 bits long, this one is 8, this one has the length of the last 3 bit field, etc.
08:39:00*salewski joined #nim
08:46:09salewskinarimiran, maybe remove the spam links in https://forum.nim-lang.org/t/5488
08:46:15*salewski quit (Quit: WeeChat 2.5)
08:48:02narimirandone
08:48:44narimirandom96: we should limit allowed editing time of a post to 5 minutes or so
08:51:53zedeusthat would solve a rare problem while preventing followups/edits that can save people time from reading outdated info
08:54:28Araqzedeus, people can ask for moderation on outdated info
08:54:57Araqoutdated info is by design though, the forum is old and can also be seen as an archive
09:00:29*Vladar joined #nim
09:03:38FromGitter<mratsim> Is there a hidden LLVM backend? https://github.com/nim-lang/Nim/pull/12643/files#diff-8af935b2312d6a0974d7f32b58bda4f2R6468
09:04:08FromGitter<mratsim> @narimiran, why limit editing to 5 min?
09:04:16FromGitter<mratsim> sometimes I edit after a day
09:04:45FromGitter<mratsim> also I would like to be able to edit titles for years, in the old forum I could change my Arraymancer topic title with the latest version
09:04:47narimiranbecause we have spammers posting seemingly normal post and then after some time they change it into the one containing spammy links and similar
09:06:20FromGitter<mratsim> can we restrict old edit to only be able to link within the nim-lang.org domain or github/gitlab then?
09:07:42Araqnot really because some spammers are not concerned with links
09:21:13FromGitter<alehander92> does anybody
09:21:15FromGitter<alehander92> use musl
09:21:16FromGitter<alehander92> with nim
09:21:35FromGitter<alehander92> @mratsim nlvm is
09:21:37FromGitter<alehander92> the llvm backend
09:23:17FromGitter<mratsim> But why is it mentioned in that commit?
09:23:28FromGitter<mratsim> ah, it's part of the test suite?
09:23:38FromGitter<alehander92> well, i think they try to think of
09:23:39FromGitter<alehander92> nlvm
09:23:43FromGitter<alehander92> when they add some features
09:23:54FromGitter<alehander92> ah i dont know if its really relevant there
09:24:19FromGitter<alehander92> well, its not implemented
09:24:48FromGitter<alehander92> for nlvm, its a good question, i dont know if the manual otherwise talks about nlvm
09:32:22*Kevin5 joined #nim
09:36:15FromGitter<gogolxdong> Does Nim is self-contained means Nim implements bootstrapping? What's the difference?
09:37:59*leorize quit (Remote host closed the connection)
09:38:00*ng0 quit (Remote host closed the connection)
09:39:38*ng0 joined #nim
09:39:54*floppydh joined #nim
09:39:54zedeusself-contained means the compiler is written in Nim
09:40:32zedeusI think, maybe I got it mixed up
09:41:00zedeusmight refer to dependency-free executables
09:41:09*leorize joined #nim
09:41:21FromGitter<alehander92> nim is bootstrapped
09:41:32FromGitter<alehander92> but i am also not sure if self-contained means the same
09:50:41lqdev[m]I'm pretty sure self-contained == dependency-free
09:52:53FromGitter<gogolxdong> is it the same with dependency-free== self-contained?
09:53:45lqdev[m]dunno, really
09:55:03Araqit used to mean "depends only on the OS and libc" and then allmighty go came along and changed the meaning to "depends only on the OS" and it stuck
09:56:12Araqso you need to link against musl to claim it for Nim. Silly nonsense.
09:56:44*filcuc joined #nim
09:57:10Araqso yeah, let's pretend you don't have libc lying around. Much like you can pretend not to have a heap. Or maybe a CPU?
09:57:19*tane joined #nim
10:02:33*clyybber joined #nim
10:03:55*ng0 quit (Quit: Alexa, when is the end of world?)
10:12:23PMunchWhy doesn't this work: https://play.nim-lang.org/#ix=21wK
10:13:12Araqgive it a return type
10:13:45FromGitter<mratsim> might as well pretend you don't have GCC or LLVM
10:13:53PMunchOh wait..
10:14:27PMunchOf course
10:15:36FromDiscord<itmuckel> @PMunch https://github.com/PMunch/nimlsp/pull/34 <-- I fixed it up ^^
10:17:03FromDiscord<alehander42> Araq
10:17:23FromDiscord<alehander42> well, nim doesnt depend on glibc explicitly
10:17:24FromDiscord<alehander42> right
10:17:57FromDiscord<alehander42> it depends on the c/posix standards, which should be implemented in some % by the different libc-s like musl
10:18:00PMunchitmuckel, use the `/` procedure from os to combine directories: https://nim-lang.org/docs/os.html#%2F%2Cstring%2Cstring
10:18:06PMunchThat way it will work on both Windows and Linux
10:18:24PMunchSo getTempDir() / "nimlsp"
10:18:51FromDiscord<alehander42> mratsim well, i'd like if there is a third option
10:19:02FromDiscord<alehander42> (there are of course, like tcc)
10:19:51Araqalehander42: sure and we also have workarounds and seek to avoid FILE* in later versions
10:20:47Araqmratsim: https://www.researchgate.net/publication/2394127_Combining_Analyses_Combining_Optimizations fyi
10:22:34clyybberfor a doctor of philosophy
10:22:36clyybberinteresting
10:22:48*ponyride1 quit (Ping timeout: 245 seconds)
10:23:22*ng0 joined #nim
10:23:41*ponyrider joined #nim
10:24:13FromGitter<mratsim> thanks
10:24:59FromGitter<mratsim> I'm pretty sure I can skip most of those concerns with my DSLs, my biggest unknown at the moment is loop boundaries
10:26:14FromDiscord<itmuckel> @PMunch path join operator. How cool is that?
10:26:15FromDiscord<itmuckel> https://cdn.discordapp.com/attachments/371759389889003532/643758441592258561/iu.png
10:27:01PMunchitmuckel, haha yeah it's pretty neat
10:28:52FromDiscord<alehander42> Araq nice
10:29:06FromDiscord<itmuckel> Okay, should be good now.^^
10:29:12FromGitter<mratsim> Also I have this thought of turning the thread-local worker in Picasso into Finite State Machine, potentially using the evil undocumented {.goto.} pragma :P
10:29:39Araqyou're a good boy.
10:29:43FromDiscord<alehander42> btw have you ever planned having a pure assembly backend even just for fun
10:29:51FromDiscord<alehander42> it doesnt make sense today at all probably
10:30:01Araqdom96 played with one
10:30:02*vesper quit (Ping timeout: 240 seconds)
10:30:13Araqit's much fun indeed
10:30:38FromDiscord<alehander42> it shouldn't be too hard to make one
10:30:54FromGitter<mratsim> debugging would be a pain though
10:30:56FromDiscord<alehander42> but probably its much more work to support different archs
10:31:01FromDiscord<alehander42> mratsim why
10:31:04*tklohna joined #nim
10:31:07Zevvyou'll miss out on all of 2019's excellent c compiler optimizations as well
10:31:08FromDiscord<alehander42> thats how most compiler work
10:31:16FromDiscord<alehander42> Zevv, absolutely
10:31:17*vesper11 joined #nim
10:31:35FromGitter<mratsim> Did you read about x86 SIB and modRM encoding?
10:31:42FromDiscord<alehander42> i'd be hoenst
10:31:49FromDiscord<alehander42> it was egoistic i was thinking of osdev
10:31:59FromDiscord<alehander42> and the fact self-hosting nim currently requires
10:32:06FromDiscord<alehander42> one to also write/port a c compiler
10:33:02FromDiscord<alehander42> but i'd say an os without at least a kinda ok c compiler doesnt make much sense
10:33:13FromGitter<mratsim> Once you get it, it's not too hard but it took me a good amount of time to understand for the amount of LOC required to generate correct machine code: https://github.com/numforge/laser/blob/d1e6ae6106564bfb350d4e566261df97dbb578b3/laser/photon_jit/x86_64/x86_64_base.nim#L119-L200
10:35:40FromDiscord<alehander42> well, with nim you have to know how to generate both the correct c code and the correct machine code
10:35:51*ponyrider quit (Quit: WeeChat 2.6)
10:42:34*Araq sighs
10:42:45Araqall you really have to do is to look at the machine code
10:42:55FromGitter<mratsim> "Error: Sorry, your pltform (linux_arm) is not supported by choosenim. :/
10:44:03Araqotherwise you can argue that you also need to understand every LLVM code transformation too if you want to write an OS
10:46:44FromDiscord<alehander42> Araq well, there is some kind of correlation probably
10:46:59FromDiscord<alehander42> if i use a llvm backend, probably sometimes i'd look at the llvm bytecode, sometimes at the machine code
10:47:26FromDiscord<alehander42> i dont say its a problem at all, just thats how it is
10:47:43FromDiscord<alehander42> i also even prefer c backends a bit
10:47:48Araqbut it's not "how it is", Linus doesn't look at GIMPLE
10:48:04Araqhe looks at the produced assembler. There is really nothing more to it.
10:48:25FromDiscord<alehander42> well, i often look at the c code
10:48:28FromDiscord<alehander42> of my nim code
10:48:29FromDiscord<alehander42> is that wrong
10:48:53FromGitter<mratsim> @narimiran, regarding this: https://github.com/status-im/nim-stint/issues/99 should I test on your miran-unsigned-colors branch or version-1-0 branch?
10:49:09FromDiscord<alehander42> it's like, if i can figure out by looking at the c code, good, otherwise maybe look at the assembly (i am not sure if i ever actually used the assembly)
10:49:14Araqit's a rather incomplete picture, alehander
10:49:43FromDiscord<yewpad> Is it theoretically possible to use GraalVM with Nim? Like having a server written in Nim and people can write plugins in say Java and GraalVM bunches everything together?
10:50:35FromDiscord<alehander42> Araq, yes but
10:50:39AraqGraalVM is all about theory, so yes. It's very possible. :P
10:50:40FromDiscord<alehander42> often its useful
10:50:56FromDiscord<alehander42> i usually dont need super optimizations
10:51:02FromGitter<mratsim> I prefer to look into the assembly code than the C code, provided I have a good profiler that let me jump in the functions. GDB is too clunky
10:51:04FromDiscord<yewpad> Araq: GraalVM is all about theory
10:51:04FromDiscord<yewpad> 😆
10:51:08FromDiscord<alehander42> just to see quickly how stuff happens on lower level
10:51:37FromDiscord<alehander42> e.g. "this nim code is expanded to this loop calling readdir"
10:51:50FromDiscord<alehander42> i'd say assembly is not productive for this
10:52:01FromDiscord<alehander42> of course, for math optimizations its different
10:52:06FromGitter<mratsim> but asembly when what you do is dominated by IO is not really useful
10:52:33FromDiscord<alehander42> mratsim tried lldb?
10:52:37FromGitter<mratsim> for VM, crypto, big int and numerical computing it is
10:52:43FromGitter<mratsim> yes
10:52:56FromGitter<mratsim> but maybe I'm to young but I prefer GUI :P
10:53:07FromDiscord<alehander42> well, there are good ui-s for gdb
10:53:15FromDiscord<alehander42> e.g. gdbgui
10:53:40FromDiscord<alehander42> or our perl6-like always-"coming soon" ui 😦 🙂
10:53:44FromGitter<mratsim> it's a pain to set breakpoint in gdb, though I use them when I need to debug stuff, it's always reluctantly
10:53:54FromDiscord<alehander42> hm, why is it a pain
10:54:07FromDiscord<alehander42> need to solve pain points in our project
10:54:09AraqI use if condition: writeStackTrace()
10:54:13FromGitter<mratsim> b "foo.nim:256"
10:54:29FromDiscord<alehander42> ah manually, yeah, its a bit slow
10:54:34FromGitter<mratsim> you need to do that for all function you want to inspect
10:54:35Araqdebuggers suck at conditional breakpoints anyway so I never missed one
10:54:37FromDiscord<alehander42> but gdb also has to work with the vscode debugger
10:54:55FromDiscord<alehander42> mratsim we did set it up once with @bobeff i think even using the nim-gdb
10:54:57FromDiscord<alehander42> by krux02
10:55:17FromDiscord<alehander42> Araq, yeah conditions are pretty important
10:55:24narimiran@mratsim version-1-0 branch now removed runnableExamples and returned to ..code-block::
10:55:54FromGitter<mratsim> so which branch should I test? or is it not needed anymore?
10:55:54FromDiscord<alehander42> gdb has conditional breakpioints
10:56:03FromDiscord<alehander42> but i guess the problem is that you need to write some kind of c expression ?
10:56:04FromGitter<mratsim> compiling on a Pi is super slow :/
10:56:08narimiranand my branch has several (potential) fixes applied to it
10:57:04Araqalehander42: I need to write some C yes, but worse, it's also super slow
10:57:11FromDiscord<alehander42> we do solve this in a way, in our setup you can write something like conditional breakpoints with nim expressions
10:57:11narimirani think the best you could do is to test it either on the tagged v1.0.2 commit or to checkout HEAD~5 (both on version-1-0 branch)
10:57:29FromDiscord<alehander42> and even interpret templates like mdbg
10:57:43FromDiscord<alehander42> but the speed is never super fast i guess after all
10:58:25FromDiscord<alehander42> actually with a tracepoint its fast enough: as you dont need to recompile your code
10:58:28FromDiscord<alehander42> manually its very slow
10:58:50Araqin fact, simply setting up gdb foobar.exe and saying 'run' is already too much for me
10:59:07Araqand then it doesn't remember the breakpoints I setup the last time
10:59:23FromDiscord<alehander42> but if you could add different "if condition: echo stuff"
10:59:27FromDiscord<alehander42> to your program
10:59:31FromDiscord<alehander42> and running them without recompiling
10:59:38FromDiscord<alehander42> would that be worth it
11:00:49*uu91 quit (Read error: Connection reset by peer)
11:01:03*uu91 joined #nim
11:01:25krux02Araq: gdb is cumbersome, but you you don't quit gdb, the breakpoints are not discarded.
11:01:49krux02just call `run` again and it will execute the fresh build with the old breakpoints.
11:02:04Araqah, good to know
11:02:09FromDiscord<alehander42> or use `rr` and just reverse-continue
11:02:16FromDiscord<alehander42> but yeah, you probably use windows
11:02:48clyybberI like gdb
11:02:56clyybberand theres nothing better anyways
11:03:14Araqclyybber, Visual Studio?
11:03:18FromGitter<mratsim> so krux02, what's this mystery LLVM comment in your alignas PR?
11:03:53clyybberAraq: Is it better?
11:04:11Araqit's not comparable
11:04:37*Kevin5 quit (Remote host closed the connection)
11:05:02krux02What I don't like about gdb is that it is so tough to understand using it. Modern IDEs have such a trivial to use debugger integrated, yet gdb is this thing that is completely useless to you if you didn't spend hours learning it.
11:05:23krux02mratsim: what do you mean with LLVM comment?
11:05:44krux02I did not implement any LLVM backend support for the alignas pragma.
11:05:50FromDiscord<alehander42> clyybber `rr` is using `gdb`, it just adds very fast `reverse-` commands to it
11:05:54krux02meaning the pragma is ignored on thet backend.
11:06:01FromDiscord<alehander42> (the gdb ones are not really comparable)
11:06:02FromGitter<mratsim> but we don't have a LLVM backend?
11:06:28krux02I just mentioned it, because the other pragmas also have a comment about the LLVM backend.
11:06:31clyybberalehander42: Oh, I see. Nice
11:06:50clyybberAlso for debugging code you didn't write (why?) radare2 is really nice
11:07:07krux02gdb also has some support for undo that is based on fork.
11:07:08clyybberthough you also have to spend hours learning it
11:07:10FromDiscord<alehander42> clyybber its good, because it reproduced your run each time, so you dont get different stuff when you `run` again
11:07:14FromDiscord<alehander42> krux02 but many editor-s have UI plugins which just call `gdb` internally
11:07:46krux02you can fork the process at any point in time, continue, and then resume by quitting the process and continuing the other branch of the fork.
11:07:50*Vladar quit (Quit: Leaving)
11:07:52krux02works only on Linux
11:07:52FromDiscord<alehander42> krux02 this `undo` support is much much weaker iirc
11:07:59FromDiscord<alehander42> it really isnt comparable
11:08:41krux02yea I didn't investigate rr yet.
11:12:07FromDiscord<alehander42> otherwise i thought people use
11:12:12FromDiscord<alehander42> the vscode debugger
11:12:21FromDiscord<alehander42> is it not compatible enough?
11:14:41FromDiscord<alehander42> debugger ui*
11:14:49krux02yea
11:15:45FromDiscord<alehander42> hm, but i ran it fine with your nim-gdb.py printers
11:19:51*ponyrider joined #nim
11:29:19*rockcavera joined #nim
11:30:26AraqWarning: GC_ref is a no-op in JavaScript [User]
11:30:30Araqhmmm
11:30:39Araqthat doesn't sound right for --gc:arc :D
11:36:42*vsantana joined #nim
11:38:51*tklohna quit (Ping timeout: 265 seconds)
11:41:42FromDiscord<alehander42> what is gc:arc
11:42:12Araqsame as --gc:destructors
11:42:23Araqgot tired of writing this long word for testing things
11:44:01FromGitter<mratsim> @narimiran, I confirm colors runnableExamples work
11:44:38narimiranthen i even less understand what's wrong with travis
11:44:45FromGitter<mratsim> soon it will be expanded into arc --> arac --> arak
11:45:09FromGitter<mratsim> should I tested the commit before this https://github.com/nim-lang/Nim/commit/e2aa1d6d84aeb000070a0d2fcb5796a0c58246f7 ?
11:45:18FromGitter<mratsim> Travis has 32-bit arch?
11:45:27*tklohna joined #nim
11:45:32narimiraneven that one fails
11:45:38narimiranyes
11:45:44FromGitter<mratsim> uh?
11:46:17narimiranyes, we test 32-bit on travis and azure pipelines; even that commit failed on travis
11:46:37FromGitter<mratsim> ah, via multilib
11:46:54FromGitter<mratsim> I thought it was native
11:47:13FromGitter<mratsim> testing 32-bit via multilib might create more trouble though
11:59:12Araqbah, ugh, damn
11:59:20Araq var copiedData = data
11:59:20Araq GC_ref(copiedData) # we need to protect data until send operation is completed
11:59:20Araq # or failed.
11:59:39Araq^ but I don't have a refcount on strings anymore
12:00:11*vsantana quit (Quit: leaving)
12:00:12*dddddd joined #nim
12:01:14livcdtreeform: yes html scraping. Also how do you deal with JS ?
12:01:30livcdWhat is the chance the JS backend will be dropped?
12:02:05*vsantana joined #nim
12:02:25Araqunlikely I'll drop it. maybe if wasm is widely supported and has really good DOM access
12:02:40Araqin about 5 years? who knows
12:08:41*theelous3 joined #nim
12:16:08Zevvwe need more backends. jvm, ODEX, wasm, x86_64!
12:20:16FromDiscord<alehander42> python!
12:20:22FromDiscord<alehander42> and .net IR
12:20:49FromDiscord<alehander42> and a cranelift backend
12:21:19FromDiscord<alehander42> (cranelift is cool tho 🙂 )
12:38:46*TheManiac[m] quit (Write error: Connection reset by peer)
12:38:47*swisscowbell[m] quit (Remote host closed the connection)
12:38:47*Demos[m] quit (Remote host closed the connection)
12:38:47*isaac[m] quit (Write error: Connection reset by peer)
12:38:47*shashlick[m] quit (Read error: Connection reset by peer)
12:38:48*yglukhov[m] quit (Write error: Connection reset by peer)
12:38:53*salotz[m] quit (Write error: Connection reset by peer)
12:38:57*xomachine[m] quit (Remote host closed the connection)
12:38:59*skrylar[m] quit (Read error: Connection reset by peer)
12:39:00*LEdoian[m] quit (Read error: Connection reset by peer)
12:39:02*k0mpjut0r quit (Write error: Connection reset by peer)
12:39:08*macsek1911[m] quit (Remote host closed the connection)
12:39:09*pigmej quit (Read error: Connection reset by peer)
12:39:09*d-nice2[m] quit (Write error: Connection reset by peer)
12:39:13*Manny8888 quit (Read error: Connection reset by peer)
12:39:13*muxueqz[m] quit (Read error: Connection reset by peer)
12:39:15*GitterIntegratio quit (Write error: Connection reset by peer)
12:39:15*M948e5[m] quit (Remote host closed the connection)
12:39:15*MrAxilus quit (Read error: Connection reset by peer)
12:39:16*lasso[m] quit (Write error: Connection reset by peer)
12:39:17*narimiran[m] quit (Read error: Connection reset by peer)
12:39:18*planetis[m] quit (Read error: Connection reset by peer)
12:39:18*Balu[m] quit (Read error: Connection reset by peer)
12:39:18*nc-x[m] quit (Read error: Connection reset by peer)
12:39:18*Miguelngel[m] quit (Read error: Connection reset by peer)
12:39:20*nergal[m] quit (Read error: Connection reset by peer)
12:39:21*Connor[m] quit (Remote host closed the connection)
12:39:21*lqdev[m] quit (Remote host closed the connection)
12:39:22*leorize[m] quit (Remote host closed the connection)
12:39:22*BitPuffin quit (Remote host closed the connection)
12:39:25*Asbrn[m] quit (Remote host closed the connection)
12:39:25*joachimschmidt55 quit (Remote host closed the connection)
12:39:30*meff[m] quit (Remote host closed the connection)
12:39:30*zielmicha[m]1 quit (Remote host closed the connection)
12:39:31*spymasterd[m] quit (Remote host closed the connection)
12:49:12rockcaveraIs it possible to declare a variable type at runtime? Example: if x greater than 8 declares type uint16, if less than uint8 ...
12:49:17PMunchhttp://ix.io/21xc/nim <- getmac.nim(60, 14) Error: illegal capture 'ip' because ':anonymous' has the calling convention: <inline>
12:49:17disbot^ play at https://play.nim-lang.org/#ix=21xc 😏
12:49:37PMunchAny idea why this fails when I cross-compile for Windows but not when I compile it for Linux?
12:50:51*endragor quit (Remote host closed the connection)
12:51:47FromDiscord<alehander42> rockcavera you can do it on compile time
12:52:31FromDiscord<alehander42> or with using a generic eventually
12:52:41rockcaveraAt compile time I know it is possible.
12:52:44FromDiscord<alehander42> but it depends on the exact usecase
12:53:02FromDiscord<alehander42> it isnt really possible generally
12:53:21clyybberrockcavera: You can't. Types are static assertions for a program, so they are a compile time construct.
12:53:32FromDiscord<alehander42> yes
12:53:47FromDiscord<alehander42> if you want to just make sure stuff is done on uint8, you can make a generic
12:53:48clyybber(OO with methods stores types at runtime)
12:53:49FromDiscord<alehander42> function
12:54:02PMunchHmm, it appears like it is the ?. operator that does the illegal capture
12:54:06FromDiscord<alehander42> and call it with uint8 when its <8
12:54:45rockcaverathanks
12:54:55FromDiscord<alehander42> but basically you have to explicitly say which type would be used in each branch
12:55:43PMunchThis is the implementation of ?. by the way: https://github.com/PMunch/nim-optionsutils/blob/master/src/optionsutils.nim#L139-L187
12:55:49PMunchNothing Windows specific there..
13:00:32*JustASlacker joined #nim
13:18:31FromDiscord<alehander42> hm i get a similar error
13:18:36FromDiscord<alehander42> with a simple example
13:18:46*theelous3 quit (Ping timeout: 268 seconds)
13:18:51FromDiscord<alehander42> http://ix.io/21xg
13:18:51disbot^ play at https://play.nim-lang.org/#ix=21xg 😏
13:19:14FromDiscord<alehander42> it seems to me its just a inline limitation
13:26:47*clyybber quit (Quit: WeeChat 2.6)
13:27:15FromDiscord<alehander42> http://joeduffyblog.com/2015/11/03/a-tale-of-three-safeties/ interesting, so this is kinda a much more real example of what i hoped for in my small kernel
13:28:35*Vladar joined #nim
13:32:32*nsf quit (Quit: WeeChat 2.6)
13:35:59*LEdoian[m] joined #nim
13:35:59*lqdev[m] joined #nim
13:35:59*k0mpjut0r joined #nim
13:35:59*nergal[m] joined #nim
13:36:00*BitPuffin joined #nim
13:36:00*isaac[m]1 joined #nim
13:36:00*M948e5[m] joined #nim
13:36:00*TheManiac[m] joined #nim
13:36:00*GitterIntegratio joined #nim
13:36:00*swisscowbell[m] joined #nim
13:36:01*planetis[m] joined #nim
13:36:01*MrAxilus joined #nim
13:36:01*Demos[m] joined #nim
13:36:01*leorize[m] joined #nim
13:36:05*skrylar[m] joined #nim
13:36:05*Connor[m] joined #nim
13:36:05*d-nice2[m] joined #nim
13:36:05*Balu[m] joined #nim
13:36:06*meff[m] joined #nim
13:36:06*zielmicha[m]1 joined #nim
13:36:06*spymasterd[m] joined #nim
13:36:06*pigmej joined #nim
13:36:06*Miguelngel[m] joined #nim
13:36:06*macsek1911[m] joined #nim
13:36:06*Manny8888 joined #nim
13:36:06*joachimschmidt55 joined #nim
13:36:06*nc-x[m] joined #nim
13:36:07*salotz[m] joined #nim
13:36:07*xomachine[m] joined #nim
13:36:07*shashlick[m] joined #nim
13:36:07*yglukhov[m] joined #nim
13:36:07*lasso[m] joined #nim
13:36:07*muxueqz[m] joined #nim
13:36:07*Asbrn[m] joined #nim
13:36:08*narimiran[m] joined #nim
13:46:22*hed0n1st joined #nim
13:46:52*hed0n1st quit (Client Quit)
13:57:50*disbot quit (Remote host closed the connection)
14:05:51*xace quit (Quit: leaving)
14:07:01AraqGordonBGood, are you around?
14:07:47GordonBGoodYeah, still around
14:09:14Araqso ... it occured to me if we mark new() / ObjectRef() as 'owned' explicitly when we want it, we could make this feature opt-in
14:09:41Araqmaybe it always was obvious to you ;-)
14:10:06Araqonce I opted into ownership, ownership can only be moved around
14:11:13GordonBGoodYes, that was along the lines of what I was thinking, but I've never really written it up as a RFC or made it more concrete than just a shape of an idea
14:12:11GordonBGoodIt seems some months ago that we were moving well beyond what B/C conceived, and thus shouldn't be bound by their limitations
14:12:31Araqand we could require ownership when moving refs to a different thread
14:12:36*xace joined #nim
14:12:57GordonBGoodBut I couldn't really test it without compiler help, so stepped back to see what would end up working
14:13:02Araqand then we can make all RC ops non-atomic. maybe
14:13:34GordonBGoodYes, that's the shred of B/D I keep hanging onto
14:14:04Araqon a related note, I think I know why my closures are still buggy
14:14:21AraqI overlooked an aspect of their implementation
14:14:48GordonBGoodI've been testing your latest devel commits, and it's closures that keep being the snag
14:14:48Araqso hopefully we're closer to "stable" than we think ;-)
14:15:05Araqyeah, refs are fine as far as I can tell
14:15:17*Vladar quit (Quit: Leaving)
14:16:05GordonBGoodWhat aspect of their implementation, the aspect of their automatic lifting of values from the stack to the heap when it is detected they are going to be used outside the scope of the local proc?
14:16:46Araqwe pass them around as 'nkClosure' which we treat as a tuple but it doesn't get assignments/destructions assigned to it properly
14:17:00Araqother tuples seem to be fine
14:17:27Araqanyway, can you post your example program once again please?
14:17:50GordonBGoodYes, that's exactly what I've had to work around in bypassing the closure bug.
14:18:56GordonBGoodSure, I think you mean the "hammings" one? And it's quite a good test for this as it pushed closures pretty hard, although it doesn't do a lot of ref counting
14:19:18Araqhammings, yeah
14:19:35Araqideally without your custom =sink/=destroy hacks :P
14:20:46GordonBGoodThe one with custom hacks is the one I use to try to bypass what isn't working in --gc:arc
14:21:11GordonBGoodThis is the one that works with default GC and I hope will soon work with --gc:arc: https://wandbox.org/permlink/vZIUDOyygNxh7FOb
14:22:16GordonBGoodIt's a little bit complex as it is also a benchmark, but no "hooks"
14:23:01GordonBGoodIf you want something a little more directed just to test closures, I can boil something down for that too
14:23:52Araqwhatever you think is best for fixing these bugs
14:24:24GordonBGoodThis Hammings algorithm is something that Swift can't do, as it can't consume the LazyList due to stack overflow
14:24:45Araquh oh, don't want to deal with that
14:25:10GordonBGoodAnd Rust can do it, but it is really hard to make the closures hook up, fighting the ownership system all the way
14:25:20Araqref destruction queueing is for a later version...
14:26:02GordonBGoodI don't think we are going to have the stack problem - Swift deferres all automatic destruction to the end of the proc but putting finalizers on the stack, or they did last I checked
14:27:13GordonBGoodWe'll have to be careful how we implement it - but last I checked, the Swift people were only starting to consider how to use copy/move semantics
14:27:46tanegiven two seqs `a = newSeq[int](5)` and `b = @[1,2,3,4,5]`, what does `a = b` actually do?
14:28:50GordonBGoodwhat does it actually do for us?
14:29:09GordonBGoodAs currently impleented?
14:29:25GordonBGoodlegacy seqs or seqsv2
14:29:27GordonBGood?
14:29:37taneI don't know? I'm using the nim 1.0.0 compiler
14:29:58tanedoes it allocate? does it overwrite?
14:31:14*tklohna quit (Ping timeout: 240 seconds)
14:33:37GordonBGoodtane: for version 1.0.X, default behavior is it creates a copy of b to a, overwriting the old seq that was a, seq payloads are allocated on the heap
14:33:45Araqtane, it copies.
14:34:03taneso, how can i just copy the contents? i.e. arrayCopy
14:34:06AraqGordonBGood, it copies. Copies can be optimized into moves but please don't concern beginners with this
14:34:16GordonBGoodOkay
14:34:31Araqtane, it copies the contents too
14:35:40tanethere's no proc for: `for (i, v) in b.pairs(): a[i] = v` then?
14:36:20Araqit's just '='
14:39:40tanesorry, no
14:40:10taneif the target sequenceh as enough memory to contain the values of the source sequence, I could simply memcpy
14:40:22tanemost of my use-cases come with that guarantee, that's what I'm asking here
14:40:39taneI just confirmed it uses new memory by printing repr(unsafeAddr(a[0]))
14:40:49*disruptek_ quit (Quit: Bye)
14:40:49*disruptek quit (Quit: Bye)
14:40:51tanewhich it obviously doesn't if I copy via for-loop
14:41:00Araqin the new seq implementation we do what you suggest ;-)
14:41:08taneok, I like that :)
14:41:32tanejust trying to get a feeling for the costs incurred by various operations, thanks
14:42:03Araqthat's currently a weak point as the costs are all about to change quite a bit :-/
14:42:17taneas long as they're decreasing.. :)
14:43:12tanealthough I have to say, it's performing really well already, passing LTO to the compiler/linker seems to work as well
14:44:06*Vladar joined #nim
14:44:16*tklohna joined #nim
14:44:29Araqdecreasing except for 'ref' which is turning into atomic ref counting
14:44:55Araqat least we'll be faster than shared_ptr oh well
14:45:14*disbot joined #nim
14:46:08*disruptek joined #nim
14:47:36taneAraq, do you happen to know whether there will be some nim talks at fosdem'20?
14:48:21narimiranPMunch: ^
14:48:53*clyybber joined #nim
14:49:15GordonBGoodAraq, I have to get some sleep. If you want more simpler tests for closures, post sometihing, and I'll have them ready for you in the morning your time...
14:49:20PMunchtane, we certainly hope so :)
14:49:22GordonBGoodgn8
14:49:26Araqbye
14:49:50PMunchWe have created a developer room with the minimalistic languages people and are accepting talks at the moment
14:49:56taneah nice
14:50:11taneI actually heard 1st about fosdem in this channel, planning on going next year
14:50:49PMunchTalks will be preffered to be short 15-20 minutes things, so I hope that we'll at least have a couple Nim talks. I know there are certainly enough cool projects around in the community to talk about :)
14:51:22PMunchFOSDEM is a great conference, so I hope we'll see you there .)
14:51:40Araqcan't we organize a Nim conference instead
14:51:44tanelooking forward to it :)
14:52:06clyybberGordonBGood: gn8
14:52:09PMunchAraq, if you can fill up our talk slots for FOSDEM I'll consider helping you :P
14:52:32PMunchSo far there haven't been an exceptional amount of proposed talks
14:54:21*GordonBGood quit (Ping timeout: 268 seconds)
14:58:09*clyybber quit (Quit: WeeChat 2.6)
15:00:34*floppydh quit (Quit: WeeChat 2.6)
15:05:35*PMunch quit (Quit: Leaving)
15:07:43disruptekzevv should do a talk on optimizing npeg.
15:13:13*JustASlacker quit (Remote host closed the connection)
15:44:09FromDiscord<alehander42> Araq this was an idea but it seemed easier to just combine it with fosdem
15:44:41FromDiscord<alehander42> i am not coming to fosdem btw, so i played myself
15:45:34*NimBot joined #nim
15:45:45FromDiscord<alehander42> that's good
15:46:09FromGitter<mratsim> I don't want to do slides :p
15:46:52disruptekthat one's going in my Araq.fortune collection.
15:46:57FromDiscord<alehander42> otherwise i always promoted the bulgaria-conf idea 😛
15:49:32*tklohna quit (Ping timeout: 246 seconds)
15:49:59*tklohna joined #nim
15:54:22*nsf joined #nim
16:23:40Zevvhow much free slots are there for nim then?
16:32:18*hoijui joined #nim
16:35:21disruptekenough.
16:56:56federico3mratsim: you don't need slides
17:00:45*hoijui quit (Quit: Leaving)
17:06:19*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
17:06:36*pbb joined #nim
17:13:22FromDiscord<Clyybber> your repos are an presentation for themselves
17:14:38*jxy joined #nim
17:22:54*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
17:23:09*pbb joined #nim
17:25:48*donpdonp joined #nim
17:26:31donpdonpive been using nim over the last month for a personal project. its been great to use.
17:27:30donpdonpi try lots of unusual languages and nim is nice for its c-interop obviously, but also the syntax feels 'forgiving' or less rigid than others.
17:28:19donpdonpand why doesnt everyone use "ptr type" thats much more readable than "*type"
17:28:37FromDiscord<Clyybber> Is there something that is an os thread type? Which is pthread on unix and so on?
17:33:58FromDiscord<Clyybber> Ah, got it
17:34:21FromDiscord<Generic> donpdonp: do you mean something* in Nim?
17:35:13FromDiscord<Clyybber> Uh, yeah. Nevermind I got it, I was searching for something that expands to the OS's pthread in the generated C code.
17:35:20FromDiscord<Clyybber> Which is SysThread
17:35:26FromDiscord<Clyybber> Or posix/PThread
17:35:29donpdonpGeneric: ah yes, a few different syntaxes get mixed up in my head :)
17:35:45*krux02 quit (Remote host closed the connection)
17:35:46FromDiscord<Generic> something* means that it's exported
17:35:56FromDiscord<Generic> it has nothing to do with pointers
17:36:00FromDiscord<Clyybber> Oh, lol, thought you were referring to me
17:36:14*clyybber joined #nim
17:36:40FromDiscord<Generic> haha
17:38:28donpdonpGeneric: actually whatI meant was *type in other languages, as an example of something that is less readable than 'ptr type'
17:39:04FromDiscord<Generic> oh, my bad
17:39:46donpdonpno prob. judging by all the participants thus far are coming from "FromDiscord" bot, that discord is more popular than irc here. :)
17:40:04FromDiscord<Generic> well the core devs are all on IRC
17:40:08FromDiscord<Generic> or some
17:43:17AraqI could switch if it helps anybody
17:46:18*vsantana quit (Remote host closed the connection)
17:51:16rockcaveraWhat is the best current GUI package from Nim?
17:56:46FromGitter<topcheese> Hi, I'm new and I've discovered Nim a few days ago. This is what I found when looking for a GUI, https://matthiashager.com/gui-options-for-nim https://peterme.net/cross-platform-guis-and-nim-macros.html
17:57:10rockcaveraWhat would be the best? would be the one that features better ease, cross-platform, more features ...
17:58:37FromDiscord<Generic> afaik there's unfortunately no one fits all solution
17:58:48FromDiscord<Generic> gui's are a pity
17:59:27FromDiscord<Generic> it depends on what you're trying to archieve
17:59:55FromGitter<topcheese> I've played around with NimX, but I'm not sure if I want to be tied into sdl2.
18:00:14FromDiscord<Generic> nimx is for example not native
18:01:11FromDiscord<Generic> libui is native on all three big OSes is limited
18:02:14FromGitter<topcheese> I was actually looking at a couple of other gui libraries I was thinking of trying to port over. Libui seems like a good one.
18:03:21FromGitter<topcheese> The other libraries are https://github.com/reubenscratton/oaknut
18:03:42FromGitter<topcheese> https://github.com/gammasoft71/xtd
18:04:15Zevvlibui is stale and far from complete IIRC
18:04:40FromDiscord<Generic> yes, certain widgets are simply missing
18:04:56FromDiscord<Generic> like tree views or list boxes
18:05:18ZevvIt is pretty compact though. I made the lua binding a few years ago, and that was only an evening or two of work.
18:05:25Zevvoh /a/ lua binding, there's more I see
18:08:06*vsantana joined #nim
18:08:30FromGitter<topcheese> SDL2 is very portable, so I'd say Nimx is a good choice.
18:10:27*gangstacat quit (Quit: Ĝis!)
18:13:09FromDiscord<Generic> a non native gui has it's problems
18:13:47FromDiscord<Generic> just to pull something from my head, it doesn't work with screen readers
18:14:32FromDiscord<Generic> besides the obvious one of it never/rarely getting to native look and feel
18:17:20*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
18:17:34*pbb joined #nim
18:18:20*theelous3 joined #nim
18:19:57*muxueqz[m] quit (Quit: User has been idle for 30+ days.)
18:20:26*gangstacat joined #nim
18:20:44FromGitter<topcheese> Isn't there a nim project that also uses HTML5 gui? I thought I ran across one.
18:22:25Mister_Magistercan you simply crosscompile to arm?
18:24:17FromGitter<topcheese> Maybe it was this, but I'm not sure. https://github.com/juancarlospaco/nim-html-tools
18:27:05livcdzeev: you made lua bindings for libui?
18:32:19FromGitter<Willyboar> Probably you here about this https://github.com/treeform/fidget
18:33:36Zevvlivcd: long ago
18:34:06Zevvhttps://github.com/zevv/libuilua
18:36:50FromGitter<topcheese> Thanks @Willyboar that's it, I like that one. I ran across it yesterday and forgot to save the link.
18:41:15*swisscowbell[m] left #nim ("Kicked by @appservice-irc:matrix.org : User has been idle for 30+ days.")
18:41:24FromGitter<Willyboar> We are waiting for the results :)
18:48:22FromDiscord<exelotl> iup is good, people sleep on it and I don't know why
18:52:59FromDiscord<exelotl> The other day I needed to add a file open/save prompt and a text input dialog to a small graphical app I was working on
18:53:14FromGitter<topcheese> No Mac support afaik.
18:53:45FromDiscord<exelotl> Tried a few options and iup was the only one that didn't give me any headache
18:54:45FromGitter<topcheese> oops, wrong lib. Yeah iup's not bad.
18:55:31FromDiscord<exelotl> Oh
18:56:14*uu91 quit (Ping timeout: 276 seconds)
18:57:08madpropsdoes nim send things as reference when needed? what happens when i send an object for instance?
18:57:14madpropsto a proc
18:57:15*uu91 joined #nim
18:58:19Araqmadprops: exactly
19:04:49*clyybber quit (Quit: WeeChat 2.6)
19:12:50FromDiscord<kodkuce> @treeform duno if i am retarded or what but i am getting expression 'close(wss)' has no type (or is ambiguous) , am porting form old niv ws, hmm
19:14:18FromDiscord<kodkuce> proc close accepts WebSocket so hmm duno wtf, i checked name so should not be ambiguous if i get what that means xD
19:16:23FromDiscord<kodkuce> expression 'close(magic)' has no type (or is ambiguous)
19:16:43FromDiscord<kodkuce> hmm or meybe its taking close proc from some other lib
19:18:24FromDiscord<kodkuce> hmm
19:18:52FromDiscord<treeform> So wss ws secure socket?
19:18:59FromDiscord<treeform> or web socket server?
19:19:35disruptekformer.
19:19:56FromDiscord<kodkuce> var magic = await newWebSocket(req)
19:20:01FromDiscord<kodkuce> and its atm magic
19:20:06FromDiscord<treeform> ok
19:20:14FromDiscord<kodkuce> cuz was not sure wtf is ambigoues
19:20:46FromDiscord<kodkuce> form what i see it accpets proc close*(ws: WebSocket) = and i am giving it WebSocket so duno whats wrong
19:21:13FromDiscord<treeform> its a pretty simple proc?
19:21:14FromDiscord<treeform> https://github.com/treeform/ws/blob/master/src/ws.nim#L429
19:21:33FromDiscord<kodkuce> ye just saw
19:21:33FromDiscord<treeform> Instead of close does hangup work?
19:22:00FromDiscord<treeform> I think the websocket either not my websocket or the close is not my close?
19:22:09FromDiscord<kodkuce> Error: expression 'hangup(magic)' has no type (or is ambiguous)
19:22:46FromDiscord<kodkuce> worst thing even vscode shows me autocomplete for your proc
19:23:07FromDiscord<treeform> It feels like you still have some stuff using niv nad some stuff using mine
19:23:15FromDiscord<treeform> and its crossing some how
19:23:37FromDiscord<kodkuce> hmm but i am not importing anymore websockets or whatewer is niv one called
19:23:40FromDiscord<treeform> did you try nim -f to force a full recompile
19:23:43FromDiscord<kodkuce> can unistall to try
19:23:48FromDiscord<kodkuce> nah
19:23:55FromDiscord<kodkuce> dident think of that
19:24:16FromDiscord<kodkuce> meybe cuz same folder but its a new file i leaft old one
19:25:33Araqcompile with --noNimblePath
19:25:38FromDiscord<kodkuce> hmm unistalling niv websocket didnet help, hmm will try some more myself and if donset work wil lcry again
19:25:46FromDiscord<kodkuce> ok
19:26:15FromDiscord<kodkuce> im(2, 8) Error: cannot open file: ws
19:26:25FromDiscord<kodkuce> that should be normal if not using nible path
19:26:42FromDiscord<kodkuce> cuz i instlled treeform ws with nimble
19:26:46FromDiscord<treeform> https://gist.github.com/treeform/8662b651335a0adf703bb7601752d3f2
19:26:56FromDiscord<treeform> Here is a simple close example, does it work for you?
19:27:31FromDiscord<kodkuce> tough i cna copy paste it in dir and try, or even better first try this simple example myebe i broken it somwer myself
19:28:40FromDiscord<kodkuce> ok so simple one worked
19:28:48FromDiscord<kodkuce> so guess i broken it with some import or something
19:28:52FromDiscord<kodkuce> exploring
19:29:01FromDiscord<treeform> so now you need to remove stuff till your program looks like my example?
19:29:47FromDiscord<kodkuce> yep will figure it out
19:30:42FromDiscord<kodkuce> i think i found
19:30:45FromDiscord<kodkuce> what was issue
19:31:03FromDiscord<treeform> you can also call `ws.close(webSocket)` to make sure it picks up my function
19:31:22FromDiscord<treeform> what was the issue?
19:31:48FromDiscord<kodkuce> sec just want to see if i was that much dumb
19:32:53FromDiscord<kodkuce> lol Niv ones close proc returns Future your does not i just removed await
19:33:07FromDiscord<kodkuce> or discard duno what i putet there
19:33:15FromDiscord<kodkuce> duno how i dident see it earyler xD
19:34:00FromDiscord<treeform> oh yeah, errors around async are kind of bad.
19:36:36*GordonBGood joined #nim
19:41:44*GordonBGood quit (Ping timeout: 276 seconds)
20:08:03madpropscan i sort var files: seq[(string, times.Time)] with sortedByIt ?
20:08:19madpropsim trying files.sortedByIt(it[1])
20:08:51madpropsor maybe i should make an object for this
20:10:32FromGitter<Vindaar> @madprops: in principle `sortedByIt` works for that. But the type that's actually compared must have `<`, `==` procs defined. Not sure if that's the case for `Time`
20:13:21*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
20:13:35*pbb joined #nim
20:19:06*sschwarzer joined #nim
20:19:11sschwarzerHi :)
20:19:29sschwarzerIs there a way to prevent inlining of an iterator (for debugging)?
20:22:16Araqno, sorry.
20:22:40sschwarzerThanks
20:23:40sschwarzerWhat do you think about such a feature? Do you think it would make sense or are there reasons it shouldn't be in Nim (apart from the additional effort)?
20:24:44Araqwell if you wrote the iterator you can annotate it with .closure
20:25:09sschwarzerBy the way, I worked around it by temporarily changing the iterator to a proc that returns a seq.
20:25:21Araqgood choice
20:25:35sschwarzerAraq: Good to know. Yes, it's an iterator of my own.
20:27:36FromDiscord<alehander42> sschwarzer what kind of debugging
20:28:01FromDiscord<alehander42> iirc there are some possible improvements related to iterator stepping debug info
20:28:07sschwarzerAlthough the "final" version of the iterator allows in-place modification of the data structure that is iterated over. But to test/debug the general functionality the seq workaround was ok.
20:28:32sschwarzeralehander: With gdb
20:28:35FromDiscord<alehander42> yes
20:29:24sschwarzeralehander: the instruction pointer jumped to nonsensical places. I haven't looked at the generated C code, but I assume the problem was because of the inlining.
20:29:32FromDiscord<alehander42> i think usually
20:29:35FromGitter<s0kil> Is there an filesystem watcher for Nim V1? ⏎ I have tried `https://github.com/FedericoCeratto/nim-fswatch` & `https://github.com/Vindaar/fsmonitor2` & `https://github.com/nim-lang/graveyard/tree/master/fsmonitor` without any luck.
20:29:37FromDiscord<alehander42> it jumps to the iteration original code
20:29:47FromDiscord<alehander42> which is sensible but not really useful for most simple `items`
20:29:52FromDiscord<alehander42> one option is to add a debug flag
20:30:15FromDiscord<alehander42> which makes nim generate a nonsensical lineinfo for iterator lines
20:30:37FromDiscord<alehander42> or to just generate the `for` callsite lineinfo for all of them
20:31:01FromDiscord<alehander42> the downside is that for some more complicated iterators its useful to be able to step inside
20:31:39*jjido joined #nim
20:32:24FromDiscord<alehander42> btw finally the nim small kernel kinda works
20:32:39FromDiscord<alehander42> the guys from #osdev helped me a lot with my qemu issues
20:33:21FromDiscord<alehander42> and after a lot of playing with the nim code and a c tutorial which its kinda based on, i realized i miss __asm__ __violatile__ sti
20:33:29FromDiscord<alehander42> so now keyboard input is working
20:33:40FromDiscord<alehander42> which is like super quality software
20:37:03Araqwow nice
20:38:22*filcuc quit (Ping timeout: 252 seconds)
20:46:05*nsf quit (Quit: WeeChat 2.6)
20:50:01*sschwarzer quit (Quit: leaving)
21:00:43*lritter joined #nim
21:01:14*narimiran quit (Ping timeout: 240 seconds)
21:08:03*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:15:11*jjido joined #nim
21:16:56*nif quit (Quit: ...)
21:17:05FromDiscord<alehander42> i plan on maybe moving this code to a lib, so one can make toy kernels more easily
21:17:06*nif joined #nim
21:17:12FromDiscord<alehander42> most of the code isnt mine anyway
21:17:22*Joco223 joined #nim
21:19:50Araq+1
21:21:31Joco223Hello everyone! I just wanted to ask, I've gotten a hang of Nim and I'd like to contribute to it. I've read the contribution guidelines, but I am wondering on what issues should I go for first?
21:23:36AraqJoco223: hi, welcome
21:23:41disruptekmaybe a pr that adds a test that demonstrates a bug.
21:23:53*abm joined #nim
21:24:04Araqdepends on your skills and interests
21:24:41Araqthe --gc:regions bugs are a bit embarrassing but then I never announced the feature and it's moribund so ...
21:26:56Joco223Well I've come from Cpp and I've made a few things with Nim, nothing too big. Some stuff that I've made in Cpp which is relevant to this is a VM, simple programming language based on the VMs (I've had multiple version)
21:27:13AraqVM bugs is it then :P
21:27:18disrupteklol
21:27:29Araqwhat the heck is a "No Unit Production Speedrun" ?
21:28:00disruptekoh, you mean NUPS
21:28:07Araqhow can you even solve all the missions without producing any units
21:28:54skrylar[m]im just gonna.. use an importc to deal with this long double nonsense
21:37:41*Joco223 quit (Remote host closed the connection)
21:43:20*tane quit (Quit: Leaving)
21:45:36*GordonBGood joined #nim
21:48:10*ltriant joined #nim
21:55:25donpdonpfor source files in the same project, when do i 'import' vs 'include'?
21:55:50disruptekinclude is an escape hatch. don't use it unless you need to escape.
21:55:55FromGitter<zetashift> One rarely use includes
21:57:07donpdonpok thx
21:57:28GordonBGoodOne of the main reasons that includes are used in the Nim code base is that pragmas can't be inported
21:57:49GordonBGoodSo if a pragma has been created, the file needs to be included
21:58:05donpdonptypes and fields are almost always public* since they'll be imported by other source files?
21:59:22GordonBGoodIf you are writing a library to be used by others, you can choose what to exposed; if it is for your own use, then of course it is entirely up to you
21:59:44*GordonBGood quit (Read error: Connection reset by peer)
21:59:54donpdonpi mean other source files in the same project.
22:00:25*GordonBGood joined #nim
22:02:09GordonBGoodThere is no real reason to expose types and fields that are only used within the file and not part of you "library"'s API
22:02:58GordonBGoodExposing everything pollutes the name space of your other files and kind of defeats the purpose of dividing up you project
22:03:12donpdonpa.nim and b.nim need type T, so I made types.nim and import it from a and b. if type T is not public*, nim says T is declared and not used
22:03:37donpdonpi guess that is just a Hunt
22:03:39donpdonpHint
22:03:45dom96GordonBGood, pragmas can be imported
22:03:48madpropsim liking the case insensitivity. it's feels more forgiving, even though i've had to adjust some code like config var against Config object, but no biggie
22:03:56dom96at least macros which can be invoked as pragmas can
22:04:32dom96GordonBGood, to be honest, if there are cases which cannot be imported then I would consider that a bug
22:05:39donpdonpimport just throws the proc and types into the namespace of the file doing the import? what if a.nim imports b and c, and a proc name is the same in b and c?
22:06:27Araqmadprops: always nice to hear :-)
22:06:59Araqdonpdonp: try it or read a tutorial about it
22:07:05GordonBGoodI'm pretty sure I saw in the doc's that pragmas couldn't be imported, but I can't find it now
22:07:09Araqit doesn't work as you think it does.
22:07:37AraqGordonBGood: yeah, there is no {.pragma*: ...} in Nim
22:10:02*Vladar quit (Quit: Leaving)
22:11:27donpdonpAraq: good point :)
22:11:47donpdonpis a third file the usual way to resolve a circular dependency?
22:12:15GordonBGooddom96, Araq: Yeah, I was remembering this: https://nim-lang.org/docs/manual.html#pragmas-pragma-pragma
22:18:13FromDiscord<kodkuce> @treeform you alive, does header get updated via ws or i not gething this, am talking about protocol one, duno if its issue with godot ws client or mybrain or you lib
22:18:23FromDiscord<kodkuce> with old niv ws it worked np
22:18:54FromDiscord<kodkuce> but now if i use protocol it shoots me error E 0:00:01:0910 _verify_headers: Condition ' !headers.has("sec-websocket-protocol") ' is true. returned: false
22:19:11FromDiscord<kodkuce> https://github.com/godotengine/godot/blob/master/modules/websocket/wsl_client.cpp#L140
22:19:22FromDiscord<kodkuce> https://github.com/treeform/ws/blob/master/tests/echo.nim
22:19:34*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:19:59FromDiscord<kodkuce> in niv you pedefind protocol but form what i see in ws you do it dynamicly on client request or i got it worng?
22:20:23dom96kodkuce: what limitations are you running into with niv's?
22:20:29FromDiscord<treeform> are you connecting to `localhost: 9001/ws` or just `localhost: 9001/`
22:20:47FromDiscord<treeform> are you connecting to `localhost:9001/ws` or just `localhost:9001/`
22:20:58FromDiscord<kodkuce> just localhost
22:21:07FromDiscord<treeform> thats for regular html pages
22:21:08FromDiscord<kodkuce> :8080 in my case
22:21:10FromDiscord<treeform> remove
22:21:17FromDiscord<treeform> if req.url.path == "/ws":
22:21:23FromDiscord<kodkuce> i allread did
22:21:34donpdonphow does a nim developer keep straight the imports that are local source files and the imports that are nimble packages
22:21:56FromDiscord<kodkuce> can make minimal
22:22:31madpropswhat's the most straightforward way to replace part of the string, in a case insensitive manner?
22:23:54FromDiscord<treeform> @kodkuce I do send back a protocol: https://github.com/treeform/ws/blob/master/src/ws.nim#L89
22:23:57FromDiscord<kodkuce> @treeform tought i added this if wsconn.protocol != "": echo wsconn.protocol and it echos the protocol godot client send/requested, so meyeb its client issue tought like i say it worked in niv version, probbaly cuz in niv it was preset on wsserver creation
22:24:00FromDiscord<treeform> Maybe the C++ version does not lower case it?
22:24:49FromDiscord<kodkuce> possible
22:25:09FromDiscord<treeform> can you edit the ws.nim and make header lower case and see if it works for you?
22:25:21FromDiscord<treeform> same case as `ERR_FAIL_COND_V(!headers.has("sec-websocket-protocol"), false);`
22:25:41FromDiscord<kodkuce> ye am doing that atm
22:26:57FromDiscord<treeform> do you need to use "protocol" thing at all?
22:27:25FromDiscord<kodkuce> nah
22:27:33FromDiscord<kodkuce> but was just testing 🙂
22:27:42FromDiscord<treeform> does it work without the protocol?
22:27:42FromDiscord<kodkuce> hmm for some reason still dosent work
22:27:52FromDiscord<kodkuce> ye whiuto protocol it works
22:28:46FromDiscord<kodkuce> i go check how niv did it meybe i get it myself
22:28:49FromDiscord<kodkuce> have time anyway
22:32:17FromDiscord<kodkuce> nivs was too result.add("Sec-Websocket-Protocol: upecase so its not that
22:32:44FromDiscord<treeform> just write a quick tests, works for me 🙂
22:33:12FromDiscord<treeform> https://gist.github.com/treeform/1f28dafa53925ba6c56d698a999c5f7a
22:33:20FromDiscord<treeform> But I don't have the Godot side.
22:34:15FromDiscord<treeform> Can you put `echo`s around https://github.com/treeform/ws/blob/master/src/ws.nim#L77 and see what protocol do you actually send?
22:34:35FromDiscord<kodkuce> sure
22:36:36FromDiscord<treeform> maybe your protocol has like a ":" in it or like a \c\L ?
22:37:16*krux02 joined #nim
22:38:02FromDiscord<treeform> looks likes nivs version does transforms like to lowercase on the protocol: https://github.com/niv/websocket.nim/blob/master/websocket/server.nim#L80
22:38:10FromDiscord<treeform> maybe that is helping your thing run?
22:38:26FromDiscord<kodkuce> i think i found issue
22:38:30FromDiscord<kodkuce> if not ws.protocol.len == 0:
22:38:42FromDiscord<kodkuce> i put 1 echo under it and it dident write i think
22:39:22FromDiscord<kodkuce> tough echoing ws.protocol shows my protocol
22:40:43FromDiscord<treeform> what if you do `if ws.protocol.len > 0:`
22:42:54FromDiscord<kodkuce> this is some uber magic
22:42:56FromDiscord<kodkuce> Prot len is: 15
22:43:02FromDiscord<treeform> you right there is some thing iffy with the `not ==` line
22:44:03dom96you're probably getting: (not ws.protocol.len) == 0
22:44:09dom96i.e. bitwise not
22:44:15FromDiscord<treeform> ouch
22:44:21FromDiscord<treeform> thats probably right
22:44:35FromDiscord<kodkuce> yep now it works
22:44:41FromDiscord<kodkuce> with if ws.protocol.len > 0:
22:44:52FromDiscord<treeform> thank you for finding this bug
22:44:57FromDiscord<treeform> i'll whip up a use case for it
22:45:10FromDiscord<treeform> I don't use protocols, so I did not test it as well...
22:45:22FromDiscord<treeform> i'll whip up a test case for it
22:46:06FromDiscord<kodkuce> i personaly duno for what protocols are even xD dident read RFC
22:46:35FromDiscord<treeform> I think they are kind of stupid .. you can just do them in user land with your json or binary blobs
22:46:46FromDiscord<treeform> I don't know why they are included
22:47:43FromDiscord<kodkuce> duno now i must read rfc so meybe i know xD
22:49:07FromDiscord<kodkuce> or can you short spoon me, do they split like chat rooms or what?
22:49:51FromDiscord<treeform> not really
22:49:52FromDiscord<kodkuce> searching protocol in https://tools.ietf.org/html/rfc6455#section-5.2 gives me 270 entirs
22:49:54FromDiscord<kodkuce> xD
22:50:03FromDiscord<treeform> websocket is a protocol
22:50:06FromDiscord<treeform> and it has a sub protocol
22:50:45FromDiscord<treeform> you are looking for this: https://tools.ietf.org/html/rfc6455#page-59
22:51:03FromDiscord<treeform> "This enables scripts to both select a subprotocol and be
22:51:03FromDiscord<treeform> sure that the server agreed to serve that subprotocol."
22:51:09FromDiscord<treeform> thats basically what you would use it for
22:51:35FromDiscord<treeform> you can use it for versioning etc...
22:51:40FromDiscord<kodkuce> oh
22:51:48FromDiscord<kodkuce> i think i get it now
22:51:58FromDiscord<treeform> https://tools.ietf.org/html/rfc6455#section-1.9
22:53:23*solitudesf quit (Ping timeout: 246 seconds)
22:53:34madpropsis there an example of how i can make a custom sub on .replace to make case insensitive replacements?
22:53:35FromDiscord<kodkuce> so if i have 2 diferent way of handling comm betwin server clients, example old and new, and basicly if i use json or binary blob i can just put first in json version:old or version:new and just process it diferently
22:53:49FromGitter<deech> Has anyone implemented immutable datastructures for Nim that share nodes efficiently?
22:53:59FromDiscord<treeform> @kodkuce yeah thats what I do too.
22:54:04*nif quit (Quit: ...)
22:54:10FromDiscord<treeform> But you could use this for that.
22:54:14*nif joined #nim
22:54:37FromDiscord<kodkuce> ok got it ty 🙂
22:56:50Araqdeech: I vaguely remember some Nimble package(s) about it
22:58:31FromDiscord<treeform> @kodkuce I have shipped 0.3.3 version of `ws` that should fix your issue.
22:58:41FromDiscord<treeform> can you verify that it works for you?
23:00:00FromDiscord<kodkuce> sure
23:02:18FromDiscord<kodkuce> @treeform yep it works
23:02:32FromDiscord<kodkuce> did nimble unsitall ws , then nible install ws
23:02:40FromDiscord<treeform> 👌
23:02:51FromDiscord<treeform> perfect
23:06:08*vsantana quit (Remote host closed the connection)
23:22:02lqdev[m]@kodkuce FYI you can omit the uninstall step
23:23:45FromDiscord<kodkuce> it will oweride cuz new version right?
23:24:03FromDiscord<kodkuce> ye i dident think about that