00:09:01 | rayman22201 | @Skaruts, here is the template version of popBack, just fyi: |
00:09:14 | rayman22201 | https://www.irccloud.com/pastebin/sYITKQJ8/ |
00:10:25 | rayman22201 | you probably don't need it though. It's the ast macro equivalent of "force inline" for the function. So meh. |
00:12:23 | Araq | it evaluates 'a' twice, bug :P |
00:15:01 | FromDiscord_ | <Skaruts> @Araq what if x1 is a member variable, for example in a Rect object? |
00:15:26 | FromDiscord_ | <Skaruts> so I could do rect.x or rect.x1, would that template still work? |
00:18:50 | FromDiscord_ | <Skaruts> @rayman thanks, I'll try that one too |
00:19:07 | rayman22201 | wouldn't the function also evaluate 'a' twice? I'm not sure I see the bug :/ |
00:19:10 | rayman22201 | @Araq |
00:19:45 | FromDiscord_ | <Skaruts> me neither, but I'm still a Nim peasant so... |
00:20:01 | rayman22201 | also, yeah, you can use the "alias template" to access member vars |
00:20:33 | FromDiscord_ | <Skaruts> what's with the untyped though? |
00:21:02 | rayman22201 | it'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:07 | FromDiscord_ | <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:59 | FromDiscord_ | <Skaruts> and the Rect object only takes ints |
00:22:02 | rayman22201 | No, 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:05 | rayman22201 | It'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:23 | FromDiscord_ | <Skaruts> ah ok |
00:25:55 | Araq | rayman22201: well it's the same as a #define, watch out for eval twice problems |
00:27:41 | FromDiscord_ | <Skaruts> geometry.nim(66, 26) Error: type mismatch: got <Rect> |
00:27:41 | FromDiscord_ | <Skaruts> but expected one of: |
00:27:42 | FromDiscord_ | <Skaruts> template x1(): untyped |
00:27:42 | FromDiscord_ | <Skaruts> |
00:27:42 | FromDiscord_ | <Skaruts> expression: x1(self) |
00:28:11 | FromDiscord_ | <Skaruts> line 66 `result.x = int( (self.x1 + self.x2) div 2 )` |
00:28:39 | FromDiscord_ | <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:42 | FromDiscord_ | <Skaruts> type Rect* = ref object of RootObj |
00:31:42 | FromDiscord_ | <Skaruts> x*, y*, x2*, y2*, w*, h*:int |
00:31:42 | FromDiscord_ | <Skaruts> pos*, size*:Point |
00:31:53 | rayman22201 | https://www.irccloud.com/pastebin/nv8n4jAp/ |
00:33:04 | rayman22201 | @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:42 | rayman22201 | it's trying to call "x1(self)~ -- the template. But the template doesn't take any arguments. |
00:34:02 | rayman22201 | jesus. I fat fingered that |
00:34:23 | rayman22201 | x1.self == x1(self) # this is a template call |
00:34:56 | FromDiscord_ | <Skaruts> can I get around it? |
00:35:04 | Araq | just use 'x1' and not 'x' consistently or the other way round |
00:36:19 | FromDiscord_ | <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:10 | FromDiscord_ | <Skaruts> I could swear I did this before though... when I learned about templates, an eternity ago |
00:39:09 | rayman22201 | maybe: `template x2(self : untyped): untyped = self.x1` |
00:39:12 | FromDiscord_ | <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:34 | FromDiscord_ | <Skaruts> the only problem when I do rect.x = 10, the other one is neglected |
00:41:05 | * | envoyt joined #nim |
00:41:36 | FromDiscord_ | <Skaruts> @rayman oh that seems to work |
00:42:05 | FromDiscord_ | <Skaruts> everything is running ok at least, and nothing exploded |
00:42:33 | rayman22201 | if this is your kind of thing, you may enjoy this library: https://github.com/zevv/with |
00:44:45 | FromDiscord_ | <Skaruts> not sure |
00:46:22 | rayman22201 | lol. Fair enough. Just throwing it out there. Glad the simple solution is working for you though. |
00:47:09 | FromDiscord_ | <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:28 | FromDiscord_ | <Skaruts> I'm learning as I go |
00:48:21 | FromDiscord_ | <Skaruts> been many months away from Nim though, so I forgot much of what I read in the manual and tutorial |
00:48:45 | FromDiscord_ | <Skaruts> I read it quite attentively back then |
00:49:12 | rayman22201 | you have a good rule of thumb in general. I just like templates and macros too much... I'm one of *those* people. |
00:49:15 | rayman22201 | 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:40 | FromDiscord_ | <Skaruts> noted |
00:50:19 | rayman22201 | Good news is that manual probably got way better since you last looked :-) |
00:51:11 | FromDiscord_ | <Skaruts> I read it somewhat cursorily again maybe 4 or 5 months ago |
00:51:43 | FromDiscord_ | <Skaruts> I still refer to all of that when I need though, I was just there looking for that pop equivalent |
00:52:28 | FromDiscord_ | <Skaruts> it's a bit too technical though 😃 |
00:53:13 | FromDiscord_ | <Skaruts> or maybe it's just me |
00:53:17 | rayman22201 | That's why we have the tutorials |
00:53:31 | rayman22201 | https://nim-lang.org/learn.html |
00:53:37 | FromDiscord_ | <Skaruts> indeed |
00:54:04 | rayman22201 | we probably need more of those actually :-) |
00:54:18 | FromDiscord_ | <Skaruts> nim by example isn't bad either |
00:54:37 | rayman22201 | yeah |
00:55:42 | rayman22201 | ok. dinner time for me. gn |
00:57:46 | FromDiscord_ | <Skaruts> I wonder why the guys that made the wrappers for libtcod and sfml didn't abstract type castings |
00:58:17 | FromDiscord_ | <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:00 | FromDiscord_ | <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:06 | FromDiscord_ | <djazz> Would be nice if the stdlib supported shift() etc |
04:16:12 | FromDiscord_ | <djazz> On seqs |
04:17:12 | * | Voltist joined #nim |
04:17:29 | Tanger | djazz: https://forum.nim-lang.org/t/2552 |
04:20:28 | * | Voltist quit (Remote host closed the connection) |
04:29:42 | FromDiscord_ | <djazz> Saw that, heh. |
04:31:15 | FromDiscord_ | <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:33 | narimiran | @djazz regarding pop'ing from the beginning of the list: |
05:17:12 | narimiran | 1. do you know that's an expensive (O(n)) operation? |
05:17:34 | FromDiscord_ | <demotomohiro> How to stringfy untyped argument in template? |
05:17:36 | FromDiscord_ | <demotomohiro> https://wandbox.org/permlink/lBQBT01eJhQyrACg |
05:17:47 | narimiran | 2. 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:07 | FromDiscord_ | <djazz> Thanks, good to know |
05:22:30 | FromDiscord_ | <demotomohiro> Im sorry, I posted wrong URL |
05:22:32 | FromDiscord_ | <demotomohiro> https://wandbox.org/permlink/0EgIJzAMxo6km31t |
05:24:47 | * | leorize quit (Quit: WeeChat 2.3) |
05:34:53 | FromDiscord_ | <demotomohiro> I can make a macro that can do same thing |
05:34:55 | FromDiscord_ | <demotomohiro> https://wandbox.org/permlink/SFJJntMiaXksqGoL |
05:36:54 | FromDiscord_ | <demotomohiro> An untyped argument in template cannot be stringify? |
05:40:59 | narimiran | @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:50 | vegai_ | the multisync macro seems amazing |
06:07:03 | vegai_ | is there some downsides that are not readily obvious |
06:07:26 | vegai_ | 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:51 | leorize | Araq: should stacktraces in VM follow excessiveStackTrace or listFullPaths? |
06:36:31 | PMunch | Oh by the way, the listFullPaths sometimes lists the paths of the TravisCI |
06:36:48 | * | nolanv joined #nim |
06:37:08 | leorize | yea, I'm fixing that |
06:43:34 | * | leorize quit (Remote host closed the connection) |
06:43:36 | PMunch | Good :) |
06:44:01 | PMunch | dom96, still haven't had access to the playground? :( |
06:44:51 | FromGitter | <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:22 | livcd | is playground dead? |
06:47:34 | * | leorize joined #nim |
06:57:37 | leorize | lol, some logic in the compiler introduces paths like: ../home/<snip>/system.nim |
06:59:37 | PMunch | livcd, yes.. |
06:59:38 | * | laaron quit (Remote host closed the connection) |
06:59:53 | * | laaron joined #nim |
06:59:54 | PMunch | I 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:44 | leorize | at least we know it's not hacked :P |
07:00:55 | PMunch | livcd, 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:14 | PMunch | leorize, oh yeah, if anyone hacks it now I'd be surprised :P |
07:04:44 | * | gmpreussner joined #nim |
07:06:06 | FromGitter | <alehander42> @rokups |
07:06:09 | FromGitter | <alehander42> example? |
07:06:39 | FromGitter | <alehander42> loops? and which debugging options, usually it has to do with templates and iterators |
07:06:42 | * | tjmac joined #nim |
07:08:33 | FromGitter | <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:07 | FromGitter | <alehander42> yeah, you're write, this is inline |
07:12:18 | FromGitter | <alehander42> right* ops |
07:12:38 | FromGitter | <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:57 | Araq | > should stacktraces in VM follow excessiveStackTrace or listFullPaths? |
07:14:03 | Araq | argh. I don't know |
07:14:49 | FromGitter | <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:03 | Araq | excessiveStackTrace? |
07:15:25 | Araq | rokups: we spent some effort in improving these problems but it's never perfect |
07:16:27 | FromGitter | <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:52 | FromGitter | <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:55 | leorize | Araq: as promised: https://github.com/nim-lang/Nim/pull/11583 |
07:19:12 | leorize | but this wouldn't solve the "path leaking to generated binary" |
07:19:48 | leorize | on *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:08 | Araq | arnetheduck: I'm not sure how much effort it would be but I'll look into it |
07:32:57 | PMunch | Hmm, is there a way to zip something on compile-time? |
07:33:09 | PMunch | For embedding statically into the executable |
07:33:48 | leorize | you can use `zip` |
07:33:54 | * | envoyt quit (Ping timeout: 252 seconds) |
07:33:55 | leorize | with staticExec ofc |
07:34:11 | leorize | but I don't think it have output to stdout |
07:34:16 | * | envoyt joined #nim |
07:34:51 | leorize | oh, you can |
07:36:06 | leorize | const zipped = staticExec("zip -@", listOfFileSeparatedByNL) |
07:36:30 | leorize | or const ziped = staticExec("zip", staticRead "file to be zipped") |
07:36:33 | leorize | PMunch: ^ |
07:38:09 | PMunch | Hmm yeah, on Linux that works |
07:38:17 | PMunch | But on Windows that would be trickier |
07:38:24 | PMunch | Or does it have zip as well? |
07:38:36 | leorize | if you install it |
07:38:42 | leorize | chocolatey should have it |
07:39:18 | FromDiscord_ | <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:52 | PMunch | djazz, certainly a possibility :P |
07:45:05 | PMunch | I'm just toying with the idea of creating installers in Nim |
07:45:29 | PMunch | So I would want to pack content statically into an executable, and of course preferably in zip or another compressed format |
07:45:48 | FromDiscord_ | <djazz> Aha |
07:46:21 | FromDiscord_ | <djazz> tar + gzip or xz/lzma would be neat |
07:46:31 | PMunch | And 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:18 | FromDiscord_ | <djazz> On Linux/mac its super easy to make a self extracting shell script, assuming unzip/tar is available |
07:47:35 | FromDiscord_ | <djazz> Data can be appended to the end of script |
07:47:45 | FromDiscord_ | <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:07 | FromDiscord_ | <djazz> I know I have done with NW.js (nodewebkit) |
07:48:24 | FromDiscord_ | <djazz> Runtime exe, then js code concated to it |
07:48:29 | * | vegai_ joined #nim |
07:48:53 | FromDiscord_ | <djazz> Not sure how you get the size of the original exe to get the right offset though |
07:49:24 | FromDiscord_ | <djazz> That way you dont need to recompile to change data. |
07:50:16 | * | leorize quit (Ping timeout: 260 seconds) |
07:50:20 | PMunch | I mean something like this works for embedding files: http://ix.io/1MJv/Nim |
07:50:24 | FromDiscord_ | <djazz> And then link zlib etc statically |
07:51:08 | * | vegai_ is now known as vegai |
07:51:16 | PMunch | But 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:31 | leorize[m] | wrap libarchive for nim then use tar + xz for superior compression performance :p |
07:54:33 | * | vegai joined #nim |
07:54:44 | FromDiscord_ | <djazz> ^ |
07:55:58 | FromDiscord_ | <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:45 | FromDiscord_ | <djazz> If the offset can be figured out |
07:59:26 | FromDiscord_ | <djazz> https://www.strchr.com/creating_self-extracting_executables |
08:00:21 | FromGitter | <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:53 | leorize[m] | but for transport xz is still better |
08:01:34 | leorize[m] | zstd is better for streaming content |
08:02:54 | FromDiscord_ | <djazz> xz is slow to compress :/ |
08:03:08 | leorize | not that it matters when you are creating an installer :p |
08:03:29 | PMunch | Yeah 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:49 | FromDiscord_ | <djazz> https://www.systutorials.com/docs/linux/man/1-unzipsfx/ |
08:09:59 | * | dwdv joined #nim |
08:11:16 | PMunch | Again though I need a cross-platform solution |
08:12:41 | FromDiscord_ | <djazz> Yes... |
08:13:12 | FromDiscord_ | <djazz> You want the create_installer exe to make a new exe? |
08:13:21 | FromDiscord_ | <djazz> Compiled or existing |
08:13:47 | FromDiscord_ | <djazz> Something similar to unzipsfx |
08:14:18 | leorize | staticRead should be fine for starters... |
08:14:35 | leorize | more complicated solutions like embedding to the end of file can be explored later |
08:14:44 | FromDiscord_ | <djazz> Also, on windows, .msi files are basically self extracting installers. Supports uninstalling too |
08:17:13 | Araq | PMunch, on windows and Linux you can append a binary blob to the .exe |
08:17:23 | Araq | then you write the size of the blob at the very end |
08:17:35 | Araq | then at runtime you read the length and extract the blob |
08:17:54 | leorize | use NESM and write a footer with payload data :) |
08:18:05 | Araq | it works but it mostly re-invents a "resource compiler" |
08:18:36 | Araq | mingw ships with a resource compiler, use it |
08:19:17 | Araq | or use my Nim implementation that does that that I never released as a Nimble package :-/ |
08:19:29 | Araq | or anywhere else... |
08:19:32 | FromDiscord_ | <djazz> 😂 |
08:19:51 | FromDiscord_ | <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:57 | leorize | so italics on discord results in /me for irc? |
08:21:08 | FromDiscord_ | <djazz> Oh really |
08:21:08 | FromGitter | <arnetheduck> what's everyone using on windows btw? msys2? or some other mingw? |
08:21:23 | leorize | I use msys2 |
08:21:39 | leorize | their Nim is horribly outdated though, but I only use the mingw part of msys anyway |
08:22:54 | PMunch | djazz, 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:46 | FromDiscord_ | <djazz> Ah, I see |
08:25:50 | FromDiscord_ | <djazz> So the creator is a nim module, or? |
08:26:39 | leorize | then staticRead is more than enough |
08:26:46 | FromDiscord_ | <djazz> Yeah |
08:26:53 | leorize | compression can be done via 7z command line if desired |
08:27:07 | PMunch | Well 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:55 | PMunch | Sorry if my descriptions are a bit vague, I'm currently in a meeting :P |
08:28:59 | FromDiscord_ | <djazz> On mac, do you want a custom installer too? Usually they are .dmg files and you drop the .app in /Applications |
08:29:12 | leorize | PMunch: hanging out on IRC in a meeting, nice :) |
08:31:54 | PMunch | djazz, this is only targetting Windows |
08:32:32 | FromDiscord_ | <djazz> "Again though I need a cross-platform solution" |
08:32:58 | leorize | for creating windows installers :p |
08:33:18 | PMunch | leorize, it's pretty low-key. We're having a hackathon :) |
08:33:23 | FromDiscord_ | <djazz> Aah |
08:33:32 | PMunch | djazz, 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:46 | PMunch | (and wine, so I can test it from my Linux machine :P) |
08:34:16 | PMunch | This way a Linux build server could easily spit out ready-made Windows installers |
08:35:39 | leorize | well, 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:02 | FromDiscord_ | <djazz> Well, I would make a precompiled exe and add assets, metadata and compressed data to the exe |
08:36:19 | FromDiscord_ | <djazz> That way no need to compile something everytime |
08:36:36 | FromDiscord_ | <djazz> Only need mingw etc once |
08:38:33 | FromDiscord_ | <djazz> This reminds me of MojoSetup btw https://icculus.org/mojosetup/ |
08:39:58 | FromDiscord_ | <djazz> https://hg.icculus.org/icculus/mojosetup/raw-file/tip/docs.txt |
08:39:59 | PMunch | leorize, yes you would still need to sign it |
08:40:02 | PMunch | Unfortunately.. |
08:40:22 | PMunch | Well, fortunately that you need to sign, but unfortunately that it isn't trivial to do from Linux |
08:40:38 | PMunch | It's currentyl the only manual step I need to do to create installers.. |
08:40:58 | PMunch | But my current method relies on running InnoSetup under Wine, and InnoSetup is fairly horrible |
08:41:36 | FromDiscord_ | <djazz> Ah, signing, right.. |
08:42:20 | leorize | PMunch: mono have signcode |
08:42:37 | PMunch | That's a big dependency just to sign a file :P |
08:42:46 | leorize | that or windows sdk :p |
08:42:47 | PMunch | It must be a fairly standard algorithm.. |
08:43:31 | PMunch | djazz "This webpage is a placeholder until a more formal page is written." and the discussion part is from 2007.. |
08:43:38 | PMunch | How maintained is that? |
08:43:38 | PMunch | :P |
08:44:06 | leorize | https://manpages.ubuntu.com/manpages/bionic/en/man1/signcode.1.html |
08:44:22 | FromDiscord_ | <djazz> GOG uses MojoSetup for its installers, I think? Or used to atleast |
08:44:23 | leorize | well looks like the source is BSD licensed, so you can inspect that yourself :p |
08:45:04 | leorize | still using mojosetup |
08:45:13 | * | Vladar joined #nim |
08:46:20 | FromDiscord_ | <djazz> The dev seems to update it occationally https://twitter.com/icculus/status/1058232980047519744?s=19 |
08:46:51 | FromDiscord_ | <djazz> GTK3 support |
08:47:01 | * | leorize quit (Quit: WeeChat 2.3) |
08:47:56 | FromDiscord_ | <djazz> 7 months ago was the last commit |
08:48:14 | FromDiscord_ | <djazz> Its probably that stable now, its rarely updated |
08:48:42 | FromDiscord_ | <djazz> It has an embedded Lua interpreter for scripting |
08:49:08 | * | sagax_ joined #nim |
08:49:24 | PMunch | leorize[m], hmm that tool looks interesting |
08:51:18 | * | sagax quit (Ping timeout: 245 seconds) |
08:55:19 | FromGitter | <alehander42> @rokups yeah indeed but actually .. |
08:55:27 | FromGitter | <alehander42> maybe we can just not inline functions in debug mode |
08:55:36 | FromGitter | <alehander42> but this might break something |
08:55:51 | FromGitter | <alehander42> is it possible for inlined function to depend somehow on the fact it is inlined araq |
08:58:37 | FromGitter | <mratsim> is it? afaik inline functions are just copied into the C file |
08:59:38 | FromDiscord_ | <demotomohiro> Defining functions without ``inline`` in header file cause linker error like ``foo`` function is defined multiple times in C language. |
08:59:42 | FromGitter | <rokups> is there a flag to disable inlining? its not in `--fullhelp` |
09:00:00 | FromGitter | <mratsim> Nim doesn't generate header files though |
09:00:48 | * | vlad1777d__ joined #nim |
09:00:51 | FromGitter | <mratsim> {.pragma: myinline, inline.} and replace all inline pragmas by myinline |
09:00:55 | FromGitter | <rokups> if something other than `importc` causes c compiler error then its a bug in nim compiler anyway |
09:01:14 | FromGitter | <mratsim> when you want to disable it switch to {.pragma: myinline.} and the pragma will do nothing |
09:01:16 | FromDiscord_ | <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:35 | Araq | PMunch https://gist.github.com/Araq/507d5e336eec15951aec153e4581bd14 |
09:18:21 | Araq | inlining is performed by the C compiler |
09:24:42 | lqdev[m] | am I the only one who prefers `proc main() =` instead of `proc main =`? |
09:25:24 | FromGitter | <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:47 | FromDiscord_ | <djazz> Araq: nice! |
10:33:35 | * | laaron joined #nim |
10:34:57 | noonien | hm |
10:35:19 | noonien | i'm getting a SIGSEGV while compiling a file, how can i debug this? |
10:38:45 | narimiran | "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:27 | noonien | i 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:09 | vegai | earlier I asked about a possible threaded db pool design with shared memory, and I was recommended allocShared |
10:49:38 | vegai | I'm also considering not using shared memory, but giving out db references or pointers via channels. Does that make sense? |
10:50:22 | vegai | I 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:16 | FromGitter | <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:31 | noonien | can i make `nim` not handle SIGSEGV? i want a coredump, and want to avoid running it in gdb directly because reasons |
11:09:33 | FromGitter | <rokups> wow what a slander on hackernews |
11:09:37 | FromGitter | <rokups> "- Nim: fast dev time; fast performance; not v1, C/C++ interop is second to none. Newruntime seems awesome" |
11:09:46 | FromGitter | <rokups> c/c++ interop is the best there is |
11:10:09 | FromGitter | <rokups> i havent seen any language that would let us use c++'s templates directly |
11:12:06 | noonien | is that a feature? don't most people use nim to avoid c++ templates? |
11:14:01 | FromGitter | <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:09 | leorize[m] | noonien: compile your code with -d:noSignalHandler and sigsegv will be handled by the os |
11:20:39 | noonien | it's not my code that's getting the SIGSEGV, but the nim compiler |
11:22:31 | noonien | here's what i mean: http://ix.io/1MK3 |
11:22:44 | noonien | i can't post foo.nim sadly, that's why i'm trying to debug |
11:23:48 | leorize[m] | you'd need the compiler source for that |
11:24:07 | leorize[m] | build koch then run ./koch temp c foo.nim |
11:24:37 | noonien | i can't tell `nim` to not register a SIGSEGV handler? |
11:24:56 | leorize[m] | it's a compile-time switch, sadly |
11:25:08 | noonien | ah, ok :( |
11:25:10 | noonien | gdb it is then |
11:25:15 | leorize[m] | and this applies to all nim-generated code |
11:25:52 | * | couven92 quit (Ping timeout: 268 seconds) |
11:26:24 | leorize[m] | without debuginfo you might not get far... |
11:27:17 | leorize[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:45 | Araq | noonien: -d:noSignalHandler |
11:38:28 | noonien | i tried, same issue, since this is a compiler SIGSEGV |
11:39:34 | noonien | `gdb -ex=r --args nim c foo.nim` doesn't seem to catch the SIGSEGV either |
11:40:04 | leorize[m] | you need some commands in gdb to override the handler |
11:40:47 | * | theelous3_ joined #nim |
11:42:15 | FromDiscord_ | <djazz> Try ltrace or strace |
11:43:28 | leorize[m] | strace won't get null deref |
11:43:54 | * | elrood joined #nim |
11:44:12 | noonien | yeah, 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:35 | noonien | from what i can tell, gdb should sigsegv even if the program has a signal handler |
11:44:40 | noonien | but 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:41 | vegai | rokups: I guess you misread "second to none" there |
11:54:25 | * | Trustable quit (Remote host closed the connection) |
11:55:25 | FromGitter | <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:51 | narimiran | "second to none" == the best |
12:03:08 | FromGitter | <Vindaar> yes, was just typing that ^ |
12:03:34 | FromGitter | <Vindaar> second to none -> there's nothing that makes this second in rang, so to say |
12:04:21 | noonien | yes, and he's saying c/c++ is the best there is, not nim's |
12:04:41 | noonien | it's like saying nim has the best nim interop |
12:05:04 | narimiran | international misreading day |
12:07:25 | PMunch | Hmm, did nimble behaviour change in 0.20.0? |
12:07:56 | PMunch | nimble install on 0.20.0 doesn't copy all the files in the package, while switching to 0.19.0 works fine |
12:08:40 | PMunch | Oh 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:18 | PMunch | Hmm, nim-httpauth doesn't work any longer? |
12:18:23 | PMunch | federico3 ^ |
12:18:46 | * | envoyt quit (Ping timeout: 244 seconds) |
12:20:04 | noonien | i managed to make a repro for the SIGSEGV: http://ix.io/1MKd |
12:20:17 | noonien | i know there's an error, but there shouldn't be a SIGSEGV |
12:21:25 | noonien | i'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:17 | leorize[m] | have you filed a bug report? |
12:30:30 | noonien | not yet, will do |
12:31:10 | livcd | uhm how do i slice an array? |
12:31:11 | krux02 | mratsim: are you around? |
12:34:49 | federico3 | PMunch: uh? |
12:44:08 | narimiran | livcd: `a[4 .. 7]` |
12:46:50 | PMunch | nimble install doesn't work |
12:47:05 | PMunch | And 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:51 | narimiran | PMunch: `nimble -v`? |
13:03:52 | * | Vladar quit (Remote host closed the connection) |
13:04:15 | * | Vladar joined #nim |
13:07:28 | PMunch | v0.10.2 |
13:13:14 | * | dwdv joined #nim |
13:24:55 | federico3 | https://news.ycombinator.com/item?id=20266566 Nim pops up here |
13:27:58 | * | theelous3_ joined #nim |
13:29:28 | shashlick_ | @PMunch check out nimdeps which is a good basis for an installer |
13:29:32 | shashlick_ | https://github.com/genotrance/nimdeps |
13:29:59 | shashlick_ | Also I've been working on a nimterop based version of nimarchive |
13:32:12 | PMunch | shashlick_, oh that does seem interesting |
13:32:45 | PMunch | We're having a hackathon at work, so I won't be able to pursue this for a couple days though |
13:33:02 | PMunch | I actually wanted to do the installer as part of the hackathon :P |
13:33:21 | shashlick_ | I made nimdeps to bundle all files at compile time |
13:33:34 | shashlick_ | No compression support though |
13:34:27 | shashlick_ | My goal was to carry dll files for the binary but Nim loads them too early |
13:34:40 | shashlick_ | But for an installer, it works fine |
13:34:42 | Cadey | shashlick_: what does this do that staticRead doesn't? |
13:35:00 | Cadey | https://nim-lang.org/docs/system.html#staticRead%2Cstring |
13:35:05 | shashlick_ | Just point to a directory/file and it will pull it in |
13:35:36 | shashlick_ | It uses static read but supports directories as well |
13:35:55 | shashlick_ | Plus extracts it automatically on first run if desired |
13:35:59 | * | theelous3_ quit (Ping timeout: 268 seconds) |
13:36:05 | Cadey | :+1: |
13:36:42 | shashlick_ | Handles all path challenges since static read is relative to current source file rather than working dir |
13:42:04 | PMunch | Hmm, 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:04 | salewski | narimiran, I have the impression that the "goto source" in https://nim-lang.org/docs/system.html does not work correctly. |
13:46:40 | salewski | When I click on the "source" button, I always go to very wrong lines... |
13:46:43 | narimiran | salewski: your impression is correct ;) i've already sent a PR which fixes those |
13:46:57 | salewski | Thanks, bye. |
13:47:01 | * | salewski quit (Client Quit) |
13:47:19 | narimiran | why 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:10 | narimiran | in 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:56 | Lea-kitty | Hello everybody ;) |
13:57:04 | narimiran | hi Lea-kitty |
14:07:11 | * | elrood quit (Remote host closed the connection) |
14:22:39 | FromGitter | <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:08 | FromGitter | <survivorm> calling it with wrk -t12 -c400 -d10s http://127.0.0.1:8081/ext_request |
14:23:33 | FromGitter | <survivorm> Any ideas? |
14:24:09 | FromGitter | <survivorm> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d122e89ce7f044dab63aed7] |
14:24:32 | FromGitter | <survivorm> That's the code fragment processing the request |
14:24:44 | FromGitter | <survivorm> in browser it works just fint |
14:24:52 | FromGitter | <survivorm> fine |
14:28:32 | * | narimiran quit (Ping timeout: 272 seconds) |
14:32:43 | Lea-kitty | what do you think about language v, i had a hard time believing it personally ! |
14:33:49 | zestyr | meh |
14:33:56 | lqdev[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:12 | lqdev[m] | also, reading through its source code, yeah it's also a mess |
14:35:16 | lqdev[m] | it doesn't really bring anything new to the table anyways, so meh |
14:35:47 | Lea-kitty | lqdev[m]Hi, listen i am of the same opinion, it seems very bisare ... you think he will succeed in keeping his promises? |
14:35:59 | Lea-kitty | :) |
14:36:17 | lqdev[m] | I hope so, but I'm not interested in the language anyway. I already have Nim :) |
14:37:28 | Cadey | let's move this to #nim-offtopic |
14:37:51 | FromGitter | <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:02 | zestyr | survivorm: 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:37 | lqdev[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:21 | Lea-kitty | i 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:22 | Lea-kitty | e it is useless, and yes too, i love NIM ;) |
14:43:45 | FromDiscord_ | <djazz> Cadey: oh hey, didnt see you there 😉 |
14:45:43 | Cadey | o/ djazz |
14:45:48 | leorize[m] | lqdev: message the appservice-irc bot |
14:46:29 | * | theelous3 joined #nim |
14:47:37 | lqdev[m] | leorize: should I use the regular freenode nickname registration procedure? |
14:47:45 | leorize[m] | lqdev: https://github.com/matrix-org/matrix-appservice-irc/wiki/End-user-FAQ#how-do-i-registeridentify-to-nickserv |
14:47:46 | leorize[m] | yes |
14:48:09 | FromDiscord_ | <djazz> you can group your nicks |
14:48:42 | FromDiscord_ | <djazz> `/msg nickserv group main_nick password` |
14:52:48 | FromGitter | <survivorm> @zestyr thanx, i'll try |
14:54:48 | * | leorize joined #nim |
14:55:06 | lqdev[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:32 | leorize | no, it was for the twitch stream IIRC |
14:56:46 | leorize | dom96 might be able to elaborate on that |
14:56:47 | lqdev[m] | ah |
14:58:04 | cfv[m] | <lqdev[m] "V is a mess, somewhat of a scam "> I agree. |
14:58:18 | cfv[m] | <FromGitter "<rokups> V is a testament to the"> Good point. |
14:58:33 | cfv[m] | It's a big mess about anything |
14:59:36 | FromGitter | <alehander42> not a scam, just a very alpha project |
14:59:39 | FromGitter | <alehander42> and offtopic |
14:59:58 | * | Jesin quit (Ping timeout: 244 seconds) |
15:00:06 | FromGitter | <alehander42> btw that messaging thing, is there history of your irc personal convos |
15:00:16 | FromGitter | <alehander42> or does this depend on a person's client/bouncer |
15:00:28 | FromGitter | <alehander42> hm, this is offtopic as well nvm |
15:01:02 | cfv[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:13 | cfv[m] | Maybe it works for something very small |
15:01:26 | FromGitter | <alehander42> well most lang projects require many years to mature |
15:01:29 | cfv[m] | While it pretends to work for huge programs |
15:01:36 | cfv[m] | <FromGitter "<alehander42> well most lang pro"> Yeah |
15:01:56 | FromGitter | <alehander42> that's a reason i like experimental languages |
15:01:58 | lqdev[m] | a very alpha project which makes so many promises you can't believe it's true |
15:02:11 | FromGitter | <alehander42> i dream for a simpler framework |
15:02:21 | FromGitter | <alehander42> which lets you easily define different type systems |
15:02:29 | FromGitter | <alehander42> grammars/cfg passes etc |
15:02:31 | cfv[m] | Like Nim. It's been around since 2005 and now, 14 years after, it is nearly mature |
15:03:01 | FromGitter | <alehander42> for experimenting with memory safety, linear types and other features |
15:03:16 | FromGitter | <alehander42> something like racket maybe |
15:03:22 | FromGitter | <alehander42> maybe i should play with it more |
15:04:04 | lqdev[m] | I tried racket's GUI and gave up after 5 minutes |
15:04:12 | lqdev[m] | it produces huge executables |
15:04:20 | FromGitter | <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:28 | lqdev[m] | 15 MB for a single crappy window |
15:04:34 | FromGitter | <alehander42> maybe codegen as well |
15:04:38 | cfv[m] | <FromGitter "<alehander42> something like rac"> I don't like Lisp-scheme programming languages |
15:04:44 | FromGitter | <alehander42> yeah me too |
15:04:51 | FromGitter | <alehander42> but i mean as a flexible system |
15:05:03 | FromGitter | <alehander42> afaik racket is very flexible and you can tweak almost every component |
15:05:11 | cfv[m] | Nim is very flexible |
15:05:14 | FromGitter | <alehander42> otherwise i dont care much about lisp syntax |
15:05:18 | FromGitter | <alehander42> eh not so much |
15:05:27 | FromGitter | <alehander42> i cant really put on another type system or read macros |
15:05:29 | FromGitter | <alehander42> `read` macros |
15:05:45 | FromGitter | <alehander42> and this is good, nim's goal is to be general purpose |
15:05:52 | FromGitter | <alehander42> so some limitations are needed |
15:06:08 | FromGitter | <alehander42> and also nim is a big language |
15:06:12 | cfv[m] | <FromGitter "<alehander42> so some limitation"> Obviously |
15:06:31 | cfv[m] | Any language has its limitations |
15:06:52 | FromGitter | <alehander42> what i imagine is e.g. |
15:06:54 | FromGitter | <alehander42> a library |
15:07:01 | FromGitter | <alehander42> that defines how the type system rules |
15:07:02 | FromGitter | <alehander42> work |
15:07:06 | * | theelous3_ joined #nim |
15:07:10 | FromGitter | <alehander42> so you can compile your code with different ones |
15:07:17 | FromGitter | <alehander42> which yeah creates dialects |
15:07:23 | FromGitter | <alehander42> but thats fine for toy languages |
15:08:06 | cfv[m] | Do you mean a framework? |
15:08:17 | FromGitter | <alehander42> yeah i use |
15:08:25 | FromGitter | <alehander42> a framework yeah |
15:08:29 | cfv[m] | A framework is a sort of "dialect" intended for a certain use |
15:08:35 | FromGitter | <alehander42> no |
15:08:40 | Araq | Nim is not *that* big. |
15:08:44 | FromGitter | <alehander42> i mean that you can use the same annotation mechanism |
15:09:03 | FromGitter | <alehander42> but you have different "type" rule systems |
15:09:12 | FromGitter | <alehander42> and they are hooked to your compile time |
15:09:16 | FromGitter | <alehander42> the same with codegen etc |
15:10:08 | FromGitter | <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:26 | FromGitter | <alehander42> with dsl-s with the ability to add custom code for your logic |
15:10:31 | Araq | "compiler compilers" do exist |
15:10:49 | FromGitter | <alehander42> i remember jetbrains had something like that? |
15:10:55 | FromGitter | <alehander42> mps? |
15:10:55 | Araq | yup |
15:14:03 | Araq | so ... 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:46 | Araq | borrow checking was years of work for Rust. |
15:15:55 | FromGitter | <alehander42> hm i just wanted to experiment with some nim-related things |
15:16:46 | Araq | type systems are super hard. They don't always look like that |
15:18:40 | FromGitter | <alehander42> my reasons were egoistic |
15:18:43 | FromGitter | <alehander42> i wanted to make my own language |
15:18:50 | Araq | that's fine |
15:18:53 | FromGitter | <alehander42> but i often overgeneralize massively |
15:19:02 | Araq | ^ exactly. |
15:19:05 | FromGitter | <alehander42> and decide "ok, i am not sure if i want A B or C component" |
15:19:21 | FromGitter | <alehander42> so let's make a way to have them all as options so one can decide later |
15:19:27 | FromGitter | <alehander42> after actually using / testing them |
15:19:46 | Araq | yeah, so you don't decide and say "in my lang it's up to the programmer, one can write type extensions" |
15:19:52 | FromGitter | <alehander42> not really |
15:19:59 | FromGitter | <alehander42> i wanted to be able to test quickly |
15:20:07 | FromGitter | <alehander42> different lang ideas |
15:20:16 | FromGitter | <alehander42> e.g. in the same way you test newruntime |
15:20:26 | FromGitter | <alehander42> but on a simpler more hackable language |
15:20:39 | FromGitter | <alehander42> i know that real languages have 10x edge cases and requirements |
15:20:52 | leorize | Araq: out of curiosity: did you make any other language before Nim? |
15:21:04 | FromGitter | <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:30 | Araq | but that's the thing... you don't find all the edge cases with the "simple prototype", maybe you find some. |
15:21:42 | Cadey | type systems are a tarpit |
15:21:46 | Cadey | they look simple |
15:22:08 | FromGitter | <alehander42> well i guess if you include sum types, function types and collections and pointers you can still find most problems |
15:22:22 | Araq | if you are successful then you'll have users. |
15:22:35 | FromGitter | <alehander42> but my point isnt really to be succesful but to experiment |
15:22:36 | Araq | and your users will find issues. thousands of them. |
15:22:40 | FromGitter | <alehander42> because often people decide |
15:22:42 | Araq | See Nim. ;-) |
15:22:47 | FromGitter | <alehander42> this feels like the right way |
15:23:01 | FromGitter | <alehander42> because its too hard to write 2-3 different subsystems |
15:23:12 | Cadey | Nim is a tool I wish I could use more |
15:23:14 | Araq | Nim originally started simple too, my goal was to not exceed a 20_000 line implementation |
15:23:17 | FromGitter | <alehander42> but if its a very small core prototypish language |
15:23:57 | FromGitter | <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:57 | Araq | leorize[m]: no, I created DSLs and preprocessors though |
15:24:11 | FromGitter | <alehander42> ok, a little bit optimistic |
15:24:32 | FromGitter | <alehander42> Araq yeah but i feel Nim is a general purpose language with the additional goal of flexibility |
15:24:44 | FromGitter | <alehander42> its normal to start supporting all kinds of stuff |
15:25:26 | FromGitter | <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:48 | FromGitter | <alehander42> but the biggest problem is that |
15:26:05 | FromGitter | <alehander42> usually assumptions from the type/optimizer passes might continue in the codegen |
15:26:56 | FromGitter | <alehander42> but that actually is an optimizer responsibility: the codegen can always receive low level simple IR |
15:27:00 | FromGitter | <alehander42> nvm |
15:29:01 | FromGitter | <alehander42> Araq where do people use dsl-s in the industry |
15:30:45 | Araq | I don't know. Either everywhere or hardly anywhere. HTML+CSS+JS is a set of DSLs, no? |
15:31:32 | Araq | flex and bison are popular in some circles. |
15:32:11 | FromGitter | <alehander42> i wondered where those custom dsl-s e.g. those you wrote are used |
15:33:08 | FromGitter | <alehander42> i guess developer tools and maybe scientific code, most users probably hate dsl-s |
15:33:33 | FromGitter | <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:08 | Araq | https://en.wikipedia.org/wiki/Linear_temporal_logic https://en.wikipedia.org/wiki/CTL* more DSLs ;-) |
15:35:14 | leorize | PMunch: do you have any plans for having Nim's `devel` on the playground? |
15:36:17 | Araq | vindaar: please report it properly |
15:37:26 | Araq | (my own DSLs were only used by myself :P ) |
15:37:50 | * | tjmac quit (Quit: -bye) |
15:38:37 | FromGitter | <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:28 | FromGitter | <Vindaar> Ah, I just hit this: https://github.com/nim-lang/Nim/issues/7322 |
15:53:31 | PMunch | leorize, not anything in particular |
15:53:43 | PMunch | But I have been thinking about adding a version selector |
15:54:15 | PMunch | I just wanted to think more about how/if I could do nimble packages, because that might influence the design |
15:54:35 | PMunch | And ATM I've locked myself out of the server (which is why the playground is currently down..) |
15:59:07 | FromGitter | <alehander42> Araq good |
15:59:22 | FromGitter | <alehander42> yeah dsl-s are additicive |
16:02:57 | * | theelous3_ quit (Ping timeout: 245 seconds) |
16:05:10 | FromGitter | <kayabaNerve> But can V compile Doom 3 in 0.5 seconds? /s |
16:05:38 | disruptek | sql has its enthusiasts. |
16:07:20 | FromGitter | <Varriount> narimiran: You called? |
16:08:02 | FromGitter | <kayabaNerve> Isn't Script a DSL? |
16:10:25 | FromGitter | <alehander42> sql is a language imo |
16:10:46 | FromGitter | <arnetheduck> domain-specific-language.. so it depends on how you define your domain? |
16:10:56 | FromGitter | <alehander42> kinda yeah |
16:11:03 | FromGitter | <alehander42> ok in this sense it is a dsl indeed |
16:11:31 | FromGitter | <alehander42> i usually think of language lib dsl-s like rails |
16:11:33 | FromGitter | <alehander42> sorry |
16:15:18 | * | theelous3 quit (Ping timeout: 252 seconds) |
16:16:23 | PMunch | Hmm, trying to use int.high as the value for an enum gives this weird error http://ix.io/1ML7/ |
16:16:47 | Araq | PMunch: saw my gist? |
16:17:03 | PMunch | Uhm, no? |
16:17:16 | Araq | check today's logs then please |
16:17:35 | FromGitter | <kayabaNerve> If Scipt counts, then I'm working on a DSL. Fun stuff. |
16:17:44 | PMunch | Araq, just found it :) |
16:19:46 | PMunch | So it creates a directory listing as a file of some sort? |
16:19:59 | PMunch | Or an archive I guess |
16:22:31 | PMunch | Oh, and it self extracts from the executable. That's nice |
16:30:11 | PMunch | Uuuhm, parseEnum hangs.. |
16:30:29 | PMunch | Ouch.. |
16:30:35 | * | Trustable joined #nim |
16:30:51 | PMunch | I had an "enum Role = User, Admin = uint32.high" |
16:31:05 | PMunch | So that I could add a bunch of stuff between User and Admin if I needed to |
16:31:13 | PMunch | Apparently parseEnum loops over this.. |
16:33:50 | leorize | enums with holes are evil |
16:33:53 | leorize | :p |
16:34:07 | FromGitter | <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:28 | leorize | probably for storing into an sql database |
16:35:07 | disruptek | sorting or masks. |
16:36:25 | * | drewr joined #nim |
16:37:14 | disruptek | anyway, 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:52 | FromGitter | <Vindaar> ^ you lost me |
16:39:11 | disruptek | alt.sysadmin.recovery humor. |
16:40:42 | noonien | how can i enable lto for release? |
16:48:30 | solitudesf | https://github.com/SolitudeSF/dot/blob/master/nim.nim#L35 you can put something like that in config.nims |
16:48:58 | noonien | great, thanks! |
16:53:08 | stefanos82 | question: from a folder 'example' that contains subfolders 'foo' and 'bar', how can I call foo's module from inside 'bar'? |
17:03:58 | FromDiscord_ | <djazz> solitudesf: how does that wasm switch work? |
17:04:10 | FromDiscord_ | <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:32 | solitudesf | i got it to spit out the binary. i never verified it actually working. |
17:45:45 | FromGitter | <kayabaNerve> If I have to work with UTF-8 NFKD from Nim, what's my best option? |
17:50:43 | Araq | NFKD? |
17:50:49 | FromGitter | <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:14 | FromGitter | <kayabaNerve> Araq: https://unicode.org/reports/tr15/ |
17:51:20 | * | dddddd quit (Remote host closed the connection) |
17:51:49 | FromGitter | <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:18 | FromGitter | <kayabaNerve> So beyond Unicode links, I can't really answer too many questions, sorry. |
17:53:01 | * | dddddd joined #nim |
17:54:42 | FromGitter | <kayabaNerve> I may just want to do a C FFI... |
17:58:05 | FromGitter | <kayabaNerve> Oh fun. Unicode even has a FAQ. https://unicode.org/faq/normalization.html |
18:03:22 | Araq | there is a "unicode" nimble package that offers it? not sure |
18:04:17 | * | neceve quit (Remote host closed the connection) |
18:05:42 | FromGitter | <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:05 | FromGitter | <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:13 | FromGitter | <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:19 | FromGitter | <juancarlospaco> Hi |
18:41:37 | * | nsf joined #nim |
18:43:20 | FromDiscord_ | <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:18 | FromGitter | <arnetheduck> @kayabaNerve what would you prefer *over* unicode, in dealing with human linguistic creativity? :) |
19:27:11 | Voltist | Hi 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:43 | Voltist | What I am going to do is make the opt:size flag hide the full paths in the binary. |
19:28:02 | Araq | it's now covered by -d:release and -d:danger |
19:28:20 | Voltist | Not according to that issue |
19:28:33 | Voltist | How recent is 'now'? |
19:28:38 | Araq | yesterday |
19:29:15 | Voltist | Ah, I see |
19:29:25 | Voltist | That issue should be closed |
19:30:19 | Araq | it's still not solved entirely |
19:30:45 | FromDiscord_ | <djazz> Hi, I reported that issue (: |
19:30:58 | Voltist | Hey! |
19:31:25 | Voltist | I'm the numpty that has been trying to work on it |
19:32:59 | Voltist | Araq: how is not yet entirely solved? |
19:33:25 | Araq | the compiler likes ../../../home/voltist/ paths |
19:33:33 | Araq | which leak as much information :P |
19:35:09 | Voltist | The -d:release and -d:danger flags don't hide those? |
19:36:23 | leorize | yea, it's due to how they're stored |
19:36:53 | leorize | some logic should be added for files outside of the project that's being compiled |
19:37:44 | leorize | Voltist: so this is where the file name is introduced https://github.com/nim-lang/Nim/blob/1255b3c8647c2ad4be831698633eaf2f4a38795c/compiler/ccgstmts.nim#L690 |
19:41:04 | Voltist | So is the `toFileName(p.config, t.info)` responsible for actually generating the file path? |
19:43:18 | Araq | yes but keep in mind that the macro system also exposes full paths |
19:43:24 | Araq | and that we have a JS codegen |
19:48:24 | FromGitter | <kayabaNerve> @arnetheduck Hmmmmmmmm |
19:48:30 | FromGitter | <kayabaNerve> ASCII and PNG /s |
19:48:35 | PMunch | Hmm, 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:01 | PMunch | Like does it handle cookies with ajax requests? |
19:49:13 | PMunch | I guess that's the way I would have to communicate with the server |
19:49:23 | Voltist | @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:01 | Araq | Voltist: please check the PR queue, people are working on it |
19:57:16 | Voltist | OK, thanks! |
19:59:07 | lqdev[m] | you know, every time I switch from Nim to a different language I miss one thing |
19:59:15 | lqdev[m] | that thing… it's `result` |
19:59:41 | lqdev[m] | I hate having to declare this variable manually |
19:59:46 | lqdev[m] | it just clutters code |
20:01:35 | Voltist | And 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:35 | lqdev[m] | indeed, it weels weird in mostly C derivatives imo |
20:10:59 | * | Vladar quit (Remote host closed the connection) |
20:15:21 | PMunch | lqdev[m], I liked result much more than I thought I would |
20:16:08 | PMunch | I always end up missing macros and templates :P |
20:16:21 | PMunch | But I think I might like them a bit too much :P |
20:16:27 | leorize | Araq: any good idea for the ../../home paths? or should we just get the file name portion of it? |
20:16:38 | lqdev[m] | same here |
20:17:34 | leorize | result is one of the thing that keeps me writing pascal before I found Nim :) |
20:19:46 | PMunch | Hmm, I'm stil looking for a good workflow for my server/frontend combo |
20:19:56 | PMunch | I 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:53 | FromGitter | <zetashift> But? :P |
20:31:32 | PMunch | I don't know, I feel it would be awkward to use when the server needs to do a lot of stuff |
20:31:35 | PMunch | But maybe not |
20:31:54 | PMunch | I'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:13 | Araq | leorize: 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) |