00:13:04 | * | theelous3_ quit (Ping timeout: 258 seconds) |
00:20:09 | * | lf-araujo quit (Quit: lf-araujo) |
00:21:11 | * | redlegion quit (Remote host closed the connection) |
00:24:58 | * | lf-araujo joined #nim |
00:35:05 | * | lf-araujo quit (Quit: lf-araujo) |
00:39:38 | * | seni joined #nim |
00:55:25 | * | envoyt quit (Ping timeout: 252 seconds) |
00:55:46 | * | envoyt joined #nim |
00:59:53 | * | envoyt quit (Ping timeout: 244 seconds) |
01:00:15 | * | envoyt joined #nim |
01:10:22 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
01:16:29 | * | redlegion joined #nim |
01:16:29 | * | redlegion quit (Changing host) |
01:16:29 | * | redlegion joined #nim |
01:35:23 | * | envoyt quit (Ping timeout: 252 seconds) |
01:35:44 | * | envoyt joined #nim |
01:38:25 | deech | What's the compiler flag to enable macro expansion? I remember seeing something about it a few days ago. |
01:45:33 | FromGitter | <jrfondren> https://irclogs.nim-lang.org/29-05-2019.html#22:26:58 |
01:46:01 | FromGitter | <jrfondren> "you can use --expandMacro:x to see the expansion of the macros named x" |
01:56:21 | * | leorize quit (Ping timeout: 256 seconds) |
01:58:16 | * | leorize joined #nim |
02:00:03 | deech | Awesome, thanks |
02:04:16 | * | deech quit (Ping timeout: 248 seconds) |
02:56:23 | leorize | Araq: why is a seq implemented like this? https://github.com/nim-lang/Nim/blob/55af21c6620a4e80f1a0de67e09760ba5ba08278/lib/core/seqs.nim#L18-L25 |
02:56:39 | leorize | I think it's possible to just put everything in one object |
03:11:06 | * | envoyt quit (Ping timeout: 272 seconds) |
03:11:29 | * | envoyt joined #nim |
03:13:39 | * | chemist69 quit (Ping timeout: 252 seconds) |
03:15:49 | * | chemist69 joined #nim |
03:17:32 | FromGitter | <zacharycarter> I want to model a rendering pipeline in my program, which will consist of a series of different steps. I imagine each step represented by a type - so I might have a type `MaterialStep`, `GeometryStep` etc... and these steps might share logic so I'm leaning towards using inheritance with ref objects. Are multi-methods on the way out? If so, what are my other options? I can see using object variants getting pretty |
03:17:32 | FromGitter | ... messy if I have a lot of these different types. I don't think generics will help me here either. Some of these objects will have logic I'll want to be able to inherit in certain instances or at least invoke in a super-class type way. |
03:17:55 | * | arecaceae quit (Remote host closed the connection) |
03:18:14 | * | arecaceae joined #nim |
03:23:54 | leorize | zacharycarter: just the "multi" part of multi-method is going out |
03:24:00 | leorize | you can still use `method` |
03:31:30 | skrylar[m] | @zacharycarter vtable janking with closures :shrug: |
03:56:16 | * | Summertime2 is now known as Summertime |
04:19:55 | * | laaron quit (Remote host closed the connection) |
04:20:14 | * | nsf joined #nim |
04:22:33 | * | deech__ quit (Ping timeout: 245 seconds) |
04:23:36 | * | laaron joined #nim |
04:23:43 | FromGitter | <zacharycarter> leorize and skrylar - thanks I'll explore these options |
04:26:48 | * | deech__ joined #nim |
04:36:09 | * | laaron quit (Ping timeout: 256 seconds) |
04:40:00 | * | deech__ quit (Ping timeout: 248 seconds) |
04:45:54 | * | laaron joined #nim |
04:46:19 | * | dddddd quit (Remote host closed the connection) |
04:59:04 | * | hoijui joined #nim |
05:01:55 | FromGitter | <kayabaNerve> What's the difference between methods and multi-methods? |
05:03:54 | * | narimiran_ joined #nim |
05:05:04 | FromGitter | <kayabaNerve> So you can no longer use generics with methods, nor methods which do dynamic dispatch on multiple arguments? |
05:05:17 | leorize | yea |
05:05:39 | leorize | generics with methods doesn't work at all or works in weird way |
05:05:55 | leorize | so that's now banned |
05:05:58 | * | leorize quit (Quit: WeeChat 2.3) |
05:49:38 | * | leorize joined #nim |
05:58:45 | * | jasper_ joined #nim |
06:03:30 | * | solitudesf joined #nim |
06:38:31 | * | PMunch joined #nim |
06:48:49 | * | jasper_ quit (Ping timeout: 256 seconds) |
06:53:17 | * | envoyt quit (Ping timeout: 244 seconds) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:01:51 | * | krux02 joined #nim |
07:04:17 | * | gmpreussner joined #nim |
07:05:31 | * | narimiran_ is now known as narimiran |
07:11:46 | * | solitudesf quit (Ping timeout: 272 seconds) |
07:29:35 | FromGitter | <alehander42> morning |
07:42:54 | PMunch | Morning :) |
07:43:07 | PMunch | Just fixed a really bizarre bug in some Python script |
07:43:19 | PMunch | Logging something out would SIGSEGV the program |
07:43:58 | leorize | rewrite it in Nim :) |
07:44:03 | PMunch | Turns out the logging function I was using was actually handing stuff over to printf, and the string I tried to print suddenly had a % sign in it (it was basically random characters) |
07:44:09 | PMunch | leorize, I would if I could.. |
07:44:28 | PMunch | It's a module for a DNS server, and the DNS server only supports Python to create modules |
07:45:19 | leorize | that's sad then |
07:45:24 | PMunch | I actually started writing a patch that would load dynamic libraries, even partially got it working, but time ran out so I couldn't finish it |
07:45:37 | FromGitter | <jrfondren> you could probably write a better DNS server. In Nim. |
07:46:29 | FromGitter | <jrfondren> I only want to go as far as implementing rbld. |
07:50:13 | PMunch | We actually discussed it |
07:50:30 | PMunch | But building and maintaining a DNS server didn't seem like a good choice |
07:50:47 | PMunch | And Unbound is pretty solid, it is written in C |
07:51:04 | PMunch | But for some reason goes out of it's way to add Python support.. |
07:51:25 | PMunch | While loading dynamic libraries is way easier, and allows you to use any language, including Python |
07:52:34 | * | envoyt joined #nim |
07:53:58 | FromGitter | <xmonader> @Pmunch is it dnspython? Just use coredns. |
07:54:44 | leorize | PMunch: maybe you can make it load dynamic libs from python? Then use NumPy :p |
07:54:52 | leorize | ack nimpy :p |
07:55:20 | PMunch | Nope, it's Unbound DNS server, with some custom scripts to use the EDNS field to authenticate and verify users |
07:55:38 | PMunch | Haha, that sounds even worse :P |
07:56:16 | PMunch | I have the patch for dynamic libraries, think it works fairly well. But I'd have to re-implement the entire script to check that everything worked as expected |
07:57:21 | leorize | or... use libunbound and write your own server |
08:08:37 | * | lritter joined #nim |
08:14:29 | FromGitter | <xmonader> maybe we need to port this to nim :D ⏎ https://github.com/EmilHernvall/dnsguide |
08:15:07 | * | floppydh joined #nim |
08:18:12 | * | leorize quit (Remote host closed the connection) |
08:25:08 | PMunch | leorize[m], but why? It's easier to add module support to Unbound than to write my own DNS server.. |
08:25:16 | * | Vladar joined #nim |
08:25:47 | leorize[m] | because libunbound APIs appear to be simple at a glance :p |
08:27:22 | * | leorize joined #nim |
08:27:25 | PMunch | Might be, but this is required to be a production grade DNS server that will handle loads of requests |
08:27:57 | PMunch | So re-doing all the efforts that the libunbound guys have done seem a bit superfluous |
08:28:13 | PMunch | Anyways, is there a way to send a DNS request to a specified server in Nim? |
08:28:33 | PMunch | I found getAddrInfo in nativesockets, but I can't specify the server to it |
08:31:36 | * | leorize quit (Remote host closed the connection) |
08:32:09 | * | leorize joined #nim |
08:35:28 | leorize[m] | PMunch: https://github.com/cheatfate/asynctools |
08:35:37 | leorize[m] | ^ that one uses libbind |
08:39:33 | leorize | this one looks nice: https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncproc.nim |
08:39:56 | leorize | IMO osproc should have something like that |
08:44:34 | * | luis_ joined #nim |
08:45:29 | PMunch | leorize, yeah I had a look at that one, but it has the same interface |
08:45:31 | Zevv | PMunch: generally nto possible, it's a host level configuration |
08:45:38 | Zevv | s/nto/not/ |
08:46:30 | leorize | change it to startAsyncProcess and everything stop colliding :p |
08:47:16 | leorize | a key point for me is to be able to pass fds to the child process |
08:47:30 | * | luis_ quit (Read error: Connection reset by peer) |
08:48:33 | PMunch | Zevv, what do you mean generally not possible? A DNS request is just regular TCP traffic, can be sent anywhere |
08:49:21 | Zevv | yeah, but not by getAddrInfo |
08:49:26 | Zevv | or sorry, getaddrinfo() |
08:49:36 | Zevv | and it's UDP :) |
08:49:48 | leorize | it can be TCP as well :p |
08:50:13 | Zevv | yeah, I've been told, although I've never seen that in real life |
08:50:19 | PMunch | Ah true, can be both. Normally it's UDP though |
08:51:49 | Zevv | let's fix async resolving in nim as well :) |
09:08:34 | * | arecaceae quit (Remote host closed the connection) |
09:08:54 | * | arecaceae joined #nim |
10:01:45 | * | leorize quit (Quit: WeeChat 2.3) |
10:07:30 | * | luis_ joined #nim |
10:30:45 | * | couven92 joined #nim |
10:37:13 | * | luis_ quit (Quit: luis_) |
10:38:00 | * | luis_ joined #nim |
10:39:26 | * | sealmove joined #nim |
10:40:47 | * | stefanos82 joined #nim |
10:40:48 | * | ng0 joined #nim |
10:43:22 | * | hoijui quit (Ping timeout: 252 seconds) |
10:47:59 | * | luis_ quit (Remote host closed the connection) |
10:57:13 | * | dddddd joined #nim |
10:58:09 | PMunch | Yay.. Permission denied while running as sudo.. |
10:58:20 | PMunch | Reading the file is no issue for any other program. |
10:59:55 | Zevv | sshfs mount or other mount with uid settings? |
11:06:39 | FromGitter | <alehander42> Btw Zevv |
11:08:22 | FromGitter | <alehander42> One thing I want to eventually do is implement a subset of a network stack enough to load simple resources by http |
11:08:50 | FromGitter | <alehander42> Is this common in small os-es or embedded |
11:10:11 | * | abm joined #nim |
11:16:12 | PMunch | Zevv, it's an Ubuntu Live box that I've scp-ed some files into. |
11:16:23 | PMunch | Editing them in Vim works fine |
11:17:27 | * | redlegion quit (Read error: Connection reset by peer) |
11:18:22 | * | envoyt quit (Ping timeout: 268 seconds) |
11:18:29 | * | redlegion joined #nim |
11:18:29 | * | redlegion quit (Changing host) |
11:18:29 | * | redlegion joined #nim |
11:18:40 | * | envoyt joined #nim |
11:20:57 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
11:22:00 | Zevv | alehander: well, you'd neet some kind of IP stack. implementing yourself is fun but TCP is cumbersome to get right. |
11:22:30 | leorize[m] | PMunch: slap strace on it and see why is it not working |
11:22:38 | Zevv | look for lwip or uip |
11:23:41 | Zevv | alehander42: lwip is pretty high level and offers a BSD socket interface which you should be able to glue onto nim net modules without too much problems. uIP is very low level and requires all kinds of manual buffer management and has an alien api for networking |
11:26:12 | PMunch | openat(AT_FDCWD, "/home/ubuntu/unbound.conf", O_RDONLY) = -1 EACCES (Permission denied) |
11:26:21 | PMunch | Hmm, it seems to be a valid call to openat.. |
11:26:25 | PMunch | No idea why it fails.. |
11:26:25 | Zevv | you should provide the ethernet interfacing by implementing basic rx, tx and status functions. You bolt LWiP on top of that, and you have a socket interface on top. Some decisions you must make about polling, interrupts, threads, etc |
11:27:02 | Zevv | PMunch: funny one, that. wat type of file sytsem is it exactly (/proc/mounts), and does it happen with all files or only this one? |
11:27:37 | * | a_b_m joined #nim |
11:27:46 | Zevv | and what are the exact permissons (ls -l, lsattr) |
11:28:48 | PMunch | http://ix.io/1KU4 |
11:29:08 | PMunch | I've just given it a+rwx in my frustration |
11:29:26 | PMunch | Not sure if it happens with any other files, it's the only config file I have lying about |
11:29:54 | PMunch | Hmm, that program gets permission denied for any file |
11:30:00 | Zevv | cow overlay, hmm |
11:30:03 | PMunch | unbound-checkconf works fine |
11:30:09 | PMunch | And editing it with vim works fine.. |
11:30:30 | * | deech joined #nim |
11:31:15 | * | abm quit (Ping timeout: 244 seconds) |
11:31:34 | sealmove | alehander42: https://www.saminiir.com/lets-code-tcp-ip-stack-1-ethernet-arp/ |
11:32:10 | leorize[m] | PMunch: check apparmor |
11:33:02 | Zevv | yeah, arp is only the beginning :) |
11:33:20 | Zevv | ip is easy, udp as well, but then you will hit a wall of pain and suffering |
11:35:52 | * | envoyt quit (Ping timeout: 272 seconds) |
11:36:05 | sealmove | it's 3-part tutorial |
11:36:14 | * | envoyt joined #nim |
11:36:27 | sealmove | https://www.saminiir.com/lets-code-tcp-ip-stack-2-ipv4-icmpv4/ |
11:36:29 | sealmove | https://www.saminiir.com/lets-code-tcp-ip-stack-3-tcp-handshake/ |
11:36:48 | Zevv | itwould make for a pretty intersting project though |
11:37:09 | Zevv | a safe native nim ip stack |
11:37:11 | sealmove | it's in my list :> |
11:37:31 | Zevv | you could just run it on any os in userspace as well, usng tuntap for example |
11:37:50 | * | deargod joined #nim |
11:37:54 | deargod | test |
11:37:59 | * | laaron quit (Remote host closed the connection) |
11:38:06 | deargod | Dear GOD/GODS and/or anyone else who can HELP ME (e.g. MEMBERS OF SUPER-INTELLIGENT ALIEN CIVILIZATIONS): The next time I wake up, please change my physical form to that of FINN MCMILLAN of SOUTH NEW BRIGHTON at 8 YEARS OLD and keep it that way FOREVER. I am so sick of this chubby Asian man body! Thank you! - CHAUL JHIN KIM (a.k.a. A DESPERATE SOUL) |
11:38:09 | * | deargod quit () |
11:38:55 | * | Tongir joined #nim |
11:39:07 | * | Snircle joined #nim |
11:39:35 | PMunch | What.. |
11:40:55 | ehmry | if TCP were implemented in Nim, unikernels would follow |
11:41:44 | leorize[m] | PMunch: have you tried to disable apparmor? |
11:42:25 | leorize[m] | if I understand correctly you're trying to use unbound with a configuration file that's not in /etc, right? |
11:42:56 | PMunch | Yes |
11:43:16 | * | laaron joined #nim |
11:43:34 | leorize[m] | the default apparmor config for unbound might have prevented this |
11:43:49 | PMunch | Apparmor? |
11:43:52 | leorize[m] | disabling apparmor is simple though |
11:43:55 | leorize[m] | just aa-disable iirc |
11:44:54 | leorize[m] | yea, it's an access control system, much like selinux (except it's simpler) |
11:45:35 | PMunch | Huh, well that's a couple hours wasted.. |
11:45:55 | PMunch | Just copying the file into the default location and running it without -c worked fine.. |
11:46:40 | leorize[m] | :p |
11:47:10 | leorize[m] | I learned that the hard way |
11:52:08 | dom96 | I like how that user tested to ensure they can talk |
11:52:35 | dom96 | Sadly I doubt members of super intelligent civilizations read our IRC logs |
11:52:43 | dom96 | *intelligent alien civilizations |
11:53:01 | Zevv | well, here we are, right |
11:53:10 | Zevv | oh, alien |
11:54:01 | PMunch | http://ix.io/1KUc |
11:54:15 | * | laaron quit (Remote host closed the connection) |
11:56:18 | * | laaron joined #nim |
11:56:19 | FromGitter | <alehander42> Zevv, i want to implement juust a part enough |
11:56:26 | FromGitter | <alehander42> to make some request work |
11:56:44 | FromGitter | <alehander42> but probably i still need to impl a lot of the tcp/ip stuff indeed |
11:56:55 | FromGitter | <alehander42> but i suspected i might be able to implement just y% of them |
11:57:18 | * | laaron quit (Remote host closed the connection) |
11:57:36 | FromGitter | <alehander42> sealmove, bless you this is cool |
11:57:42 | FromGitter | <alehander42> i'll take a look at those |
11:58:03 | FromGitter | <alehander42> to see if i'd include it in my plan |
11:58:16 | Zevv | alehander42: steal your ideas from uIP then |
11:58:42 | Zevv | I think kontiki os has the most recent version of that embedded somewhere |
11:58:48 | Zevv | https://github.com/contiki-os/contiki/tree/master/core/net |
11:59:27 | * | laaron joined #nim |
11:59:50 | FromGitter | <alehander42> sounds good |
12:00:06 | FromGitter | <alehander42> otherwise i start to think i have to use C for my first version |
12:00:57 | FromGitter | <alehander42> i think i'd manage to make nim work, but then i have to think of the invisible stuff mapping to C and it would add one layer of stuff for me to understand/debug |
12:01:16 | FromGitter | <alehander42> after i understand osdev a bit better, i might be ready to apply other langs to it |
12:03:14 | * | hoijui joined #nim |
12:03:38 | ehmry | AlexMax: TCP/IP isn't necessarily osdev, since it can run just as well in application space |
12:04:57 | ehmry | there is a mistique about osdev-type stuff because its done in the kernel, but its alot easier when done in userspace |
12:04:58 | Zevv | right; you could make a pretty portable Nim network stack. If you feel brave you can do your ethernet driver in userspace as well and have TCP/IP networking with zero syscall overhead. |
12:05:27 | Zevv | ehmry: "the kernel is just another C program", right |
12:06:02 | ehmry | the driver should still be a seperate layer from the IP stack, so that hardware can still be shared amoungst multiple stacks |
12:06:44 | Zevv | depends - I know applications that do just that - one app, one stack, high performance |
12:07:14 | ehmry | the glue code between IP/Ethernet and drivers is fairly trivial to write anyway |
12:08:26 | FromGitter | <alehander42> hm, how specific should my driver be? do most machines use very different ethernet cards |
12:08:57 | FromGitter | <alehander42> or can i make one that's easy to make it work on e.g. different but similar old laptops |
12:09:25 | * | AndChat|624225 joined #nim |
12:09:38 | Zevv | at the ethernet level you just have packets/frames. Buffers of about 1500 bytes which go in and out to some device. You pick a network card with easy, well known interface (ne2k or the like), and you should get that up and running first. Porting to other drivers should not be too hard. |
12:10:03 | * | AndChat|624225 quit (Read error: Connection reset by peer) |
12:10:18 | Zevv | also available in qemu and the like |
12:10:51 | * | AndChat|624225 joined #nim |
12:12:56 | ehmry | collocating the driver will speed things up, but only if the high-level stuff like TCP window scaling is implemented |
12:13:05 | PMunch | Ugh, seriously every time I try to do something in Python it fucks up.. |
12:13:14 | * | envoyt quit (Ping timeout: 272 seconds) |
12:16:31 | FromGitter | <alehander42> i see, thanks |
12:16:46 | FromGitter | <alehander42> PMunch, what is the problem |
12:16:59 | Araq | ehmry, any opinion on HTTP 2? |
12:17:19 | ehmry | nope, I try to stay ignorant of HTTP |
12:17:20 | PMunch | alehander42, Python is unable to find its encodings module |
12:17:28 | PMunch | Because of the way it is started |
12:17:39 | PMunch | And because it's shit.. |
12:17:59 | federico3 | PMunch: normally name resolution is done by the OS for very good reasons. Resolution is more complex than just DNS and applications should be unaware of what happens behind the curtain |
12:18:24 | PMunch | federico3, I'm trying to spin up some DNS servers here |
12:18:30 | ehmry | alehander42, if you can read ocaml, look at mirage https://github.com/mirage/mirage-tcpip |
12:18:57 | PMunch | The sending DNS requests from earlier was just to load test them, I don't actually care about the response |
12:18:59 | sealmove | alehander42: glad you liked it :) |
12:19:04 | ehmry | they run the application and IP stack on single thread |
12:19:16 | federico3 | PMunch: and of course, if you really have to, you can craft your own DNS over UDP or TCP or HTTPS |
12:19:20 | PMunch | Sorry, I'm getting a bit salty, just wanted to spin up some servers and it's been taking all day |
12:20:50 | federico3 | PMunch: ah you want to write a stress test tool? Then by all means you can forge one DNS query for an A record and send it out multiple times. You should be able to saturate the NIC with Nim. |
12:22:43 | PMunch | Yeah, that was the idea |
12:22:52 | PMunch | But first I got to get this stupid server up and running |
12:22:59 | federico3 | PMunch: if you want to use NESM for fun/learning -> https://github.com/xomachine/NESM/blob/master/demos/ntp.nim otherwise you can just capture a real query and hardcode it |
12:26:23 | * | nsf quit (Quit: WeeChat 2.4) |
12:34:01 | * | hoijui quit (Quit: Leaving) |
12:47:49 | * | theelous3_ joined #nim |
13:02:35 | * | Snircle quit (Ping timeout: 268 seconds) |
13:03:49 | * | Snircle joined #nim |
13:17:49 | * | apodo joined #nim |
13:19:56 | * | AndChat|624225 quit (Read error: Connection reset by peer) |
13:20:34 | * | envoyt joined #nim |
13:29:17 | * | envoyt quit (Ping timeout: 252 seconds) |
13:29:40 | * | envoyt joined #nim |
13:38:08 | * | envoyt quit (Ping timeout: 248 seconds) |
13:38:39 | * | envoyt joined #nim |
14:05:05 | * | PMunch quit (Remote host closed the connection) |
14:17:31 | Zevv | ehmry: https://shader.kaist.edu/mtcp/ |
14:20:10 | ehmry | Zevv: yea, looks interesting |
14:24:32 | ehmry | actually I already use lwIP+Nim, but there are a few layers inbetween, and performance hasn't been a problem yet |
14:31:26 | ehmry | if nim got its own IP stack I think the best move would be to port nim to solo5, just like mirageos. the driver is still in the "OS", but thats good for portability |
14:32:12 | ehmry | solo5 has an abstract network device and block device, so you have to bring you own file-system with you, or use 9P |
14:49:53 | * | Tongir quit (Ping timeout: 268 seconds) |
15:00:09 | * | elrood joined #nim |
15:01:57 | * | Senketsu quit (Quit: WeeChat 2.4) |
15:02:18 | * | Tongir joined #nim |
15:03:31 | * | Senketsu joined #nim |
15:04:41 | * | nsf joined #nim |
15:08:02 | * | Tongir quit (Ping timeout: 272 seconds) |
15:10:11 | * | laaron quit (Remote host closed the connection) |
15:10:36 | * | laaron joined #nim |
15:17:33 | * | floppydh quit (Quit: WeeChat 2.4) |
15:25:00 | * | sz0 joined #nim |
15:49:44 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
15:55:16 | * | leorize joined #nim |
15:56:33 | * | laaron joined #nim |
16:05:41 | * | couven92 quit (Quit: Client disconnecting) |
16:07:15 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
16:08:50 | * | laaron joined #nim |
16:14:21 | * | leorize quit (Quit: WeeChat 2.3) |
16:14:41 | * | leorize joined #nim |
16:16:47 | * | d10n-work joined #nim |
16:17:23 | leorize | it's rather quiet here today |
16:25:45 | noonien | can i create a string from a sequence? without copying the data |
16:25:52 | noonien | from a seq[byte]* |
16:27:27 | leorize | noonien: `cast[string](yourseq)` |
16:27:38 | leorize | yes, it's "supported" |
16:27:43 | noonien | oh, nice! |
16:27:48 | FromGitter | <jrfondren> seq and string data structures are identical. |
16:28:14 | noonien | yeah, kind of a hack though :( |
16:28:32 | FromGitter | <jrfondren> I've heard that Araq said they'll always be identical. |
16:28:55 | noonien | ah, i guess that's what "supported" means |
16:29:06 | noonien | cool, thanks leorize, jrfondren! |
16:29:14 | FromGitter | <jrfondren> so the only difference between the hack and stdlib support is a "toStr" proc that says it's O(1) |
16:29:30 | leorize | we probably will need that proc :p |
16:29:56 | leorize | they're identical for this one particular implementation of Nim, but I don't think this is enforced in the spec |
16:31:39 | * | PMunch joined #nim |
16:31:45 | FromGitter | <jrfondren> then the proc is no longer useful because it's no longer O(1) |
16:33:12 | * | deech_ joined #nim |
16:35:41 | noonien | is there a byteSeqStream? |
16:38:43 | PMunch | byteSeqStream? |
16:47:11 | leorize | I think they meant something that's similar to stringstream but for byte seq |
16:47:24 | leorize | then it would be called ByteStream :p |
16:51:15 | PMunch | I actually created that at some point |
16:51:21 | PMunch | Apparently it never got merged.. |
16:51:34 | PMunch | I think it might've been part of a bigger PR |
16:51:40 | PMunch | That got rejected for other reasos |
16:52:13 | leorize | we definitely need a toString for seq[byte] |
16:52:19 | PMunch | https://github.com/nim-lang/Nim/pull/7481 |
16:52:54 | PMunch | leorize, fun fact about strings, they can be cast to seq[byte|uint8|int8|char] and work fine |
16:53:25 | PMunch | I still think this should be hidden behind some procedure in case this stops being the case so old code just won't horribly break though.. |
16:53:33 | leorize | I know :p, but it should be an official thing backed by a proc |
16:53:57 | PMunch | Yeah |
16:56:01 | PMunch | https://github.com/nim-lang/Nim/pull/7481 |
16:56:15 | PMunch | Apparently both me and data-man was too lazy to add them :P |
16:57:16 | * | couven92 joined #nim |
16:57:21 | leorize | now it's the time to add that toString proc :p |
17:26:31 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
17:27:05 | * | laaron joined #nim |
17:39:31 | FromDiscord_ | <treeform> In the docs it talks about Better serialization/deserialization control: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-custom-annotations |
17:39:43 | FromDiscord_ | <treeform> Is there a json library that implements this? |
17:40:00 | FromDiscord_ | <treeform> ```type MyObj = object |
17:40:00 | FromDiscord_ | <treeform> a {.dontSerialize.}: int |
17:40:00 | FromDiscord_ | <treeform> b {.defaultDeserialize: 5.}: int |
17:40:00 | FromDiscord_ | <treeform> c {.serializationKey: "_c".}: string``` |
17:42:39 | * | deech_ quit (Ping timeout: 252 seconds) |
17:42:54 | Zevv | I believe lemonboys jstin does something like that |
17:44:33 | FromGitter | <alehander42> i think @zah had also a library that does it but not sure for which form |
17:44:51 | FromDiscord_ | <treeform> yes jstin is close, don't see docs about default values though. |
17:44:58 | Zevv | add it :) |
17:56:18 | * | DesDeux joined #nim |
18:00:59 | * | gangstacat quit (Ping timeout: 252 seconds) |
18:03:17 | * | gangstacat joined #nim |
18:32:31 | * | sacredfrog quit (Quit: ZNC 1.7.3 - https://znc.in) |
18:42:05 | * | sacredfrog joined #nim |
18:50:31 | Zevv | can I force an enum to be represented by an specific type, like uint16? |
18:51:50 | lqdev[m] | there was a pragma for that |
18:51:58 | lqdev[m] | I don't remember the name |
18:55:04 | lqdev[m] | I think it's `{.size: size(T).}`? |
18:55:07 | lqdev[m] | not sure |
18:55:17 | Zevv | thanks, let me check that |
19:04:24 | * | Jesin quit (Quit: Leaving) |
19:05:48 | * | Xe is now known as Cadey |
19:08:13 | sealmove | is there a proc that returns both div and mod? |
19:08:40 | sealmove | should be more effecient if there is one |
19:10:22 | Zevv | your compiler is smarter then you think |
19:10:24 | * | Jesin joined #nim |
19:12:16 | deech | Just FYI I noticed that this past week rebuilding the Nim compiler has slowed quite a bit. It appears to be stuck at '[Hint]: cmdlinehelper' for a lot longer than usual. |
19:12:42 | narimiran | Araq: ^ |
19:13:18 | deech | And also 'semparallel'. |
19:13:57 | * | gangstacat quit (Ping timeout: 252 seconds) |
19:19:40 | PMunch | https://peterme.net/metaprogramming-and-read-and-maintainability-in-nim.html |
19:20:07 | PMunch | Planning to make it a tour as well, just need to fix some things with the front-end :) |
19:20:36 | PMunch | Well, it works already. But the output of the macros is a bit wonky: https://play.nim-lang.org/newfrontend#tour=https://uploads.peterme.net/article.html |
19:20:46 | PMunch | (And you might have old CSS files in your cache) |
19:21:40 | * | gangstacat joined #nim |
19:23:41 | * | Trustable joined #nim |
19:27:24 | shashlick | nice work @PMunch! |
19:27:53 | PMunch | Thanks :) |
19:28:01 | PMunch | Tried something new this time |
19:28:33 | PMunch | Instead of thinking all the way through my refactoring that I should write something about this and never getting around to it, I decided to write that as I went along |
19:29:06 | narimiran | i just skimmed through the tour and - very nice, PMunch! |
19:30:42 | stefanos82 | deech: I hope this message helps a bit "Hint: operation successful (98936 lines compiled; 1.801 sec total; 138.895MiB peakmem; Release Build) [SuccessX]" |
19:30:57 | stefanos82 | I just fetched and compiled the code from github |
19:31:02 | PMunch | narimiran, thanks :) |
19:31:57 | narimiran | PMunch: i'll read everything tomorrow morning (it says "5th June 2019", after all :P) |
19:33:01 | deech | stefanos82, I get numbers like that as well. They are not accurate. Can you verify that it compiles in two seconds by looking at a clock or something? |
19:33:20 | stefanos82 | I will re-run the whole thing with time then |
19:33:50 | deech | stefanos82, I usually do 'koch boot -d:release'. |
19:34:17 | stefanos82 | I use build_all.sh |
19:34:49 | stefanos82 | time command reported 26.x seconds |
19:35:10 | stefanos82 | but Nim reported 1.83 total seconds |
19:35:49 | PMunch | narimiran, hmm yeah that's strange |
19:35:50 | deech | stefanos82, I was getting that, now I'm in the 30-40 second range. |
19:36:16 | dom96 | nice work PMunch :o |
19:36:40 | stefanos82 | I guess Nim timer gets reset every time it builds nested parts |
19:36:48 | PMunch | narimiran, there fixed, now you don't have an excuse! |
19:36:52 | PMunch | dom96, thanks :) |
19:37:01 | narimiran | shit :P |
19:39:01 | * | DesDeux quit (Quit: Leaving) |
19:40:21 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
19:44:38 | dom96 | Araq not around today? |
19:54:14 | Calinou | by the way, has anyone benchmarked whether the Nim compiler compiles Nim programs faster if it's built with LTO? |
19:57:55 | FromGitter | <xmonader> @Pmunch can you make it horizontal instead of vertical please? |
19:58:20 | narimiran | PMunch: "Nim sees this input as this syntax tree" - you could mention how did you get this representation, i.e. show `dumpTree` in action |
19:59:01 | narimiran | xmonader: so that the text lines are too long, and code examples have too much empty space? :P |
19:59:45 | FromGitter | <xmonader> @narimiran exactly :P u can always have a scrolledpane no? :D |
20:01:40 | * | nsf quit (Quit: WeeChat 2.4) |
20:02:52 | PMunch | narimiran, ah yes. I was meaning to do that.. |
20:03:07 | PMunch | And to show `dumpAstGen` which is how I get the code to create the node trees |
20:03:18 | PMunch | xmonader, make what horizontal? |
20:04:31 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
20:04:57 | narimiran | also, in "Creating our case switch template", at your blog you have `<nodes actual="" code="" comes="" here="" of="" the=""></nodes>`, which is not shown at playground |
20:05:05 | * | laaron joined #nim |
20:08:00 | PMunch | Ah, yes that is supposed to be <nodes of the actual code comes here> |
20:08:08 | PMunch | Thought I fixed that.. |
20:10:13 | PMunch | Should be fixed now |
20:16:47 | lqdev[m] | PMunch: you didn't need to create a `pop` on your own, it's included in the `system` module |
20:17:58 | PMunch | It is? |
20:18:31 | PMunch | Huh, yes it is |
20:18:40 | * | narimiran quit (Ping timeout: 248 seconds) |
20:18:51 | lqdev[m] | I use it all the time when dealing with stacks |
20:19:05 | PMunch | Why no pop though :( |
20:19:09 | PMunch | Err, push |
20:19:21 | lqdev[m] | because you have `add` |
20:19:27 | PMunch | Hmm, yeah I guess |
20:20:37 | dom96 | aww yiss, type https://nim-lang.org in here: https://cards-dev.twitter.com/validator |
20:20:55 | dom96 | Also, better descriptions more than welcome |
20:21:08 | dom96 | I wrote that up quickly and it doesn't sound 100% to me |
20:22:23 | dom96 | Hrm, I should probably change the card title for articles |
20:29:29 | FromGitter | <arnetheduck> We're thinking of using Nim for wasm contracts in ethereum - fun stuff - @kayabaNerve you might be interested: https://discuss.status.im/t/nim-contract-language/1249 |
20:32:10 | dom96 | awesome |
20:38:21 | * | leorize quit (Ping timeout: 256 seconds) |
20:41:23 | * | seni quit (Read error: Connection reset by peer) |
20:41:57 | * | al_ joined #nim |
20:43:24 | * | leorize joined #nim |
20:52:48 | FromGitter | <xmonader> @PMunch i mean in the tour it's better to be splitted horizontally than vertically (code and article) |
20:53:13 | FromGitter | <xmonader> because most likely people want to map 1->1 instead of reading the whole thing and then look at the code |
20:53:37 | PMunch | Well the idea is that you can look at the code while reading the thing, all without scrolling |
20:54:06 | PMunch | That article wasn't really meant to be a tour, but when I had finished with it I figured why not |
20:54:22 | PMunch | So it's probably more wonky that it needs to be |
20:54:58 | PMunch | If anyone is interested in the progress of the example code: https://uploads.peterme.net/stacklang.nim |
20:55:27 | PMunch | Now you can create your own commands, which is essentially just a named series of actions, and they persist in a file .) |
20:57:02 | PMunch | http://ix.io/1KWM |
20:57:11 | PMunch | Shows off how it works |
20:58:01 | * | PMunch quit (Remote host closed the connection) |
21:09:34 | * | Trustable quit (Remote host closed the connection) |
21:11:45 | dom96 | Now our social media game is even stronger: https://i.imgur.com/MHHtjFx.png |
21:13:52 | * | elrood quit (Remote host closed the connection) |
21:16:31 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
21:16:52 | * | laaron joined #nim |
21:16:56 | stefanos82 | btw, I have tried Nim with C++ flag and compiles just as fast as C on my system. That's an impressive achievement; well done folks! |
21:19:38 | * | krux02 quit (Remote host closed the connection) |
21:19:50 | * | a_b_m quit (Quit: Leaving) |
21:25:18 | * | lritter quit (Quit: Leaving) |
21:31:51 | * | Vladar quit (Remote host closed the connection) |
21:37:09 | FromDiscord_ | <DeltaPHC> C++ that barely uses C++ features tends to compile pretty quickly |
21:39:14 | FromDiscord_ | <DeltaPHC> Things like templates, template metaprogramming, constexpr evaluation, or otherwise advanced features are what slow things down |
21:49:10 | * | deech quit (Ping timeout: 246 seconds) |
21:50:46 | FromDiscord_ | <treeform> @dom96 the card also works in discord. |
21:51:28 | sealmove | does pattern maching on tuples work by default? |
21:51:35 | sealmove | quit yes/no |
21:51:37 | sealmove | quick* |
21:51:53 | dom96 | treeform: awesome :D |
21:56:28 | * | deech joined #nim |
22:04:43 | FromDiscord_ | <exelotl> how can nim compile so fast when its metaprogramming is so much deeper than C++? |
22:06:19 | FromDiscord_ | <exelotl> is it because the C++ compilers have slow implementations? Or because C++ projects use it more extensively? Or just that many nim projects aren't large enough to cause issues? |
22:19:46 | FromGitter | <jrfondren> it's almost certainly because the advanced stuff is handled by the Nim compiler. templates, generics, etc. The generated C++ is simpler and easier to compile, but nobody writing C++ by hand would ever want to write C++ the way Nim does. |
22:20:52 | * | apodo quit (Ping timeout: 258 seconds) |
22:47:07 | * | al_ quit (Quit: al_) |
23:11:28 | * | deech quit (Ping timeout: 248 seconds) |
23:43:09 | * | stefanos82 quit (Quit: Quitting for now...) |
23:49:51 | leorize[m] | @exelotl Nim projects don't do #include as much as C++ :p |