00:08:45 | * | vicfred quit (Quit: Leaving) |
00:09:29 | FromDiscord | <Kiloneie> Wau, Windows 10 is a douche bag, had to run finish.exe as admin on a clean copy, any other way would not add the compiler to path... whatever... |
00:12:14 | * | bung_ quit (Quit: Lost terminal) |
00:13:40 | skrylar[m] | xD |
00:13:59 | skrylar[m] | speaking of bags. i never heard back from the nim maintainer on alpine. |
00:14:06 | skrylar[m] | i sent them updated build scripts |
00:21:39 | FromDiscord | <Varriount> shashlick: Is it possible to send toast input to wrap via stdin? |
00:40:28 | * | maier joined #nim |
00:45:49 | * | maier quit (Ping timeout: 264 seconds) |
01:15:52 | * | apahl quit (Ping timeout: 260 seconds) |
01:17:29 | * | apahl joined #nim |
01:20:06 | * | Zectbumo_ quit (Remote host closed the connection) |
01:21:12 | shashlick | Not yet but we could add it |
01:21:20 | * | Zectbumo joined #nim |
01:24:39 | * | krux02_ quit (Remote host closed the connection) |
01:30:03 | * | audiofile quit (Quit: Default Quit Message) |
01:34:16 | * | Tongir joined #nim |
01:36:34 | * | Tlanger quit (Ping timeout: 246 seconds) |
01:49:16 | * | vicfred joined #nim |
02:06:59 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:08:34 | * | muffindrake joined #nim |
02:13:47 | * | dadada joined #nim |
02:14:12 | * | dadada is now known as Guest30360 |
02:20:48 | * | Zectbumo quit (Remote host closed the connection) |
02:22:05 | * | Zectbumo joined #nim |
02:27:56 | rockcavera | is the compiler inference for "int64" instead of "int" correct? https://play.nim-lang.org/#ix=2sCL |
02:36:21 | * | zacts quit (Quit: WeeChat 2.8) |
02:41:20 | * | maier joined #nim |
02:44:37 | FromDiscord | <Yardanico> Yes |
02:45:17 | FromDiscord | <Yardanico> -2147483647 is the least possible int32 |
02:45:31 | FromDiscord | <Yardanico> -2147483648 wouldn't fit in int32 |
02:46:13 | * | lritter quit (Ping timeout: 240 seconds) |
02:46:22 | * | maier quit (Ping timeout: 260 seconds) |
02:46:55 | * | lritter joined #nim |
02:48:40 | * | thomasross quit (Ping timeout: 246 seconds) |
02:53:00 | * | NimBot joined #nim |
03:02:38 | FromDiscord | <Anuke> that's interesting, because in Java `-2147483648` is a valid int32 value https://media.discordapp.net/attachments/371759389889003532/738230034820759642/unknown.png |
03:03:03 | rockcavera | in Nim -2147483648 is a valid int32 |
03:03:23 | rockcavera | echo low(int32) = -2147483648 |
03:03:41 | FromDiscord | <Anuke> https://play.nim-lang.org/#ix=2sCL |
03:04:27 | FromDiscord | <Anuke> ah, the `-` gets evaluated afterwards |
03:06:37 | rockcavera | However, the issue is not whether or not it is a valid int32, but the fact that the compiler is using the wrong type inference. I believe that the compiler type inference should be for "int", even though the value is higher than an int32, because int, in Nim, is according to "architecture" |
03:08:14 | rockcavera | https://nim-lang.org/docs/manual.html#lexical-analysis-numerical-constants |
03:08:35 | rockcavera | "This integer type is int if the literal is in the range low(i32)..high(i32), otherwise it is int64." |
03:09:51 | rockcavera | Either the documentation is wrong or it is a bug. |
03:15:00 | FromDiscord | <Elegant Beef> I think it's a bug |
03:15:11 | FromDiscord | <Elegant Beef> 2^31 is the 8 ending value |
03:19:26 | rockcavera | https://github.com/nim-lang/Nim/issues/15119 |
03:19:28 | disbot | ➥ Wrong type inference ; snippet at 12https://play.nim-lang.org/#ix=2sEX |
03:53:37 | * | rockcavera quit (Remote host closed the connection) |
03:55:15 | FromDiscord | <Varriount> Yardanico: What are you currently working on? |
03:55:20 | Yardanico | nothing :P |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:45 | * | supakeen joined #nim |
04:16:53 | * | ForumUpdaterBot quit (Remote host closed the connection) |
04:17:02 | * | ForumUpdaterBot joined #nim |
04:26:44 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:42:12 | * | maier joined #nim |
04:42:28 | * | andrew_ joined #nim |
04:44:12 | * | andrew_ is now known as andrew[43] |
04:44:49 | * | dzamo joined #nim |
04:47:05 | * | maier quit (Ping timeout: 240 seconds) |
05:09:37 | * | maier joined #nim |
05:09:57 | * | narimiran joined #nim |
05:23:00 | * | lbart quit (Ping timeout: 256 seconds) |
05:25:46 | * | lbart joined #nim |
05:25:47 | * | lbart quit (Changing host) |
05:25:47 | * | lbart joined #nim |
05:29:56 | * | bunbunbunbunny joined #nim |
05:33:06 | * | arecacea1 quit (Remote host closed the connection) |
05:33:58 | * | arecacea1 joined #nim |
05:48:04 | silvernode[m] | Good morning |
05:48:15 | * | solitudesf joined #nim |
05:51:08 | FromDiscord | <Elegant Beef> Hello |
05:52:54 | * | letto quit (Quit: Konversation terminated!) |
05:54:19 | silvernode[m] | So I've been using Element as my IRC client lately instead of weechat, irssi, hexchat or konversations. So far it has been working very well. I'm not sure if the IRC bridge for Matrix still has any of the issues that I have heard about for the last couple of years but I haven't noticed any. |
05:54:41 | Yardanico | the Matrix->Freenode bridge still crashes from time to time |
05:54:42 | * | letto joined #nim |
05:54:52 | Yardanico | you can notice it if you have join/leave messages enabled in IRC :) |
05:55:23 | Yardanico | also I don't like Element because it's Electron |
05:55:41 | Yardanico | and the default matrix server is usually overloaded |
05:55:56 | silvernode[m] | hmm, I gues I should keep an eye on that. I still want to host my own synapse server but so far it seems to be python based which I would rather not use. |
05:56:32 | silvernode[m] | I was hoping there was a Rust based version or something not interpreted |
05:56:34 | Yardanico | you can use Quassel for IRC if you want logs :) you can host quassel server anywhere you want |
05:57:07 | * | letto quit (Client Quit) |
05:57:50 | icyphox | silvernode[m]: Isn't there? It's called conduit. |
05:58:25 | icyphox | Also, ZNC works perfectly fine. :) |
05:58:40 | Yardanico | well, I don't want to use some other services so I will need to share my password with them :) |
05:58:42 | silvernode[m] | <icyphox "silvernode: Isn't there? It's ca"> I haven't really looked to hard for alternatives but conduit seems to be what I am looking for. |
05:58:58 | * | letto joined #nim |
05:58:58 | silvernode[m] | > <@freenode_icyphox:matrix.org> silvernode: Isn't there? It's called conduit. |
05:58:58 | silvernode[m] | * I haven't really looked too hard for alternatives but conduit seems to be what I am looking for. |
05:59:07 | icyphox | Yardanico: ZNC is self-hosted... |
05:59:15 | Yardanico | icyphox: so can be quassel :) |
05:59:17 | Yardanico | I host it on my VPS |
05:59:30 | icyphox | Ah cool. |
05:59:36 | icyphox | Whatever works. :) |
05:59:40 | Yardanico | it has mobile clients too |
05:59:53 | icyphox | I just use Revolution IRC on Android. |
06:00:12 | icyphox | TBH, not a big fan of bridging Discord/Gitter/Matrix -> IRC. |
06:00:20 | FromDiscord | <Elegant Beef> Are there any good matrix clients with good VOIP? 😄 |
06:00:32 | Yardanico | icyphox: well, otherwise we'd have more split communities |
06:00:34 | Yardanico | which is bad |
06:00:45 | icyphox | From my experience, Matrix's VOIP is just Jitsi Meet. |
06:00:57 | FromDiscord | <Elegant Beef> Ah so no |
06:01:07 | FromDiscord | <Elegant Beef> Jitsi is just such a bad voip solution |
06:01:10 | Yardanico | we have more and more discord users nowadays |
06:01:12 | icyphox | Yardanico: Yeah true. It's just the freetard in me speaking, heh. |
06:01:16 | icyphox | Unfortunately. |
06:01:30 | Yardanico | icyphox: if there was a good open-source discord alternative, people would've used it :) |
06:01:35 | icyphox | Beef: Not really. Works perfectly fine. |
06:01:40 | Yardanico | with same ease of creating your own servers for free and without charge |
06:01:58 | FromDiscord | <Elegant Beef> It's not a case of working it's a case of not being a seemless experience |
06:02:23 | FromDiscord | <Elegant Beef> With element atleast the embedded jitsi didnt work when i tested it |
06:02:31 | FromDiscord | <Elegant Beef> I had to open up the browser to have it work |
06:02:32 | icyphox | Dunno, I use it on the daily @ work. |
06:07:48 | silvernode[m] | I hate Discord but I understand why it's popular. |
06:07:58 | Yardanico | exactly :P |
06:09:20 | FromDiscord | <Elegant Beef> Eh i also hate discord but the alternatives arent of acceptable quality imo |
06:09:27 | Yardanico | you could use it less :) |
06:09:33 | Yardanico | e.g. for nim you could just use an IRC client |
06:09:45 | FromDiscord | <Elegant Beef> I mean i suppose, but eh |
06:10:53 | FromDiscord | <Elegant Beef> Wonder if we could abuse the element js intergration to get a voip solution i dont find appalling 😄 |
06:11:35 | Yardanico | Discord is JS as well |
06:11:42 | Yardanico | I mean client-side |
06:11:52 | FromDiscord | <Elegant Beef> Element lets you add on web apps to the chat |
06:11:56 | FromDiscord | <Elegant Beef> widgets iirc |
06:12:10 | silvernode[m] | So I have been trying to successfully use the optParser proc but as far as I can tell there is only one solid example of how to use it. I get the concept, it's just the syntax that trips me up. All I want to do is take arguments and then run a shell command. A package manager wrapper is what I am going for. |
06:12:25 | silvernode[m] | parseOpt proc rather |
06:12:30 | Yardanico | silvernode[m]: what is the problem you're having exactly? |
06:12:45 | Yardanico | Nim compiler is a good complex example of parseopt usage :) |
06:12:50 | silvernode[m] | <Yardanico "silvernode: what is the problem "> getting it to work at all. |
06:13:05 | Yardanico | well, you have to be more specific |
06:13:50 | Yardanico | and btw, what parseOpt proc you're talking about? |
06:14:12 | Yardanico | https://nim-lang.org/docs/parseopt.html#initOptParser%2Cstring%2Cset%5Bchar%5D%2Cseq%5Bstring%5D this is the usual place you'd pass your arguments to |
06:14:48 | silvernode[m] | <Yardanico "well, you have to be more specif"> I'll get back to on that. this is something I am coming back to after a few months so I need to mess with it again more but I just wanted to see if any of you had some working examples that I can use as a base. |
06:15:05 | Yardanico | the ones in parseopt docs are working |
06:15:22 | Yardanico | not sure what "parseOpt" you're talking about though |
06:15:30 | FromDiscord | <Elegant Beef> think they meant module |
06:15:31 | Yardanico | there's no such proc, but there's a "parseopt" module |
06:15:56 | silvernode[m] | <Yardanico "the ones in parseopt docs are wo"> You know, I think I just realized the issue I was having with it. Going to try again real quick. |
06:16:00 | Yardanico | see e.g. the example here https://nim-lang.org/docs/parseopt.html#getopt.i,OptParser |
06:16:14 | FromDiscord | <Elegant Beef> It seems relatively simple to use, you import os and parseopt init a parseopt with the commandLineParams() then iterate using getopt |
06:16:38 | FromDiscord | <Elegant Beef> sorry init a opt parser |
06:16:49 | Yardanico | there are also docopt and cligen |
06:17:12 | silvernode[m] | Is the example in the docs a recommended way to use it or should I not copy pasta the example code and modify it? |
06:17:25 | Yardanico | why would it be not a recommended way to use it? |
06:18:05 | Yardanico | usually doc examples are meant to represent the usual usage of something :) |
06:18:15 | silvernode[m] | <Yardanico "why would it be not a recommende"> I don't know, I am just used to people telling me that example code is generally not what I should rely on. |
06:18:22 | Yardanico | weird |
06:18:23 | FromDiscord | <Elegant Beef> Uhh |
06:18:25 | FromDiscord | <Elegant Beef> Yea |
06:18:32 | FromDiscord | <Elegant Beef> Example code is there for you to understand and use |
06:18:36 | * | letto quit (Read error: Connection reset by peer) |
06:18:54 | * | letto joined #nim |
06:19:05 | * | dddddd quit (Ping timeout: 240 seconds) |
06:19:36 | FromDiscord | <Elegant Beef> Example code that doesnt explain how to use something isnt example code it's pseudo code 😄 |
06:25:01 | silvernode[m] | I am trying to figure out how to make the example print out the argument that I give it, instead of what it prints out by default. Looking at the example, my brain can't figure out why it's not doing what I want. |
06:25:11 | Yardanico | ?? |
06:25:25 | FromDiscord | <Varriount> Which example? |
06:25:34 | silvernode[m] | https://nim-lang.org/docs/parseopt.html |
06:26:39 | FromDiscord | <Elegant Beef> Silvernode this is what you'd want then↵https://play.nim-lang.org/#ix=2sFA |
06:26:47 | Yardanico | silvernode[m]: I just modified the minimal getopt example a bit - https://play.nim-lang.org/#ix=2sFB |
06:27:14 | FromDiscord | <Elegant Beef> Hmm i swear i've seen something similar before yard 😄 |
06:27:49 | silvernode[m] | Ohhhh! That's the bit I needed to change, it makes a lot more sense now. I knew I needed to do that but wasn't sure how. Thanks |
06:28:01 | * | letto quit (Quit: Konversation terminated!) |
06:28:04 | FromDiscord | <Elegant Beef> Look at the initOptParser parameters |
06:28:09 | * | dddddd joined #nim |
06:28:15 | FromDiscord | <Elegant Beef> It takes in a `seq[TaintedString]` |
06:28:15 | silvernode[m] | The values were static which was my issue. |
06:28:36 | silvernode[m] | <FromDiscord "<Elegant Beef> It takes in a `se"> I'll take a look |
06:32:12 | * | letto joined #nim |
06:33:49 | silvernode[m] | Ok so now I need a portable way to run shell commands from within Nim. |
06:34:39 | silvernode[m] | there are various ways to run os commands on the shell in nim but which way would you guys recommend? |
06:34:50 | Yardanico | not sure if it works for windows, but |
06:34:50 | Yardanico | https://github.com/Vindaar/shell |
06:35:31 | ForumUpdaterBot | New thread by Serge: Channel is not recognised by VS Code plugin, see https://forum.nim-lang.org/t/6620 |
06:36:07 | silvernode[m] | <Yardanico "">https://github.com/Vindaar/shell"> This looks really easy to use, thanks a lot |
06:39:17 | Yardanico | people blaming extensions when they didn't do the configuration :( |
06:39:20 | Yardanico | about that channel thread |
06:42:29 | * | krux02 joined #nim |
06:47:50 | * | bunbunbunbunny quit (Quit: leaving) |
06:57:27 | FromDiscord | <Elegant Beef> At this point it should throw a warning if it doesnt detect a config with threads on in it 😄 |
06:57:33 | Yardanico | no |
06:57:41 | Yardanico | then should we do it for literally everything? |
06:58:07 | Yardanico | it maybe should be in the FAQ for the extension, sure |
07:00:32 | FromDiscord | <Elegant Beef> I was half joking but if it could create a warning for anything that requires a switch it'd be more explicit on what needs to be done, and it seems that is something many people need to be told |
07:00:39 | FromDiscord | <Elegant Beef> Cause apparently the threads docs are hard to read 😄 |
07:00:57 | Yardanico | if people can't properly read docs, this is not gonna help them :) |
07:10:48 | FromGitter | <tulayang> The runtime ``--gc:arc`` says that it offers a shared heap. So, is there still a thread-local heap when using this runtime? When using ``--gc:arc``, I found that the memory allocated by ``alloc0()`` is not reclaimed when the thread exits. Is the memory allocated by ``alloc0()`` in a shared heap? |
07:11:08 | Yardanico | you can always use allocShared to allocate in the shared heap, no? |
07:11:14 | Yardanico | not sure about that alloc0 though |
07:12:16 | FromGitter | <tulayang> Yes, I know ``allocShared`` allocate in a shared heap. |
07:15:10 | FromGitter | <tulayang> I just want to confirm whether or not there is still a thread-local heap when using ``--gc:arc``? |
07:34:03 | Araq | --gc:arc --threads:on means every allocation is global and not thread-local |
07:34:37 | Araq | however, you need to be careful with the refcounting, use Isolated[T] and read the RFC please |
07:34:57 | Araq | https://github.com/nim-lang/RFCs/issues/244 |
07:34:58 | disbot | ➥ 'isolated' data for Nim ; snippet at 12https://play.nim-lang.org/#ix=2sjf |
07:38:41 | Yardanico | urgh that's why I sometimes don't like isolated communities |
07:39:02 | Yardanico | in a small russian telegram chat "about nim" (but there's almost never actual talk about nim) people are arguing if nim is a compiler or a "transpiler" again |
07:39:58 | Araq | lol so what |
07:40:16 | * | Tlanger joined #nim |
07:41:19 | Araq | Nim is a transpiler as much as C-front is a preprocessor. |
07:41:36 | Araq | things never change, people don't understand compilers |
07:41:58 | Araq | and come up with words where the wikipedia definition makes no sense |
07:42:38 | Oddmonger | transpiler mess up people head |
07:42:54 | Oddmonger | now let's talk about gnu as backend :] |
07:43:02 | * | Tongir quit (Ping timeout: 256 seconds) |
07:43:13 | Araq | programming alchemy, we're living in dark ages |
07:43:24 | FromDiscord | <Rika> oh man not transpiler talk again |
07:43:29 | Yardanico | just bundle clang with nim (the license allows), and boom, these transpiler people are happy :P |
07:43:33 | Yardanico | just hide the C from them |
07:43:40 | FromDiscord | <Rika> whos resetting the days-without-transpiler-argument counter |
07:43:50 | Yardanico | nah, it's not here |
07:43:59 | Oddmonger | Yardanico: just alias gcc to cat |
07:44:12 | Araq | gcc transpiles C to asm |
07:44:18 | Yardanico | exactly |
07:44:20 | Araq | we all know it to be true |
07:45:53 | Oddmonger | humm… true, there is an IL for that |
07:48:05 | * | andrew[43] quit (Ping timeout: 240 seconds) |
07:49:23 | Araq | Yardanico, but we do bundle gcc with Nim on Windows kind of and for other OSes we use what is available |
07:49:36 | Araq | if you cannot install Nim you're not much of a software developer |
07:50:40 | * | andrew_ joined #nim |
07:50:57 | Araq | in fact, we used to bundle mingw with Nim directly. but it creates much larger downloads and every time you update nim you have to redownload what didn't change |
07:52:03 | * | D_ quit (Remote host closed the connection) |
07:52:58 | * | D_ joined #nim |
07:54:37 | Yardanico | heh, I'm also reading a long forum thread about nim vs d, and there was a mention about count of repos on github |
07:54:43 | Yardanico | "GitHub has total_count of 280 Red projects, compared to 3,115 for Nim / 10,325 for D." from apr 2019 |
07:54:52 | Yardanico | now it's 4843 for nim and 11578 for D |
07:55:08 | Zevv | I can whip up a script to generate a bunch more, if you want |
07:55:13 | Yardanico | lol |
07:55:32 | Yardanico | crystal has 5821 huh |
07:56:02 | Araq | so what? I know D is still more popular |
07:56:13 | Yardanico | no, just good growth of Nim :) |
07:58:25 | FromGitter | <bung87> nim users 476 |
07:58:32 | Yardanico | wat? :P |
07:58:51 | FromGitter | <bung87> https://github.com/search?q=language%3Anim&type=Users |
07:58:56 | Yardanico | it's not full |
07:58:59 | FromDiscord | <Elegant Beef> Remember kids mandarin is the most common language |
07:59:20 | * | Zectbumo quit (Remote host closed the connection) |
07:59:39 | FromGitter | <bung87> doesn't be english? |
07:59:40 | Yardanico | it has a ton of dialects though |
07:59:52 | Yardanico | @bung87 no, "mandarin" (if you count all dialects of it) is almost 3 times more popular |
08:00:28 | Yardanico | found a more updated article though, might be actually more real |
08:00:29 | Yardanico | https://www.visualcapitalist.com/100-most-spoken-languages/ |
08:00:35 | * | Zectbumo joined #nim |
08:00:38 | Yardanico | the thing is that most people in India speak english too |
08:00:39 | * | Zectbumo quit (Remote host closed the connection) |
08:00:47 | Yardanico | at least a bit of it |
08:01:29 | FromGitter | <bung87> well , speaking is different hah |
08:01:30 | Yardanico | but by native speaker count Mandarin surely wins |
08:01:39 | Araq | wow |
08:01:46 | Yardanico | https://en.wikipedia.org/wiki/List_of_languages_by_number_of_native_speakers |
08:01:49 | ForumUpdaterBot | New thread by Wt: Whether or not there is still a thread-local heap when using --gc:arc?, see https://forum.nim-lang.org/t/6621 |
08:01:51 | Araq | that graph for "Japanic" is nice |
08:02:09 | Yardanico | haha |
08:02:12 | Araq | Japanic ------------------> Japanese |
08:02:26 | Yardanico | well Japan was in isolation throughout most of it's history :P |
08:02:56 | FromDiscord | <Rika> isnt it Japonic |
08:03:10 | FromDiscord | <Rika> japan is still very isolated compared to many countries |
08:03:35 | Araq | no offspring, no evolution, omg, it must be a bad language! Probably they still lack words for "computer" and "sex" |
08:04:04 | Yardanico | well as far as I know Japanese want more westernization |
08:04:14 | Araq | well I'm kidding |
08:04:27 | FromDiscord | <Rika> it's obvious, dw |
08:08:11 | * | nikita` joined #nim |
08:14:55 | Yardanico | ok, next failing (with arc) nimble package on my list is "ptrace.nim" |
08:24:00 | Yardanico | reproduced that one, not sure if a bug |
08:24:15 | Yardanico | basically - you can apparently have a proc which returns "cstring" but initialize result in it as "result = newString(32)" |
08:24:26 | Yardanico | and it works correctly with refc, but with arc you get an empty string |
08:24:51 | Yardanico | actually not empty, you get a string with a single character - " in it lol |
08:25:48 | Yardanico | https://play.nim-lang.org/#ix=2sFV |
08:26:35 | FromDiscord | <Varriount> @shashlick: Have you ever though about running nimterop through a fuzzer? |
08:26:43 | Yardanico | would that really help? |
08:26:50 | Yardanico | it's better to test on real projects imo :) |
08:27:11 | FromDiscord | <Varriount> Yardanico: It would help find inputs that cause the program to crash. |
08:27:22 | Yardanico | but is that really a priority? |
08:27:35 | Yardanico | you could make a fuzzer for nim's compiler to file tens of issues for "crashes" :) |
08:27:43 | Yardanico | but all of these would be low priority |
08:28:28 | FromDiscord | <Varriount> So what your saying is, finding low-priority bugs has no value? |
08:28:44 | Yardanico | it has value certainly |
08:29:10 | Araq | spamming our issue tracker even moreso certainly has negative value |
08:29:33 | Araq | if you create a separate issue tracker for these bugs I wouldn't mind |
08:29:54 | Yardanico | well, Varriount talks about nimterop mostly, it was me who made an example with Nim :) |
08:29:57 | FromGitter | <bung87> `sleepAsync(0)` is close to go's `runtime.Gosched()` ? |
08:30:20 | FromDiscord | <Varriount> Araq: I was talking moreso about Nimterop. It's crashing when parsing some headers from the Windows SDK |
08:30:33 | Araq | ah ok, I'm sorry |
08:30:42 | Araq | but using a fuzzer for Nim did come up in the past |
08:34:20 | Yardanico | Araq, so is https://play.nim-lang.org/#ix=2sFV returning a string with " valid behaviour for ARC? |
08:34:20 | FromDiscord | <Varriount> Araq: I'll add "setup an EC2 instance for fuzzing Nim" to my list. 😄 |
08:34:29 | Yardanico | i was surprised you could do that honestly (newString and return type as cstring) |
08:34:48 | Araq | nope, invalid code |
08:34:51 | Yardanico | ok |
08:35:09 | Araq | good thing I'm working on a borrow checker :P |
08:35:30 | Araq | (cursor inference is borrow checking) |
08:35:55 | Araq | (and it need to do mutation analysis) |
08:35:57 | ForumUpdaterBot | New thread by Serge: String interning (seen on Github) : Is it good? has anybody been using it?, see https://forum.nim-lang.org/t/6622 |
08:36:32 | Araq | (it's almost like I know what I'm doing.) |
08:38:18 | Yardanico | https://github.com/ba0f3/ptrace.nim/pull/2 |
08:38:19 | disbot | ➥ Fix invalid return type in getData |
08:38:26 | Yardanico | next one on my list is "bencode" |
08:43:03 | Yardanico | hrm, the test fail here is not caused by cursor inference :P |
08:46:25 | FromDiscord | <Clyybber> Araq: Does the optInd in the parser stand for 'optional Indentation'? |
08:46:34 | Araq | yes |
08:47:19 | FromDiscord | <Clyybber> sent a long message, see http://ix.io/2sFY |
08:47:31 | FromDiscord | <Clyybber> Doe s this patch make sense then? |
08:48:14 | FromDiscord | <Clyybber> sent a long message, see http://ix.io/2sFZ |
08:48:29 | FromDiscord | <Clyybber> currently you need the outer braces too |
08:49:09 | Araq | the patch is bad |
08:49:15 | Araq | 4 + |
08:49:18 | Araq | 5 |
08:49:22 | Araq | shouldn't compile |
08:49:25 | Araq | it needs to be |
08:49:28 | Araq | 4 + |
08:49:30 | Araq | 5 |
08:49:55 | FromDiscord | <Yardanico> damn sorry discord bridge ate leading spaces here 😛 |
08:49:59 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/738317452600934400/unknown.png |
08:50:16 | Araq | you can special case the allowed indentation before parenthesis, maybe |
08:50:44 | Yardanico | ah actually I don't think it's the bridge, Discord itself doesn't allow leading spaces lol |
08:50:52 | Yardanico | it just strips them out |
08:52:00 | * | Vladar joined #nim |
09:04:23 | * | andrew_ quit (Ping timeout: 265 seconds) |
09:12:55 | Yardanico | oh lol this one is interesting (the bencode issue) |
09:13:23 | Yardanico | it somehow "forgets" value of the seq |
09:13:36 | Yardanico | same behaviour with arc from a month ago |
09:14:01 | Yardanico | maybe due to changed tables stuff, hmm |
09:17:01 | Yardanico | https://github.com/nim-lang/Nim/issues/15121 urgh |
09:17:02 | disbot | ➥ Flutter bindings for Nim |
09:22:36 | FromDiscord | <Varriount> Yardanico: If you place a zero-width character before the line, discord doesn't eat the spaces. |
09:23:54 | Yardanico | yes |
09:23:57 | Yardanico | but I consider that as a hack :P |
09:24:11 | Yardanico | although in my IRC -> Markdown formatter I insert a zero-width space as well between the entries |
09:24:17 | Yardanico | but it's not yet live |
09:24:23 | FromDiscord | <Varriount> But if there's no other way... |
09:25:33 | Yardanico | well I might consider adding this, sure |
09:25:53 | Yardanico | but let me first check if it would really be possible |
09:26:41 | Yardanico | well I don't think it would really be possible since I also do some word-based processing |
09:34:07 | * | dzamo[m] left #nim ("User left") |
09:36:29 | Yardanico | LOL that bencode issue is certainly very weird |
09:36:37 | Yardanico | it works when I remove one of the branches in the object variant |
09:37:16 | Yardanico | https://github.com/nim-lang/Nim/issues/15122 |
09:37:18 | disbot | ➥ [ARC] Sequence "disappears" with a table inside of a table with an object variant ; snippet at 12https://play.nim-lang.org/#ix=2sG6 |
09:37:24 | * | vicfred_ joined #nim |
09:40:25 | * | vicfred quit (Ping timeout: 264 seconds) |
09:40:35 | Yardanico | it's probably something tables-related |
09:42:36 | Yardanico | oh it worked 1 month ago |
09:42:38 | Yardanico | time for git bisect :P |
09:45:31 | Yardanico | uh-oh |
09:45:42 | Yardanico | bisect said that the first bad one is the https://github.com/nim-lang/Nim/pull/15095 PR |
09:45:43 | disbot | ➥ fixes #15076 |
09:45:45 | Yardanico | strange |
09:51:32 | Yardanico | ok, next package - cassette (recording and replaying HTTP sessions for testing) |
09:51:50 | Yardanico | fails because it has a "dispose" proc for two of it's types, and it conflicts with ARC's "dispose" in system :P |
10:02:19 | FromDiscord | <dom96> oof, sounds like a breaking change |
10:04:26 | Zevv | AARGH I *hate* this |
10:04:36 | Zevv | I do a large writeup in some online web app like github |
10:04:39 | Zevv | spend two hours there |
10:04:48 | Zevv | and halfway through the day my tab is gone |
10:04:54 | Zevv | and I didn't commit or whatever |
10:05:04 | Yardanico | :/ |
10:05:10 | FromDiscord | <Varriount> Write in a text editor first |
10:05:12 | Yardanico | I use telegram as my "temp buffer" to save work in case something happens lol |
10:05:14 | Yardanico | or a text editor |
10:05:47 | Zevv | yeah I *always* do that |
10:05:49 | Zevv | except for today |
10:05:50 | Zevv | sigh |
10:05:54 | FromDiscord | <Varriount> Zevv: My sympathies though, it is really annoying |
10:06:15 | Zevv | I seme to have some leftovers in some magic file in my firefox profile, 'jsonlz4' format |
10:06:23 | Zevv | how do I open that :/ |
10:06:33 | FromDiscord | <dom96> Life pro-tip: install a keylogger, that way you'll never lose what you write lol |
10:06:42 | Yardanico | lz4 decompress ?:P |
10:06:44 | Yardanico | and then it's a json |
10:06:51 | Zevv | jaah too bad |
10:06:59 | Yardanico | 7zip should work just fine |
10:07:00 | FromDiscord | <Varriount> Zevv: From the name, it might be a gzipped JSON file? |
10:07:03 | Yardanico | p7zip on linux |
10:08:24 | FromDiscord | <Zed> are there an decent resources for embedded programming with nim? |
10:09:07 | Yardanico | I mean on latest releases it ain't so hard :P |
10:09:23 | Yardanico | you can start by trying --os:any --gc:arc -d:useMalloc --panics:on |
10:09:35 | Yardanico | if your embedded platform has a C compiler with a C stdlib of course |
10:11:16 | * | lritter quit (Quit: Leaving) |
10:11:18 | FromDiscord | <Zed> im planning on using something like a teensy or pro micro |
10:11:45 | FromDiscord | <Zed> ill have to play around with it |
10:13:34 | * | Vladar quit (Read error: Connection reset by peer) |
10:13:43 | * | opal quit (Ping timeout: 240 seconds) |
10:14:02 | Yardanico | ok, ad fails because of finalizers in the "bignum" nimble lib which are just bindings to gmp, but they're very old |
10:14:09 | Yardanico | there's even "import unsigned" |
10:16:08 | * | opal joined #nim |
10:17:09 | Zevv | Jess, found my stuff in firefox's dungeons |
10:17:13 | Yardanico | noice |
10:17:37 | FromDiscord | <dom96> oh cool, you should write a little utility that helps recover this sort of thing |
10:17:47 | FromDiscord | <dom96> (or a blog post with instructions on how to do it) |
10:18:05 | Zevv | Someone did |
10:18:08 | Zevv | so I put my stuff in |
10:18:14 | Zevv | and a huge json blob came out |
10:19:13 | * | Vladar joined #nim |
10:21:58 | FromDiscord | <Varriount> What did the utility do? |
10:22:08 | FromDiscord | <Varriount> Can you give us a link? |
10:43:48 | * | andrew joined #nim |
10:46:11 | Zevv | https://www.jeffersonscher.com/ffu/scrounger.html |
10:46:22 | Zevv | I just trusted this guy and send him my whole file |
10:46:45 | Yardanico | I don't think you really uploaded it |
10:46:47 | Yardanico | it's client-side |
10:46:51 | Yardanico | check the js files |
10:46:54 | Zevv | if it looked any slicker i wouldn't have trusted it. But the bare-boneness of it made me trust it |
10:46:57 | Zevv | I know |
10:47:08 | Zevv | But then again, could you check all of it in a minute or two? |
10:47:16 | Yardanico | just load the page |
10:47:20 | Yardanico | and disconnect from the internet |
10:47:24 | Zevv | yeah yeah |
10:47:48 | Zevv | then it will create one of these background js services and send it tomorrow when I'm not looking |
10:47:53 | Zevv | there's a whole os in my browser |
10:47:55 | Yardanico | lol |
10:49:17 | FromDiscord | <Clyybber> sent a long message, see http://ix.io/2sGp |
10:49:38 | Yardanico | @Clyybber if your message is longer than 3 newlines it'll be sent as ix.io link :P |
10:50:03 | FromDiscord | <Clyybber> Gotcha, shoulda split it |
10:50:05 | Yardanico | I mean for pinging people |
10:50:22 | FromDiscord | <Clyybber> Araq: Is it intended that this parses fine: |
10:50:27 | FromDiscord | <Clyybber> block: (↵ discard; |
10:50:32 | FromDiscord | <Clyybber> discard↵ ) |
10:50:44 | FromDiscord | <Clyybber> now I fucked up.. |
10:51:01 | FromDiscord | <Clyybber> That *this* parses fine: |
10:51:05 | FromDiscord | <Clyybber> block: (↵ discard;↵ discard↵ ) |
10:54:44 | FromDiscord | <Clyybber> Dammnit, the bridge is killing me :p |
10:55:15 | FromDiscord | <Clyybber> Araq: Is it intended that this parses fine http://ix.io/2sGt ? |
10:55:37 | FromDiscord | <Clyybber> Seems weird since the indentation for the second discard is off |
10:56:18 | FromDiscord | <dom96> use markdown 🙂 |
10:56:50 | Yardanico | I added irc to markdown and markdown to irc in ircord, but didn't run it as the main bridge yet :) |
10:57:00 | Yardanico | need to probably add some safe guards so it doesn't go in an endless while loop |
10:57:04 | FromDiscord | <lqdev> @Clyybber pretty sure that's intended, try dedenting the second discard below the first one |
10:57:08 | Yardanico | I do manual parsing of irc formatting and markdown :D |
10:57:13 | Yardanico | for conversion between them |
10:57:23 | Yardanico | stupid, but seemed to work in my testing |
10:57:30 | Yardanico | https://github.com/Yardanico/ircord/blob/master/src/utils.nim#L24 |
10:57:38 | FromDiscord | <dom96> sent a code paste, see https://play.nim-lang.org/#ix=2sGu |
10:57:41 | FromDiscord | <Clyybber> @lqdev wdym? |
10:57:52 | FromDiscord | <Clyybber> I am saying it maybe shouldn't be allowed |
10:57:53 | FromDiscord | <dom96> you get a code paste link |
10:57:59 | Yardanico | yes |
10:58:03 | Yardanico | you get the same with a long message |
10:58:08 | Yardanico | more than 3 lines or more than 500 characters |
10:58:18 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2sGv |
10:58:20 | FromDiscord | <lqdev> doesn't work |
10:59:02 | FromDiscord | <Clyybber> does |
10:59:03 | FromDiscord | <Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2sGw |
10:59:12 | FromDiscord | <lqdev> yeah. |
10:59:18 | FromDiscord | <Clyybber> and I'm not sure thats intended |
10:59:39 | FromDiscord | <Clyybber> (edit) 'https://play.nim-lang.org/#ix=2sGw' => 'https://play.nim-lang.org/#ix=2sGx' |
10:59:52 | Yardanico | poor bridge gettiing abused :P |
11:00:02 | Yardanico | https://i.imgur.com/jO6O6Ut.png |
11:00:14 | FromDiscord | <lqdev> lol |
11:03:21 | FromDiscord | <lqdev> do deques require initialization? |
11:03:25 | FromDiscord | <lqdev> doesn't seem like it |
11:03:32 | FromDiscord | <lqdev> https://play.nim-lang.org/#ix=2sGB |
11:03:36 | FromDiscord | <lqdev> doesn't crash |
11:03:50 | FromDiscord | <Clyybber> I think zevv made them not require it |
11:03:50 | Yardanico | https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/collections/deques.nim#L68 |
11:04:02 | Yardanico | and anyway, seqs were nil before 0.19 |
11:04:05 | FromDiscord | <lqdev> Yardanico: I have that page open :P |
11:04:13 | * | Vladar quit (Quit: Leaving) |
11:04:13 | FromDiscord | <lqdev> not sure what the `mask` does |
11:04:41 | * | beatmox quit (Ping timeout: 272 seconds) |
11:08:25 | FromDiscord | <lqdev> is there any way I can enforce a `move` when a value is passed to a proc's param? |
11:08:38 | Yardanico | enforce? |
11:08:51 | Yardanico | hrm |
11:09:00 | Araq | use a 'sink' parameter |
11:09:01 | FromDiscord | <lqdev> basically I have an `Entity` which is just `distinct int` and an array index |
11:09:11 | FromDiscord | <lqdev> and I have a `delEntity` which deletes an entity |
11:09:20 | FromDiscord | <Clyybber> Araq: Is it intended that this parses fine http://ix.io/2sGt ? |
11:09:22 | Yardanico | if it's not used afterwards, sink will work just fine |
11:09:28 | FromDiscord | <lqdev> ok |
11:09:41 | Yardanico | proc mytest(data: sink int) |
11:09:58 | Yardanico | Araq: by the way, is it safe to (ab)use sink when you need to modify the argument inside the proc? |
11:10:06 | Yardanico | so you don't have to wriite "var arg = arg" |
11:10:18 | FromDiscord | <Rika> what happens if you have a code block with no newlines? ``` test ``` |
11:10:29 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/738352807240925184/unknown.png |
11:10:35 | FromDiscord | <Rika> lol |
11:10:50 | FromDiscord | <Yardanico> ```nim↵echo "hi"↵``` |
11:10:59 | FromDiscord | <Clyybber> Araq: Because the fact that this parses fine means that this http://ix.io/2sGE/nim doesnt. It thinks I'm trying to pass the echo to discard |
11:11:32 | FromDiscord | <Yardanico> The logic is simple: if there are more than 3 newlines and there's \`\`\` - it's a code paste, use play.nim-lang.org (it still uses ix.io). Otherwise give a plain ix.io link |
11:11:52 | FromDiscord | <Yardanico> well there's also logic to try to give https://paste.rs link if ix.io didn't work for some reason |
11:12:38 | * | dddddd quit (Ping timeout: 256 seconds) |
11:13:14 | * | beatmox joined #nim |
11:14:25 | * | dddddd joined #nim |
11:15:51 | FromDiscord | <Clyybber> Another try, since my messages get lost |
11:16:01 | Yardanico | they don't :P |
11:16:12 | Yardanico | maybe 4raq is busy |
11:16:52 | FromDiscord | <Clyybber> I mean get lost in the sea of text |
11:17:04 | FromDiscord | <Clyybber> maybe some irc clients don't like the discord prefix |
11:17:15 | * | clyybber joined #nim |
11:17:27 | clyybber | Araq: The fact that this: http://ix.io/2sGt parses fine means that this: http://ix.io/2sGE/nim doesnt. It thinks I'm trying to pass the echo to discard. |
11:17:38 | clyybber | WDYT about disallowing the first example, but then making the second one work instead |
11:24:53 | FromDiscord | <InventorMatt> is there a way to zip more than two sequences as the same time? |
11:25:11 | Araq | dunno, don't break code. and if you want a more principled approach to indentation based parsing, wait for my RFC... |
11:25:57 | Yardanico | you have too many unpublished RFCs :P |
11:26:55 | FromDiscord | <Clyybber> Araq: I don't think anything actually relies on that behaviour (only really works for discard and some other keywords/calls), but the CIs will tell me |
11:26:59 | Yardanico | @InventorMatt seems like zero_functional implements it https://github.com/zero-functional/zero-functional#zip |
11:27:50 | FromDiscord | <InventorMatt> thank you |
11:28:08 | Yardanico | oh LOL |
11:28:14 | Yardanico | zero functional crashes the compiler with arc |
11:28:15 | Yardanico | fun |
11:30:51 | * | clyybber quit (Quit: WeeChat 2.9) |
11:31:30 | Yardanico | wait it now works? dafaq |
11:32:17 | Yardanico | ahh. only with -d:dangert |
11:32:19 | Yardanico | danger |
11:33:28 | Yardanico | ah no, lol, it only crashes with a single example |
11:37:57 | Yardanico | oh it's not related to zero_functional at all |
11:38:37 | Yardanico | ohhhhhhh |
11:39:54 | Yardanico | Araq: should this work with ARC? https://play.nim-lang.org/#ix=2sGK |
11:40:06 | Yardanico | basically the lib in benchmarks gets the name of the proc by "example0.repr" at compile-time |
11:40:15 | Yardanico | weird but it actually works for refc |
11:42:27 | * | Vladar joined #nim |
11:52:44 | FromDiscord | <Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=2sGN |
11:54:42 | * | andrew quit (Ping timeout: 260 seconds) |
11:58:21 | * | rockcavera joined #nim |
11:59:06 | Araq | Yardanico, meh |
11:59:26 | Araq | no idea why it ever worked |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:43 | * | supakeen joined #nim |
12:22:14 | * | tsujp joined #nim |
12:28:34 | * | andrew joined #nim |
12:33:28 | * | tsujp quit (Quit: WeeChat 2.9) |
12:37:25 | * | tsujp joined #nim |
12:37:43 | * | tsujp quit (Client Quit) |
12:38:18 | * | tsujp joined #nim |
12:38:40 | FromDiscord | <xsouxsou29> cd .. |
12:40:37 | * | vicfred_ quit (Quit: Leaving) |
12:40:56 | * | waleee-cl joined #nim |
12:45:31 | * | rockcavera quit (Remote host closed the connection) |
12:48:34 | * | rockcavera joined #nim |
12:52:21 | * | arecacea1 quit (Remote host closed the connection) |
12:53:47 | * | arecacea1 joined #nim |
12:55:39 | * | endragor joined #nim |
13:13:49 | * | endragor quit (Remote host closed the connection) |
13:17:17 | * | Vladar quit (Quit: Leaving) |
13:24:15 | * | rockcavera quit (Remote host closed the connection) |
13:32:18 | FromDiscord | <xsouxsou29> Hello guys 🙂 I'm a datascientist that is very enthousiastic about bringing torch in nim. I know the project already exist but I think it was done with the old API and it is not using nimterop. For those who don't know, torch is a machine learning library with a C++ and a python API 🙂 ↵Do you think I should start from the old project and add the new API ? or is it better to start from scratch with nimterop ? |
13:32:59 | FromDiscord | <Rika> look into `arraymancer` if you havent already |
13:33:22 | FromDiscord | <Rika> (though i have no answer for your actual question_) |
13:34:26 | shashlick | Nimterop doesn't support c++ |
13:35:04 | FromDiscord | <lqdev> yeah, wrapping c++ is a manual process right now |
13:35:18 | FromDiscord | <lqdev> though i heard c2nim can parse a large subset of c++, so you may wanna give it a shot |
13:35:19 | Araq | well c2nim does support c++ |
13:35:33 | * | vicfred joined #nim |
13:35:45 | Araq | it was used to wrap Unreal Engine and Urho 3D and wxWidgets |
13:36:08 | Araq | it's semi-automatic though and only supports some features of C++11 |
13:39:43 | FromDiscord | <xsouxsou29> ah ! ok so based on your comments, the second option is very costly |
13:42:25 | shashlick | Better c2nim than hand wrapping |
13:43:08 | shashlick | There's a lot of nuance and for larger libs, it's too much work - better to use tools |
13:45:54 | FromDiscord | <xsouxsou29> From what I understood, for c2nim it is better the modify the code of the library you want to wrap. Which can be a bit annoying knowing how much facebook (the owner of pytorch) update and change the lib. |
13:48:24 | * | nikita` quit (Quit: leaving) |
13:48:30 | Araq | that's correct but you can wrap a subset, most C++ headers are full of useless junk like declaring uint32 once again |
13:48:57 | Araq | and you can diff+patch your modified header against a new header version |
13:50:59 | * | Kaivo quit (Ping timeout: 240 seconds) |
13:52:59 | FromDiscord | <xsouxsou29> I see your point, you're right it is not such a big deal ! I'll give a try to c2nim 🙂 finger cross |
13:53:02 | FromDiscord | <xsouxsou29> (edit) 'cross' => 'crossed' |
13:53:06 | FromDiscord | <xsouxsou29> (edit) 'finger' => 'fingers' |
13:53:24 | * | Kaivo joined #nim |
13:54:35 | * | NimBot joined #nim |
14:01:31 | * | Vladar joined #nim |
14:15:24 | ForumUpdaterBot | New thread by Hugogranstrom: SymbolicNim, symbolic algebra in Nim, see https://forum.nim-lang.org/t/6623 |
14:29:27 | ForumUpdaterBot | New thread by Digitalcraftsman: How to cast a slice of seq[char] to uint?, see https://forum.nim-lang.org/t/6624 |
14:36:17 | * | Trustable joined #nim |
14:37:27 | * | opal quit (Read error: Connection reset by peer) |
14:39:10 | * | opal joined #nim |
15:05:37 | disruptek | !last zevv |
15:05:38 | disbot | Zevv spoke in 12#nim 4 hours ago 12https://irclogs.nim-lang.org/30-07-2020.html#10:47:53 |
15:05:45 | disruptek | that's just lazy. |
15:06:29 | Zevv | so true |
15:06:37 | Zevv | what do you want |
15:10:16 | * | narimiran quit (Ping timeout: 265 seconds) |
15:14:39 | Zevv | !last disruptek |
15:14:39 | disbot | disruptek never seen. |
15:16:12 | disruptek | lol |
15:16:19 | disruptek | mornin' zevv |
15:16:26 | Zevv | afternoon' disruptek |
15:16:37 | Zevv | you're really doing this, right? |
15:17:03 | disruptek | probably. |
15:17:08 | Zevv | nice. |
15:17:17 | disruptek | well, did you notice anything strange about #28 code? |
15:17:58 | * | endragor joined #nim |
15:18:08 | Zevv | well, there's no cps macro happening? |
15:18:13 | Zevv | and ou don't use your `.` |
15:18:18 | disruptek | yeah. |
15:18:59 | Zevv | your point being? |
15:19:13 | disruptek | we're back to this idea that the concept is what's important. |
15:19:34 | Zevv | oh sure |
15:19:36 | disruptek | all we really need to capture is this association of code with data. everything else is irrelevant. |
15:19:51 | Zevv | code is just data, didn't you know? |
15:20:05 | disruptek | i had heard something about that, yes. |
15:20:33 | Zevv | I think a lot was learned over the last week |
15:21:08 | disruptek | isn't `replace(s: string): string` a continuation? |
15:21:36 | Zevv | no |
15:21:40 | disruptek | why not? |
15:21:47 | Zevv | it's just a proc |
15:22:05 | disruptek | the data isn't important. |
15:22:19 | disruptek | it's the type system's understanding of applicability that is important. |
15:22:30 | disruptek | the type system knows we can apply X to Y and get Z. |
15:22:45 | * | maier quit (Ping timeout: 240 seconds) |
15:22:45 | Zevv | which you should make use of wherever possible |
15:22:59 | Zevv | but it's not a continuation |
15:23:06 | Zevv | you can't stash it away and call it tomorrow |
15:23:13 | disruptek | but that's data. |
15:23:18 | disruptek | data isn't important to us. |
15:23:32 | disruptek | data has nothing to do with this. |
15:23:52 | Zevv | I have yet to reach your level of enlightenment on this |
15:23:59 | disruptek | this is all about iterating through a code-flow graph. |
15:24:36 | disruptek | what is `.next()`? it's literally the result of fn(c). |
15:24:49 | Zevv | no, of c.fn(c) |
15:24:51 | Zevv | c also holds the fn |
15:25:00 | disruptek | yeah, whatever. |
15:25:09 | Zevv | it's a difference |
15:25:19 | Zevv | but continue |
15:25:58 | disruptek | it's a difference that we can code around. |
15:26:00 | disruptek | that's the key. |
15:26:20 | disruptek | we give you the invisible storage of fn() on your T. |
15:26:39 | Zevv | right |
15:27:40 | * | Guest30360 is now known as dadada |
15:27:47 | Zevv | c.data is T |
15:27:51 | dadada | hey nimmers |
15:28:02 | disruptek | how do you do? |
15:28:07 | disruptek | fellow nimion. |
15:29:16 | dadada | just learned there's a work in progress JS-2-C++ transpiler https://github.com/NectarJS/nectarjs ... if this ever becomes really good, and there's ever a really great automatic wrapper generator for C++ (for Nim), than we could use a large chunk of Javascript/(and also Typescript) modules/libs in Nim projects |
15:29:16 | Zevv | so disruptek, what is your plan |
15:29:56 | dadada | the nectarjs project is currently very active, I wouldn't mention it otherwise... |
15:30:28 | disruptek | !repo quickjs4nim |
15:30:29 | disbot | https://github.com/ImVexed/quickjs4nim -- 9quickjs4nim: 11A Nim wrapper for QuickJS 15 8⭐ 0🍴 |
15:30:41 | disruptek | that's another way. |
15:31:22 | shashlick | looks like http://json.to is broken on devel |
15:31:38 | disruptek | what is that? |
15:32:01 | disruptek | yer blowin' my mind right now, shashlick. |
15:32:06 | dadada | disruptek: definitely cool, but you pay the penalty of an interpreter, nectarjs should produce very fast C++ binaries without any interpretation |
15:32:55 | disruptek | dadada: contribute a pr to nimterop to help it use the c++ version of treesitter and you've killed many birds with one stone. |
15:33:25 | disruptek | shashlick: anyway, only chumps use to(). |
15:34:29 | dadada | disruptek: I don't think it's that easy, C++ just has too many quirks, creating a module for the SWIG project would take about 4000 lines (less because you can copy much from the go module), and they have ironed out those C++ quirks for us, I think that path is more realistic, I already looked at much of the code, but I have no time to do or test this |
15:35:08 | dadada | just my opinion, of course it would be great to have support in nimterop as well |
15:35:34 | FromDiscord | <dom96> A lot of the time you don't need to wrap the majority of the C++ to use a certain library |
15:35:35 | disruptek | why not contribute the js->treesitter->nim, then? |
15:35:54 | disruptek | how hard could it be? |
15:35:55 | FromDiscord | <dom96> Just wrap what you need manually 😄 |
15:37:06 | FromDiscord | <exelotl> Nectarjs does a terrible job of explaining itself... I came across it several months ago, didn't even realise it was a JS to C++ compiler until you told me just now |
15:37:27 | dadada | exelotl: I agree, I found out the details from their well hidden blog |
15:37:35 | disruptek | Zevv: the plan is to implement lisp in nim, i guess. same as always. |
15:37:36 | dadada | https://nectarjs.com/blog |
15:39:02 | FromDiscord | <exelotl> The documentation gets as far as "a variable is like a box that you can put a value in" and then just stops 🤦♂️ |
15:39:19 | disruptek | !last exelotl |
15:39:19 | disbot | exelotl spoke in 12#nim 16 seconds ago 12https://irclogs.nim-lang.org/30-07-2020.html#15:39:02 |
15:39:33 | disruptek | that's one of the funniest things i've read in a long time. |
15:41:11 | Zevv | Lisp. well why not. My other car is a Cdr |
15:41:32 | disruptek | hohoho |
15:41:32 | * | D_ quit (Ping timeout: 260 seconds) |
15:42:02 | Zevv | but now do answer my quesion: Why did all this cps stuff started out as a *untyped* macro |
15:42:14 | disruptek | aww i wrote it down. |
15:42:27 | FromDiscord | <Clyybber> because he wanted while: else: |
15:42:30 | FromDiscord | <Clyybber> what else: |
15:42:39 | * | zacts joined #nim |
15:42:47 | disruptek | what else |
15:42:53 | disruptek | that's what we call it. |
15:42:56 | disruptek | whatelse |
15:43:05 | FromDiscord | <Clyybber> what: else: |
15:43:09 | FromDiscord | <Clyybber> whats it do? |
15:43:13 | disruptek | who cares? |
15:43:22 | FromDiscord | <Clyybber> what: ever: |
15:43:26 | disruptek | lol |
15:43:40 | disruptek | what (data) else (code) |
15:43:53 | disruptek | (else what) |
15:44:02 | FromDiscord | <Clyybber> what () |
15:44:04 | FromDiscord | <Clyybber> ? |
15:44:06 | disruptek | () |
15:44:30 | FromDiscord | <Clyybber> :() |
15:44:32 | * | D_ joined #nim |
15:44:47 | Araq | dadada, C++'s quirks when it comes to wrapping are all inherited from C. |
15:44:55 | disruptek | 𝝺 |
15:45:13 | Araq | at least it got a module system now so maybe in 10 years the preprocessor is mostly gone |
15:45:19 | dadada | sometimes I think if I should get into JS programming again, I resented JS because it always was more like a hack (at least in parts), than a well defined language, now with newer revisions its beginning to look a bit better, and they have so much momentum going with the ecosystem, I wonder if I should just jump on that bandwaggon, but I don't like C-style syntax anymore... so if there's a pythonic modern JS |
15:45:25 | dadada | variant (with macros to not lose Nim's main selling point), maybe that could work for me, and then something like nectarjs for generating fast binaries... I don't know, I actually don't want to leave the Nim train, but Javascript has crazy projects like Babel in its ecosystem that are only possible because it has become like a kind of "too big to fail" language, that will in the end probably have support for |
15:45:31 | dadada | anything you can imagine |
15:45:44 | disruptek | c-style syntax? |
15:46:03 | disruptek | you want coffeescript. |
15:46:09 | FromDiscord | <Clyybber> if the stuff you care most about is big libraries and company support than yeah, nim probably isn't for you yet |
15:46:34 | disruptek | itym "off-side rule" vs. "curly braces" |
15:47:50 | disruptek | i wrote a largish project in coffeescript -> babel -> webpack and it works great. zero warts afaic. |
15:48:03 | disruptek | it took a lot of work to get it to that point, though. |
15:48:33 | disruptek | enough that i don't ever want to go back. and i left the place very clean. |
15:48:39 | dadada | disruptek: isn't it harder to debug a coffescript compared to JS? |
15:48:52 | disruptek | i never learned js properly, so i dunno. |
15:49:00 | disruptek | i find coffeescript much easier on the eye. |
15:49:02 | Araq | source code maps are for debugging |
15:49:20 | disruptek | also, i'm just about the only coffeescript author i read. |
15:49:34 | Araq | and you should really use TypeScript, else there is no productivity |
15:49:36 | disruptek | so, like, don't ask me a damned thing. but seriously, do. |
15:49:48 | dadada | disruptek: vimium extension for chrome is written in coffeescript |
15:49:49 | Araq | but I'm in the static typing camp |
15:49:59 | disruptek | yes, typescript is obviously what you want. |
15:50:13 | disruptek | i did this work 6 years ago now. |
15:50:53 | disruptek | js has changed a lot since then, too. |
15:53:59 | disruptek | let c = "foo" -> s/o/x/g; assert c == "fxx" |
15:54:18 | disruptek | let c = "foo" -> s/o/x/g; assert c() == "fxx" # rather |
15:55:59 | disruptek | let c = "foo" -> s/o/x/g; assert c == "foo" # also |
15:56:25 | disruptek | var c = "foo" -> s/o/x/g; assert c == "foo" # obvs |
15:56:29 | * | Trustable quit (Remote host closed the connection) |
16:01:16 | dadada | those necatarjs people could've transpiled to Nim instead of C++? Is there anything missing in Nim (that C++ has) that prevented that option... |
16:01:29 | * | rockcavera joined #nim |
16:01:30 | dadada | of course the most likely reason is they don't know Nim in the first place |
16:01:45 | disruptek | var c = "foo" & s/o/x/g |
16:02:15 | disruptek | c &= s/f/b/g |
16:02:45 | disruptek | assert c() == "bxx" |
16:04:22 | Araq | dadada, but to accomplish what? if you target C++, you get C++ interop (if you want to) |
16:04:39 | Araq | if you target Nim you get Nim interop which nobody cares about :-) |
16:05:05 | * | andrew quit (Ping timeout: 240 seconds) |
16:07:56 | dadada | Araq: usually it's enough to have C-interop and you can use that almost anywhere, and Nim compiles to C, can export to C, this would really suffice for most cases, no? |
16:08:22 | dadada | also Nim has multiple backends itself, maybe more to come in the future, so when they target Nim, they'd also target those current and future backends |
16:09:07 | dadada | the nectarjs people implemented their own memomy management, but they could've used Nim's inbuilt memory management, and saved themselves that work |
16:09:25 | dadada | s/memomy/memory |
16:09:57 | Zevv | clyybber: did you have any new revelations about #15118 ? |
16:09:59 | disbot | https://github.com/nim-lang/Nim/issues/15118 -- 3Cgen error: genSym fails to make unique identifier for ref object types ; snippet at 12https://play.nim-lang.org/#ix=2sHS |
16:11:25 | FromDiscord | <Clyybber> nope, sorry. Was hacking on the parser |
16:12:01 | disruptek | Zevv: what do you think about this syntax? |
16:12:19 | Zevv | talking about #28? |
16:12:27 | disruptek | scroll up |
16:14:05 | Zevv | the arrow regexp thingy? |
16:14:15 | disruptek | i thnk & |
16:14:28 | FromDiscord | <Clyybber> a riddle |
16:14:33 | disruptek | ~& |
16:14:33 | disbot | &: 11unreachable |
16:14:38 | Zevv | =~ |
16:15:02 | disruptek | ah, two into one. |
16:15:22 | disruptek | ~= |
16:15:23 | disbot | no footnotes for `=`. 🙁 |
16:15:40 | disruptek | well, for ligature reasons. |
16:15:51 | Zevv | =~ is perl, that's how we did that back in the ninetees |
16:16:07 | disruptek | i know, but i was thinking ~= for some reason. |
16:16:20 | disruptek | everyone wrote perl then, it was crazy. |
16:16:29 | disruptek | line noise. |
16:16:49 | disruptek | and remarkably large projects. |
16:16:56 | Zevv | Some of my friends from back then still call me "two-lines-of-perl-zevv" |
16:17:05 | Zevv | because I apparently did everything in two lines of perl |
16:17:09 | Zevv | I have no recollections of that, however |
16:17:17 | disruptek | that seems about right. |
16:17:30 | dadada | ok, this looks like a good read https://codeburst.io/nectarjs-compiling-javascript-into-native-binaries-for-every-platform-2efb2083a4a ... now I'll shut about nectarjs :D |
16:17:34 | disruptek | we went to great lengths to run it from the command-line. |
16:17:45 | * | vicfred_ joined #nim |
16:18:07 | Zevv | my only perl project I can remember was smtppp |
16:18:13 | Zevv | for doing ppp over smtp |
16:18:18 | disruptek | ofc |
16:18:45 | leorize[m] | why would you ever want to do ppp over smtp |
16:18:47 | Zevv | oh that was not the ninetees. http://ix.io/2sHV |
16:18:48 | disruptek | how about the one where you have a filesystem on gmail? |
16:18:58 | Zevv | I was working at a site where there was no internet, but there was an email gateway |
16:19:11 | disruptek | in 2001? |
16:19:15 | Zevv | in 2001 |
16:19:25 | Zevv | company policy |
16:19:29 | disruptek | third world countries, huh? |
16:19:45 | Zevv | it was amazingly usable |
16:19:53 | Zevv | just make sure to crank up your window sizes |
16:20:04 | disruptek | lol |
16:20:20 | disruptek | but ppp over 296 mtu is so much snappier. |
16:20:34 | Zevv | hehe |
16:20:37 | * | vicfred quit (Ping timeout: 264 seconds) |
16:20:50 | Zevv | dude I am so old. I just went into this project directory I never visit anymore |
16:20:57 | Zevv | I did SLIP back then |
16:21:08 | disruptek | cslip. i'll call back with 296. |
16:21:13 | Zevv | and CPIO |
16:21:18 | disruptek | right. |
16:21:23 | Zevv | anyway, back to 2020 |
16:21:28 | Zevv | how's the CPSv3 coming up |
16:21:33 | Zevv | go type that shit boi |
16:21:39 | * | oriba joined #nim |
16:21:46 | disruptek | i'm stoned. just thinking at the moment. |
16:21:59 | Zevv | yeah, and I'm buzzed. Good team we are |
16:22:24 | disruptek | i'm told it takes two to tango. |
16:23:05 | leorize | enlighten me with your cps magic |
16:23:10 | leorize | how do I use this stuff |
16:23:19 | leorize | and how can I implement more things on top of it? |
16:23:23 | disruptek | roll to 0.0.11 |
16:23:25 | Zevv | MIDDLEWARE |
16:24:06 | disruptek | zevv that was one of the cutest github posts i've ever seen. |
16:24:26 | Zevv | the pain I went through for that. I had the tab open but forgot to submit |
16:24:38 | Zevv | until 5 hours later I noticed the post was not on github |
16:24:39 | disruptek | that's the worst. |
16:24:47 | Zevv | so I grepped through my .mozilla and found some matches |
16:24:48 | disruptek | good reason to use ghi. |
16:24:57 | Zevv | and the stuff was just there waiting for me in some lz4'ed json |
16:25:04 | Zevv | I *never* type in web ui.s This was the first time |
16:25:08 | Zevv | It was ment to be a few lines |
16:25:24 | Zevv | leorize: so, you're serious about this? I can talk you through a bit |
16:25:39 | Zevv | but expect everything to be completely rewritten |
16:25:49 | Zevv | basic concepts will hold, but stuff will chainge |
16:25:54 | leorize | sure |
16:26:12 | leorize | I have to see the magical world without futures :p |
16:26:28 | Zevv | ok, basically there's a few layers. On the bottom there is the CPS concept. Read up on that stuff and marvel on the beauty |
16:26:35 | Zevv | the nasty part is that it is a pain to code in CPS style by hand |
16:26:48 | Zevv | so there's the disruptek/cps repo, which has 2 things. 2 layers |
16:27:02 | Zevv | the important part there is the 'cps' macro in the `cps` module |
16:27:15 | Zevv | You pass it a proc that can currently have a fairly large subset of valid nim |
16:27:19 | * | Jesin quit (Quit: Leaving) |
16:27:33 | Zevv | and the macro will cut that into separate "resumable" pieces for you |
16:27:42 | Zevv | one of these pieces is what is called a "Continuation" |
16:28:10 | Zevv | disruptek has reached higher levels of enlightenment about that stuff and is already thinking in concepts |
16:28:25 | Zevv | but for me, a continuation is a real thing: it's an object that holds a proc pointer |
16:28:39 | Araq | dadada, for the fun of it I studied NectarJS's source code |
16:28:42 | Zevv | and some stuff. You "continue" a continuation by calling that function with the stuff |
16:28:49 | Zevv | you call `c.fn(c)` |
16:28:55 | Zevv | The result of that is again a continuation |
16:28:59 | Zevv | That is where the magic is |
16:29:03 | Araq | and well. don't use it in production. or at all. |
16:29:27 | Zevv | on top of that, there is things like aync io or coroutines or iterators |
16:29:34 | dadada | Araq: yeah, I'm currently as well :D it looks very basic at the moment |
16:29:59 | * | Jesin joined #nim |
16:30:18 | leorize | Zevv: now that's cool |
16:30:18 | Zevv | I never took the effort to look into disruptek evnet queue because it is totally overengineerd, so I propose to look at stash/standalone_tcp_server.nim |
16:30:24 | Zevv | it's pretty self contained |
16:30:52 | disruptek | rude. |
16:30:58 | leorize | win32 api contains a few CPS-style calls, I wonder if it's possible for me to tell the macro to "cut here and give me a continuation" |
16:30:59 | Zevv | it is bare bones CPS based async with only cps as dependency |
16:31:07 | Araq | dadada, https://medium.com/@bob.clark_34506/ive-seen-the-kickstarter-campaign-and-i-m-not-surprised-it-failed-18d30b92c09c#--responses nails it |
16:31:08 | leorize | so I can just yeet it to winapi :P |
16:31:40 | * | theelous3 joined #nim |
16:31:45 | disruptek | leorize: zevv is being modest; he created cps -- this is a fork. |
16:32:04 | Zevv | yeah, I got to, like, 20% or so |
16:32:06 | Zevv | and gave up |
16:32:21 | dadada | Araq: to be fair, that article is outdated a bit, they now say they use no GC and have their own memory management |
16:32:31 | disruptek | nah, i think it was at least 3/5, right? |
16:32:51 | dadada | but it's true that the project is very vague |
16:32:59 | disruptek | it was just lifting and copy-env, iirc. |
16:33:21 | Zevv | anyway, we now have while/else and if/continue |
16:33:31 | disruptek | haha |
16:33:55 | disruptek | whatelse is awesome. |
16:34:10 | Zevv | but seriously, I made gotos. I made try/catch/throw |
16:34:13 | dadada | looking at the source code reminded me why I think JS code is ugly |
16:34:21 | disruptek | ~araq |
16:34:21 | disbot | Araq: 11👑Andreas "What Else?" Rumpf👑 -- disruptek |
16:34:24 | Zevv | leorize: Here is a standalone goto: https://github.com/disruptek/cps/blob/master/stash/goto.nim |
16:34:38 | Zevv | or iterators: https://github.com/disruptek/cps/blob/master/stash/iterator.nim |
16:34:49 | Zevv | the last version was only 5 times slower then nim iterators |
16:35:29 | dadada | there's another very similar project but with less activity https://github.com/andrei-markeev/ts2c |
16:36:06 | leorize | Zevv: I guess now you just have to make it 5x faster :P |
16:36:25 | Zevv | frankly, I don't give a |
16:36:40 | disruptek | it's leak-free in arc. |
16:38:07 | leorize | and that's really cool |
16:38:08 | Zevv | I've been leak free for some years |
16:38:15 | disruptek | not me. |
16:38:22 | Zevv | well, was the async leak not found and fixed the other day? |
16:38:29 | disruptek | i can't remember a time when i didn't leak at least once per day. |
16:39:17 | disruptek | i think an async leak was fixed, yes. i don't know if it was entirely curative. |
16:39:28 | disruptek | i think Yardanico is the authority on those. |
16:40:10 | FromDiscord | <lqdev> does nim have support for checking CPU extensions? |
16:40:20 | disruptek | !repo cpuwhat |
16:40:21 | disbot | https://github.com/awr1/cpuwhat -- 9cpuwhat: 11Nim utilities for advanced CPU operations: CPU identification, ISA extension detection, bindings to assorted intrinsics 15 15⭐ 1🍴 |
16:40:56 | FromDiscord | <lqdev> cool, thanks |
16:41:05 | Zevv | oh and here I am gulping /proc/cpuinfo |
16:41:16 | disruptek | sucker. |
16:41:25 | Zevv | i know |
16:41:49 | disruptek | zevv's stuck in 2018 nim over here. |
16:41:55 | Zevv | I like how you always take care to use proper punctuation, even if you're just cursing |
16:42:20 | disruptek | lol no |
16:42:58 | FromDiscord | <aachh> So, if I was writing a language VM in C I'd use macros to identify opcodes, like #define some-opcode 0x01, #define another-opcode 0x02, right? And then use those macros across the VM implementation |
16:43:06 | FromDiscord | <aachh> What would be the Nim-ic way to do that? |
16:43:37 | FromDiscord | <lqdev> use an enum |
16:43:41 | disruptek | ~manual |
16:43:42 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
16:43:43 | FromDiscord | <Clyybber> const someopcode = 0x01 |
16:44:08 | FromDiscord | <aachh> Are consts compile-time evaluated? |
16:44:11 | FromDiscord | <lqdev> yes |
16:44:14 | FromDiscord | <aachh> Ah, I ese |
16:44:16 | FromDiscord | <aachh> see* |
16:44:20 | FromDiscord | <aachh> Thank you very much! |
16:46:16 | FromDiscord | <aachh> Also apparently there's a computed goto pragma |
16:46:18 | FromDiscord | <aachh> For while loops |
16:46:21 | FromDiscord | <aachh> https://nim-lang.org/docs/manual.html#pragmas-computedgoto-pragma |
16:46:24 | FromDiscord | <aachh> Nim is amazing |
16:46:59 | Zevv | And so it is |
16:50:45 | * | superbia joined #nim |
16:53:26 | * | abm joined #nim |
16:55:18 | dadada | the changelog of nectarjs is in parts hilarious |
16:55:22 | dadada | VERSION 0.4.0 |
16:55:25 | dadada | Improving some bug |
16:55:53 | dadada | it's very reassuring that they have been improving some bug |
16:58:29 | * | superbia1 joined #nim |
16:59:23 | * | couven92 joined #nim |
17:00:59 | * | superbia quit (Ping timeout: 240 seconds) |
17:01:22 | * | couven92 quit (Client Quit) |
17:01:41 | Oddmonger | it's a feature |
17:02:03 | Zevv | someone has to do it, might as well be them right |
17:02:46 | dadada | usually most people do it unintentionally, they're the first to do it intentionally |
17:11:36 | * | snowolf quit (Quit: No Ping reply in 180 seconds.) |
17:11:36 | * | snowolf joined #nim |
17:11:36 | * | snowolf quit (Changing host) |
17:11:36 | * | snowolf joined #nim |
17:12:15 | * | andrew joined #nim |
17:13:16 | * | SenasOzys joined #nim |
17:14:38 | disruptek | Zevv: a continuation that wraps T has the same semantics as any other continuation that wraps T. they are the same type. |
17:19:48 | * | maier joined #nim |
17:24:20 | Zevv | so? |
17:24:30 | disruptek | netflix & chill |
17:25:06 | * | maier quit (Ping timeout: 260 seconds) |
17:27:48 | Araq | dadada, my favourite is https://github.com/NectarJS/nectarjs/commit/f034e33734ffa5fb5294b9c108942d99be3b1945#diff-c218b20e504dcc41a5ca00a9cf3f5d6aR40-R46 |
17:28:18 | Araq | that's both entirely unnecessary with 'char*' and leaks memory |
17:29:04 | * | snowolf quit (Quit: No Ping reply in 180 seconds.) |
17:29:39 | * | snowolf joined #nim |
17:31:15 | * | endragor quit (Remote host closed the connection) |
17:32:41 | FromDiscord | <aachh> I mean |
17:32:56 | FromDiscord | <aachh> The idea of a compiler making binaries out of JavaScript seems cool |
17:33:02 | FromDiscord | <aachh> I actually haven't ever heard about this |
17:34:33 | Araq | the idea is as cool as using JavaScript for anything |
17:37:27 | dadada | it's definitely useful... I don't see the point in porting asciidoctor to Nim, it's really a lot of work, and the reference project will always be better than the port, exactly because it is the reference |
17:38:18 | dadada | but since Ruby can transpile to Javascript very well through Opal, we get asciidoctor.js ... now the final step would be to transpile JS into Nim in an ideal world |
17:38:19 | Zevv | that's a bad reason. |
17:38:48 | Zevv | not doing somehing because you think the current stuff will always be better |
17:39:18 | dadada | but not being in the ideal world, transpiling asciidoctor.js to C/C++ would be pretty decent, than I could probably make use of it in C/C++/Nim projects without a lot of issues, don't get the penalty of an interpreter |
17:39:56 | FromDiscord | <Rika> not all interpreters have massive penalties though? |
17:41:10 | Araq | dunno, I simply don't use asciidoctor. The less software written after 1990 I use, the happier I am. |
17:41:12 | dadada | a minor penalty is still not a good thing |
17:41:20 | * | sagax joined #nim |
17:41:51 | disruptek | no one likes spending time in the box. |
17:41:59 | dadada | Araq: it's a terrible name for a format that is superior competition to markdown |
17:42:06 | FromDiscord | <aachh> > the idea is as cool as using JavaScript for anything |
17:42:09 | FromDiscord | <aachh> Ay, I like JS though |
17:42:12 | Zevv | Araq is doing is docs in nroff |
17:42:15 | dadada | and I bet you use markdown, which was written after 1990.. :D |
17:42:28 | FromDiscord | <aachh> Beat me up, but that's my genuine opinion |
17:42:31 | FromDiscord | <Rika> dadada: and the effort needed to port something is even less of a good thing isnt it |
17:44:32 | Araq | dunno, asciidoctor is a nice name. but I just learned it's written in Ruby and so I won't use it. :P |
17:44:41 | dadada | Rika: it depends what we're talking about, I don't think those things can be generalized, of course it would be great to port Qt5 to native Nim code, but a wrapper that I can use in Nim would already make me very happy ... I mean, obviously it would be crazy to want to port all the millions upon millions of lines of code |
17:45:04 | dadada | millions of lines of FOSS code, I don't mean Qt only here |
17:45:40 | Araq | well but Qt5 accomplishes more than parsing ascii into a document tree and rendering it out as HTML. I did that in my spare time. |
17:46:11 | dadada | Araq: you're making my exact point! (there's also a python version called asciidoc ... btw...) It being written in Ruby is my sole reason for not already using it |
17:46:31 | * | andrew_ joined #nim |
17:46:37 | dadada | Araq: it can render to DocBook, manpages and PDFs ... and I'm sure more backends will follow |
17:46:39 | * | Jesin quit (Quit: Leaving) |
17:47:01 | dadada | indeed, there are already more backends, they're just not advertised on their frontpage, you find it deep in the docs |
17:48:41 | dadada | I would like to add a backend for it, that renders to a terminal, because to my knowledge it's one of only very few such formats that also support defining colors for text segments ... markdown can't do it, orgmode can't do it AFAIK |
17:49:49 | * | dulsi_ is now known as dulsi |
17:50:01 | * | andrew quit (Ping timeout: 264 seconds) |
17:57:49 | * | Jesin joined #nim |
18:00:52 | dadada | Araq: what convinces me is that asciidoc is endorsed by Linus Torvalds, markdown has so many obvious shortcomings if you want to do anything more advanced like using footnotes or tables, you already need extensions, and it has no support for coloring and many other features that asciidoc has. Then there's orgmode, which is really cool in emacs, but it also lacks features of asciidoc. I'd like to see one |
18:00:59 | dadada | format succeed, that is easy to write (which I think is the main selling point of such formats), and has all the features that one would need to even write a real book, keep notes, keep track of projects/todos/dates (like orgmode), use it to make manpages, use it to make websites, obviously for documentation... asciidoc(tor) seems closest to achieving that at the moment, but no C compatible implementation |
18:01:05 | dadada | existing is probably holding it back ... |
18:01:52 | * | nikita` joined #nim |
18:01:53 | Zevv | disruptek: this bubble-up local lifting is amazingly simple to implement |
18:02:10 | dadada | yeah, sure you can write a basic markdown like parser in your spare time, but to the all the little details right and to support those more advanced features, like generating a PDF with a TOC and footnotes, I think that's not something you'd want to reinvent the wheel for |
18:02:44 | Araq | well I did it. for RST, it's still alive and called Nim's documentation generator |
18:03:09 | disruptek | no, no, let's reinvent the wheel. |
18:03:58 | Araq | and most people complained that it's not markdown so I added markdown features |
18:04:46 | disruptek | the continuation operator is `...`() 😁 |
18:06:46 | * | Kaivo quit (Remote host closed the connection) |
18:07:28 | * | Kaivo joined #nim |
18:10:17 | * | Kaivo quit (Remote host closed the connection) |
18:10:58 | * | Kaivo joined #nim |
18:14:06 | Zevv | disruptek: http://ix.io/2sIw, for what it's worth |
18:27:22 | Zevv | life is so much easier when you're typed |
18:34:04 | * | andrew_ quit (Ping timeout: 256 seconds) |
18:37:56 | * | zacts quit (Quit: WeeChat 2.8) |
18:40:37 | * | kenran joined #nim |
18:40:41 | FromDiscord | <Clyybber> disruptek... |
18:41:15 | disruptek | ...continuations intensify |
18:42:43 | FromDiscord | <aachh> Am I dumb or is there no array construction shortcut syntax? |
18:42:50 | disruptek | yes. |
18:42:57 | FromDiscord | <aachh> Like I want to initialize the array so there all of the values are the same |
18:43:05 | FromDiscord | <aachh> is there no syntax for that? |
18:43:34 | FromDiscord | <aachh> Like, you've got [length; value] in Rust, I believe |
18:43:40 | FromDiscord | <aachh> Is there something similar to this in Nim? |
18:44:34 | disruptek | https://nim-lang.org/docs/manual.html#types-array-and-sequence-types |
18:45:11 | * | Vladar quit (Quit: Leaving) |
18:46:24 | FromDiscord | <aachh> Yeah, I checked that earlier |
18:52:36 | leorize | @aachh algorithms.fill |
18:53:12 | FromDiscord | <aachh> Thank you very much!! |
18:53:21 | leorize[m] | https://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CT |
18:53:39 | leorize[m] | why sugar when it's one line away :P |
18:58:40 | * | andrew joined #nim |
18:59:47 | * | opal quit (Remote host closed the connection) |
19:00:54 | * | dzamo quit (Quit: dzamo) |
19:01:31 | * | opal joined #nim |
19:01:50 | * | nsf joined #nim |
19:03:02 | * | kenran quit (Quit: Lost terminal) |
19:03:39 | FromDiscord | <aachh> Oh no, wait |
19:03:56 | FromDiscord | <aachh> You don't need to fill the array at all |
19:04:03 | FromDiscord | <aachh> xD this is basically what I wanted |
19:05:46 | * | kenran joined #nim |
19:05:51 | * | kenran quit (Client Quit) |
19:06:23 | * | kenran joined #nim |
19:09:41 | Zevv | you |
19:09:43 | * | leorize quit (Ping timeout: 240 seconds) |
19:09:46 | Zevv | are not impressed |
19:09:47 | Zevv | are you |
19:10:57 | Zevv | disruptek: tell me, does the template way of accessing env variables work for you, or do you still think rewriting the source is better? |
19:11:17 | Zevv | !last pmunch |
19:11:17 | disbot | PMunch quit 72 weeks ago and last spoke 2 weeks ago |
19:11:27 | Zevv | how is that |
19:11:27 | * | leorize joined #nim |
19:15:18 | * | rockcavera quit (Remote host closed the connection) |
19:15:49 | * | rockcavera joined #nim |
19:20:42 | * | maier joined #nim |
19:22:32 | disruptek | when i try to compile this 100 line file, the nim compiler gives me 61,016 lines of error messages. more than 3mb. |
19:22:43 | Zevv | pretty cool |
19:22:48 | Zevv | which 100 line file would that be |
19:23:08 | disruptek | i guess it's not cps v3. |
19:23:12 | FromDiscord | <Varriount> shashlick: How can I tell when an output file from Nimterop was only partially generated (either due to the preprocessor terminating, or constructs Nimterop can't transform/recognize)? |
19:24:10 | FromDiscord | <Varriount> (other than by manually comparing the source file and the generated file) |
19:24:25 | Zevv | https://play.nim-lang.org/#ix=2sIR |
19:24:31 | Zevv | fine here? |
19:25:42 | * | maier quit (Ping timeout: 256 seconds) |
19:26:28 | disruptek | i'm trying to make data: seq[T] work. |
19:26:59 | Zevv | your data is already seq[T] in #28 |
19:28:06 | disruptek | var c = ... @[n, n.succ] |
19:28:16 | disruptek | c &= ... grow[T] |
19:29:00 | Zevv | so, what exactly is your plan now. You're starting from scratch right? |
19:29:09 | disruptek | well, i'm starting with 28. |
19:29:31 | Zevv | right |
19:29:43 | disruptek | trying to write it as "normal" nim that can consume `replace(s: string): string` transforms, regardless of where they are defined. |
19:30:15 | Zevv | hm fair enough |
19:31:07 | Zevv | do you have stuff in a repo yet? commit early commit often, as they say |
19:33:45 | * | narimiran joined #nim |
19:38:23 | disruptek | i always say that. |
19:38:31 | shashlick | @Varriount: preprocessor failures raise errors |
19:38:45 | shashlick | as for stuff nimterop doesn't recognize, it prints comments out at the beginning |
19:39:08 | Zevv | hey. I have `proc foo[T](v: T) = ...`. I can't do getTypeImpl or getTypeInst on `v` |
19:39:11 | Zevv | so how do I get `T`? |
19:39:44 | Zevv | or actually whay I have is in the proc `var someThing = v`. I need `someThing`'s type, so I want `T` |
19:40:24 | disruptek | dunno, does it seem important? |
19:40:52 | Zevv | to me it is. I'm lifting generics |
19:41:09 | FromDiscord | <Varriount> shashlick: Are you sure? I know that some libraries (such as the directx ones) are supposed to fail, because they have a #error pragma when compiled as C headers (they are C++ only) |
19:41:31 | disruptek | i kinda feel like playing wow. |
19:41:33 | FromDiscord | <Varriount> shashlick: Also, how does Nimterop know when to expand a C macro, vs treating it like a template? |
19:41:34 | disruptek | is that weird? |
19:41:41 | disruptek | i know if i boot it up i'll hate it. |
19:42:00 | Zevv | nah go for it |
19:42:09 | disruptek | i can't do it. |
19:42:15 | Zevv | then go type that shit boi |
19:42:21 | Zevv | talk talk talk |
19:42:30 | disruptek | well, i have. |
19:42:33 | Zevv | \o/ |
19:43:11 | disruptek | not only doesn't it work, but it takes 2 full seconds to thinking to decide it's not compilable. |
19:43:17 | shashlick | @Varriout - errors should kill - https://github.com/nimterop/nimterop/blob/master/nimterop/toastlib/getters.nim#L364 |
19:43:35 | disruptek | this is a 3 line error message, mind you. |
19:43:35 | Zevv | 2 secs, that's nothing |
19:43:36 | shashlick | as for C macros, nimterop doesn't know how to generate templates yet |
19:46:06 | FromDiscord | <Varriount> shashlick: But it knows how to translate `ifdef` to `when defined` (or at least, it appears to, from the output I'm looking at). |
19:46:26 | leorize | shashlick: you seem to have checked some binary into nimble source tree |
19:48:51 | * | Ven`` joined #nim |
19:48:54 | shashlick | @Varriount: that's cleaned out by the preprocessor - there's no ifdefs after running through it |
19:48:59 | shashlick | @leorize: ugh |
19:49:27 | shashlick | what got added |
19:49:49 | leorize | issue727/src/abc |
19:49:57 | leorize | tests/issue727/src/abc |
19:50:20 | shashlick | is it possible to remove it altogether |
19:50:35 | leorize | you should employ one of those "ignore all file without extension" gitignore files |
19:53:27 | federico3 | dom96: http://play.mitos.is/?do=play |
19:55:52 | FromDiscord | <Recruit_main707> defining my own DllMain brakes the dll after compiling for some reason 🥴 ↵`proc DllMain*(hModule: HANDLE, reasonForCall: DWORD, lpReserved: LPVOID): WINBOOL {.stdcall, exportc, dynlib.} =` |
19:58:46 | * | zacts joined #nim |
19:59:47 | FromDiscord | <Recruit_main707> can i import a c macro? |
20:01:50 | FromDiscord | <lqdev> pretty sure yeah, but you'll have to use {.nodecl.} |
20:01:56 | FromDiscord | <lqdev> haven't tried tho |
20:02:09 | FromDiscord | <lqdev> just import it as a proc |
20:04:06 | * | opal quit (Remote host closed the connection) |
20:05:19 | * | opal joined #nim |
20:13:24 | FromDiscord | <lqdev> is there any documentation on lent/sink besides araq's RFC? |
20:13:51 | disruptek | doc/destructors.rst |
20:13:56 | leorize | ~destructors |
20:13:57 | disbot | no footnotes for `destructors`. 🙁 |
20:13:59 | leorize | ~destructor |
20:14:00 | disbot | destructor: 11https://nim-lang.org/docs/destructors.html -- leorize |
20:14:06 | FromDiscord | <lqdev> thanks |
20:15:33 | FromDiscord | <lqdev> > If it cannot be proven to be the last usage of the location, a copy is done instead and this copy is then passed to the sink parameter. |
20:15:38 | FromDiscord | <lqdev> that clears things up |
20:16:06 | disruptek | eh yeah |
20:16:07 | FromDiscord | <lqdev> i was looking for something more akin to c++'s rvalue references but i guess this should suffice |
20:16:35 | disruptek | Zevv: http://ix.io/2sJg/nim |
20:16:51 | * | kenran quit (Quit: leaving) |
20:16:58 | disruptek | i'm looking forward to red dead redemption 2. |
20:17:05 | disruptek | i wonder if i can get it cheaply. |
20:17:05 | Zevv | oh dude |
20:17:08 | Zevv | you're up for a treat |
20:17:27 | disruptek | i really loved the first game. |
20:17:48 | Zevv | I think I even liked this one better |
20:19:38 | Zevv | /tmp/d.nim(91, 9) Error: expression 'c ... @[n, succ(n, 1)]' has no type (or is ambiguous) |
20:20:39 | disruptek | zevv i give you 3mins with my code and you've already broken it. |
20:21:05 | Zevv | make better code then |
20:21:45 | Zevv | dude could you not proc `.`[T](c: C[T]; p: P[C[T]]): C[T] = |
20:22:42 | disruptek | did you not get all the lines of the file? |
20:22:51 | disruptek | or did you throw away the ones you couldn't read? |
20:22:57 | Zevv | I curled the ix |
20:30:29 | * | zacts quit (Quit: WeeChat 2.8) |
20:32:22 | * | Trustable joined #nim |
20:33:46 | * | andrew quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
20:36:18 | * | nsf quit (Quit: WeeChat 2.8) |
20:40:26 | * | narimiran quit (Ping timeout: 256 seconds) |
20:52:07 | * | dulsi_ joined #nim |
20:54:25 | * | dulsi quit (Ping timeout: 240 seconds) |
20:57:58 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:58:45 | * | rockcavera quit (Read error: Connection reset by peer) |
21:00:28 | * | rockcavera joined #nim |
21:02:12 | * | rockcavera is now known as Guest92467 |
21:02:12 | * | tiorock joined #nim |
21:02:12 | * | Guest92467 quit (Killed (tolkien.freenode.net (Nickname regained by services))) |
21:02:12 | * | tiorock is now known as rockcavera |
21:06:15 | * | rockcavera quit (Read error: Connection reset by peer) |
21:07:40 | * | rockcavera joined #nim |
21:08:37 | * | dulsi_ is now known as dulsi |
21:09:10 | * | WilhelmVonWeiner quit (Quit: leaving) |
21:09:33 | * | WilhelmVonWeiner joined #nim |
21:09:36 | * | tiorock joined #nim |
21:09:36 | * | tiorock quit (Changing host) |
21:09:36 | * | tiorock joined #nim |
21:09:36 | * | rockcavera is now known as Guest26348 |
21:09:36 | * | tiorock is now known as rockcavera |
21:09:37 | * | Ven`` joined #nim |
21:10:15 | dadada | what are the most popular applications (or other projects) that are written in Nim? |
21:10:25 | federico3 | the compiler itself :) |
21:11:18 | FromDiscord | <Elegant Beef> Nimble |
21:11:31 | FromDiscord | <Elegant Beef> pretty much all of the nim dev tools 😄 |
21:11:42 | FromDiscord | <Elegant Beef> Nitter is pretty popular iirc |
21:12:05 | * | Guest26348 quit (Ping timeout: 240 seconds) |
21:15:26 | dadada | disruptek: how is nymph development going? |
21:15:32 | dadada | was that supposed to replace nimble? |
21:18:58 | leorize | it's nimph, this is not python lol |
21:19:10 | dadada | ok, so nimph |
21:19:24 | shashlick | new --gc:arc bug in devel |
21:19:29 | leorize | I don't think nimph will ever replace nimble, esp when it requires nimble to function :P |
21:20:04 | shashlick | disruptek is good with me poaching stuff out of nimph into nimble |
21:20:26 | leorize | better nimble is good for everyone |
21:20:37 | dadada | yes, definitely |
21:21:33 | * | maier joined #nim |
21:26:50 | * | maier quit (Ping timeout: 260 seconds) |
21:28:09 | FromDiscord | <aachh> :( https://media.discordapp.net/attachments/371759389889003532/738508251624374433/Zrzut_ekranu_2020-07-30_o_23.28.03.png |
21:30:41 | FromDiscord | <Recruit_main707> i think writing your own dll main is broken/impossible in latest stable release of nim |
21:30:56 | leorize | depends on how you're doing it |
21:32:11 | FromDiscord | <Recruit_main707> i have tried everything, but nothing worked, not even nppnim's way (which in theory works) |
21:32:26 | FromDiscord | <Recruit_main707> and is somewhat up to date |
21:32:28 | leorize | well how are you doing it then? |
21:33:01 | FromDiscord | <Recruit_main707> https://github.com/jangko/nppnim/blob/master/nppnim.nim#L75-L77 |
21:33:43 | FromDiscord | <Recruit_main707> trying to load the resulting dll with loadLib returns `nil` |
21:34:15 | * | rockcavera quit (Read error: Connection reset by peer) |
21:35:03 | leorize | did you compile with --noMain? |
21:35:32 | FromDiscord | <Recruit_main707> yes, code compiles |
21:35:37 | * | solitudesf quit (Ping timeout: 264 seconds) |
21:36:25 | leorize | did you inspect the resulting C code? |
21:36:59 | FromDiscord | <Recruit_main707> yes, i have found something rn actually, it is --threads what apparently makes things dont work |
21:37:09 | FromDiscord | <Recruit_main707> even if its not used |
21:37:33 | * | rockcavera joined #nim |
21:37:44 | leorize | so... what's the issue in the code gen? |
21:38:51 | FromDiscord | <Recruit_main707> there is no visible difference between compiling it with --threads:on or off↵just the fact that it works or it doesnt |
21:39:26 | leorize | so... have you filed an issue with some sample testing code? |
21:39:33 | FromDiscord | <exelotl> dadada: nitter is a fairly popular project using Nim |
21:39:46 | FromDiscord | <Recruit_main707> nope, i have just found it, i guess i should |
21:40:01 | FromDiscord | <Recruit_main707> ill do it tomorrow after trying some things |
21:40:16 | leorize | thanks :) |
21:43:11 | leorize | is there any known technique to do type matching in a macro? |
21:43:42 | FromDiscord | <lqdev> like, comparing two types? there's sameType |
21:44:32 | dadada | exelotl: yeah, somebody already said that... If I was cynical my comment on this would be: so there's one. |
21:44:36 | dadada | :D |
21:48:40 | FromDiscord | <exelotl> Oh lol I missed that 😂 |
21:51:24 | FromDiscord | <exelotl> Does look like nitter is the most starred on github, followed by jester, then arraymancer |
21:55:51 | dadada | I get physically ill when looking at JS code :-( |
21:56:51 | FromDiscord | <Elegant Beef> ok and you're mentioning this why? |
21:58:07 | dadada | well, I hoped for it to be amusing, maybe it is not. |
21:58:22 | FromDiscord | <Elegant Beef> idk what you're on about |
22:00:51 | * | aenesidemus joined #nim |
22:12:25 | * | Amun_Ra quit (Ping timeout: 246 seconds) |
22:18:17 | FromDiscord | <exelotl> Here's some JS code that I wrote today https://twitter.com/exelotl/status/1288914689024548866 |
22:18:34 | FromDiscord | <exelotl> Hope you enjoy |
22:31:49 | FromDiscord | <Elegant Beef> @exelotl my current method beats yours hands down https://media.discordapp.net/attachments/371759389889003532/738524271344877628/unknown.png |
22:32:33 | FromDiscord | <Elegant Beef> storing all even numbers into an intset from int.low to int.high, very efficient |
22:33:38 | FromDiscord | <Elegant Beef> Something tells me that i dont have enough memory for my solution |
22:35:06 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:35:33 | FromDiscord | <exelotl> Holy shit hahaha |
22:35:34 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2sJV |
22:35:49 | FromDiscord | <Elegant Beef> Totally valid solution, i killed it at 3GiB cause no way in hell is it going to finish |
22:36:23 | FromDiscord | <exelotl> The poor playground... |
22:36:29 | FromDiscord | <Elegant Beef> I didnt run it there |
22:36:56 | FromDiscord | <Elegant Beef> -2^63..2^63 -1 is a few too many bytes |
22:37:29 | FromDiscord | <exelotl> I love the simplicity of this awful awful solution |
22:37:58 | FromDiscord | <Elegant Beef> how much ram does this require |
22:38:46 | FromDiscord | <exelotl> Actually you could use a set instead of an intset |
22:39:15 | FromDiscord | <exelotl> (Maybe) |
22:40:06 | FromDiscord | <Elegant Beef> I mean doesnt really matter the amount of ram required is ~2 * 2^63 * 8 |
22:40:50 | FromDiscord | <exelotl> nah it would be /8 rather than *8 right? |
22:40:51 | FromDiscord | <Elegant Beef> https://media.discordapp.net/attachments/371759389889003532/738526548684046417/unknown.png |
22:40:55 | FromDiscord | <Elegant Beef> Yea nvm |
22:40:56 | FromDiscord | <Elegant Beef> Im dumb |
22:41:00 | FromDiscord | <Elegant Beef> The * 8 is useless |
22:41:33 | FromDiscord | <Elegant Beef> there should be proper https://media.discordapp.net/attachments/371759389889003532/738526724974706738/unknown.png |
22:42:17 | FromDiscord | <Elegant Beef> yes i realize that 2* 2^63 is just 2^64 |
22:42:56 | FromDiscord | <Elegant Beef> I guess it only needs half of that since it only needs evens and that's 50$ |
22:42:58 | FromDiscord | <Elegant Beef> (edit) '50$' => '50%' |
22:45:40 | FromDiscord | <Elegant Beef> So anyone want to go halfers with me on ram so we can see if this works? |
22:58:22 | FromDiscord | <exelotl> @Elegant Beef dangit :( https://media.discordapp.net/attachments/371759389889003532/738530955941249174/Screenshot_from_2020-07-30_23-58-06.png |
22:59:32 | FromDiscord | <Elegant Beef> I mean you're literally going to filling up have the amount of possible ram available for 64 bit CPUs |
22:59:37 | FromDiscord | <Elegant Beef> (edit) 'have' => 'half' |
22:59:48 | FromDiscord | <Elegant Beef> So it's not going to work regardless |
23:00:00 | FromDiscord | <Elegant Beef> oh wait you went 32bit |
23:00:04 | FromDiscord | <exelotl> yeah. xD |
23:00:09 | FromDiscord | <exelotl> it would fit in 512mb |
23:00:35 | FromDiscord | <Elegant Beef> should fit in roughly 2GB afaik |
23:01:32 | FromDiscord | <exelotl> yeah, but bearing in mind these are bitsets, you can store 8 values per byte |
23:03:05 | FromDiscord | <exelotl> for example a set[0..63] should fit in 8 bytes |
23:03:31 | * | krux02_ joined #nim |
23:03:44 | FromDiscord | <Elegant Beef> Yea i understand what you implied but 0 idea how it's done 😄 |
23:06:02 | * | krux02 quit (Ping timeout: 260 seconds) |
23:06:31 | * | Avatarfighter quit (Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in) |
23:07:15 | * | abm quit (Read error: Connection reset by peer) |
23:08:25 | FromDiscord | <exelotl> oh it's simple (for small sets at least), it basically does `(s and (1 shl n))` to check if the `n`th bit is flipped (in which case `n` is in the set) |
23:09:46 | FromDiscord | <Elegant Beef> Oh, i misread bits instead of bytes |
23:09:49 | FromDiscord | <Elegant Beef> it's just bitflags 😄 |
23:09:54 | * | nikita` quit (Quit: leaving) |
23:10:04 | FromDiscord | <exelotl> yeah :P |
23:10:17 | FromDiscord | <Elegant Beef> I was super confused how it could compress 64 flags into 8 bits |
23:12:57 | FromDiscord | <exelotl> I'm not entirely sure how the `intsets` module works though... I think it's based off the same concept but can have holes, so that it doesn't waste memory if you add e.g. the values `3` and `500321` |
23:13:45 | FromDiscord | <exelotl> would be cool if someone who knows more could explain it to me. xD |
23:18:35 | * | dadada quit (Ping timeout: 240 seconds) |
23:20:29 | * | Trustable quit (Remote host closed the connection) |
23:20:53 | * | dadada joined #nim |
23:21:17 | * | dadada is now known as Guest49611 |
23:22:28 | * | maier joined #nim |
23:27:23 | * | maier quit (Ping timeout: 240 seconds) |
23:59:27 | Yardanico | I'm ecstatic |
23:59:44 | Yardanico | all nim-markdown tests passed after the cursor inference re-implementation PR |