<< 04-06-2019 >>

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:25deechWhat's the compiler flag to enable macro expansion? I remember seeing something about it a few days ago.
01:45:33FromGitter<jrfondren> https://irclogs.nim-lang.org/29-05-2019.html#22:26:58
01:46:01FromGitter<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:03deechAwesome, thanks
02:04:16*deech quit (Ping timeout: 248 seconds)
02:56:23leorizeAraq: why is a seq implemented like this? https://github.com/nim-lang/Nim/blob/55af21c6620a4e80f1a0de67e09760ba5ba08278/lib/core/seqs.nim#L18-L25
02:56:39leorizeI 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:32FromGitter<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:32FromGitter... 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:54leorizezacharycarter: just the "multi" part of multi-method is going out
03:24:00leorizeyou can still use `method`
03:31:30skrylar[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:43FromGitter<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:55FromGitter<kayabaNerve> What's the difference between methods and multi-methods?
05:03:54*narimiran_ joined #nim
05:05:04FromGitter<kayabaNerve> So you can no longer use generics with methods, nor methods which do dynamic dispatch on multiple arguments?
05:05:17leorizeyea
05:05:39leorizegenerics with methods doesn't work at all or works in weird way
05:05:55leorizeso 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:35FromGitter<alehander42> morning
07:42:54PMunchMorning :)
07:43:07PMunchJust fixed a really bizarre bug in some Python script
07:43:19PMunchLogging something out would SIGSEGV the program
07:43:58leorizerewrite it in Nim :)
07:44:03PMunchTurns 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:09PMunchleorize, I would if I could..
07:44:28PMunchIt's a module for a DNS server, and the DNS server only supports Python to create modules
07:45:19leorizethat's sad then
07:45:24PMunchI 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:37FromGitter<jrfondren> you could probably write a better DNS server. In Nim.
07:46:29FromGitter<jrfondren> I only want to go as far as implementing rbld.
07:50:13PMunchWe actually discussed it
07:50:30PMunchBut building and maintaining a DNS server didn't seem like a good choice
07:50:47PMunchAnd Unbound is pretty solid, it is written in C
07:51:04PMunchBut for some reason goes out of it's way to add Python support..
07:51:25PMunchWhile loading dynamic libraries is way easier, and allows you to use any language, including Python
07:52:34*envoyt joined #nim
07:53:58FromGitter<xmonader> @Pmunch is it dnspython? Just use coredns.
07:54:44leorizePMunch: maybe you can make it load dynamic libs from python? Then use NumPy :p
07:54:52leorizeack nimpy :p
07:55:20PMunchNope, it's Unbound DNS server, with some custom scripts to use the EDNS field to authenticate and verify users
07:55:38PMunchHaha, that sounds even worse :P
07:56:16PMunchI 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:21leorizeor... use libunbound and write your own server
08:08:37*lritter joined #nim
08:14:29FromGitter<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:08PMunchleorize[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:47leorize[m]because libunbound APIs appear to be simple at a glance :p
08:27:22*leorize joined #nim
08:27:25PMunchMight be, but this is required to be a production grade DNS server that will handle loads of requests
08:27:57PMunchSo re-doing all the efforts that the libunbound guys have done seem a bit superfluous
08:28:13PMunchAnyways, is there a way to send a DNS request to a specified server in Nim?
08:28:33PMunchI 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:28leorize[m]PMunch: https://github.com/cheatfate/asynctools
08:35:37leorize[m]^ that one uses libbind
08:39:33leorizethis one looks nice: https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncproc.nim
08:39:56leorizeIMO osproc should have something like that
08:44:34*luis_ joined #nim
08:45:29PMunchleorize, yeah I had a look at that one, but it has the same interface
08:45:31ZevvPMunch: generally nto possible, it's a host level configuration
08:45:38Zevvs/nto/not/
08:46:30leorizechange it to startAsyncProcess and everything stop colliding :p
08:47:16leorizea 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:33PMunchZevv, what do you mean generally not possible? A DNS request is just regular TCP traffic, can be sent anywhere
08:49:21Zevvyeah, but not by getAddrInfo
08:49:26Zevvor sorry, getaddrinfo()
08:49:36Zevvand it's UDP :)
08:49:48leorizeit can be TCP as well :p
08:50:13Zevvyeah, I've been told, although I've never seen that in real life
08:50:19PMunchAh true, can be both. Normally it's UDP though
08:51:49Zevvlet'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:09PMunchYay.. Permission denied while running as sudo..
10:58:20PMunchReading the file is no issue for any other program.
10:59:55Zevvsshfs mount or other mount with uid settings?
11:06:39FromGitter<alehander42> Btw Zevv
11:08:22FromGitter<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:50FromGitter<alehander42> Is this common in small os-es or embedded
11:10:11*abm joined #nim
11:16:12PMunchZevv, it's an Ubuntu Live box that I've scp-ed some files into.
11:16:23PMunchEditing 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:00Zevvalehander: well, you'd neet some kind of IP stack. implementing yourself is fun but TCP is cumbersome to get right.
11:22:30leorize[m]PMunch: slap strace on it and see why is it not working
11:22:38Zevvlook for lwip or uip
11:23:41Zevvalehander42: 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:12PMunchopenat(AT_FDCWD, "/home/ubuntu/unbound.conf", O_RDONLY) = -1 EACCES (Permission denied)
11:26:21PMunchHmm, it seems to be a valid call to openat..
11:26:25PMunchNo idea why it fails..
11:26:25Zevvyou 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:02ZevvPMunch: 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:46Zevvand what are the exact permissons (ls -l, lsattr)
11:28:48PMunchhttp://ix.io/1KU4
11:29:08PMunchI've just given it a+rwx in my frustration
11:29:26PMunchNot sure if it happens with any other files, it's the only config file I have lying about
11:29:54PMunchHmm, that program gets permission denied for any file
11:30:00Zevvcow overlay, hmm
11:30:03PMunchunbound-checkconf works fine
11:30:09PMunchAnd editing it with vim works fine..
11:30:30*deech joined #nim
11:31:15*abm quit (Ping timeout: 244 seconds)
11:31:34sealmovealehander42: https://www.saminiir.com/lets-code-tcp-ip-stack-1-ethernet-arp/
11:32:10leorize[m]PMunch: check apparmor
11:33:02Zevvyeah, arp is only the beginning :)
11:33:20Zevvip 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:05sealmoveit's 3-part tutorial
11:36:14*envoyt joined #nim
11:36:27sealmovehttps://www.saminiir.com/lets-code-tcp-ip-stack-2-ipv4-icmpv4/
11:36:29sealmovehttps://www.saminiir.com/lets-code-tcp-ip-stack-3-tcp-handshake/
11:36:48Zevvitwould make for a pretty intersting project though
11:37:09Zevva safe native nim ip stack
11:37:11sealmoveit's in my list :>
11:37:31Zevvyou could just run it on any os in userspace as well, usng tuntap for example
11:37:50*deargod joined #nim
11:37:54deargodtest
11:37:59*laaron quit (Remote host closed the connection)
11:38:06deargodDear 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:35PMunchWhat..
11:40:55ehmryif TCP were implemented in Nim, unikernels would follow
11:41:44leorize[m]PMunch: have you tried to disable apparmor?
11:42:25leorize[m]if I understand correctly you're trying to use unbound with a configuration file that's not in /etc, right?
11:42:56PMunchYes
11:43:16*laaron joined #nim
11:43:34leorize[m]the default apparmor config for unbound might have prevented this
11:43:49PMunchApparmor?
11:43:52leorize[m]disabling apparmor is simple though
11:43:55leorize[m]just aa-disable iirc
11:44:54leorize[m]yea, it's an access control system, much like selinux (except it's simpler)
11:45:35PMunchHuh, well that's a couple hours wasted..
11:45:55PMunchJust copying the file into the default location and running it without -c worked fine..
11:46:40leorize[m]:p
11:47:10leorize[m]I learned that the hard way
11:52:08dom96I like how that user tested to ensure they can talk
11:52:35dom96Sadly I doubt members of super intelligent civilizations read our IRC logs
11:52:43dom96*intelligent alien civilizations
11:53:01Zevvwell, here we are, right
11:53:10Zevvoh, alien
11:54:01PMunchhttp://ix.io/1KUc
11:54:15*laaron quit (Remote host closed the connection)
11:56:18*laaron joined #nim
11:56:19FromGitter<alehander42> Zevv, i want to implement juust a part enough
11:56:26FromGitter<alehander42> to make some request work
11:56:44FromGitter<alehander42> but probably i still need to impl a lot of the tcp/ip stuff indeed
11:56:55FromGitter<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:36FromGitter<alehander42> sealmove, bless you this is cool
11:57:42FromGitter<alehander42> i'll take a look at those
11:58:03FromGitter<alehander42> to see if i'd include it in my plan
11:58:16Zevvalehander42: steal your ideas from uIP then
11:58:42ZevvI think kontiki os has the most recent version of that embedded somewhere
11:58:48Zevvhttps://github.com/contiki-os/contiki/tree/master/core/net
11:59:27*laaron joined #nim
11:59:50FromGitter<alehander42> sounds good
12:00:06FromGitter<alehander42> otherwise i start to think i have to use C for my first version
12:00:57FromGitter<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:16FromGitter<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:38ehmryAlexMax: TCP/IP isn't necessarily osdev, since it can run just as well in application space
12:04:57ehmrythere is a mistique about osdev-type stuff because its done in the kernel, but its alot easier when done in userspace
12:04:58Zevvright; 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:27Zevvehmry: "the kernel is just another C program", right
12:06:02ehmrythe driver should still be a seperate layer from the IP stack, so that hardware can still be shared amoungst multiple stacks
12:06:44Zevvdepends - I know applications that do just that - one app, one stack, high performance
12:07:14ehmrythe glue code between IP/Ethernet and drivers is fairly trivial to write anyway
12:08:26FromGitter<alehander42> hm, how specific should my driver be? do most machines use very different ethernet cards
12:08:57FromGitter<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:38Zevvat 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:18Zevvalso available in qemu and the like
12:10:51*AndChat|624225 joined #nim
12:12:56ehmrycollocating the driver will speed things up, but only if the high-level stuff like TCP window scaling is implemented
12:13:05PMunchUgh, seriously every time I try to do something in Python it fucks up..
12:13:14*envoyt quit (Ping timeout: 272 seconds)
12:16:31FromGitter<alehander42> i see, thanks
12:16:46FromGitter<alehander42> PMunch, what is the problem
12:16:59Araqehmry, any opinion on HTTP 2?
12:17:19ehmrynope, I try to stay ignorant of HTTP
12:17:20PMunchalehander42, Python is unable to find its encodings module
12:17:28PMunchBecause of the way it is started
12:17:39PMunchAnd because it's shit..
12:17:59federico3PMunch: 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:24PMunchfederico3, I'm trying to spin up some DNS servers here
12:18:30ehmryalehander42, if you can read ocaml, look at mirage https://github.com/mirage/mirage-tcpip
12:18:57PMunchThe sending DNS requests from earlier was just to load test them, I don't actually care about the response
12:18:59sealmovealehander42: glad you liked it :)
12:19:04ehmrythey run the application and IP stack on single thread
12:19:16federico3PMunch: and of course, if you really have to, you can craft your own DNS over UDP or TCP or HTTPS
12:19:20PMunchSorry, I'm getting a bit salty, just wanted to spin up some servers and it's been taking all day
12:20:50federico3PMunch: 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:43PMunchYeah, that was the idea
12:22:52PMunchBut first I got to get this stupid server up and running
12:22:59federico3PMunch: 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:31Zevvehmry: https://shader.kaist.edu/mtcp/
14:20:10ehmryZevv: yea, looks interesting
14:24:32ehmryactually I already use lwIP+Nim, but there are a few layers inbetween, and performance hasn't been a problem yet
14:31:26ehmryif 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:12ehmrysolo5 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:23leorizeit's rather quiet here today
16:25:45nooniencan i create a string from a sequence? without copying the data
16:25:52noonienfrom a seq[byte]*
16:27:27leorizenoonien: `cast[string](yourseq)`
16:27:38leorizeyes, it's "supported"
16:27:43noonienoh, nice!
16:27:48FromGitter<jrfondren> seq and string data structures are identical.
16:28:14noonienyeah, kind of a hack though :(
16:28:32FromGitter<jrfondren> I've heard that Araq said they'll always be identical.
16:28:55noonienah, i guess that's what "supported" means
16:29:06nooniencool, thanks leorize, jrfondren!
16:29:14FromGitter<jrfondren> so the only difference between the hack and stdlib support is a "toStr" proc that says it's O(1)
16:29:30leorizewe probably will need that proc :p
16:29:56leorizethey'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:45FromGitter<jrfondren> then the proc is no longer useful because it's no longer O(1)
16:33:12*deech_ joined #nim
16:35:41noonienis there a byteSeqStream?
16:38:43PMunchbyteSeqStream?
16:47:11leorizeI think they meant something that's similar to stringstream but for byte seq
16:47:24leorizethen it would be called ByteStream :p
16:51:15PMunchI actually created that at some point
16:51:21PMunchApparently it never got merged..
16:51:34PMunchI think it might've been part of a bigger PR
16:51:40PMunchThat got rejected for other reasos
16:52:13leorizewe definitely need a toString for seq[byte]
16:52:19PMunchhttps://github.com/nim-lang/Nim/pull/7481
16:52:54PMunchleorize, fun fact about strings, they can be cast to seq[byte|uint8|int8|char] and work fine
16:53:25PMunchI 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:33leorizeI know :p, but it should be an official thing backed by a proc
16:53:57PMunchYeah
16:56:01PMunchhttps://github.com/nim-lang/Nim/pull/7481
16:56:15PMunchApparently both me and data-man was too lazy to add them :P
16:57:16*couven92 joined #nim
16:57:21leorizenow 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:31FromDiscord_<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:43FromDiscord_<treeform> Is there a json library that implements this?
17:40:00FromDiscord_<treeform> ```type MyObj = object
17:40:00FromDiscord_<treeform> a {.dontSerialize.}: int
17:40:00FromDiscord_<treeform> b {.defaultDeserialize: 5.}: int
17:40:00FromDiscord_<treeform> c {.serializationKey: "_c".}: string```
17:42:39*deech_ quit (Ping timeout: 252 seconds)
17:42:54ZevvI believe lemonboys jstin does something like that
17:44:33FromGitter<alehander42> i think @zah had also a library that does it but not sure for which form
17:44:51FromDiscord_<treeform> yes jstin is close, don't see docs about default values though.
17:44:58Zevvadd 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:31Zevvcan I force an enum to be represented by an specific type, like uint16?
18:51:50lqdev[m]there was a pragma for that
18:51:58lqdev[m]I don't remember the name
18:55:04lqdev[m]I think it's `{.size: size(T).}`?
18:55:07lqdev[m]not sure
18:55:17Zevvthanks, let me check that
19:04:24*Jesin quit (Quit: Leaving)
19:05:48*Xe is now known as Cadey
19:08:13sealmoveis there a proc that returns both div and mod?
19:08:40sealmoveshould be more effecient if there is one
19:10:22Zevvyour compiler is smarter then you think
19:10:24*Jesin joined #nim
19:12:16deechJust 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:42narimiranAraq: ^
19:13:18deechAnd also 'semparallel'.
19:13:57*gangstacat quit (Ping timeout: 252 seconds)
19:19:40PMunchhttps://peterme.net/metaprogramming-and-read-and-maintainability-in-nim.html
19:20:07PMunchPlanning to make it a tour as well, just need to fix some things with the front-end :)
19:20:36PMunchWell, 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:46PMunch(And you might have old CSS files in your cache)
19:21:40*gangstacat joined #nim
19:23:41*Trustable joined #nim
19:27:24shashlicknice work @PMunch!
19:27:53PMunchThanks :)
19:28:01PMunchTried something new this time
19:28:33PMunchInstead 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:06narimirani just skimmed through the tour and - very nice, PMunch!
19:30:42stefanos82deech: 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:57stefanos82I just fetched and compiled the code from github
19:31:02PMunchnarimiran, thanks :)
19:31:57narimiranPMunch: i'll read everything tomorrow morning (it says "5th June 2019", after all :P)
19:33:01deechstefanos82, 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:20stefanos82I will re-run the whole thing with time then
19:33:50deechstefanos82, I usually do 'koch boot -d:release'.
19:34:17stefanos82I use build_all.sh
19:34:49stefanos82time command reported 26.x seconds
19:35:10stefanos82but Nim reported 1.83 total seconds
19:35:49PMunchnarimiran, hmm yeah that's strange
19:35:50deechstefanos82, I was getting that, now I'm in the 30-40 second range.
19:36:16dom96nice work PMunch :o
19:36:40stefanos82I guess Nim timer gets reset every time it builds nested parts
19:36:48PMunchnarimiran, there fixed, now you don't have an excuse!
19:36:52PMunchdom96, thanks :)
19:37:01narimiranshit :P
19:39:01*DesDeux quit (Quit: Leaving)
19:40:21*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
19:44:38dom96Araq not around today?
19:54:14Calinouby the way, has anyone benchmarked whether the Nim compiler compiles Nim programs faster if it's built with LTO?
19:57:55FromGitter<xmonader> @Pmunch can you make it horizontal instead of vertical please?
19:58:20narimiranPMunch: "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:01narimiranxmonader: so that the text lines are too long, and code examples have too much empty space? :P
19:59:45FromGitter<xmonader> @narimiran exactly :P u can always have a scrolledpane no? :D
20:01:40*nsf quit (Quit: WeeChat 2.4)
20:02:52PMunchnarimiran, ah yes. I was meaning to do that..
20:03:07PMunchAnd to show `dumpAstGen` which is how I get the code to create the node trees
20:03:18PMunchxmonader, make what horizontal?
20:04:31*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
20:04:57narimiranalso, 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:00PMunchAh, yes that is supposed to be <nodes of the actual code comes here>
20:08:08PMunchThought I fixed that..
20:10:13PMunchShould be fixed now
20:16:47lqdev[m]PMunch: you didn't need to create a `pop` on your own, it's included in the `system` module
20:17:58PMunchIt is?
20:18:31PMunchHuh, yes it is
20:18:40*narimiran quit (Ping timeout: 248 seconds)
20:18:51lqdev[m]I use it all the time when dealing with stacks
20:19:05PMunchWhy no pop though :(
20:19:09PMunchErr, push
20:19:21lqdev[m]because you have `add`
20:19:27PMunchHmm, yeah I guess
20:20:37dom96aww yiss, type https://nim-lang.org in here: https://cards-dev.twitter.com/validator
20:20:55dom96Also, better descriptions more than welcome
20:21:08dom96I wrote that up quickly and it doesn't sound 100% to me
20:22:23dom96Hrm, I should probably change the card title for articles
20:29:29FromGitter<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:10dom96awesome
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:48FromGitter<xmonader> @PMunch i mean in the tour it's better to be splitted horizontally than vertically (code and article)
20:53:13FromGitter<xmonader> because most likely people want to map 1->1 instead of reading the whole thing and then look at the code
20:53:37PMunchWell the idea is that you can look at the code while reading the thing, all without scrolling
20:54:06PMunchThat article wasn't really meant to be a tour, but when I had finished with it I figured why not
20:54:22PMunchSo it's probably more wonky that it needs to be
20:54:58PMunchIf anyone is interested in the progress of the example code: https://uploads.peterme.net/stacklang.nim
20:55:27PMunchNow you can create your own commands, which is essentially just a named series of actions, and they persist in a file .)
20:57:02PMunchhttp://ix.io/1KWM
20:57:11PMunchShows 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:45dom96Now 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:56stefanos82btw, 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:09FromDiscord_<DeltaPHC> C++ that barely uses C++ features tends to compile pretty quickly
21:39:14FromDiscord_<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:46FromDiscord_<treeform> @dom96 the card also works in discord.
21:51:28sealmovedoes pattern maching on tuples work by default?
21:51:35sealmovequit yes/no
21:51:37sealmovequick*
21:51:53dom96treeform: awesome :D
21:56:28*deech joined #nim
22:04:43FromDiscord_<exelotl> how can nim compile so fast when its metaprogramming is so much deeper than C++?
22:06:19FromDiscord_<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:46FromGitter<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:51leorize[m]@exelotl Nim projects don't do #include as much as C++ :p