<< 25-06-2019 >>

00:09:01rayman22201@Skaruts, here is the template version of popBack, just fyi:
00:09:14rayman22201https://www.irccloud.com/pastebin/sYITKQJ8/
00:10:25rayman22201you probably don't need it though. It's the ast macro equivalent of "force inline" for the function. So meh.
00:12:23Araqit evaluates 'a' twice, bug :P
00:15:01FromDiscord_<Skaruts> @Araq what if x1 is a member variable, for example in a Rect object?
00:15:26FromDiscord_<Skaruts> so I could do rect.x or rect.x1, would that template still work?
00:18:50FromDiscord_<Skaruts> @rayman thanks, I'll try that one too
00:19:07rayman22201wouldn't the function also evaluate 'a' twice? I'm not sure I see the bug :/
00:19:10rayman22201@Araq
00:19:45FromDiscord_<Skaruts> me neither, but I'm still a Nim peasant so...
00:20:01rayman22201also, yeah, you can use the "alias template" to access member vars
00:20:33FromDiscord_<Skaruts> what's with the untyped though?
00:21:02rayman22201it's a pretty common pattern to reduce typing actually. It was in a tutorial even.... somewhere I can't remember right now lol.
00:21:07FromDiscord_<Skaruts> I guess he was thinking in generic terms, so maybe I can make it int, instead? It's a very specific case
00:21:59FromDiscord_<Skaruts> and the Rect object only takes ints
00:22:02rayman22201No, templates are a special case of Nim Macro, "untyped" means a nim node. Basically where the copy and paste goes.
00:22:39*rayman22201 is going to get yelled at for this explanation. It's very simplified
00:24:05rayman22201It's untyped because the template runs before type checking has happened. You want it that way though. The macro replaces the identifier, so the type doesn't matter.
00:24:23FromDiscord_<Skaruts> ah ok
00:25:55Araqrayman22201: well it's the same as a #define, watch out for eval twice problems
00:27:41FromDiscord_<Skaruts> geometry.nim(66, 26) Error: type mismatch: got <Rect>
00:27:41FromDiscord_<Skaruts> but expected one of:
00:27:42FromDiscord_<Skaruts> template x1(): untyped
00:27:42FromDiscord_<Skaruts>
00:27:42FromDiscord_<Skaruts> expression: x1(self)
00:28:11FromDiscord_<Skaruts> line 66 `result.x = int( (self.x1 + self.x2) div 2 )`
00:28:39FromDiscord_<Skaruts> the error happens in the self.x1 (self is Rect), this is the get_center method
00:29:57*theelous3_ joined #nim
00:31:42FromDiscord_<Skaruts> type Rect* = ref object of RootObj
00:31:42FromDiscord_<Skaruts> x*, y*, x2*, y2*, w*, h*:int
00:31:42FromDiscord_<Skaruts> pos*, size*:Point
00:31:53rayman22201https://www.irccloud.com/pastebin/nv8n4jAp/
00:33:04rayman22201@Skaruts, ah. It's the method call syntax that is messing with you: https://nim-lang.org/docs/manual.html#procedures-method-call-syntax
00:33:42rayman22201it's trying to call "x1(self)~ -- the template. But the template doesn't take any arguments.
00:34:02rayman22201jesus. I fat fingered that
00:34:23rayman22201x1.self == x1(self) # this is a template call
00:34:56FromDiscord_<Skaruts> can I get around it?
00:35:04Araqjust use 'x1' and not 'x' consistently or the other way round
00:36:19FromDiscord_<Skaruts> meh... I just like to keep the code consistent in some places, like x1,x2 etc in the intersects function and x for everywhere else, because x1 is too much typing!
00:38:10FromDiscord_<Skaruts> I could swear I did this before though... when I learned about templates, an eternity ago
00:39:09rayman22201maybe: `template x2(self : untyped): untyped = self.x1`
00:39:12FromDiscord_<Skaruts> well I can still do it the way I was doing, the rect has both x and x1 and the init function sets both
00:39:34FromDiscord_<Skaruts> the only problem when I do rect.x = 10, the other one is neglected
00:41:05*envoyt joined #nim
00:41:36FromDiscord_<Skaruts> @rayman oh that seems to work
00:42:05FromDiscord_<Skaruts> everything is running ok at least, and nothing exploded
00:42:33rayman22201if this is your kind of thing, you may enjoy this library: https://github.com/zevv/with
00:44:45FromDiscord_<Skaruts> not sure
00:46:22rayman22201lol. Fair enough. Just throwing it out there. Glad the simple solution is working for you though.
00:47:09FromDiscord_<Skaruts> I'm still a bit away from many advanced stuff (or stuff that I've not learned yet because I think it's advanced)
00:47:28FromDiscord_<Skaruts> I'm learning as I go
00:48:21FromDiscord_<Skaruts> been many months away from Nim though, so I forgot much of what I read in the manual and tutorial
00:48:45FromDiscord_<Skaruts> I read it quite attentively back then
00:49:12rayman22201you have a good rule of thumb in general. I just like templates and macros too much... I'm one of *those* people.
00:49:15rayman22201 The rule is generally "do it with a proc first, only if you can't do it with a proc then try a template. ONLY if neither of those will cut it, only then, use a macro."
00:49:40FromDiscord_<Skaruts> noted
00:50:19rayman22201Good news is that manual probably got way better since you last looked :-)
00:51:11FromDiscord_<Skaruts> I read it somewhat cursorily again maybe 4 or 5 months ago
00:51:43FromDiscord_<Skaruts> I still refer to all of that when I need though, I was just there looking for that pop equivalent
00:52:28FromDiscord_<Skaruts> it's a bit too technical though 😃
00:53:13FromDiscord_<Skaruts> or maybe it's just me
00:53:17rayman22201That's why we have the tutorials
00:53:31rayman22201https://nim-lang.org/learn.html
00:53:37FromDiscord_<Skaruts> indeed
00:54:04rayman22201we probably need more of those actually :-)
00:54:18FromDiscord_<Skaruts> nim by example isn't bad either
00:54:37rayman22201yeah
00:55:42rayman22201ok. dinner time for me. gn
00:57:46FromDiscord_<Skaruts> I wonder why the guys that made the wrappers for libtcod and sfml didn't abstract type castings
00:58:17FromDiscord_<Skaruts> I find myself writing overloads for all the functions so I don't have to cast everything to and from cints, for example
00:59:00FromDiscord_<Skaruts> (I could use cints myself, but then I'd eventually have to be casting them somewhere else, I think)
01:09:51*rockcavera joined #nim
01:11:10*envoyt quit (Ping timeout: 272 seconds)
01:12:32*stefanos82 quit (Quit: Quitting for now...)
01:50:13*sz0 joined #nim
02:03:23*theelous3_ quit (Ping timeout: 245 seconds)
02:06:39*dddddd quit (Read error: Connection reset by peer)
02:12:21*lmariscal joined #nim
02:16:43*NimBot joined #nim
02:18:20*lmariscal joined #nim
02:18:35*lmariscal quit (Client Quit)
02:20:08*lmariscal joined #nim
02:25:01*lmariscal quit (Client Quit)
02:25:23*lmariscal joined #nim
02:26:06*lmariscal quit (Client Quit)
03:15:53*theelous3 quit (Ping timeout: 245 seconds)
03:16:42*theelous3_ joined #nim
03:26:35*onionhammer joined #nim
03:32:53*envoyt joined #nim
03:52:14*noonien quit (Read error: Connection reset by peer)
03:52:26*noonien joined #nim
04:16:06FromDiscord_<djazz> Would be nice if the stdlib supported shift() etc
04:16:12FromDiscord_<djazz> On seqs
04:17:12*Voltist joined #nim
04:17:29Tangerdjazz: https://forum.nim-lang.org/t/2552
04:20:28*Voltist quit (Remote host closed the connection)
04:29:42FromDiscord_<djazz> Saw that, heh.
04:31:15FromDiscord_<djazz> Something similar to pop, but for the start of the list. It was discussed earlier
04:42:18*envoyt quit (Ping timeout: 252 seconds)
04:42:38*nsf joined #nim
04:42:43*envoyt joined #nim
05:15:55*narimiran joined #nim
05:16:33narimiran@djazz regarding pop'ing from the beginning of the list:
05:17:12narimiran1. do you know that's an expensive (O(n)) operation?
05:17:34FromDiscord_<demotomohiro> How to stringfy untyped argument in template?
05:17:36FromDiscord_<demotomohiro> https://wandbox.org/permlink/lBQBT01eJhQyrACg
05:17:47narimiran2. regarding 1 - do you know we have `deques` module which has `popFirst` function? https://nim-lang.github.io/Nim/deques.html
05:19:45*theelous3_ quit (Ping timeout: 244 seconds)
05:22:07FromDiscord_<djazz> Thanks, good to know
05:22:30FromDiscord_<demotomohiro> Im sorry, I posted wrong URL
05:22:32FromDiscord_<demotomohiro> https://wandbox.org/permlink/0EgIJzAMxo6km31t
05:24:47*leorize quit (Quit: WeeChat 2.3)
05:34:53FromDiscord_<demotomohiro> I can make a macro that can do same thing
05:34:55FromDiscord_<demotomohiro> https://wandbox.org/permlink/SFJJntMiaXksqGoL
05:36:54FromDiscord_<demotomohiro> An untyped argument in template cannot be stringify?
05:40:59narimiran@Varriount are you here maybe?
05:50:33*solitudesf joined #nim
05:56:36*laaron quit (Remote host closed the connection)
05:59:16*leorize joined #nim
06:04:55*laaron joined #nim
06:06:50vegai_the multisync macro seems amazing
06:07:03vegai_is there some downsides that are not readily obvious
06:07:26vegai_don't think I've seen such a thing in other languages
06:13:39*PMunch joined #nim
06:29:46*nolanv quit (Read error: Connection reset by peer)
06:34:51leorizeAraq: should stacktraces in VM follow excessiveStackTrace or listFullPaths?
06:36:31PMunchOh by the way, the listFullPaths sometimes lists the paths of the TravisCI
06:36:48*nolanv joined #nim
06:37:08leorizeyea, I'm fixing that
06:43:34*leorize quit (Remote host closed the connection)
06:43:36PMunchGood :)
06:44:01PMunchdom96, still haven't had access to the playground? :(
06:44:51FromGitter<rokups> btw you people noticed that when debugging and "stepping over" we occasionally can be thrown into another file somewhere in stdlib? must be something with function inlining. i wonder if anything could be done about that
06:45:22livcdis playground dead?
06:47:34*leorize joined #nim
06:57:37leorizelol, some logic in the compiler introduces paths like: ../home/<snip>/system.nim
06:59:37PMunchlivcd, yes..
06:59:38*laaron quit (Remote host closed the connection)
06:59:53*laaron joined #nim
06:59:54PMunchI was trying to make it a bit more secure yesterday, but I made it so secure that even I don't have sudo access to it..
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:44leorizeat least we know it's not hacked :P
07:00:55PMunchlivcd, I'm just waiting for dom96 (which AFAIK is the only one with actual root access) to reset the sudoers file so I can get it back up
07:01:14PMunchleorize, oh yeah, if anyone hacks it now I'd be surprised :P
07:04:44*gmpreussner joined #nim
07:06:06FromGitter<alehander42> @rokups
07:06:09FromGitter<alehander42> example?
07:06:39FromGitter<alehander42> loops? and which debugging options, usually it has to do with templates and iterators
07:06:42*tjmac joined #nim
07:08:33FromGitter<rokups> @alehander42 `var s: seq[int]; s.new_seq(3)`. break on first line and f10 in vs-code. jumps into memory.nim `nimSetMem()` proc
07:11:07FromGitter<alehander42> yeah, you're write, this is inline
07:12:18FromGitter<alehander42> right* ops
07:12:38FromGitter<alehander42> one posibility is to introduce stuff similar to `genCLineDir(prc, "generated_not_to_break_here", 999999, m.config)` for code inline in certain debug builds
07:12:50*krux02 joined #nim
07:13:57Araq> should stacktraces in VM follow excessiveStackTrace or listFullPaths?
07:14:03Araqargh. I don't know
07:14:49FromGitter<rokups> @alehander42 my first idea was to not output `#line` directives for inlined functions. but then again one might want to step into inline function. no easy solution here i guess
07:15:03AraqexcessiveStackTrace?
07:15:25Araqrokups: we spent some effort in improving these problems but it's never perfect
07:16:27FromGitter<rokups> there probably isnt that much to do when you are generating c/cpp code and have no access to underlying compiler internals
07:16:52FromGitter<arnetheduck> @Araq, any chance of fixing so that one can implicitly return a proc? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d11ca641c1f606239f603bb]
07:18:55leorizeAraq: as promised: https://github.com/nim-lang/Nim/pull/11583
07:19:12leorizebut this wouldn't solve the "path leaking to generated binary"
07:19:48leorizeon *nix there's this "../home/<snip>/system.nim" which will just leaks everything :p
07:20:22*PMunch quit (Remote host closed the connection)
07:22:34*PMunch joined #nim
07:30:08Araqarnetheduck: I'm not sure how much effort it would be but I'll look into it
07:32:57PMunchHmm, is there a way to zip something on compile-time?
07:33:09PMunchFor embedding statically into the executable
07:33:48leorizeyou can use `zip`
07:33:54*envoyt quit (Ping timeout: 252 seconds)
07:33:55leorizewith staticExec ofc
07:34:11leorizebut I don't think it have output to stdout
07:34:16*envoyt joined #nim
07:34:51leorizeoh, you can
07:36:06leorizeconst zipped = staticExec("zip -@", listOfFileSeparatedByNL)
07:36:30leorizeor const ziped = staticExec("zip", staticRead "file to be zipped")
07:36:33leorizePMunch: ^
07:38:09PMunchHmm yeah, on Linux that works
07:38:17PMunchBut on Windows that would be trickier
07:38:24PMunchOr does it have zip as well?
07:38:36leorizeif you install it
07:38:42leorizechocolatey should have it
07:39:18FromDiscord_<djazz> Compile a program using nim zip module and call that ;)
07:40:34*vegai_ quit (Quit: upg)
07:44:04*jjido joined #nim
07:44:52PMunchdjazz, certainly a possibility :P
07:45:05PMunchI'm just toying with the idea of creating installers in Nim
07:45:29PMunchSo I would want to pack content statically into an executable, and of course preferably in zip or another compressed format
07:45:48FromDiscord_<djazz> Aha
07:46:21FromDiscord_<djazz> tar + gzip or xz/lzma would be neat
07:46:31PMunchAnd I want this to work on Windows of course (since installers aren't really a thing on any other platform), but since Nim is good at cross compiling I would also want to be able to create installers from a Linux or Mac machine
07:47:18FromDiscord_<djazz> On Linux/mac its super easy to make a self extracting shell script, assuming unzip/tar is available
07:47:35FromDiscord_<djazz> Data can be appended to the end of script
07:47:45FromDiscord_<djazz> It may be possible to do with exe too
07:47:46*vegai_ joined #nim
07:47:53*vegai_ quit (Client Quit)
07:48:07FromDiscord_<djazz> I know I have done with NW.js (nodewebkit)
07:48:24FromDiscord_<djazz> Runtime exe, then js code concated to it
07:48:29*vegai_ joined #nim
07:48:53FromDiscord_<djazz> Not sure how you get the size of the original exe to get the right offset though
07:49:24FromDiscord_<djazz> That way you dont need to recompile to change data.
07:50:16*leorize quit (Ping timeout: 260 seconds)
07:50:20PMunchI mean something like this works for embedding files: http://ix.io/1MJv/Nim
07:50:24FromDiscord_<djazz> And then link zlib etc statically
07:51:08*vegai_ is now known as vegai
07:51:16PMunchBut I would want to move all files into a temporary folder, then zip it, and then add that zip file to the intstaller instead
07:54:12*vegai quit (Quit: leaving)
07:54:15*leorize joined #nim
07:54:31leorize[m]wrap libarchive for nim then use tar + xz for superior compression performance :p
07:54:33*vegai joined #nim
07:54:44FromDiscord_<djazz> ^
07:55:58FromDiscord_<djazz> You could include your installer exe into your create_installer exe, and then output a new exe with installer and data concstenated
07:56:45FromDiscord_<djazz> If the offset can be figured out
07:59:26FromDiscord_<djazz> https://www.strchr.com/creating_self-extracting_executables
08:00:21FromGitter<rokups> > tar + xz for superior compression performance ⏎ new hot thing in compression field is zstd. maybe check that out as well. way faster than zlib and better compression ratio too
08:00:53leorize[m]but for transport xz is still better
08:01:34leorize[m]zstd is better for streaming content
08:02:54FromDiscord_<djazz> xz is slow to compress :/
08:03:08leorizenot that it matters when you are creating an installer :p
08:03:29PMunchYeah all of this is a bit out-of-scope for my initial POC
08:05:21*floppydh joined #nim
08:05:44*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:08:49FromDiscord_<djazz> https://www.systutorials.com/docs/linux/man/1-unzipsfx/
08:09:59*dwdv joined #nim
08:11:16PMunchAgain though I need a cross-platform solution
08:12:41FromDiscord_<djazz> Yes...
08:13:12FromDiscord_<djazz> You want the create_installer exe to make a new exe?
08:13:21FromDiscord_<djazz> Compiled or existing
08:13:47FromDiscord_<djazz> Something similar to unzipsfx
08:14:18leorizestaticRead should be fine for starters...
08:14:35leorizemore complicated solutions like embedding to the end of file can be explored later
08:14:44FromDiscord_<djazz> Also, on windows, .msi files are basically self extracting installers. Supports uninstalling too
08:17:13AraqPMunch, on windows and Linux you can append a binary blob to the .exe
08:17:23Araqthen you write the size of the blob at the very end
08:17:35Araqthen at runtime you read the length and extract the blob
08:17:54leorizeuse NESM and write a footer with payload data :)
08:18:05Araqit works but it mostly re-invents a "resource compiler"
08:18:36Araqmingw ships with a resource compiler, use it
08:19:17Araqor use my Nim implementation that does that that I never released as a Nimble package :-/
08:19:29Araqor anywhere else...
08:19:32FromDiscord_<djazz> 😂
08:19:51FromDiscord_<djazz> Yeah the appending data idea sounds good
08:20:15*FromDiscord_ <djazz> unless you want to embed a nim compiler into the createinstaller exe
08:20:35*FromDiscord_ <djazz> messed up italics oops
08:20:57leorizeso italics on discord results in /me for irc?
08:21:08FromDiscord_<djazz> Oh really
08:21:08FromGitter<arnetheduck> what's everyone using on windows btw? msys2? or some other mingw?
08:21:23leorizeI use msys2
08:21:39leorizetheir Nim is horribly outdated though, but I only use the mingw part of msys anyway
08:22:54PMunchdjazz, the idea is to have a library for creating installers. Built on wnim for the GUI, but with some specialised DSL for easily creating pages.
08:23:46FromDiscord_<djazz> Ah, I see
08:25:50FromDiscord_<djazz> So the creator is a nim module, or?
08:26:39leorizethen staticRead is more than enough
08:26:46FromDiscord_<djazz> Yeah
08:26:53leorizecompression can be done via 7z command line if desired
08:27:07PMunchWell the way it would work is that you write a Nim file that specifies which files and folders to install, what inputs you need to customise the install, etc. Then i creates an exe that embeds all the sources and shows everything in a nice GUI
08:27:55PMunchSorry if my descriptions are a bit vague, I'm currently in a meeting :P
08:28:59FromDiscord_<djazz> On mac, do you want a custom installer too? Usually they are .dmg files and you drop the .app in /Applications
08:29:12leorizePMunch: hanging out on IRC in a meeting, nice :)
08:31:54PMunchdjazz, this is only targetting Windows
08:32:32FromDiscord_<djazz> "Again though I need a cross-platform solution"
08:32:58leorizefor creating windows installers :p
08:33:18PMunchleorize, it's pretty low-key. We're having a hackathon :)
08:33:23FromDiscord_<djazz> Aah
08:33:32PMunchdjazz, yes cross-platform to create the installer. but it only needs to run on Windows
08:33:45*FromDiscord_ <djazz> gets it now
08:33:46PMunch(and wine, so I can test it from my Linux machine :P)
08:34:16PMunchThis way a Linux build server could easily spit out ready-made Windows installers
08:35:39leorizewell, you'd still need a windows server for all the signing part or windows safescreen or smt would scream at your binary :p
08:36:02FromDiscord_<djazz> Well, I would make a precompiled exe and add assets, metadata and compressed data to the exe
08:36:19FromDiscord_<djazz> That way no need to compile something everytime
08:36:36FromDiscord_<djazz> Only need mingw etc once
08:38:33FromDiscord_<djazz> This reminds me of MojoSetup btw https://icculus.org/mojosetup/
08:39:58FromDiscord_<djazz> https://hg.icculus.org/icculus/mojosetup/raw-file/tip/docs.txt
08:39:59PMunchleorize, yes you would still need to sign it
08:40:02PMunchUnfortunately..
08:40:22PMunchWell, fortunately that you need to sign, but unfortunately that it isn't trivial to do from Linux
08:40:38PMunchIt's currentyl the only manual step I need to do to create installers..
08:40:58PMunchBut my current method relies on running InnoSetup under Wine, and InnoSetup is fairly horrible
08:41:36FromDiscord_<djazz> Ah, signing, right..
08:42:20leorizePMunch: mono have signcode
08:42:37PMunchThat's a big dependency just to sign a file :P
08:42:46leorizethat or windows sdk :p
08:42:47PMunchIt must be a fairly standard algorithm..
08:43:31PMunchdjazz "This webpage is a placeholder until a more formal page is written." and the discussion part is from 2007..
08:43:38PMunchHow maintained is that?
08:43:38PMunch:P
08:44:06leorizehttps://manpages.ubuntu.com/manpages/bionic/en/man1/signcode.1.html
08:44:22FromDiscord_<djazz> GOG uses MojoSetup for its installers, I think? Or used to atleast
08:44:23leorizewell looks like the source is BSD licensed, so you can inspect that yourself :p
08:45:04leorizestill using mojosetup
08:45:13*Vladar joined #nim
08:46:20FromDiscord_<djazz> The dev seems to update it occationally https://twitter.com/icculus/status/1058232980047519744?s=19
08:46:51FromDiscord_<djazz> GTK3 support
08:47:01*leorize quit (Quit: WeeChat 2.3)
08:47:56FromDiscord_<djazz> 7 months ago was the last commit
08:48:14FromDiscord_<djazz> Its probably that stable now, its rarely updated
08:48:42FromDiscord_<djazz> It has an embedded Lua interpreter for scripting
08:49:08*sagax_ joined #nim
08:49:24PMunchleorize[m], hmm that tool looks interesting
08:51:18*sagax quit (Ping timeout: 245 seconds)
08:55:19FromGitter<alehander42> @rokups yeah indeed but actually ..
08:55:27FromGitter<alehander42> maybe we can just not inline functions in debug mode
08:55:36FromGitter<alehander42> but this might break something
08:55:51FromGitter<alehander42> is it possible for inlined function to depend somehow on the fact it is inlined araq
08:58:37FromGitter<mratsim> is it? afaik inline functions are just copied into the C file
08:59:38FromDiscord_<demotomohiro> Defining functions without ``inline`` in header file cause linker error like ``foo`` function is defined multiple times in C language.
08:59:42FromGitter<rokups> is there a flag to disable inlining? its not in `--fullhelp`
09:00:00FromGitter<mratsim> Nim doesn't generate header files though
09:00:48*vlad1777d__ joined #nim
09:00:51FromGitter<mratsim> {.pragma: myinline, inline.} and replace all inline pragmas by myinline
09:00:55FromGitter<rokups> if something other than `importc` causes c compiler error then its a bug in nim compiler anyway
09:01:14FromGitter<mratsim> when you want to disable it switch to {.pragma: myinline.} and the pragma will do nothing
09:01:16FromDiscord_<demotomohiro> If same functions defined in multiple .obj, that might cause linker error.
09:03:58*neceve joined #nim
09:09:20*PMunch quit (Remote host closed the connection)
09:12:50*dwdv quit (Quit: quit)
09:17:35AraqPMunch https://gist.github.com/Araq/507d5e336eec15951aec153e4581bd14
09:18:21Araqinlining is performed by the C compiler
09:24:42lqdev[m]am I the only one who prefers `proc main() =` instead of `proc main =`?
09:25:24FromGitter<rokups> i always add `()` too. too hipster without `()` :trollface:
09:26:30*PMunch joined #nim
09:30:49*jjido joined #nim
09:39:54*sagax_ is now known as sagax
10:01:09*abm joined #nim
10:22:56*Trustable joined #nim
10:29:38*arecaceae quit (Remote host closed the connection)
10:29:57*arecaceae joined #nim
10:31:30*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
10:31:47FromDiscord_<djazz> Araq: nice!
10:33:35*laaron joined #nim
10:34:57noonienhm
10:35:19noonieni'm getting a SIGSEGV while compiling a file, how can i debug this?
10:38:45narimiran"D is being used for autonomous driving research – Audi and Mercedes" - there are some Nim mentions in the comments: https://news.ycombinator.com/item?id=20266566
10:45:27noonieni get the sigsegv from doing `nim c file.nim`, there is no traceback
10:47:01*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:49:09vegaiearlier I asked about a possible threaded db pool design with shared memory, and I was recommended allocShared
10:49:38vegaiI'm also considering not using shared memory, but giving out db references or pointers via channels. Does that make sense?
10:50:22vegaiI should probably do more and ask less, but if that option has no chance of working, would be fun to know in advance :)
10:52:16FromGitter<mratsim> @narimiran what I'm curious about is what they are using for tensors: Tensorflow, OpenCV, Caffe/PyTorch
10:53:58*jjido joined #nim
11:09:31nooniencan i make `nim` not handle SIGSEGV? i want a coredump, and want to avoid running it in gdb directly because reasons
11:09:33FromGitter<rokups> wow what a slander on hackernews
11:09:37FromGitter<rokups> "- Nim: fast dev time; fast performance; not v1, C/C++ interop is second to none. Newruntime seems awesome"
11:09:46FromGitter<rokups> c/c++ interop is the best there is
11:10:09FromGitter<rokups> i havent seen any language that would let us use c++'s templates directly
11:12:06noonienis that a feature? don't most people use nim to avoid c++ templates?
11:14:01FromGitter<rokups> reason why c++ won language race is because c was the king and c++ provided perfect interop. given that - interop is THE FEATURE :]
11:20:09leorize[m]noonien: compile your code with -d:noSignalHandler and sigsegv will be handled by the os
11:20:39noonienit's not my code that's getting the SIGSEGV, but the nim compiler
11:22:31noonienhere's what i mean: http://ix.io/1MK3
11:22:44noonieni can't post foo.nim sadly, that's why i'm trying to debug
11:23:48leorize[m]you'd need the compiler source for that
11:24:07leorize[m]build koch then run ./koch temp c foo.nim
11:24:37noonieni can't tell `nim` to not register a SIGSEGV handler?
11:24:56leorize[m]it's a compile-time switch, sadly
11:25:08noonienah, ok :(
11:25:10nooniengdb it is then
11:25:15leorize[m]and this applies to all nim-generated code
11:25:52*couven92 quit (Ping timeout: 268 seconds)
11:26:24leorize[m]without debuginfo you might not get far...
11:27:17leorize[m]also I just saw timotheecour on nim-lang/Nim again :D the ban has been lifted I believe?
11:28:17*stefanos82 joined #nim
11:33:07*couven92 joined #nim
11:37:45Araqnoonien: -d:noSignalHandler
11:38:28noonieni tried, same issue, since this is a compiler SIGSEGV
11:39:34noonien`gdb -ex=r --args nim c foo.nim` doesn't seem to catch the SIGSEGV either
11:40:04leorize[m]you need some commands in gdb to override the handler
11:40:47*theelous3_ joined #nim
11:42:15FromDiscord_<djazz> Try ltrace or strace
11:43:28leorize[m]strace won't get null deref
11:43:54*elrood joined #nim
11:44:12noonienyeah, that's what i thought, just gave it a run to be 100% sure, i just get the write to stderr from the sighandler
11:44:35noonienfrom what i can tell, gdb should sigsegv even if the program has a signal handler
11:44:40noonienbut it does not appear to be the case
11:45:51*fredrik92 joined #nim
11:47:08*couven92 quit (Disconnected by services)
11:47:11*fredrik92 is now known as couven92
11:47:32*theelous3_ quit (Ping timeout: 245 seconds)
11:48:01*fredrik92 joined #nim
11:48:32*couven92 quit (Disconnected by services)
11:48:38*fredrik92 is now known as couven92
11:50:41vegairokups: I guess you misread "second to none" there
11:54:25*Trustable quit (Remote host closed the connection)
11:55:25FromGitter<rokups> How's that? It means "almost doesn't exist" which is complete opposite of real situation
12:00:28*Snircle joined #nim
12:02:51narimiran"second to none" == the best
12:03:08FromGitter<Vindaar> yes, was just typing that ^
12:03:34FromGitter<Vindaar> second to none -> there's nothing that makes this second in rang, so to say
12:04:21noonienyes, and he's saying c/c++ is the best there is, not nim's
12:04:41noonienit's like saying nim has the best nim interop
12:05:04narimiraninternational misreading day
12:07:25PMunchHmm, did nimble behaviour change in 0.20.0?
12:07:56PMunchnimble install on 0.20.0 doesn't copy all the files in the package, while switching to 0.19.0 works fine
12:08:40PMunchOh wait, never mind, 0.19.0 didn't work either
12:10:15*dddddd joined #nim
12:16:22*AndChat|624225 joined #nim
12:18:18PMunchHmm, nim-httpauth doesn't work any longer?
12:18:23PMunchfederico3 ^
12:18:46*envoyt quit (Ping timeout: 244 seconds)
12:20:04noonieni managed to make a repro for the SIGSEGV: http://ix.io/1MKd
12:20:17noonieni know there's an error, but there shouldn't be a SIGSEGV
12:21:25noonieni'm using a nightly: Nim Compiler Version 0.20.99 [Linux: amd64], Compiled at 2019-06-15
12:22:25*solitudesf quit (Ping timeout: 248 seconds)
12:22:31*solitudesf- joined #nim
12:25:28*solitudesf- quit (Client Quit)
12:25:59*solitudesf joined #nim
12:27:36*theelous3 joined #nim
12:28:15*Kaivo joined #nim
12:30:17leorize[m]have you filed a bug report?
12:30:30nooniennot yet, will do
12:31:10livcduhm how do i slice an array?
12:31:11krux02mratsim: are you around?
12:34:49federico3PMunch: uh?
12:44:08narimiranlivcd: `a[4 .. 7]`
12:46:50PMunchnimble install doesn't work
12:47:05PMunchAnd when I cloned it and fixed the .nimble file so it would install properly it wasn't able to compile
12:50:12*AndChat|624225 quit (Read error: Connection reset by peer)
12:50:30*envoyt joined #nim
12:52:51narimiranPMunch: `nimble -v`?
13:03:52*Vladar quit (Remote host closed the connection)
13:04:15*Vladar joined #nim
13:07:28PMunchv0.10.2
13:13:14*dwdv joined #nim
13:24:55federico3https://news.ycombinator.com/item?id=20266566 Nim pops up here
13:27:58*theelous3_ joined #nim
13:29:28shashlick_@PMunch check out nimdeps which is a good basis for an installer
13:29:32shashlick_https://github.com/genotrance/nimdeps
13:29:59shashlick_Also I've been working on a nimterop based version of nimarchive
13:32:12PMunchshashlick_, oh that does seem interesting
13:32:45PMunchWe're having a hackathon at work, so I won't be able to pursue this for a couple days though
13:33:02PMunchI actually wanted to do the installer as part of the hackathon :P
13:33:21shashlick_I made nimdeps to bundle all files at compile time
13:33:34shashlick_No compression support though
13:34:27shashlick_My goal was to carry dll files for the binary but Nim loads them too early
13:34:40shashlick_But for an installer, it works fine
13:34:42Cadeyshashlick_: what does this do that staticRead doesn't?
13:35:00Cadeyhttps://nim-lang.org/docs/system.html#staticRead%2Cstring
13:35:05shashlick_Just point to a directory/file and it will pull it in
13:35:36shashlick_It uses static read but supports directories as well
13:35:55shashlick_Plus extracts it automatically on first run if desired
13:35:59*theelous3_ quit (Ping timeout: 268 seconds)
13:36:05Cadey:+1:
13:36:42shashlick_Handles all path challenges since static read is relative to current source file rather than working dir
13:42:04PMunchHmm, trying to use db_sqlite I get an "Error: unhandled exception: unable to close due to unfinalized statements or unfinished backups [DbError]" when I run a tryExec that fails before trying to close
13:43:33*salewski joined #nim
13:45:28*theelous3 quit (Ping timeout: 245 seconds)
13:46:04salewskinarimiran, I have the impression that the "goto source" in https://nim-lang.org/docs/system.html does not work correctly.
13:46:40salewskiWhen I click on the "source" button, I always go to very wrong lines...
13:46:43narimiransalewski: your impression is correct ;) i've already sent a PR which fixes those
13:46:57salewskiThanks, bye.
13:47:01*salewski quit (Client Quit)
13:47:19narimiranwhy you don't see the changes? because there was no new version released in the mean time
13:48:45*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:49:27*Senketsu quit (Quit: WeeChat 2.5)
13:50:34*Senketsu joined #nim
13:51:42*jjido joined #nim
13:52:10narimiranin the mean time, you can use devel docs, which point to the correct source: https://nim-lang.github.io/Nim/system.html
13:56:48*Lea-kitty joined #nim
13:56:56Lea-kittyHello everybody ;)
13:57:04narimiranhi Lea-kitty
14:07:11*elrood quit (Remote host closed the connection)
14:22:39FromGitter<survivorm> Hi there. ⏎ Testing simple httpbeast app ⏎ /home/survivor/.nimble/pkgs/httpbeast-0.2.2/httpbeast.nim(287) eventLoop ⏎ /home/survivor/.nimble/pkgs/httpbeast-0.2.2/httpbeast.nim(166) processEvents ⏎ /home/survivor/.choosenim/toolchains/nim-#devel/lib/pure/asyncdispatch.nim(1562) poll ... [https://gitter.im/nim-lang/Nim?at=5d122e2f0f051738260e6fa0]
14:23:08FromGitter<survivorm> calling it with wrk -t12 -c400 -d10s http://127.0.0.1:8081/ext_request
14:23:33FromGitter<survivorm> Any ideas?
14:24:09FromGitter<survivorm> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d122e89ce7f044dab63aed7]
14:24:32FromGitter<survivorm> That's the code fragment processing the request
14:24:44FromGitter<survivorm> in browser it works just fint
14:24:52FromGitter<survivorm> fine
14:28:32*narimiran quit (Ping timeout: 272 seconds)
14:32:43Lea-kittywhat do you think about language v, i had a hard time believing it personally !
14:33:49zestyrmeh
14:33:56lqdev[m]V is a mess, somewhat of a scam imo. so many promises made, and at the last minute the author decided to add these "wip" markers everywhere on the website
14:34:12lqdev[m]also, reading through its source code, yeah it's also a mess
14:35:16lqdev[m]it doesn't really bring anything new to the table anyways, so meh
14:35:47Lea-kittylqdev[m]Hi, listen i am of the same opinion, it seems very bisare ... you think he will succeed in keeping his promises?
14:35:59Lea-kitty:)
14:36:17lqdev[m]I hope so, but I'm not interested in the language anyway. I already have Nim :)
14:37:28Cadeylet's move this to #nim-offtopic
14:37:51FromGitter<rokups> V is a testament to the fact that marketing is more important than tech
14:39:00*Vladar quit (Remote host closed the connection)
14:39:02zestyrsurvivorm: I ran into the same issue today using jester, leading to failed/pending requests (sending images specifically). As a temporary fix you can do this: `--assertions:off`
14:39:37lqdev[m]`err_needreggednick`, huh, how can I register my nick when I'm using IRC through matrix?
14:39:48*nsf quit (Quit: WeeChat 2.4)
14:39:53*floppydh quit (Quit: WeeChat 2.5)
14:40:41*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:41:21Lea-kittyi do not understand why no one is going to tell her to see her ode again before coming back or take more time, because a lot of people are interested and i feel like they're going to waste their time on it and i do not know how their make it clear that if it jumps on all new languages without thinking about their utility, community that there can b
14:41:22Lea-kittye it is useless, and yes too, i love NIM ;)
14:43:45FromDiscord_<djazz> Cadey: oh hey, didnt see you there 😉
14:45:43Cadeyo/ djazz
14:45:48leorize[m]lqdev: message the appservice-irc bot
14:46:29*theelous3 joined #nim
14:47:37lqdev[m]leorize: should I use the regular freenode nickname registration procedure?
14:47:45leorize[m]lqdev: https://github.com/matrix-org/matrix-appservice-irc/wiki/End-user-FAQ#how-do-i-registeridentify-to-nickserv
14:47:46leorize[m]yes
14:48:09FromDiscord_<djazz> you can group your nicks
14:48:42FromDiscord_<djazz> `/msg nickserv group main_nick password`
14:52:48FromGitter<survivorm> @zestyr thanx, i'll try
14:54:48*leorize joined #nim
14:55:06lqdev[m]leorize: the channel description for #freenode_#nim-offtopic:matrix.org mentions a password, is there anything I need to do with that?
14:56:32leorizeno, it was for the twitch stream IIRC
14:56:46leorizedom96 might be able to elaborate on that
14:56:47lqdev[m]ah
14:58:04cfv[m]<lqdev[m] "V is a mess, somewhat of a scam "> I agree.
14:58:18cfv[m]<FromGitter "<rokups> V is a testament to the"> Good point.
14:58:33cfv[m]It's a big mess about anything
14:59:36FromGitter<alehander42> not a scam, just a very alpha project
14:59:39FromGitter<alehander42> and offtopic
14:59:58*Jesin quit (Ping timeout: 244 seconds)
15:00:06FromGitter<alehander42> btw that messaging thing, is there history of your irc personal convos
15:00:16FromGitter<alehander42> or does this depend on a person's client/bouncer
15:00:28FromGitter<alehander42> hm, this is offtopic as well nvm
15:01:02cfv[m]V tries to attract people with huge promises (Ultra-fast compile time, microbinaries, etc...) but it's actually too young and it doesn't seem to be a good tool for medium and big projects
15:01:13cfv[m]Maybe it works for something very small
15:01:26FromGitter<alehander42> well most lang projects require many years to mature
15:01:29cfv[m]While it pretends to work for huge programs
15:01:36cfv[m]<FromGitter "<alehander42> well most lang pro"> Yeah
15:01:56FromGitter<alehander42> that's a reason i like experimental languages
15:01:58lqdev[m]a very alpha project which makes so many promises you can't believe it's true
15:02:11FromGitter<alehander42> i dream for a simpler framework
15:02:21FromGitter<alehander42> which lets you easily define different type systems
15:02:29FromGitter<alehander42> grammars/cfg passes etc
15:02:31cfv[m]Like Nim. It's been around since 2005 and now, 14 years after, it is nearly mature
15:03:01FromGitter<alehander42> for experimenting with memory safety, linear types and other features
15:03:16FromGitter<alehander42> something like racket maybe
15:03:22FromGitter<alehander42> maybe i should play with it more
15:04:04lqdev[m]I tried racket's GUI and gave up after 5 minutes
15:04:12lqdev[m]it produces huge executables
15:04:20FromGitter<alehander42> basically something that lets you define different features for simple languages with 4-5 data structures to focus on the lang stuff
15:04:28lqdev[m]15 MB for a single crappy window
15:04:34FromGitter<alehander42> maybe codegen as well
15:04:38cfv[m]<FromGitter "<alehander42> something like rac"> I don't like Lisp-scheme programming languages
15:04:44FromGitter<alehander42> yeah me too
15:04:51FromGitter<alehander42> but i mean as a flexible system
15:05:03FromGitter<alehander42> afaik racket is very flexible and you can tweak almost every component
15:05:11cfv[m]Nim is very flexible
15:05:14FromGitter<alehander42> otherwise i dont care much about lisp syntax
15:05:18FromGitter<alehander42> eh not so much
15:05:27FromGitter<alehander42> i cant really put on another type system or read macros
15:05:29FromGitter<alehander42> `read` macros
15:05:45FromGitter<alehander42> and this is good, nim's goal is to be general purpose
15:05:52FromGitter<alehander42> so some limitations are needed
15:06:08FromGitter<alehander42> and also nim is a big language
15:06:12cfv[m]<FromGitter "<alehander42> so some limitation"> Obviously
15:06:31cfv[m]Any language has its limitations
15:06:52FromGitter<alehander42> what i imagine is e.g.
15:06:54FromGitter<alehander42> a library
15:07:01FromGitter<alehander42> that defines how the type system rules
15:07:02FromGitter<alehander42> work
15:07:06*theelous3_ joined #nim
15:07:10FromGitter<alehander42> so you can compile your code with different ones
15:07:17FromGitter<alehander42> which yeah creates dialects
15:07:23FromGitter<alehander42> but thats fine for toy languages
15:08:06cfv[m]Do you mean a framework?
15:08:17FromGitter<alehander42> yeah i use
15:08:25FromGitter<alehander42> a framework yeah
15:08:29cfv[m]A framework is a sort of "dialect" intended for a certain use
15:08:35FromGitter<alehander42> no
15:08:40AraqNim is not *that* big.
15:08:44FromGitter<alehander42> i mean that you can use the same annotation mechanism
15:09:03FromGitter<alehander42> but you have different "type" rule systems
15:09:12FromGitter<alehander42> and they are hooked to your compile time
15:09:16FromGitter<alehander42> the same with codegen etc
15:10:08FromGitter<alehander42> so basically you ⏎ ⏎ define grammar ⏎ define type rule system (with custom code as well) ⏎ define additional visitors ... [https://gitter.im/nim-lang/Nim?at=5d123950f68cef3827c29db6]
15:10:26FromGitter<alehander42> with dsl-s with the ability to add custom code for your logic
15:10:31Araq"compiler compilers" do exist
15:10:49FromGitter<alehander42> i remember jetbrains had something like that?
15:10:55FromGitter<alehander42> mps?
15:10:55Araqyup
15:14:03Araqso ... what type system extensions do you think you can add? co-variance and contra-variance is months of work in most commercial compilers.
15:14:46Araqborrow checking was years of work for Rust.
15:15:55FromGitter<alehander42> hm i just wanted to experiment with some nim-related things
15:16:46Araqtype systems are super hard. They don't always look like that
15:18:40FromGitter<alehander42> my reasons were egoistic
15:18:43FromGitter<alehander42> i wanted to make my own language
15:18:50Araqthat's fine
15:18:53FromGitter<alehander42> but i often overgeneralize massively
15:19:02Araq^ exactly.
15:19:05FromGitter<alehander42> and decide "ok, i am not sure if i want A B or C component"
15:19:21FromGitter<alehander42> so let's make a way to have them all as options so one can decide later
15:19:27FromGitter<alehander42> after actually using / testing them
15:19:46Araqyeah, so you don't decide and say "in my lang it's up to the programmer, one can write type extensions"
15:19:52FromGitter<alehander42> not really
15:19:59FromGitter<alehander42> i wanted to be able to test quickly
15:20:07FromGitter<alehander42> different lang ideas
15:20:16FromGitter<alehander42> e.g. in the same way you test newruntime
15:20:26FromGitter<alehander42> but on a simpler more hackable language
15:20:39FromGitter<alehander42> i know that real languages have 10x edge cases and requirements
15:20:52leorizeAraq: out of curiosity: did you make any other language before Nim?
15:21:04FromGitter<alehander42> but on the other hand one can try more things with a simple prototype
15:21:25*couven92 quit (Quit: Client disconnecting)
15:21:30Araqbut that's the thing... you don't find all the edge cases with the "simple prototype", maybe you find some.
15:21:42Cadeytype systems are a tarpit
15:21:46Cadeythey look simple
15:22:08FromGitter<alehander42> well i guess if you include sum types, function types and collections and pointers you can still find most problems
15:22:22Araqif you are successful then you'll have users.
15:22:35FromGitter<alehander42> but my point isnt really to be succesful but to experiment
15:22:36Araqand your users will find issues. thousands of them.
15:22:40FromGitter<alehander42> because often people decide
15:22:42AraqSee Nim. ;-)
15:22:47FromGitter<alehander42> this feels like the right way
15:23:01FromGitter<alehander42> because its too hard to write 2-3 different subsystems
15:23:12CadeyNim is a tool I wish I could use more
15:23:14AraqNim originally started simple too, my goal was to not exceed a 20_000 line implementation
15:23:17FromGitter<alehander42> but if its a very small core prototypish language
15:23:57FromGitter<alehander42> you can almost "metrics" it because you can say : this system catches those cases for this programs, takes Y lines, makes N assumptions
15:23:57Araqleorize[m]: no, I created DSLs and preprocessors though
15:24:11FromGitter<alehander42> ok, a little bit optimistic
15:24:32FromGitter<alehander42> Araq yeah but i feel Nim is a general purpose language with the additional goal of flexibility
15:24:44FromGitter<alehander42> its normal to start supporting all kinds of stuff
15:25:26FromGitter<alehander42> a language "system" that i describe will work badly for an end user because each combo of "syntax" + "types" + "codegen" would result in a different language basically
15:25:48FromGitter<alehander42> but the biggest problem is that
15:26:05FromGitter<alehander42> usually assumptions from the type/optimizer passes might continue in the codegen
15:26:56FromGitter<alehander42> but that actually is an optimizer responsibility: the codegen can always receive low level simple IR
15:27:00FromGitter<alehander42> nvm
15:29:01FromGitter<alehander42> Araq where do people use dsl-s in the industry
15:30:45AraqI don't know. Either everywhere or hardly anywhere. HTML+CSS+JS is a set of DSLs, no?
15:31:32Araqflex and bison are popular in some circles.
15:32:11FromGitter<alehander42> i wondered where those custom dsl-s e.g. those you wrote are used
15:33:08FromGitter<alehander42> i guess developer tools and maybe scientific code, most users probably hate dsl-s
15:33:33FromGitter<Vindaar> Hm, my `toSeq(values(someTable))` and `toSeq(keys(someTable))` don't work anymore. Was something changed on devel? It complains they're.... iterators. Well, duh.
15:35:08Araqhttps://en.wikipedia.org/wiki/Linear_temporal_logic https://en.wikipedia.org/wiki/CTL* more DSLs ;-)
15:35:14leorizePMunch: do you have any plans for having Nim's `devel` on the playground?
15:36:17Araqvindaar: please report it properly
15:37:26Araq(my own DSLs were only used by myself :P )
15:37:50*tjmac quit (Quit: -bye)
15:38:37FromGitter<Vindaar> I guess that means it's not a desired change :D I'll see if I can extract an example
15:42:21*natrys joined #nim
15:44:43*Lea-kitty quit (Ping timeout: 260 seconds)
15:51:28FromGitter<Vindaar> Ah, I just hit this: https://github.com/nim-lang/Nim/issues/7322
15:53:31PMunchleorize, not anything in particular
15:53:43PMunchBut I have been thinking about adding a version selector
15:54:15PMunchI just wanted to think more about how/if I could do nimble packages, because that might influence the design
15:54:35PMunchAnd ATM I've locked myself out of the server (which is why the playground is currently down..)
15:59:07FromGitter<alehander42> Araq good
15:59:22FromGitter<alehander42> yeah dsl-s are additicive
16:02:57*theelous3_ quit (Ping timeout: 245 seconds)
16:05:10FromGitter<kayabaNerve> But can V compile Doom 3 in 0.5 seconds? /s
16:05:38disrupteksql has its enthusiasts.
16:07:20FromGitter<Varriount> narimiran: You called?
16:08:02FromGitter<kayabaNerve> Isn't Script a DSL?
16:10:25FromGitter<alehander42> sql is a language imo
16:10:46FromGitter<arnetheduck> domain-specific-language.. so it depends on how you define your domain?
16:10:56FromGitter<alehander42> kinda yeah
16:11:03FromGitter<alehander42> ok in this sense it is a dsl indeed
16:11:31FromGitter<alehander42> i usually think of language lib dsl-s like rails
16:11:33FromGitter<alehander42> sorry
16:15:18*theelous3 quit (Ping timeout: 252 seconds)
16:16:23PMunchHmm, trying to use int.high as the value for an enum gives this weird error http://ix.io/1ML7/
16:16:47AraqPMunch: saw my gist?
16:17:03PMunchUhm, no?
16:17:16Araqcheck today's logs then please
16:17:35FromGitter<kayabaNerve> If Scipt counts, then I'm working on a DSL. Fun stuff.
16:17:44PMunchAraq, just found it :)
16:19:46PMunchSo it creates a directory listing as a file of some sort?
16:19:59PMunchOr an archive I guess
16:22:31PMunchOh, and it self extracts from the executable. That's nice
16:30:11PMunchUuuhm, parseEnum hangs..
16:30:29PMunchOuch..
16:30:35*Trustable joined #nim
16:30:51PMunchI had an "enum Role = User, Admin = uint32.high"
16:31:05PMunchSo that I could add a bunch of stuff between User and Admin if I needed to
16:31:13PMunchApparently parseEnum loops over this..
16:33:50leorizeenums with holes are evil
16:33:53leorize:p
16:34:07FromGitter<Vindaar> if you already use an enum anyways, what's the point of separating the two by those values?
16:34:10*drewr quit (Remote host closed the connection)
16:34:28leorizeprobably for storing into an sql database
16:35:07disrupteksorting or masks.
16:36:25*drewr joined #nim
16:37:14disruptekanyway, Admins will always self-position as far as possible from Lusers; it's just the natural state. You can set them closer, but the Admins will force-direct themselves to the top of the range every time.
16:37:52FromGitter<Vindaar> ^ you lost me
16:39:11disruptekalt.sysadmin.recovery humor.
16:40:42noonienhow can i enable lto for release?
16:48:30solitudesfhttps://github.com/SolitudeSF/dot/blob/master/nim.nim#L35 you can put something like that in config.nims
16:48:58nooniengreat, thanks!
16:53:08stefanos82question: from a folder 'example' that contains subfolders 'foo' and 'bar', how can I call foo's module from inside 'bar'?
17:03:58FromDiscord_<djazz> solitudesf: how does that wasm switch work?
17:04:10FromDiscord_<djazz> what code can i try with it?
17:06:35*leorize quit (Quit: WeeChat 2.3)
17:07:05*leorize joined #nim
17:23:38*laaron quit (Remote host closed the connection)
17:24:40*lmariscal joined #nim
17:34:32solitudesfi got it to spit out the binary. i never verified it actually working.
17:45:45FromGitter<kayabaNerve> If I have to work with UTF-8 NFKD from Nim, what's my best option?
17:50:43AraqNFKD?
17:50:49FromGitter<kayabaNerve> According to this RFC https://github.com/nim-lang/RFCs/issues/47, nightly Nim supported NFKD, yet the proposed lib may or may not. Is that still true?
17:51:14FromGitter<kayabaNerve> Araq: https://unicode.org/reports/tr15/
17:51:20*dddddd quit (Remote host closed the connection)
17:51:49FromGitter<kayabaNerve> To be honest, I hate Unicode and would like to not touch it all. I know the bare minimum about how it works, yet I'm using a spec which requires hashing UTF-8 NFKD bytes.
17:52:18FromGitter<kayabaNerve> So beyond Unicode links, I can't really answer too many questions, sorry.
17:53:01*dddddd joined #nim
17:54:42FromGitter<kayabaNerve> I may just want to do a C FFI...
17:58:05FromGitter<kayabaNerve> Oh fun. Unicode even has a FAQ. https://unicode.org/faq/normalization.html
18:03:22Araqthere is a "unicode" nimble package that offers it? not sure
18:04:17*neceve quit (Remote host closed the connection)
18:05:42FromGitter<kayabaNerve> ... it turns out when that GitHub issue said "nitely" it didn't mean "nightly". It meant "nitely". https://github.com/nitely/nim-normalize.
18:06:05FromGitter<kayabaNerve> Guess I should've looked at the nimble options before trying to stick with the stdlib as adding the dep is just the best route.
18:06:13FromGitter<kayabaNerve> Thanks for the help Araq :D
18:10:41*lmariscal quit (Quit: lmariscal)
18:13:39*jjido joined #nim
18:29:08*stefanos82 quit (Quit: Quitting for now...)
18:36:19FromGitter<juancarlospaco> Hi
18:41:37*nsf joined #nim
18:43:20FromDiscord_<djazz> Hello
18:44:09*Vladar joined #nim
18:50:12*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:51:46*theelous3 joined #nim
18:59:27*narimiran joined #nim
19:00:12*narimiran quit (Remote host closed the connection)
19:03:22*narimiran joined #nim
19:15:25*crem quit (Ping timeout: 250 seconds)
19:16:59*crem joined #nim
19:21:34*Voltist joined #nim
19:25:18FromGitter<arnetheduck> @kayabaNerve what would you prefer *over* unicode, in dealing with human linguistic creativity? :)
19:27:11VoltistHi everyone. I'm enjoying Nim and looking to contribute; so I'm working on issue #11572 (full paths to imported files in binaries). I've had a failed pull request or two, but I think
19:27:43VoltistWhat I am going to do is make the opt:size flag hide the full paths in the binary.
19:28:02Araqit's now covered by -d:release and -d:danger
19:28:20VoltistNot according to that issue
19:28:33VoltistHow recent is 'now'?
19:28:38Araqyesterday
19:29:15VoltistAh, I see
19:29:25VoltistThat issue should be closed
19:30:19Araqit's still not solved entirely
19:30:45FromDiscord_<djazz> Hi, I reported that issue (:
19:30:58VoltistHey!
19:31:25VoltistI'm the numpty that has been trying to work on it
19:32:59VoltistAraq: how is not yet entirely solved?
19:33:25Araqthe compiler likes ../../../home/voltist/ paths
19:33:33Araqwhich leak as much information :P
19:35:09VoltistThe -d:release and -d:danger flags don't hide those?
19:36:23leorizeyea, it's due to how they're stored
19:36:53leorizesome logic should be added for files outside of the project that's being compiled
19:37:44leorizeVoltist: so this is where the file name is introduced https://github.com/nim-lang/Nim/blob/1255b3c8647c2ad4be831698633eaf2f4a38795c/compiler/ccgstmts.nim#L690
19:41:04VoltistSo is the `toFileName(p.config, t.info)` responsible for actually generating the file path?
19:43:18Araqyes but keep in mind that the macro system also exposes full paths
19:43:24Araqand that we have a JS codegen
19:48:24FromGitter<kayabaNerve> @arnetheduck Hmmmmmmmm
19:48:30FromGitter<kayabaNerve> ASCII and PNG /s
19:48:35PMunchHmm, I've got a server than is connected to a back-end and does some authentication stuff with Radius/AD. Would Karax be a good fit for a front-end?
19:49:01PMunchLike does it handle cookies with ajax requests?
19:49:13PMunchI guess that's the way I would have to communicate with the server
19:49:23Voltist@Araq, so if I could find the part of the JS code gen as well, then implement that extra logic, that should be good. What would be the best way for it to handle external paths, I wonder.
19:57:01AraqVoltist: please check the PR queue, people are working on it
19:57:16VoltistOK, thanks!
19:59:07lqdev[m]you know, every time I switch from Nim to a different language I miss one thing
19:59:15lqdev[m]that thing… it's `result`
19:59:41lqdev[m]I hate having to declare this variable manually
19:59:46lqdev[m]it just clutters code
20:01:35VoltistAnd the proc deceleration format. It just makes sense in Nim; procs and functions in other languages feel weird when declaring them.
20:02:58*theelous3_ joined #nim
20:03:33*Voltist quit (Quit: Quit)
20:09:53*dwdv quit (Quit: quit)
20:10:35lqdev[m]indeed, it weels weird in mostly C derivatives imo
20:10:59*Vladar quit (Remote host closed the connection)
20:15:21PMunchlqdev[m], I liked result much more than I thought I would
20:16:08PMunchI always end up missing macros and templates :P
20:16:21PMunchBut I think I might like them a bit too much :P
20:16:27leorizeAraq: any good idea for the ../../home paths? or should we just get the file name portion of it?
20:16:38lqdev[m]same here
20:17:34leorizeresult is one of the thing that keeps me writing pascal before I found Nim :)
20:19:46PMunchHmm, I'm stil looking for a good workflow for my server/frontend combo
20:19:56PMunchI mean Karax worked great for the playground front-end
20:23:50*theelous3_ quit (Ping timeout: 272 seconds)
20:27:34*nsf quit (Quit: WeeChat 2.4)
20:30:53FromGitter<zetashift> But? :P
20:31:32PMunchI don't know, I feel it would be awkward to use when the server needs to do a lot of stuff
20:31:35PMunchBut maybe not
20:31:54PMunchI've already started writing it in Karax, so we'll see
20:32:08*narimiran quit (Ping timeout: 245 seconds)
20:38:03*theelous3_ joined #nim
20:38:06*PMunch quit (Remote host closed the connection)
20:41:13Araqleorize: just hard code the knowledge about /home, /Users and C:\Users
21:00:46*Trustable quit (Remote host closed the connection)
21:19:25*solitudesf quit (Ping timeout: 246 seconds)
21:39:43*steshaw joined #nim
21:50:14*sagax quit (Write error: Connection reset by peer)
22:10:09*abm quit (Ping timeout: 248 seconds)
22:27:44*natrys quit (Quit: natrys)
22:53:27*envoyt quit (Ping timeout: 268 seconds)
23:24:32*krux02_ joined #nim
23:27:14*krux02 quit (Ping timeout: 252 seconds)