<< 09-08-2019 >>

00:00:36krux02_I did not have problems with it. I instantly understood it, even though I think "hmm, that is an interesting way to define new".
00:00:58rayman22201I did not instantly understand it. I find it very confusing actually.
00:01:15rayman22201and non-standard, as you say.
00:01:52krux02_rayman22201, you are lucky, you talk to the right person to remove features. I have an open ear for everythig that should be removed as it means fewer bugs with little work :D
00:02:16rayman22201lol. Well, normally I like to add features. But in this case, I am on your side.
00:02:41krux02_what feature is it that you would like to have?
00:03:15krux02_Currently there is only one feature that I am looking forward to implement, but I fixing bugs has even more priority.
00:03:21aq60dynamic typing :)))))
00:03:27rayman22201NOOOOOO
00:03:30rayman22201gtfo lol
00:03:37aq60kidding ofcorse
00:03:57krux02_The feature I am talking about is the handling of overload resolution for generics.
00:04:09krux02_but that is a big bucket to open for me.
00:04:39aq60at first I was so frustrated with the static types, but now it all seems logical, and you end up with cleaner and easy fo read code
00:04:57krux02_in Nim?
00:04:59krux02_or generally?
00:05:11aq60Yes, in Nim
00:05:49krux02_I started the other way around. I started with static typing, then static typing with type inference, and then I learned python, and let's say it did not convince me.
00:06:12krux02_I came a long way though
00:06:46rayman22201features I want: newruntime, a good threadpool, more feature complete async, proper interfaces (either vtables, or better concepts, or both, or something else, idk).
00:07:35krux02_BlitzBasic, C++, C, Java, Scala, Haskell, Prolog, Go and then eventually Nim
00:07:37*qxxxb joined #nim
00:07:41rayman22201pattern matching
00:07:53aq60js is even worse, like half of the bugs come from the types, and when you have 300K loc, its not even funny
00:08:08krux02_rayman22201, is ast pattern matching not enough for you?
00:08:09disruptekand you always have 300k loc.
00:08:53FromGitter<zetashift> Isn't asyncs problem the weird showstopper bugs rather than features?
00:09:18rayman22201arguably yes
00:09:42FromGitter<awr1> 90% of those blogposts that are like "static typing is actually bad : - )" are like people whose first lang was python (which is not an bad first lang to learn by any means) but then tried java or something and was immediately taken aback from the verbosity
00:10:24aq60IMO, for a a period of time, Nim should stop adding features, and focus on stabilizing the core for production
00:10:38aq60major cleanup
00:10:48krux02_I don.t like neithr Java nor python as a first language.
00:11:01krux02_I think if dynamic typing, it should be scheme
00:11:20krux02_Or for static typing it should be Go
00:11:32disruptekgo is probably a good choice.
00:11:34FromGitter<awr1> you see *one* thing implemented in a less-than-ideal way and it ruin your perception of that one thing from now on
00:11:38FromGitter<awr1> *ruins
00:11:51*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
00:12:07disruptekbut i think a solid lisp is a tool i wish i had more time with.
00:12:11krux02_problem with teaching `scheme` is, you can't do that online, people will simply not come. Scheme isn't hip.
00:12:28rayman22201@krux02_ I think I mean something more like gara (runtime pattern matching over variant types), but standardized into the stdlib.
00:12:54krux02_rayman22201, yea I think we can improve here.
00:13:15rayman22201I also agree with you that bug fixes are way more important right now
00:13:19FromGitter<awr1> parentheses are overrated, lisp kept tripping over itself popularity-wise since the 60s
00:13:24krux02_when I think about pattern matching, I think about pattern matching like in Scala. Very extentable with custom matcher classes.
00:13:43rayman22201@krux02_, I'm thinking about Ocaml or Haskell, but same concept.
00:13:53disrupteklisp is about paradigm and a programming mentality.
00:14:00FromGitter<awr1> i'm unfamiliar with gara, this looks interesting
00:14:29krux02_but on the other hand, nothing is holding you back from implementing pattern matching the way you like it with macros. It won't be standard library, but it will do everything you need.
00:14:29FromGitter<awr1> i mean lisp is more or less the most important language of all time but it's never really credited as such
00:15:05FromGitter<awr1> i mean it's credited but like
00:16:13*laaron joined #nim
00:16:16krux02_And yes I know gara. But I won't recommend it, because I remember some design philosophy differences that I had with alehandler42 when he talked about implemented it.
00:16:33FromGitter<awr1> it's in this ambiguous way where it's not clear to a lot of people why lisp is so cool, just that it apparently is and it usage is mostly restricted to academia
00:16:45krux02_basically, when you have a pattern mismatch, you want to know exactly something did mismatch.
00:17:07krux02_awr1: and emacs
00:17:22*PrimHelios_ joined #nim
00:17:29*PrimHelios quit (Ping timeout: 252 seconds)
00:17:33rayman22201lol. This is true. You can do anything with macros. It is a "nice to have" feature. I get by just fine without it, I just think it would be nice to have, and it is fundamental enough that I would prefer it be in the stdlib.
00:17:51krux02_but emacs-lisp is the practical lisp implementation, not so much an ideal language for academia.
00:18:17qxxxbcan anyone recommend an audio library for nim? I just want to play a sine wave and set it's duration and frequency. I tried libsoundio but for some reason i can't get it to work without crashing on nim
00:18:32disruptekqxxxb: which platform?
00:18:44FromGitter<awr1> sdl2 if you want low level audio
00:18:49qxxxbwindows, mac, linux if possible
00:19:24krux02_I did sdl2 as well.
00:19:25qxxxbah right i forgot about sdl2
00:20:28krux02_rayman22201, at some point I might write that pattern matching library. But it is not easy, and if I write it, it needs some quality criteria.
00:22:49rayman22201I look forward to it krux02_, but there is no rush :-) I know there are much higher priorities.
00:24:34disrupteki looked around a bit and decided to use sdl2 for a very simple audio widget. but i haven't written anything yet; i've only read some docs, etc. i like sdl2 because it looks broad enough to support myriad hardware/software, and i know it'll be very well supported. ;-)
00:24:44krux02_my most important domain for pattern matching got covered in ast-pattern-matching.
00:25:46krux02_here the matching is important because you want to match complex forms, and the ast is basically dynamically typed so you want to ensure that the kinds are correct.
00:27:39FromGitter<awr1> sdl2 audio in nim is fairly straightforawrd if youve done it in C before
00:32:20FromGitter<awr1> i suppose w/r/t nim stabilizing the language there's a question of what features do people most want out of nim that aren't "in nim" yet (and should be)
00:33:24FromGitter<awr1> b/c for me: it's cyclic imports
00:40:06*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
00:40:28*Jjp137 quit (Ping timeout: 245 seconds)
00:40:33*laaron joined #nim
00:42:21krux02_awr1: for me it's not cycling imports
00:43:30krux02_Go doesn't have cyclic imports either. When I learned that language, the lack of cyclic imports actually forced me to split my project better.
00:44:18krux02_apart from that, cyclic imports are unrealistic with the current way the compliler is implemented.
00:45:09krux02_the compiler needs to process statement after statement, otherwise you would not be able to call procedures that were generated by a macro call before it.
00:49:02FromGitter<awr1> :|
00:52:31*Jjp137 joined #nim
00:56:16krux02_it does have advantages though.
00:56:36krux02_Other languages that do have cycling imports cannot have such a good macros system as Nim
00:58:59FromGitter<awr1> i know that there is definitely an issue of "in what order do we execute top-level code?"
00:59:05FromGitter<awr1> w/r/t cyclic imports
01:02:04krux02_yes
01:02:16krux02_try to not have cycling imports at all
01:02:27*qxxxb quit (Quit: WeeChat 1.9.1)
01:03:40disruptekthe order can be computed, and even bounded to n^2 but i don't know if it can be computed stably, which is likely critical.
01:05:02FromGitter<awr1> i mean i don't disagree, cyclic imports are not really ideal, it's just that sometimes they would be convenient, especially for larger projects
01:06:07FromGitter<awr1> maybe having "longer files" could be preferable, idk
01:06:30disrupteklonger files?
01:06:38disrupteklike, literally, longer files?
01:06:52krux02_what is the problem with long files?
01:07:02krux02_you just have to sort the things correctly.
01:08:53disruptekwell, that's not really an answer until the tooling exists, right?
01:09:02disruptekand, in point of fact, the tooling doesn't exist. ;-)
01:09:35FromGitter<awr1> i guess an increased likelihood of merge conflicts, but meh
01:10:06krux02_disruptek, what is limiting you to have long files?
01:10:16disruptekme? nothing.
01:10:20krux02_awr1: no not really
01:10:35FromGitter<awr1> i suppose using `include` could help avoid this
01:10:38krux02_it doesn't matter if you have changes in many files or on big files
01:10:50FromGitter<awr1> i mean i know
01:11:11FromGitter<awr1> merge weirdness is always an inevitability at some point
01:11:18krux02_I use include as well. I did it before I optimized emacs to handle big files.
01:11:40*endragor_ joined #nim
01:11:52krux02_I have to sleep now
01:12:02disruptekgn krux02
01:12:18krux02_gn
01:12:23krux02_gn8t
01:12:28FromGitter<awr1> i guess i'm just thinking back too much to this project i worked on that used perforce, and "two people working on the same file" was a big issue always
01:12:30FromGitter<awr1> gn
01:13:13krux02_awr1: not an issue in git
01:13:18krux02_ok, good night.
01:14:01*krux02_ quit (Remote host closed the connection)
01:14:31*aq60 left #nim (#nim)
01:20:04rayman22201gn
01:42:46*endragor joined #nim
01:45:40*endragor_ quit (Ping timeout: 244 seconds)
01:47:13*endragor quit (Ping timeout: 244 seconds)
02:39:47*kungtotte joined #nim
03:04:13*lritter quit (Ping timeout: 245 seconds)
03:04:59*lritter joined #nim
03:39:21*endragor joined #nim
03:49:27*dddddd quit (Remote host closed the connection)
04:14:05*nsf joined #nim
04:28:58*laaron quit (Remote host closed the connection)
04:32:21*laaron joined #nim
04:35:24*laaron quit (Remote host closed the connection)
04:39:17*fjellfras joined #nim
04:41:31*laaron joined #nim
05:05:00*lritter quit (Ping timeout: 272 seconds)
05:18:44FromGitter<zacharycarter> shashlick: I ended up tapping out on the macro. I tried for several hours to figure out a way to make it work, but I was unsuccessful. I think it's probably too advanced a challenge right now for me and my meta programming skills w/ Nim
05:22:34FromGitter<zacharycarter> my main pain point was how to match incoming field value / pairs to fields on the type
05:24:31FromGitter<zacharycarter> I needed to construct a PNode from the VmArgs, and then find fields inside that PNode tree which matched fields on the object's type
05:24:58FromGitter<zacharycarter> that wasn't difficult - what was, was setting the value on object's field to what value was in the PNode tree - I couldn't figure out a good way to do that
05:25:37FromGitter<zacharycarter> maybe someone with decent understanding of the problem and a good understanding of macros / compiletime procs can weigh in and help provide some suggestions for how to do this
05:53:12*solitudesf joined #nim
05:57:33*rayman22201 quit (Quit: Connection closed for inactivity)
06:16:21*sagax quit (Write error: Connection reset by peer)
06:22:15FromGitter<zacharycarter> Maybe I can create a table in a macro and reference that in the generated proc, but that still means I need to create and parse the PNode tree inside the macro. Need to figure out if that is possible
06:22:26*sagax joined #nim
06:35:52Zevvzacharycarter: you're mixing macros and pnode stuff? Or trying two different approaches?
06:43:06FromGitter<zacharycarter> basically what I want to do is this - have a macro called `bindObject` which takes in a typedesc
06:43:29FromGitter<zacharycarter> let's say I pass in a typedesc `Foo`
06:43:54FromGitter<zacharycarter> it should generate two procedures - one called `getFoo` and one called `setFoo`
06:45:15FromGitter<zacharycarter> `getFoo` is the one I'm currently working on - it would, somehow, take a set of VmArgs and an index into the VmArgs registers - just like `getString` works in the vmhooks right now - it would parse a `PNode` tree and return a fully filled out `Foo`
06:45:44FromGitter<zacharycarter> let me throw together a gist real quick explaining what I want to do
06:52:46FromGitter<zacharycarter> Zevv: here is what I am thinking: https://gist.github.com/zacharycarter/2b4a6fc3740f33a8be18ea24d8c03d7b
06:52:52FromGitter<zacharycarter> I've explained everything with comments in the gist - hopefully it makes sense
06:53:21FromGitter<zacharycarter> of course in the example the type `Foo` would be defined in a place that's available to our nimscript script as well as our Nim module
07:00:00*gmpreussner quit (Quit: kthxbye)
07:01:18*vlad1777d joined #nim
07:04:19*gmpreussner joined #nim
07:06:45*krux02 joined #nim
07:47:08*laaron quit (Remote host closed the connection)
07:49:10*laaron joined #nim
07:52:57*ng0 joined #nim
08:00:31*rockcavera quit (Remote host closed the connection)
08:07:48*floppydh joined #nim
08:07:53*ritchie__ joined #nim
08:08:36*laaron quit (Remote host closed the connection)
08:08:47*laaron- joined #nim
08:15:36*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:37:58*stefanos82 joined #nim
08:41:41federico3https://github.blog/2019-08-08-github-actions-now-supports-ci-cd/
08:43:44*shomodj joined #nim
09:02:09federico3https://github.com/mawww/kakoune/wiki/Languages <- no Nim?
09:23:19*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:24:18leorizeeven more possible build jobs :D
09:28:22*vlad1777d quit (Ping timeout: 245 seconds)
09:39:08*couven92 joined #nim
09:40:19FromGitter<zacharycarter> No, no Nim support for kak
09:40:26FromGitter<zacharycarter> Unfortunately
09:42:01*shomodj joined #nim
09:44:34federico3zacharycarter: kak ships nim.kak by default
09:55:22*ritchie__ quit (Quit: Leaving)
09:56:38*ritchie_ joined #nim
09:56:54*ritchie_ quit (Client Quit)
10:05:18*shomodj_ joined #nim
10:09:38*shomodj quit (Ping timeout: 272 seconds)
10:10:59FromGitter<zacharycarter> ooo - I didn't think it had it... even with nim.kak are all the features supported that you get with nimsuggest? The last time I played with Kak I remember there was something missing
10:11:20FromGitter<zacharycarter> I think it was something with language server
10:11:40FromGitter<zacharycarter> at the time I'm not sure if nimlsp was finished
10:26:13*abm joined #nim
10:31:29federico3https://nim-lang.org/docs/idetools.html is this new?
10:32:07*solitudesf quit (Remote host closed the connection)
10:32:27*solitudesf joined #nim
10:34:27*krux02_ joined #nim
10:37:29*krux02_ quit (Remote host closed the connection)
10:46:44FromGitter<gogolxdong> ping @Araq
10:46:52shashlick@zacharycarter I've not really spent any time understanding the vm
10:47:08*abm quit (Quit: Leaving)
10:47:56FromGitter<zacharycarter> gotcha
10:47:59*abm joined #nim
10:53:19shashlickI think it is crucial to get nimscript embeddable
10:53:55shashlickAlong with reliable nimrtl support
10:54:09FromGitter<zacharycarter> well it's already embeddable
10:54:21FromGitter<zacharycarter> I'd rather have the macros than working on embedding
10:54:28FromGitter<zacharycarter> but I guess it's just order of priorities b/w you and I
10:57:17shashlickIt should be a dll that ships with every Nim version
10:57:38FromGitter<zacharycarter> yeah - that's less important to me atm
10:57:41shashlickJust like Lua, you just download the dll
10:57:51FromGitter<zacharycarter> it'd be nice, but I can live without that for now
10:58:30shashlickWell ya, I'm working on things just to flesh out Nim
10:58:42shashlickI don't have any real product to build
11:00:01FromGitter<zacharycarter> maybe there's something I'm missing in terms of passing values of types b/w NimScript and Nim
11:00:45FromGitter<zacharycarter> but I've figured out in Wren and it's easier there - it was the easiest in nimLUA - but nimLUA basically has a macro that does what I was trying to do for NimScript, but obviously for Lua
11:01:01FromGitter<Vindaar> @zacharycarter I'm trying to cook up a macro right now. I'll see how far I get before I need to get back to work :)
11:01:05FromGitter<zacharycarter> I think Wren also has some convenience methods built in, which is why it feels easier
11:01:09FromGitter<zacharycarter> @Vindaar oooo
11:01:15*dddddd joined #nim
11:01:29FromGitter<zacharycarter> will be excited to see what you come up with - I'm sure you'll get further than I did :P
11:01:35shashlick\o/
11:02:42FromGitter<Vindaar> I spent like 1 1/2h yesterday evening / this morning trying to figure out how the `PNode` is structured and how to write a `getCustomObj` from `VmArgs` by hand. Now that I understand it, the rest "should be easy"? Will see
11:02:49*Vladar joined #nim
11:03:31FromGitter<zacharycarter> :)
11:04:18*fjellfras quit (Quit: Leaving)
11:10:00krux02Vindaar: I think debug should be pretty helpful
11:10:15krux02you can even call debug to print a node from gdb
11:10:37krux02gdb> call debugNode(n, 0)
11:11:05FromGitter<Vindaar> ah, thanks! That's good to keep in mind! I remember you did quite some work to make the output a lot nicer, no?
11:11:07FromGitter<alehander42> krux02 long files suck
11:11:23FromGitter<alehander42> i mean, they're not nice, sorry, didtn want to sound rude
11:11:45FromGitter<alehander42> to me, they have similar disatvantages to long functions
11:11:59leorize[m]federico3: it's old and has already been removed from the compiler
11:12:02FromGitter<alehander42> but i can see the argument for them in another env, where you dont have text files at all: but just a database of functions
11:12:19FromGitter<alehander42> and you can have "views" which show you parts of your codebase depending on query
11:12:27FromGitter<alehander42> e.g. "show render.*"
11:14:13krux02alehander42: what is the prblem with long files / long function
11:14:39krux02the only problem I see with them is that modern editors often suck displaying files with a few k of lines.
11:15:45krux02I think this idea of "tiny pieces of code" is broken. Big programs are big pieces of code. Code has context. In functions the context is dostroyed.
11:16:22krux02My styleguide is, as few function calls as possible. Introduce fucntions if you want to avoid code duplication, but not earlier.
11:16:40krux02putting things in functions does not make the code more readable, often the opposite is the case.
11:22:04FromGitter<alehander42> i don't agree really
11:22:17FromGitter<alehander42> i agree that extremism in "small functions" is not good
11:22:27FromGitter<alehander42> but it's a good guideline 90% of the time imho
11:22:45FromGitter<alehander42> small functions are more easily composable, way easier to understand
11:22:56FromGitter<alehander42> i am not talking about small libraries here
11:23:19FromGitter<alehander42> of course, you dont have to overdo it: its similar to DRY, its ok to repeat yourself 1-2-3 times
11:23:57FromGitter<alehander42> i'd say even in the compiler there are not "really' many long functions
11:24:12FromGitter<alehander42> many of the long functions are just long series of "subfunctions" for case object cases
11:24:27FromGitter<alehander42> which would be a bit more separate in languages with pattern matching
11:25:25FromGitter<alehander42> i'd say the problem is the opposite: modern tooling needs to improve a bit in visualizing context
11:25:39FromGitter<alehander42> but this is more about not having too many abstraction layers
11:25:47FromGitter<alehander42> (if i only followed this in my own code..)
11:25:50*rockcavera joined #nim
11:28:32FromGitter<alehander42> i think the biggest difference in our views is the "matching thing": imho most long functions are equivalent to many shorter functions specialized for variants of the same ADT (or object methods)
11:33:01FromGitter<alehander42> e.g. i prefer to separate them like https://github.com/alehander42/lang/blob/master/src/sem.nim (and yeah, one of those sub-functions is too big: and it is very confusing indeed, its doing too much stuff inline)
11:33:59*nsf quit (Quit: WeeChat 2.4)
11:42:23shashlickI think life is about finding a balance - different people will find different ways to achieve that
11:43:59FromGitter<Vindaar> @zacharycarter ok, first rough version seems to work. Should be cleaned up, and the `set` procs need to be added, but for my test type here it seems to work. If you have some complicated nested types, that'll still fail (custom object in custom object), but adding that shouldn't be too difficult ⏎ https://github.com/Vindaar/embeddedNimScript/blob/addGetMacro/embeddedNims/apiImpl.nim#L175-L229
11:44:11FromGitter<mratsim> my multithreading RFC is out @rayman22201 https://github.com/nim-lang/RFCs/issues/160
11:46:30FromGitter<zacharycarter> @Vindaar - sweet! I can see if I can get nested objects working, because that's what I need. I'll give it a shot when I get home from work. Thank you for this!
11:47:23FromGitter<zacharycarter> and I can also try to follow what you did to create the set proc
11:47:24FromGitter<Vindaar> no worries! If you can give me some concrete examples of what the objects will look like that you have to handle, I can expand on this maybe tonight
11:47:40FromGitter<zacharycarter> okay - I'll update the gist when I get home with some real examples
11:47:46FromGitter<Vindaar> cool!
11:48:11shashlickWhere should this go? In the vm code or in nimscript.nim
11:48:26shashlickIt should end to on the stdlib eventually
11:55:30FromGitter<zacharycarter> well - for now I think it would make sense to issue a PR to the embedded nimscript repo
11:55:43FromGitter<zacharycarter> once the macros are fully fleshed out / working with all edge cases for Nim types
11:55:55FromGitter<zacharycarter> like - I'm sure support for generics will need to be added, etc
11:56:27FromGitter<zacharycarter> I think once that's done - if no one has figured out a way to build nimscript as a shared lib for embedding, that task can be worked on and this can be included in the library
11:56:39FromGitter<zacharycarter> if it already has been done, we can pick this change from the embedded nimscript library
11:56:57FromGitter<zacharycarter> if that makes any sense at all
12:04:00shashlickI think that will be continent on nimrtl issue
12:04:06*Kaivo joined #nim
12:04:18shashlickNimble compiled in the vm so there was only one gc
12:04:32shashlickIf it is a dll, we might have the same issue again in interop
12:04:45shashlickBut Araq and dom96 might have to comment on that
12:05:43FromGitter<mratsim> posted the RFC on HackerNews and Reddit r/programming as well
12:08:39FromGitter<Vindaar> @mratsim man, you and your skills naming things :D
12:08:43federico3lobste.rs ?
12:13:01FromGitter<zacharycarter> shashlick: that's why I think we keep the macros in the embeddedNimScript project until that gets figured out
12:13:16FromGitter<zacharycarter> I guess maybe the macros would be useful for non embedding purposes as well
12:13:32FromGitter<zacharycarter> but until someone wants them for that - maybe we keep them out of Nim itself
12:13:47FromGitter<zacharycarter> really - to me - it doesn't matter much as long as they work and I can call them :)
12:32:51*deech quit (Remote host closed the connection)
12:58:04*shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:59:23*shomodj joined #nim
13:20:13*laaron- quit (Remote host closed the connection)
13:24:00*laaron joined #nim
13:26:55*user0 joined #nim
13:30:03*laaron quit (Remote host closed the connection)
13:32:56FromGitter<ahcm> @mratsim i'd include some real world examples of scenarios that the parallelism is supposed to solve
13:33:12*laaron joined #nim
13:35:11FromGitter<ahcm> ah you have it under benchmarking
13:36:47FromGitter<zacharycarter> @mratsim - very nice work on the RFC, can tell you put a lot of time into it
13:39:03*endragor quit (Remote host closed the connection)
13:39:35*endragor joined #nim
13:40:02*solitudesf quit (Ping timeout: 245 seconds)
13:40:07*laaron quit (Remote host closed the connection)
13:42:13*laaron joined #nim
13:42:55*sz0 joined #nim
13:43:50*endragor quit (Ping timeout: 244 seconds)
13:47:38*user0 quit (Quit: user0)
13:49:17*natrys joined #nim
13:59:38*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:00:17*shomodj joined #nim
14:10:24*floppydh quit (Quit: WeeChat 2.5)
14:14:13FromDiscord_<Kiloneie> Why won't this code strip whitespaces ? https://play.nim-lang.org/#ix=1R7K
14:17:13disruptekstrip only strips spaces at the beginning and ending of the string.
14:17:29*NimBot joined #nim
14:17:31disruptek^try, too
14:19:50FromGitter<awr1> the picasso stuff is very interesting
14:28:20FromGitter<awr1> RE the load-balancing section: i wonder how reasonable it would be to allow some (compile-time? init-time?) flexibility in the underlying work-stealing impl
14:32:41FromDiscord_<Kiloneie> That works yeah, thanks, thought it would work with strip, like it did in python.... xD
14:32:53FromGitter<awr1> RE earlier discussion on long files/long functions: this is worth reading http://number-none.com/blow/john_carmack_on_inlined_code.html
14:33:00disrupteki believe that's how python works, too.
14:33:10FromGitter<alehander42> https://travis-ci.org/nim-lang/Nim/jobs/569812361
14:33:17FromGitter<alehander42> i get "no output in 10 mins"
14:33:18FromGitter<alehander42> here
14:33:18disruptekit's weird how little python i write these days.
14:33:26FromGitter<alehander42> is it possible to see which test triggered it
14:33:33FromDiscord_<Kiloneie> Okay i will check real quick in Python xD
14:33:35FromGitter<alehander42> not obvious to me from the output
14:33:39FromGitter<awr1> IMO long functions aren't bad (and having scoped functions in nim makes long functions more reasonable) than they were before
14:33:51FromGitter<awr1> against C/C++
14:34:17FromGitter<alehander42> i'd argue the opposite: the more expressive your language is, the more stuff you can put in 20 lines
14:34:30FromGitter<alehander42> it depends what you call long
14:34:44FromGitter<awr1> (you have captureless lambdas in C++, but ehhh)
14:34:45FromGitter<alehander42> (and the more stuff means: a lot more to ponder on)
14:35:24FromGitter<awr1> it's not so much more or less lines in the greater view of the whole project
14:35:32FromGitter<alehander42> i think most of the time one can do his stuff in ~10 lines of code at most (as a function OR as an `of` branch)
14:35:32FromGitter<awr1> but a matter of organization
14:35:40FromGitter<alehander42> i just dont agree
14:35:41disruptekit's pretty rare that you want to express something to the reader that doesn't fit on a single screen yet cannot be more succinctly conveyed with the use of another proc/macro/template/whatever.
14:36:09FromGitter<alehander42> it just doesnt make sense to have a very long function most of the time: you can most of the time outline "here we process this , here we construct this" and move this in other calls
14:36:22FromGitter<awr1> sometimes forcing things to be modular when they are only called once is unnecessary
14:36:25FromGitter<alehander42> if its too hard, this means it would be 3x harder for the debugging guy
14:36:29FromGitter<awr1> *once in the code
14:36:34disruptekyes. what's hard about coding is understanding it, not creating it.
14:36:40FromGitter<alehander42> its not about modularity, but clarity
14:36:57disruptekso the effort should be on that clarity.
14:37:09FromGitter<alehander42> but this is a bit hard to argue without concrete examples
14:37:30disruptekany case tree against nimnode is a good example.
14:37:31FromDiscord_<Kiloneie> yeah okay same in python, my memory is a bit fuzzy
14:37:41FromGitter<alehander42> so it would be better to take a look at long functions (or if they have `case` + `of`: long `of` branches) which are > 10 lines
14:38:18FromGitter<awr1> and also, sometimes you want a bit of modularity, but you don't need a function available everywhere in a project, so scoped functions remain a useful utility for longer functions
14:38:52FromGitter<alehander42> disruptek: thats my other main argument: that NimNode processing would be N functions in pattern-matching code, so i wouldn't really call it the same
14:38:52FromGitter<awr1> if you need to throw it somewhere else, make it public, just copy paste elsewhere (and hope you aren't capturing anything, i guess)
14:39:05*rockcavera quit (Read error: Connection reset by peer)
14:39:17FromGitter<alehander42> scoped functions, you mean nested functions? (i know them by this name)
14:39:24FromGitter<awr1> nested functions yeah
14:39:27*rockcavera joined #nim
14:39:31FromGitter<alehander42> yes, but i'd argue then you dont have long function
14:39:42FromGitter<alehander42> if its separated in nested ones
14:39:48disrupteki mean, you're right that it's harder to slim down a huge case.
14:40:13FromGitter<awr1> i suppose you could argue that but you still get the "code locality" benefit that you get with long functions
14:40:15disruptekthe point is that it's harder to read. ;-)
14:40:26FromGitter<awr1> you don't have to jump around "as much"
14:41:24FromGitter<alehander42> disruptek: i'd say its not hard to generate "dispatcher" functions , e.g. with https://github.com/alehander42/lang/blob/master/src/tools.nim
14:41:28FromGitter<alehander42> or https://github.com/alehander42/poly
14:42:02FromGitter<alehander42> those are not perfect examples: one would probably use templates or `{.inline.}` for the inner functions, and make a better/more general dsl
14:42:10FromGitter<alehander42> but the point is that its not hard
14:42:18disruptekfair enough.
14:42:49FromGitter<alehander42> @awr1 i see that, and i agree that in some cases it might be better to have a long function
14:43:09FromGitter<alehander42> but i think its rarer
14:44:18FromGitter<alehander42> and yeah, in go or C the amount of lines of a normal function might be much bigger of course
14:44:29FromGitter<alehander42> and thats cool
14:48:56FromGitter<alehander42> but sorry, i dont have so much experience
14:49:03FromGitter<alehander42> maybe i am missing some other usecases
14:57:06krux02@alehander42: http://number-none.com/blow/blog/programming/2014/09/26/carmack-on-inlined-code.html
14:58:08*rayman22201 joined #nim
15:01:24FromGitter<alehander42> > This email was getting too long .
15:01:29FromGitter<alehander42> :P
15:06:03FromGitter<alehander42> ok, this is a good example, but still even he says "I have gotten much more bullish about pure functional programming, even in C/C++ where reasonable"
15:06:16FromGitter<alehander42> and we are talking about pretty specialized usecase
15:06:41FromGitter<alehander42> and i'd argue it can be again better fixed with proper tooling / better type/effect systems
15:07:38FromGitter<alehander42> there is no need to burden yourself with manually inlining so much stuff, if your tooling can measure statistical cost of subsections / or even statically prove limits to costs
15:08:41FromGitter<alehander42> or to expand different possible flows(scenarios) through the code
15:09:21*endragor joined #nim
15:10:54FromGitter<alehander42> but i am coming from a different point: it seems to me that most long functions i see, are long because they're not architectured well
15:11:04*lritter joined #nim
15:11:21FromGitter<alehander42> but here i am talking about my own code(i have several long functions that really bite me and make it hard for me)
15:15:30FromDiscord_<eagle> hi, I tried to install nim with `curl https://nim-lang.org/choosenim/init.sh -sSf | sh` but I have this error ```Exception: Execution failed with exit code 1
15:15:30FromDiscord_<eagle> ... Command: sh build.sh
15:15:30FromDiscord_<eagle> ... Output: # OS: linux
15:15:30FromDiscord_<eagle> ... # CPU: amd64
15:15:30FromDiscord_<eagle> ... gcc -w -O3 -fno-strict-aliasing -Ic_code -c c_code / 1_2 / stdlib_assertions.nim.c -o c_code / 1_2 / stdlib_assertions.nim.o
15:15:33FromDiscord_<eagle> ... gcc: error trying to exec 'as': execvp: No file or folder of this type
15:15:33FromDiscord_<eagle> Cleaning failed build
15:15:35FromDiscord_<eagle> Tip: 8 posts have been suppressed, use --verbose to show them.
15:15:36FromDiscord_<eagle> Error: Build failed
15:15:37FromDiscord_<eagle> ``` can someone help me?
15:16:02FromDiscord_<eagle> i'm on solus linux
15:16:48krux02eagle I don't knnow solus linux
15:16:56krux02my recommended way to build nim is via git
15:17:12krux02git clone [email protected]:nim-lang/Nim.git
15:17:17krux02git checkout devel
15:17:29FromDiscord_<eagle> hmm okay
15:18:15krux02well, I am working on the compiler, that is of course my prefered way to install nim
15:18:37krux02at least that is the way where I can provide support
15:19:14FromDiscord_<eagle> okay, thanks
15:20:20jmiveneagle, the error says that it can't find "as". Check if binutils is installed
15:21:18FromDiscord_<eagle> ooooooooh yes
15:21:30FromGitter<awr1> hm
15:21:49FromDiscord_<eagle> i'll try aigen
15:21:50FromGitter<awr1> rm -rf choosenim
15:21:54FromGitter<awr1> i mean
15:21:59FromGitter<awr1> rm -rf ~/.choosenim
15:22:20FromGitter<awr1> and try again maybe? that's weird
15:22:23FromGitter<awr1> or that
15:22:26FromGitter<awr1> the binutils thing
15:23:16FromDiscord_<eagle> i install binutims and i try again
15:23:34FromDiscord_<eagle> binutils*
15:26:38FromDiscord_<eagle> okay it works thanks
15:32:54FromGitter<zacharycarter> @Vindaar - taking a look at the macro now - only issue I have w/ compiling is that I can't find `getVarNode` anyway
15:32:57FromGitter<zacharycarter> anywhere*
15:33:09FromGitter<Vindaar> Ah, I added a note to the readme on my branch
15:33:57FromGitter<Vindaar> The problem seems to be that since the proc we call takes a `var` parameter, it's internally passed as a pointer. In order to access the `PNode` of that, I had to add this. The normal `getNode` would crash
15:35:02FromGitter<zacharycarter> ah okay - I will check the readme - thanks
15:35:08FromGitter<Vindaar> So for now you'll have to patch your `vmhooks.nim`. And there doesn't seem to be a way to put that proc somewhere else, since we have to be able to access to `TFullReg`, which is defined in `vm.nim`, but not exported
15:35:59FromGitter<zacharycarter> I think there might be a way - but I'll let you know if I have success with implementing it without patching vmhooks
15:36:12FromGitter<Vindaar> ok!
15:36:57FromGitter<zacharycarter> thanks again for putting this together - can't wait to test it out in a few moments :D
15:37:32FromGitter<Vindaar> glad to help! Hope you aren't disappointed immediately again :D
15:38:12FromGitter<zacharycarter> haha - well my disappointment was mostly my own fault - I know this macro is possible but I'm not the best at Nim meta programming
15:39:24FromGitter<Vindaar> I was mainly referring to the many shortcomings of the current solution, heh. But yeah, it takes a while to grok how to approach this stuff
15:40:01FromGitter<zacharycarter> :) yeah - I was okay at it when I was working on a few macro-heavy libraries but I always write macros for a given time and then stop and then forget they exist for a while :P
15:40:34FromGitter<mratsim> @awr1 ideally I think we should have a set of high level interface, the representations of tasks may vary wildly for example but I'm all ears
15:41:14FromGitter<Vindaar> For me I often try to write macro solutions for things where it's not even necessary, just because it's fun :|
15:41:47FromGitter<Vindaar> Helps the macro experience, but doesn't help people reading the code
15:42:33FromGitter<zacharycarter> yeah - I feel like every time I write a macro it ends up that a macro isn't really the ideal way to solve the problem, but I'm sure of it in this case, because it was suggested to me by someone smarter :P
15:42:51FromGitter<mratsim> @vindaar the name is fun :p
15:43:27FromGitter<Vindaar> @mratsim I was being serious. I love the names of your projects :)
15:45:18*solitudesf joined #nim
15:46:59FromGitter<Vindaar> in this case I also don't see a macro less way for a general solution. Although some parts of the current code could probably be replaced by a normal proc call (thinking about the extraction of values from nodes)
15:47:16FromGitter<mratsim> @federico3 no lobste.rs I don't have an account
15:47:33federico3mratsim: URL?
15:49:28FromGitter<zacharycarter> so one very hacky way of solving having to hack vmhooks is just to include compiler/vm in apiImpl
15:49:31FromGitter<zacharycarter> less than ideal - but it works
15:50:27FromGitter<Vindaar> true, that should work
15:50:28FromGitter<zacharycarter> although I think there is a way to patch Nim modules in your solution
15:50:34FromGitter<zacharycarter> so that might be the better route
15:50:53FromGitter<zacharycarter> I just can't remember how off the top of myead
15:51:22FromGitter<Vindaar> I only know about patchFile https://nim-lang.github.io/Nim/nimscript.html#patchFile%2Cstring%2Cstring%2Cstring, but I've never used it and have no clue if it could help
15:52:29FromGitter<zacharycarter> I think that's what I'm thinking of
15:54:25FromGitter<zacharycarter> but the macro seems to work great! I'll try to write one for generating the set proc
15:54:32FromGitter<zacharycarter> and then look at nested objects
15:55:11FromGitter<Vindaar> awesome! If you get stuck, just ask.
15:56:21FromGitter<zacharycarter> thanks! will do!
16:11:50*sz0 quit (Quit: Connection closed for inactivity)
16:16:17*SitiSchu joined #nim
16:16:20*SitiSchu quit (Remote host closed the connection)
16:32:22*Vladar quit (Remote host closed the connection)
16:45:21*Miguelngel[m] quit (Remote host closed the connection)
16:45:21*planetis[m] quit (Remote host closed the connection)
16:45:25*nergal[m]1 quit (Write error: Connection reset by peer)
16:45:33*k0mpjut0r quit (Write error: Connection reset by peer)
16:45:34*BitPuffin quit (Remote host closed the connection)
16:45:37*macsek1911[m] quit (Remote host closed the connection)
16:45:38*gh0st[m] quit (Remote host closed the connection)
16:45:41*BaldEagleX02[m] quit (Read error: Connection reset by peer)
16:45:43*GitterIntegratio quit (Remote host closed the connection)
16:45:43*lqdev[m] quit (Remote host closed the connection)
16:45:44*Demos[m] quit (Read error: Connection reset by peer)
16:45:45*zielmicha[m]1 quit (Read error: Connection reset by peer)
16:45:45*isaac[m] quit (Read error: Connection reset by peer)
16:45:45*spymasterd[m] quit (Read error: Connection reset by peer)
16:45:46*meff[m] quit (Remote host closed the connection)
16:45:46*encryptize[m] quit (Read error: Connection reset by peer)
16:45:47*yglukhov[m] quit (Write error: Connection reset by peer)
16:45:48*mattisme quit (Read error: Connection reset by peer)
16:45:48*leorize[m] quit (Read error: Connection reset by peer)
16:45:49*xomachine[m] quit (Read error: Connection reset by peer)
16:45:53*Connor[m] quit (Remote host closed the connection)
16:45:53*narimiran[m] quit (Read error: Connection reset by peer)
16:45:53*johnjane[m] quit (Remote host closed the connection)
16:45:53*TheManiac[m] quit (Remote host closed the connection)
16:45:53*skrylar[m] quit (Remote host closed the connection)
16:46:35*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:48:03*FromGitter quit (Ping timeout: 248 seconds)
16:48:46*FromGitter joined #nim
16:51:14*endragor quit (Remote host closed the connection)
16:52:47*ng0 quit (Remote host closed the connection)
16:53:50*ng0 joined #nim
16:53:59*planetis[m] joined #nim
17:11:10FromGitter<zacharycarter> @Vindaar - following your example, it was easy to generate the setResult proc, at least just to get something working: https://gist.github.com/zacharycarter/9dd9d4399e418589b4a44eb368373706
17:11:23FromGitter<zacharycarter> I still need to support different field types etc, but this works for the example with a string field
17:12:58*shomodj joined #nim
17:15:57FromGitter<zacharycarter> although I think there's a bug w/ the field name - working on tha tnow
17:16:59*BitPuffin joined #nim
17:17:00*Connor[m] joined #nim
17:17:00*Demos[m] joined #nim
17:17:00*GitterIntegratio joined #nim
17:17:00*leorize[m] joined #nim
17:17:00*nergal[m] joined #nim
17:17:00*gh0st[m] joined #nim
17:17:00*isaac[m] joined #nim
17:17:00*k0mpjut0r joined #nim
17:17:00*mattisme joined #nim
17:17:06*spymasterd[m] joined #nim
17:17:06*BaldEagleX02[m] joined #nim
17:17:07*encryptize[m] joined #nim
17:17:07*xomachine[m] joined #nim
17:17:07*yglukhov[m] joined #nim
17:17:07*Miguelngel[m] joined #nim
17:17:07*skrylar[m] joined #nim
17:17:07*zielmicha[m]1 joined #nim
17:17:07*narimiran[m] joined #nim
17:17:08*johnjane[m] joined #nim
17:17:08*lqdev[m] joined #nim
17:17:08*TheManiac[m] joined #nim
17:17:09*meff[m] joined #nim
17:17:11*macsek1911[m] joined #nim
17:20:43FromGitter<Vindaar> nice! I haven't really looked at what kind of code is required for the set proc. Keep me updated :)
17:22:41*shomodj_ joined #nim
17:23:35*nif quit (Quit: ...)
17:23:44*nif joined #nim
17:24:32*shomodj quit (Ping timeout: 252 seconds)
17:27:09FromGitter<Vindaar> I'm kinda wondering, the compiler must convert the macro `NimNode` to a `PNode` somewhere anyways, no? Shouldn't one not be able to just call the appropriate proc to do that conversion?
17:29:21FromGitter<zacharycarter> I'm not sure - if that already happens, one would think you could
17:29:34FromGitter<zacharycarter> but Araq was kind of the one guiding me on this and he didn't mention anything about that
17:29:52FromGitter<zacharycarter> I have a feeling if it were that easy, we wouldn't be writing these macros and NimScript would be used in a lot more places
17:30:01FromGitter<Vindaar> good point
17:31:15FromGitter<zacharycarter> okay I fixed the genSetProc macro and it's working now for strings - time to add the other types and then I'll move onto nested objects
17:31:32FromGitter<zacharycarter> basically the set proc just does the opposite of what the get proc does
17:31:38oprypinhi. i'm running these commands https://bpaste.net/show/2du3 (same as https://github.com/nim-lang/csources#nim-c-sources but master branch) but I'm getting `lib/system.nim(207, 11) Error: undeclared identifier: 'is'`. what's going on here?
17:31:42FromGitter<zacharycarter> it parses an instance of an object and then generates a PNode from it
17:32:58FromGitter<Vindaar> good work. and yes, that makes sense
17:33:14FromGitter<Vindaar> @oprypin does it only fail on the master branch?
17:33:26oprypinyes
17:34:12FromGitter<Vindaar> when do you get that error?
17:36:31leorizeoprypin: the master branch is dead
17:36:58oprypinunderstandable. what's the alternative way to download source code of latest release of Nim
17:37:09leorizeplease clone either `version-0-20` if you want the latest development 0.20.x, or `devel` if you want the latest development version
17:37:31oprypini don't want to specify or update this version manually
17:37:48leorizesorry, this is no longer an option
17:37:54leorizeyou could pull the tags though
17:38:09leorizethe latest tag should be the latest released version
17:38:45federico3oprypin: on what platform?
17:38:55oprypinhttps://bpaste.net/show/tqcp
17:39:15Zevvzacharycarter: hey, you got it working?
17:39:21oprypinthis is the platform that i care about :p https://travis-ci.org/oprypin/nim-random/jobs/544966661 linux i suppose
17:39:32Zevvi was travelling today so couldnt look at your link, sorry
17:40:06leorizeoprypin: https://github.com/nim-lang/Nim/wiki/BuildServices#building-nim-projects-on-travis-ci
17:40:16federico3oprypin: https://github.com/nim-lang/Nim/wiki/BuildServices
17:40:51FromGitter<zacharycarter> Zevv: @Vindaar did
17:41:17FromGitter<zacharycarter> And I am working on enhancements, also no worries at all
17:41:36oprypinhttps://github.com/nim-lang/Nim/wiki/BuildServices#using-choosenim it is then. and i guess it *really* supercedes the next section
17:47:32*stefanos82 quit (Quit: Quitting for now...)
17:50:44oprypin> Building tools (nimble, nimgrep, nimpretty, nimsuggest)
17:50:44oprypinwhy tho? :/
17:52:20federico3huh?
17:55:16oprypinim just saying that choosenim sucks after all. i just need 1 part from it - found that it relies on https://nim-lang.org/channels/stable to get the version
17:57:18Zevvso, vindaar is good at that stuff, maybe he can help me out as well :)
17:57:56dom96oprypin, why does it suck?
17:58:27FromGitter<Vindaar> Zevv: ah, I just like to hack around ;) But sure, I'll try to help
18:00:26oprypindom96, does a lot of stuff that i don't need, utilizes temporary paths without showing what they are, writes into "global" locations (i.e. ~/.nimble)
18:01:28dom96oprypin, I guess its goals don't align with your expectations then
18:01:58Zevvvindaar: I like to hack around as well, but I've been hitting walls for a few weeks
18:01:59FromGitter<alehander42> didnt it get some XDG HOME support
18:03:28FromGitter<Vindaar> Zevv: what are you trying to do?
18:03:39Zevvmy problem has to do with quote do and getAst not being able to return Table[]s from a macro because the generated AST refers to the "data" and "counter" fields inside the Table type
18:04:22Zevvand because the generated AST tries to fill in all fields of variants, which leads to illegal code. But this is secondary, i can just make my type not a variant is that is the workaround
18:04:23FromDiscord_<treeform> I think choosenim is great. It does exactly want I want. Its a pain setting up the paths.
18:04:43federico3oprypin: I'm updating the wiki page
18:04:48oprypinfederico3, hold on
18:04:54oprypini'll try to revive that one
18:05:34dom96treeform: Thank you <3
18:05:39Zevvvindaar: im currently on mobile and need to do some other stuff, but if you like a puzzle I can share some example code to show the problems I'm trying to solve.
18:05:52FromGitter<Vindaar> yeah, was just about to ask for an example
18:06:09Zevvill see if i can hack something up from my phone, give me a minute or two
18:06:25FromGitter<Vindaar> take your time, I'll be afk for a bit
18:07:13*shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:10:24FromGitter<mratsim> @federico3 URL for ? My RFC? https://github.com/nim-lang/RFCs/issues/160
18:10:49federico3mratsim: or your post about it
18:10:54Zevvvindaar: http://paste.ubuntu.com/p/GvtzDd8KK6/
18:15:24FromGitter<alehander42> but why do you need to return a table
18:15:35FromGitter<alehander42> can you return a pattern?
18:15:41FromGitter<alehander42> if so it should be easy to make a helper
18:16:55Zevvhow do you mean a pattern?
18:17:29ZevvI tried to return a seq and sacrifice the lookups speed - its not heavily indexed, but then the ast loses its seqness and I get an array instead
18:20:01FromGitter<alehander42> http://ix.io/1R8Y/nim
18:20:41FromGitter<alehander42> i asked what is Pattern
18:20:52FromGitter<alehander42> because currently its easy to make it work with newLit
18:20:57FromGitter<alehander42> but in the worst case you just need a custom
18:21:01FromGitter<alehander42> newLit for Pattern too
18:21:32FromGitter<Vindaar> a few minutes away and the problem solves itself ;)
18:22:07FromGitter<alehander42> sorry, i just saw a possible way and wanted to see if its what is wanted
18:22:22FromGitter<alehander42> next one is on you :P
18:22:43FromGitter<Vindaar> haha, that's totally fine :D
18:23:06FromGitter<alehander42> i am sitting here eating cake with fever
18:23:11FromGitter<alehander42> and losing my time on the internet :P
18:25:00FromGitter<Vindaar> sounds like a good time /s at least you still have an appetite
18:25:34ZevvPattern is seq[] of an object
18:27:07*Vladar joined #nim
18:27:09Zevvwhich is constructed recursively from the nim ast
18:28:12FromGitter<Vindaar> then you might have to change the `newLit(v)` in line 15 of @alehander42's code. But it should still work
18:29:52Zevvlet me see - i must admit I didnt think of this solution :)
18:30:43*clyybber joined #nim
18:39:58FromGitter<mratsim> The post is just a link to the RFC @federico3
18:44:06*Trustable joined #nim
18:45:06federico3mratsim: posted on lobste.rs
18:46:12FromGitter<alehander42> Zevv: i also havent thought of that
18:46:30FromGitter<alehander42> but i suspect all the "new quote" PR-s had that and i forgot
18:46:49FromGitter<alehander42> maybe newLit for table should be in macros.nim ?
18:46:53FromGitter<alehander42> maybe it is in some of the PR-s
18:46:54FromGitter<alehander42> not sure
18:52:29FromGitter<zacharycarter> sweet - seqs are working for the set result macro now
18:52:38FromGitter<zacharycarter> for strings anyway :P
18:53:02FromGitter<zacharycarter> will add support for other types then work on nested objects
19:00:46FromGitter<Vindaar> it's coming together. :) for the nested types, it should in principle be as simple as delegating the corresponding `result.customObField = ...` to the `getCustomType` proc, I guess. Then only the order in which the macros for the two types are called is important and everything should work ™
19:05:14*Cthalupa quit (Ping timeout: 268 seconds)
19:06:55*Cthalupa joined #nim
19:09:44oprypinhttps://travis-ci.org/oprypin/nim-random/builds/569966942 :>
19:09:44oprypinhttps://github.com/nim-lang/Nim/wiki/BuildServices/_compare/456a981971aa013665531941d81134f89fa66d80...33aaa0642e151f3e55d546597dea1890c2c5406e
19:17:44FromGitter<Varriount> @zacharycarter Whatcha working on?
19:18:32FromGitter<zacharycarter> @Varriount - so with the Nim VM, passing user define types b/w NimScript and Nim has been a pain
19:19:06FromGitter<Varriount> Ah, you're trying to use the VM in a program other than the compiler?
19:19:09FromGitter<zacharycarter> basically for every type you have to write two procs, one that parses a PNode and constructs an instance of that type and also one that parses an instance of that type and generates a PNode
19:19:13FromGitter<zacharycarter> yeah - my game
19:19:39*Trustable quit (Remote host closed the connection)
19:19:39FromGitter<zacharycarter> so last night I was up until like 4AM Helsinki time trying to write a macro to generate procs to do this
19:19:55FromGitter<zacharycarter> and I gave up this morning and then Vindaar did it in a couple of hours
19:20:09FromGitter<zacharycarter> so now I'm adding more functionality to the macros
19:20:13FromGitter<Varriount> :O
19:20:27FromGitter<Varriount> Sounds like something that should honestly be a standard library module
19:20:48FromGitter<zacharycarter> it's pretty nice - basically there's a template where you just pass in a typedesc
19:20:59FromGitter<zacharycarter> and it generates the two procs by calling the two macros
19:21:31FromGitter<zacharycarter> so far we can handle types with strings, floats, ints and seqs
19:21:39FromGitter<zacharycarter> and I'm about to work on nested objects
19:21:39FromGitter<Varriount> But not complex objects?
19:21:53FromGitter<zacharycarter> well - it should work on nested objects - I just need to write the code
19:22:01FromGitter<Varriount> Apropos of nothing, I just finished *all* my classes. I am now a summer 2019 graduate.
19:22:10FromGitter<zacharycarter> congrats man!!!! that's awesome :D
19:22:32FromGitter<Varriount> I now have time to actually *do* things, like travel.
19:22:48FromGitter<Varriount> I could even take a trip to wherever-you-work-now. :P
19:23:01FromGitter<zacharycarter> well - if you ever feel like visiting Finland :P
19:23:14FromGitter<zacharycarter> it's actually pretty nice here - but it's going to start getting cold soon
19:23:17FromGitter<zacharycarter> like really really cold
19:23:45FromGitter<zacharycarter> by October it will be in the 40 degree Fahrenheit range I imagine
19:24:13FromGitter<alehander42> which is like normal
19:24:21FromGitter<alehander42> the question is
19:24:26FromGitter<alehander42> how cold is it in Decem
19:24:30FromGitter<alehander42> January8
19:24:31FromGitter<alehander42> *
19:24:33FromGitter<Varriount> @zacharycarter What's the closest airport?
19:24:41krux02@PMunch: are you around?
19:25:00FromGitter<zacharycarter> `HEL`
19:25:05FromGitter<zacharycarter> Helsinki Airport
19:25:26FromGitter<zacharycarter> it's in an area called Vaanta
19:25:29FromGitter<Varriount> I could leave today for a little over $800
19:25:48FromGitter<zacharycarter> that's about how much it cost me to get over here
19:25:58FromGitter<zacharycarter> plane ticket wise anyway
19:26:06FromGitter<alehander42> do you need a visa
19:26:07FromGitter<alehander42> for eu?
19:26:19FromGitter<zacharycarter> to visit I think only a passport
19:26:19FromGitter<Varriount> Just a passport, iirc
19:26:24FromGitter<alehander42> nice
19:26:30FromGitter<zacharycarter> I don't even have a visa - but I have a work permit
19:26:33*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
19:26:35FromGitter<zacharycarter> or a residence permit I guess is what they call it
19:26:36FromGitter<Varriount> If I wanted to be cheap, I could go to another airport and drive
19:26:47FromGitter<alehander42> talin?
19:27:02FromGitter<zacharycarter> I don't think Estonia is that much cheaper these days - but I could be wrong
19:27:04FromGitter<alehander42> btw Sankt Peterburg is relatively close and pretty nice
19:27:09FromGitter<alehander42> but i think you need a visa
19:27:10FromGitter<zacharycarter> I know that Finns still migrate over there to buy their beer
19:27:10FromGitter<alehander42> for that
19:27:39FromGitter<zacharycarter> if you're not going to St. Petersburg by boat - you def need a visa
19:27:51FromGitter<alehander42> wait, by boat you dont
19:28:01FromGitter<alehander42> or you mean that you can just take a look from it
19:28:03FromGitter<alehander42> without entering
19:28:08FromGitter<zacharycarter> well - like if you take a ferry from Helsinki to St. Petersburg you don't
19:28:14*laaron joined #nim
19:28:15FromGitter<alehander42> i dont think so
19:28:17FromGitter<zacharycarter> you can get in with a passport - but you can't leave St. Petersburg
19:28:21FromGitter<alehander42> huh
19:28:27FromGitter<zacharycarter> yeah it's weird af
19:28:29FromGitter<Varriount> @zacharycarter Do you speak Finnish?
19:28:29FromGitter<alehander42> i wonder if thats true for us as well
19:28:38FromGitter<zacharycarter> @Varriount negative - it's a complicated ass language
19:28:48FromGitter<zacharycarter> and with a population of 5 mil - IMO it's not worth learning
19:29:20FromGitter<alehander42> suomi
19:29:27FromGitter<alehander42> kimi raikonen
19:29:28FromGitter<zacharycarter> it sounds cool though - I always crack up when I hear Finnish people conversing
19:29:34FromGitter<alehander42> oh well thata ll my words
19:29:38FromGitter<zacharycarter> like `Joo` is informal for yes
19:29:47FromGitter<zacharycarter> but they pronounce `J's` as `Y's`
19:29:52FromGitter<zacharycarter> so it sounds like they're saying `Yo`
19:29:59FromGitter<zacharycarter> and they'll say `Joo` repeatedly
19:30:08FromGitter<zacharycarter> so it sounds like they're saying `Yo Yo Yo`
19:30:14FromGitter<zacharycarter> like they're about to break out into a rap song
19:30:21FromGitter<alehander42> hahha
19:30:25clyybberlol
19:30:37FromGitter<alehander42> i cant imagine finnish people doing it
19:30:49FromGitter<zacharycarter> people walk around here with like the modern day boom box
19:30:54FromGitter<zacharycarter> playing Finnish hip hop
19:31:06FromGitter<alehander42> is it good
19:31:07FromGitter<zacharycarter> it's like a suit case with speakers
19:31:26FromGitter<zacharycarter> I guess it's hard to judge - like IMO no, but I also come from the country that invented hip hop
19:31:38FromGitter<zacharycarter> but maybe if I understood the lyrics... but even then I don't know
19:32:08FromGitter<zacharycarter> their metal is definitely on point
19:32:28FromGitter<zacharycarter> and there was this whole thing pretty recently - https://www.youtube.com/watch?v=Ad3cGfLC5v8
19:34:32FromGitter<zacharycarter> Finns really love their metal and their knitting
19:37:16FromGitter<zacharycarter> @Vindaar you can probably think of a better way to do this - but for generating nodes for a seq - this is what I came up with: ⏎ https://gist.github.com/zacharycarter/e43526242ae2b5e28ec4d53e07817a9e
19:37:29FromGitter<zacharycarter> I'm not sure if there's a way to avoid the `parseInt` `parseFloat` etc - or not
19:38:17FromGitter<zacharycarter> but if I remove those I get this error: ```C:\Users\carte\projects\embeddedNimScript\embeddedNims\apiImpl.nim(173, 30) Error: type mismatch: got <TNodeKind, TaintedString> ⏎ but expected one of: ⏎ proc newFloatNode(kind: TNodeKind; floatVal: BiggestFloat): PNode```
19:40:42FromGitter<zacharycarter> btw - this is a video of the game I'm working on. I'm pretty sure it show some bug, but just to give you an idea: https://www.youtube.com/watch?v=b03F1408L3A
19:41:12FromGitter<Vindaar> hm, the parsing is sure weird. Do you accidentally convert the values to strings somewhere?
19:42:56FromGitter<zacharycarter> I don't think so - unless it's the assignment at the top of that proc
19:43:07FromGitter<zacharycarter> where I wrote - `seqKind = dtype.nodeToVal().strVal`
19:43:37FromGitter<zacharycarter> but that doesn't make sense really - because val is in the `quote do` and that's what's being complained about
19:43:50FromGitter<Vindaar> but that only converts the NimNode of the inner type (`seq[float]` -> `float`) to a string
19:43:55FromGitter<zacharycarter> yeah
19:44:03FromGitter<Vindaar> if anything it'd have to happen outside of that proc
19:44:12FromGitter<Vindaar> did you push the code in full somewhere already?
19:44:25FromGitter<zacharycarter> no but I can put up a gist with the latest version
19:44:32FromGitter<zacharycarter> let me do that now
19:45:02*aq60 joined #nim
19:46:07FromGitter<zacharycarter> https://gist.github.com/zacharycarter/e3e30f5277d62364d48d957e75f47ddc
19:46:26FromGitter<Vindaar> let's see :)
19:51:21rayman22201@zacharycarter and @Vindaar. this is a very cool thing you are doing. Please make it a nimble package when you are done!
19:54:26FromGitter<zacharycarter> rayman22201: I think maybe the best thing to do is just issue a PR to https://github.com/Serenitor/embeddedNimScript/tree/master/scripts
19:55:32FromGitter<zacharycarter> we could probably turn it into a nimble package with some work, but embedding NimScript atm requires copying the Nim stdlib into your project
19:56:04FromGitter<zacharycarter> or at least having a symlink to it or changing the string which references the path in the embedded nimscript source code
19:56:06FromGitter<zacharycarter> that sets up the vm
19:57:41FromGitter<Vindaar> ahh, now I understand what the problem is. The resulting `case seqKind` must not be in the actual output of the macro code. We know what `seqKind` is at CT. The way the code is structured right now means that for any type the whole case structure is generated. And since your type here has a field `seq[string]` the elements `val` are of course strings too
19:59:23FromGitter<zacharycarter> ah okay - so I basically need to break it down into more procedures, or maybe figure out a way to re-use the set primitive ones I already wrote
19:59:37FromGitter<zacharycarter> that makes sense - thanks for explaining that
19:59:48rayman22201That project seems kind of dead, you may be better off forking it. Your macros will make using nimscript much easier. I just don't want to loose that!
20:00:02FromGitter<zacharycarter> I actually just issued a PR to it a few weeks ago
20:00:08FromGitter<zacharycarter> to make it work with 0.20.0
20:00:14FromGitter<zacharycarter> and it was accepted
20:00:20FromGitter<zacharycarter> so I think it's still alive maybe
20:00:41rayman22201Oh nice. In that case. A PR to that may be a good way to go.
20:00:47FromGitter<zacharycarter> just not actively being worked on - I mean in Serenitor's defense - he already pretty much made everything work besides this
20:01:01rayman22201True
20:01:11FromGitter<zacharycarter> so I think it's just really stagnant since most people aren't embedding NimScript into their projects
20:01:40FromGitter<zacharycarter> I know shashlick is really keen on being able to have embedded nimscript without having to include the stdlib into your project
20:02:00FromGitter<zacharycarter> but I'm not sure how to achieve that atm - but I think after this macro is done that's the next thing to look at
20:02:26FromGitter<zacharycarter> maybe just come up with a stripped down version of the compiler package that only has what this library would depend on - would be a start anyway
20:02:40rayman22201Definitely 👍
20:04:07FromGitter<Vindaar> yeah, something like this should work:
20:04:07FromGitter<Vindaar> https://gist.github.com/Vindaar/15cba3d524c6b73e36546fd52ad551b7
20:04:50FromGitter<Vindaar> ups, forgot to add the body to result :P
20:05:11FromGitter<zacharycarter> :P no worries - I can do that but thank you for showing me that, I was staring at it kind of wondering how I was going to do it
20:05:24FromGitter<Vindaar> :)
20:05:32FromGitter<zacharycarter> because of the for loop and doing `obj`.`fieldName`
20:05:55FromGitter<zacharycarter> I need to remember that in these cases I can just generate more Nim code
20:06:02FromGitter<zacharycarter> but it's like a backwards way of thinking for me
20:06:30FromGitter<Vindaar> I know the feeling. It has gotten much easier for me, but sometimes I'm still confused about it all :D
20:08:08FromGitter<Vindaar> whenever I'm confused I now try to take a step back and think again about what code I actually want to generate. If I don't know that, then there's no use playing with macros
20:09:31FromGitter<zacharycarter> yeah, that's very true
20:11:10krux02Vindaar: before I write a marco, I write the code that I want to generate by hand.
20:11:13krux02More than one example
20:11:17shashlickConsidering the compiler code is already there, we just need a way to import it
20:11:53shashlickMaking the compiler a package is not the best cause you end up with two compilers that can conflict
20:11:53krux02just to get an idea of how it is properly done. Then I write the macro.
20:12:07shashlickThat's what happened with c2nim, nimble and others that embed
20:12:27shashlickIdeally there is a way to get the nim compiler path and just import from there
20:12:35FromGitter<Vindaar> @krux02 yes, that's what I do nowadays too. But in the past I sometimes hoped macros could solve problems for me that I couldn't figure out without them. In those cases however, I simply wanted to do things that can't work. No matter who writes the code :)
20:13:37shashlick@zacharycarter it is easy to pull the stdlib into the binary
20:13:52shashlickThe question is how to treat it as a file system for imports to work
20:13:55FromGitter<Vindaar> like the first time I actually hoped macros would save me was when I wanted to somehow get overloading by return type. Well
20:14:12krux02:p
20:14:27shashlickOr alternatively modify imports to allow loading from memory
20:14:55krux02no macros have local effect only.
20:15:10krux02but yea, you have to figure out the limits of your tools first.
20:16:20FromGitter<Vindaar> indeed
20:17:24krux02I also wish macros could do more, e.g. call into C functions
20:17:51FromGitter<zacharycarter> okay - got that working - also had to generate an ident for `val` but once I did that it works great
20:18:02FromGitter<zacharycarter> time for complex objects now :D
20:18:12FromGitter<Vindaar> hehe
20:27:37*jmiven quit (Quit: reboot)
20:28:25*jmiven joined #nim
20:28:58*nsf joined #nim
20:31:35*clyybber quit (Quit: WeeChat 2.5)
20:31:50aq60How to increase ref?
20:32:19aq60Do I have to cast it to int, add, then back to ref?
20:33:14FromGitter<zacharycarter> `gcRef` `gcUnref` I think?
20:33:42leorizewhy would you want to do that by hand though?
20:33:55leorizebut yea, GcRef and GcUnref should do
20:34:36Zevvalehander42: though job. Patt is a seq[Inst], which is an object variant, so I'm now writing a newLit for the object variant to emit only the fields for each variant kind. Now I'm stuck because one of the variant fields contains a NimNode which can contain Nim code. Bwaaah.
20:36:25FromGitter<Vindaar> @aq60: do you mean the value behind the ref or the reference count of the object? ⏎ @zevv: why does your variant field contain a NimNode? :)
20:37:00aq60In C: `tnode_t *tnode_p, *t`; `t = tnode_p++;`
20:37:46Zevvbecause my original DSL I parsed can contain snippets of callback code :)
20:38:15Zevvvindaar: https://github.com/zevv/npeg#quickstart
20:42:02FromGitter<Vindaar> what form should the `NimNode` code be in the object that's generated though? An anonymous proc that contains the parsed NimNode?
20:52:06*shomodj joined #nim
20:52:18Zevvat this time it is just a stmtlist
20:54:03FromGitter<Vindaar> aq60: hm, in that case you have to cast back and forth I believe (although I think you have to use `ptr` in that case explicitly). However, you shouldn't actually have to write code like that in Nim in the first place. Depending on your use case you might want to use `castptr UncheckedArray (ptr to first element)` to work with ptr arrays and still use `[]` etc.
20:54:21Zevvso now I'm building a seq of objects in ast, for which the fields are initialized with ExprColonExpr, and you can't just put code in there it seems. So maybe I should try to stash away these code blocks somewhere else and only refer to them instead of passing them around
20:54:22FromGitter<Vindaar> but a `StmtList` of valid nim code or also some DSL?
20:54:45Zevvvindaar: look at the link to get an idea what I'm doing
20:55:12*mattisme left #nim ("Kicked by @appservice-irc:matrix.org : Idle kick: User has been idle for 30+ days.")
20:55:33Zevvit might explain a bit better, everytime I abstract or simplify I miss relevant details
20:56:08FromGitter<Vindaar> so you're talking about e.g. the `words[$1] = parseInt($2)` line?
20:56:21Zevvright, but that can be any code
20:57:15*stefanos82 joined #nim
20:57:24Zevvnow that I think of it, I might get away with omitting these. My root issue I'm trying to fix is that I want these grammars to be composable, I want to be able to import or include rules defined elsewhere. But these includable rules actually never contain code, only grammar.
20:57:31Zevvright, thanks for being my teddy bear :)
20:58:14Zevvthis might just work with the newLit()s
20:58:22Zevvfirst some sleep, more later.
20:59:13FromGitter<Vindaar> haha, ok. But in general you could still fill your object with `ExprColonExpr`, where if you have some field `proc (maybeArgs): maybeReturn` you just fill the code in? At least in that case code should be fine
20:59:58*couven92 quit (Read error: Connection reset by peer)
21:01:12*fredrik92 joined #nim
21:02:51FromGitter<Vindaar> stupid example, but https://play.nim-lang.org/#ix=1R9M
21:17:48*nsf quit (Quit: WeeChat 2.4)
21:20:45*BaldEagleX02[m] quit (Quit: Idle kick: User has been idle for 23+ days.)
21:29:35*krux02 quit (Remote host closed the connection)
21:30:20*johnjane[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle kick: User has been idle for 23+ days.")
21:34:13*solitudesf quit (Ping timeout: 245 seconds)
21:34:53*Kaivo quit (Quit: WeeChat 2.5)
21:42:30*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:47:40*natrys quit (Quit: natrys)
21:52:27*shomodj joined #nim
21:52:34*Summertime quit (Quit: Sunsetting.)
21:53:52*Summertime joined #nim
22:00:52*Summertime left #nim ("Leaving")
22:06:18*qwertfisch quit (Ping timeout: 245 seconds)
22:07:18*beatmox quit (Ping timeout: 258 seconds)
22:19:13*beatmox joined #nim
22:21:15*qwertfisch joined #nim
22:23:04FromDiscord_<Kiloneie> Can someone tell me how to change a table's value based on key, i though variable[key] = value was the syntax for it, i am looking at the manual and i don't get it. My code: https://play.nim-lang.org/#ix=1RaC
22:26:52FromGitter<Vindaar> if you look closely at the provided `[]=` procs, you might notice `proc `[]=`A, B (t: var Table[A, B]; key: A; val: B)`. Notice the first parameters is `var Table`. The problem is that your table is declared as `let`. Must be `var` to modify it
22:28:04FromDiscord_<Kiloneie> O,O, oh, okay xD. That was a left over from my first take on doing that program
22:31:36*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:09:19*abm quit (Read error: Connection reset by peer)
23:10:58*arecaceae quit (Remote host closed the connection)
23:11:28*arecaceae joined #nim
23:21:41*user0 joined #nim
23:22:02*user0 quit (Client Quit)
23:24:56*ng0 quit (Ping timeout: 260 seconds)
23:32:28*ng0 joined #nim
23:33:16*shomodj joined #nim
23:39:02FromDiscord_<slymilano> Hey boys!
23:39:29FromDiscord_<slymilano> Any of you guys using Nim in production? What it's like, what do you like about it, what do you hate? Do you use it with any other languages? Really interested in the language
23:39:52*PrimHelios_ quit (Quit: ZNC - https://znc.in)
23:40:13*PrimHelios joined #nim
23:47:58FromDiscord_<Kiloneie> I am about to start making videos on Nim and use it with Godot Engine via a binding and such, im new too.