00:00:36 | krux02_ | 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:58 | rayman22201 | I did not instantly understand it. I find it very confusing actually. |
00:01:15 | rayman22201 | and non-standard, as you say. |
00:01:52 | krux02_ | 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:16 | rayman22201 | lol. Well, normally I like to add features. But in this case, I am on your side. |
00:02:41 | krux02_ | what feature is it that you would like to have? |
00:03:15 | krux02_ | Currently there is only one feature that I am looking forward to implement, but I fixing bugs has even more priority. |
00:03:21 | aq60 | dynamic typing :))))) |
00:03:27 | rayman22201 | NOOOOOO |
00:03:30 | rayman22201 | gtfo lol |
00:03:37 | aq60 | kidding ofcorse |
00:03:57 | krux02_ | The feature I am talking about is the handling of overload resolution for generics. |
00:04:09 | krux02_ | but that is a big bucket to open for me. |
00:04:39 | aq60 | at 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:57 | krux02_ | in Nim? |
00:04:59 | krux02_ | or generally? |
00:05:11 | aq60 | Yes, in Nim |
00:05:49 | krux02_ | 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:12 | krux02_ | I came a long way though |
00:06:46 | rayman22201 | features 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:35 | krux02_ | BlitzBasic, C++, C, Java, Scala, Haskell, Prolog, Go and then eventually Nim |
00:07:37 | * | qxxxb joined #nim |
00:07:41 | rayman22201 | pattern matching |
00:07:53 | aq60 | js is even worse, like half of the bugs come from the types, and when you have 300K loc, its not even funny |
00:08:08 | krux02_ | rayman22201, is ast pattern matching not enough for you? |
00:08:09 | disruptek | and you always have 300k loc. |
00:08:53 | FromGitter | <zetashift> Isn't asyncs problem the weird showstopper bugs rather than features? |
00:09:18 | rayman22201 | arguably yes |
00:09:42 | FromGitter | <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:24 | aq60 | IMO, for a a period of time, Nim should stop adding features, and focus on stabilizing the core for production |
00:10:38 | aq60 | major cleanup |
00:10:48 | krux02_ | I don.t like neithr Java nor python as a first language. |
00:11:01 | krux02_ | I think if dynamic typing, it should be scheme |
00:11:20 | krux02_ | Or for static typing it should be Go |
00:11:32 | disruptek | go is probably a good choice. |
00:11:34 | FromGitter | <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:38 | FromGitter | <awr1> *ruins |
00:11:51 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
00:12:07 | disruptek | but i think a solid lisp is a tool i wish i had more time with. |
00:12:11 | krux02_ | problem with teaching `scheme` is, you can't do that online, people will simply not come. Scheme isn't hip. |
00:12:28 | rayman22201 | @krux02_ I think I mean something more like gara (runtime pattern matching over variant types), but standardized into the stdlib. |
00:12:54 | krux02_ | rayman22201, yea I think we can improve here. |
00:13:15 | rayman22201 | I also agree with you that bug fixes are way more important right now |
00:13:19 | FromGitter | <awr1> parentheses are overrated, lisp kept tripping over itself popularity-wise since the 60s |
00:13:24 | krux02_ | when I think about pattern matching, I think about pattern matching like in Scala. Very extentable with custom matcher classes. |
00:13:43 | rayman22201 | @krux02_, I'm thinking about Ocaml or Haskell, but same concept. |
00:13:53 | disruptek | lisp is about paradigm and a programming mentality. |
00:14:00 | FromGitter | <awr1> i'm unfamiliar with gara, this looks interesting |
00:14:29 | krux02_ | 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:29 | FromGitter | <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:05 | FromGitter | <awr1> i mean it's credited but like |
00:16:13 | * | laaron joined #nim |
00:16:16 | krux02_ | 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:33 | FromGitter | <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:45 | krux02_ | basically, when you have a pattern mismatch, you want to know exactly something did mismatch. |
00:17:07 | krux02_ | awr1: and emacs |
00:17:22 | * | PrimHelios_ joined #nim |
00:17:29 | * | PrimHelios quit (Ping timeout: 252 seconds) |
00:17:33 | rayman22201 | lol. 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:51 | krux02_ | but emacs-lisp is the practical lisp implementation, not so much an ideal language for academia. |
00:18:17 | qxxxb | can 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:32 | disruptek | qxxxb: which platform? |
00:18:44 | FromGitter | <awr1> sdl2 if you want low level audio |
00:18:49 | qxxxb | windows, mac, linux if possible |
00:19:24 | krux02_ | I did sdl2 as well. |
00:19:25 | qxxxb | ah right i forgot about sdl2 |
00:20:28 | krux02_ | 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:49 | rayman22201 | I look forward to it krux02_, but there is no rush :-) I know there are much higher priorities. |
00:24:34 | disruptek | i 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:44 | krux02_ | my most important domain for pattern matching got covered in ast-pattern-matching. |
00:25:46 | krux02_ | 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:39 | FromGitter | <awr1> sdl2 audio in nim is fairly straightforawrd if youve done it in C before |
00:32:20 | FromGitter | <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:24 | FromGitter | <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:21 | krux02_ | awr1: for me it's not cycling imports |
00:43:30 | krux02_ | 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:18 | krux02_ | apart from that, cyclic imports are unrealistic with the current way the compliler is implemented. |
00:45:09 | krux02_ | 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:02 | FromGitter | <awr1> :| |
00:52:31 | * | Jjp137 joined #nim |
00:56:16 | krux02_ | it does have advantages though. |
00:56:36 | krux02_ | Other languages that do have cycling imports cannot have such a good macros system as Nim |
00:58:59 | FromGitter | <awr1> i know that there is definitely an issue of "in what order do we execute top-level code?" |
00:59:05 | FromGitter | <awr1> w/r/t cyclic imports |
01:02:04 | krux02_ | yes |
01:02:16 | krux02_ | try to not have cycling imports at all |
01:02:27 | * | qxxxb quit (Quit: WeeChat 1.9.1) |
01:03:40 | disruptek | the 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:02 | FromGitter | <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:07 | FromGitter | <awr1> maybe having "longer files" could be preferable, idk |
01:06:30 | disruptek | longer files? |
01:06:38 | disruptek | like, literally, longer files? |
01:06:52 | krux02_ | what is the problem with long files? |
01:07:02 | krux02_ | you just have to sort the things correctly. |
01:08:53 | disruptek | well, that's not really an answer until the tooling exists, right? |
01:09:02 | disruptek | and, in point of fact, the tooling doesn't exist. ;-) |
01:09:35 | FromGitter | <awr1> i guess an increased likelihood of merge conflicts, but meh |
01:10:06 | krux02_ | disruptek, what is limiting you to have long files? |
01:10:16 | disruptek | me? nothing. |
01:10:20 | krux02_ | awr1: no not really |
01:10:35 | FromGitter | <awr1> i suppose using `include` could help avoid this |
01:10:38 | krux02_ | it doesn't matter if you have changes in many files or on big files |
01:10:50 | FromGitter | <awr1> i mean i know |
01:11:11 | FromGitter | <awr1> merge weirdness is always an inevitability at some point |
01:11:18 | krux02_ | I use include as well. I did it before I optimized emacs to handle big files. |
01:11:40 | * | endragor_ joined #nim |
01:11:52 | krux02_ | I have to sleep now |
01:12:02 | disruptek | gn krux02 |
01:12:18 | krux02_ | gn |
01:12:23 | krux02_ | gn8t |
01:12:28 | FromGitter | <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:30 | FromGitter | <awr1> gn |
01:13:13 | krux02_ | awr1: not an issue in git |
01:13:18 | krux02_ | ok, good night. |
01:14:01 | * | krux02_ quit (Remote host closed the connection) |
01:14:31 | * | aq60 left #nim (#nim) |
01:20:04 | rayman22201 | gn |
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:44 | FromGitter | <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:34 | FromGitter | <zacharycarter> my main pain point was how to match incoming field value / pairs to fields on the type |
05:24:31 | FromGitter | <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:58 | FromGitter | <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:37 | FromGitter | <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:15 | FromGitter | <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:52 | Zevv | zacharycarter: you're mixing macros and pnode stuff? Or trying two different approaches? |
06:43:06 | FromGitter | <zacharycarter> basically what I want to do is this - have a macro called `bindObject` which takes in a typedesc |
06:43:29 | FromGitter | <zacharycarter> let's say I pass in a typedesc `Foo` |
06:43:54 | FromGitter | <zacharycarter> it should generate two procedures - one called `getFoo` and one called `setFoo` |
06:45:15 | FromGitter | <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:44 | FromGitter | <zacharycarter> let me throw together a gist real quick explaining what I want to do |
06:52:46 | FromGitter | <zacharycarter> Zevv: here is what I am thinking: https://gist.github.com/zacharycarter/2b4a6fc3740f33a8be18ea24d8c03d7b |
06:52:52 | FromGitter | <zacharycarter> I've explained everything with comments in the gist - hopefully it makes sense |
06:53:21 | FromGitter | <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:41 | federico3 | https://github.blog/2019-08-08-github-actions-now-supports-ci-cd/ |
08:43:44 | * | shomodj joined #nim |
09:02:09 | federico3 | https://github.com/mawww/kakoune/wiki/Languages <- no Nim? |
09:23:19 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:24:18 | leorize | even more possible build jobs :D |
09:28:22 | * | vlad1777d quit (Ping timeout: 245 seconds) |
09:39:08 | * | couven92 joined #nim |
09:40:19 | FromGitter | <zacharycarter> No, no Nim support for kak |
09:40:26 | FromGitter | <zacharycarter> Unfortunately |
09:42:01 | * | shomodj joined #nim |
09:44:34 | federico3 | zacharycarter: 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:59 | FromGitter | <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:20 | FromGitter | <zacharycarter> I think it was something with language server |
10:11:40 | FromGitter | <zacharycarter> at the time I'm not sure if nimlsp was finished |
10:26:13 | * | abm joined #nim |
10:31:29 | federico3 | https://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:44 | FromGitter | <gogolxdong> ping @Araq |
10:46:52 | shashlick | @zacharycarter I've not really spent any time understanding the vm |
10:47:08 | * | abm quit (Quit: Leaving) |
10:47:56 | FromGitter | <zacharycarter> gotcha |
10:47:59 | * | abm joined #nim |
10:53:19 | shashlick | I think it is crucial to get nimscript embeddable |
10:53:55 | shashlick | Along with reliable nimrtl support |
10:54:09 | FromGitter | <zacharycarter> well it's already embeddable |
10:54:21 | FromGitter | <zacharycarter> I'd rather have the macros than working on embedding |
10:54:28 | FromGitter | <zacharycarter> but I guess it's just order of priorities b/w you and I |
10:57:17 | shashlick | It should be a dll that ships with every Nim version |
10:57:38 | FromGitter | <zacharycarter> yeah - that's less important to me atm |
10:57:41 | shashlick | Just like Lua, you just download the dll |
10:57:51 | FromGitter | <zacharycarter> it'd be nice, but I can live without that for now |
10:58:30 | shashlick | Well ya, I'm working on things just to flesh out Nim |
10:58:42 | shashlick | I don't have any real product to build |
11:00:01 | FromGitter | <zacharycarter> maybe there's something I'm missing in terms of passing values of types b/w NimScript and Nim |
11:00:45 | FromGitter | <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:01 | FromGitter | <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:05 | FromGitter | <zacharycarter> I think Wren also has some convenience methods built in, which is why it feels easier |
11:01:09 | FromGitter | <zacharycarter> @Vindaar oooo |
11:01:15 | * | dddddd joined #nim |
11:01:29 | FromGitter | <zacharycarter> will be excited to see what you come up with - I'm sure you'll get further than I did :P |
11:01:35 | shashlick | \o/ |
11:02:42 | FromGitter | <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:31 | FromGitter | <zacharycarter> :) |
11:04:18 | * | fjellfras quit (Quit: Leaving) |
11:10:00 | krux02 | Vindaar: I think debug should be pretty helpful |
11:10:15 | krux02 | you can even call debug to print a node from gdb |
11:10:37 | krux02 | gdb> call debugNode(n, 0) |
11:11:05 | FromGitter | <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:07 | FromGitter | <alehander42> krux02 long files suck |
11:11:23 | FromGitter | <alehander42> i mean, they're not nice, sorry, didtn want to sound rude |
11:11:45 | FromGitter | <alehander42> to me, they have similar disatvantages to long functions |
11:11:59 | leorize[m] | federico3: it's old and has already been removed from the compiler |
11:12:02 | FromGitter | <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:19 | FromGitter | <alehander42> and you can have "views" which show you parts of your codebase depending on query |
11:12:27 | FromGitter | <alehander42> e.g. "show render.*" |
11:14:13 | krux02 | alehander42: what is the prblem with long files / long function |
11:14:39 | krux02 | the only problem I see with them is that modern editors often suck displaying files with a few k of lines. |
11:15:45 | krux02 | I 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:22 | krux02 | My styleguide is, as few function calls as possible. Introduce fucntions if you want to avoid code duplication, but not earlier. |
11:16:40 | krux02 | putting things in functions does not make the code more readable, often the opposite is the case. |
11:22:04 | FromGitter | <alehander42> i don't agree really |
11:22:17 | FromGitter | <alehander42> i agree that extremism in "small functions" is not good |
11:22:27 | FromGitter | <alehander42> but it's a good guideline 90% of the time imho |
11:22:45 | FromGitter | <alehander42> small functions are more easily composable, way easier to understand |
11:22:56 | FromGitter | <alehander42> i am not talking about small libraries here |
11:23:19 | FromGitter | <alehander42> of course, you dont have to overdo it: its similar to DRY, its ok to repeat yourself 1-2-3 times |
11:23:57 | FromGitter | <alehander42> i'd say even in the compiler there are not "really' many long functions |
11:24:12 | FromGitter | <alehander42> many of the long functions are just long series of "subfunctions" for case object cases |
11:24:27 | FromGitter | <alehander42> which would be a bit more separate in languages with pattern matching |
11:25:25 | FromGitter | <alehander42> i'd say the problem is the opposite: modern tooling needs to improve a bit in visualizing context |
11:25:39 | FromGitter | <alehander42> but this is more about not having too many abstraction layers |
11:25:47 | FromGitter | <alehander42> (if i only followed this in my own code..) |
11:25:50 | * | rockcavera joined #nim |
11:28:32 | FromGitter | <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:01 | FromGitter | <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:23 | shashlick | I think life is about finding a balance - different people will find different ways to achieve that |
11:43:59 | FromGitter | <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:11 | FromGitter | <mratsim> my multithreading RFC is out @rayman22201 https://github.com/nim-lang/RFCs/issues/160 |
11:46:30 | FromGitter | <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:23 | FromGitter | <zacharycarter> and I can also try to follow what you did to create the set proc |
11:47:24 | FromGitter | <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:40 | FromGitter | <zacharycarter> okay - I'll update the gist when I get home with some real examples |
11:47:46 | FromGitter | <Vindaar> cool! |
11:48:11 | shashlick | Where should this go? In the vm code or in nimscript.nim |
11:48:26 | shashlick | It should end to on the stdlib eventually |
11:55:30 | FromGitter | <zacharycarter> well - for now I think it would make sense to issue a PR to the embedded nimscript repo |
11:55:43 | FromGitter | <zacharycarter> once the macros are fully fleshed out / working with all edge cases for Nim types |
11:55:55 | FromGitter | <zacharycarter> like - I'm sure support for generics will need to be added, etc |
11:56:27 | FromGitter | <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:39 | FromGitter | <zacharycarter> if it already has been done, we can pick this change from the embedded nimscript library |
11:56:57 | FromGitter | <zacharycarter> if that makes any sense at all |
12:04:00 | shashlick | I think that will be continent on nimrtl issue |
12:04:06 | * | Kaivo joined #nim |
12:04:18 | shashlick | Nimble compiled in the vm so there was only one gc |
12:04:32 | shashlick | If it is a dll, we might have the same issue again in interop |
12:04:45 | shashlick | But Araq and dom96 might have to comment on that |
12:05:43 | FromGitter | <mratsim> posted the RFC on HackerNews and Reddit r/programming as well |
12:08:39 | FromGitter | <Vindaar> @mratsim man, you and your skills naming things :D |
12:08:43 | federico3 | lobste.rs ? |
12:13:01 | FromGitter | <zacharycarter> shashlick: that's why I think we keep the macros in the embeddedNimScript project until that gets figured out |
12:13:16 | FromGitter | <zacharycarter> I guess maybe the macros would be useful for non embedding purposes as well |
12:13:32 | FromGitter | <zacharycarter> but until someone wants them for that - maybe we keep them out of Nim itself |
12:13:47 | FromGitter | <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:56 | FromGitter | <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:11 | FromGitter | <ahcm> ah you have it under benchmarking |
13:36:47 | FromGitter | <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:13 | FromDiscord_ | <Kiloneie> Why won't this code strip whitespaces ? https://play.nim-lang.org/#ix=1R7K |
14:17:13 | disruptek | strip only strips spaces at the beginning and ending of the string. |
14:17:29 | * | NimBot joined #nim |
14:17:31 | disruptek | ^try, too |
14:19:50 | FromGitter | <awr1> the picasso stuff is very interesting |
14:28:20 | FromGitter | <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:41 | FromDiscord_ | <Kiloneie> That works yeah, thanks, thought it would work with strip, like it did in python.... xD |
14:32:53 | FromGitter | <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:00 | disruptek | i believe that's how python works, too. |
14:33:10 | FromGitter | <alehander42> https://travis-ci.org/nim-lang/Nim/jobs/569812361 |
14:33:17 | FromGitter | <alehander42> i get "no output in 10 mins" |
14:33:18 | FromGitter | <alehander42> here |
14:33:18 | disruptek | it's weird how little python i write these days. |
14:33:26 | FromGitter | <alehander42> is it possible to see which test triggered it |
14:33:33 | FromDiscord_ | <Kiloneie> Okay i will check real quick in Python xD |
14:33:35 | FromGitter | <alehander42> not obvious to me from the output |
14:33:39 | FromGitter | <awr1> IMO long functions aren't bad (and having scoped functions in nim makes long functions more reasonable) than they were before |
14:33:51 | FromGitter | <awr1> against C/C++ |
14:34:17 | FromGitter | <alehander42> i'd argue the opposite: the more expressive your language is, the more stuff you can put in 20 lines |
14:34:30 | FromGitter | <alehander42> it depends what you call long |
14:34:44 | FromGitter | <awr1> (you have captureless lambdas in C++, but ehhh) |
14:34:45 | FromGitter | <alehander42> (and the more stuff means: a lot more to ponder on) |
14:35:24 | FromGitter | <awr1> it's not so much more or less lines in the greater view of the whole project |
14:35:32 | FromGitter | <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:32 | FromGitter | <awr1> but a matter of organization |
14:35:40 | FromGitter | <alehander42> i just dont agree |
14:35:41 | disruptek | it'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:09 | FromGitter | <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:22 | FromGitter | <awr1> sometimes forcing things to be modular when they are only called once is unnecessary |
14:36:25 | FromGitter | <alehander42> if its too hard, this means it would be 3x harder for the debugging guy |
14:36:29 | FromGitter | <awr1> *once in the code |
14:36:34 | disruptek | yes. what's hard about coding is understanding it, not creating it. |
14:36:40 | FromGitter | <alehander42> its not about modularity, but clarity |
14:36:57 | disruptek | so the effort should be on that clarity. |
14:37:09 | FromGitter | <alehander42> but this is a bit hard to argue without concrete examples |
14:37:30 | disruptek | any case tree against nimnode is a good example. |
14:37:31 | FromDiscord_ | <Kiloneie> yeah okay same in python, my memory is a bit fuzzy |
14:37:41 | FromGitter | <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:18 | FromGitter | <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:52 | FromGitter | <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:52 | FromGitter | <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:17 | FromGitter | <alehander42> scoped functions, you mean nested functions? (i know them by this name) |
14:39:24 | FromGitter | <awr1> nested functions yeah |
14:39:27 | * | rockcavera joined #nim |
14:39:31 | FromGitter | <alehander42> yes, but i'd argue then you dont have long function |
14:39:42 | FromGitter | <alehander42> if its separated in nested ones |
14:39:48 | disruptek | i mean, you're right that it's harder to slim down a huge case. |
14:40:13 | FromGitter | <awr1> i suppose you could argue that but you still get the "code locality" benefit that you get with long functions |
14:40:15 | disruptek | the point is that it's harder to read. ;-) |
14:40:26 | FromGitter | <awr1> you don't have to jump around "as much" |
14:41:24 | FromGitter | <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:28 | FromGitter | <alehander42> or https://github.com/alehander42/poly |
14:42:02 | FromGitter | <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:10 | FromGitter | <alehander42> but the point is that its not hard |
14:42:18 | disruptek | fair enough. |
14:42:49 | FromGitter | <alehander42> @awr1 i see that, and i agree that in some cases it might be better to have a long function |
14:43:09 | FromGitter | <alehander42> but i think its rarer |
14:44:18 | FromGitter | <alehander42> and yeah, in go or C the amount of lines of a normal function might be much bigger of course |
14:44:29 | FromGitter | <alehander42> and thats cool |
14:48:56 | FromGitter | <alehander42> but sorry, i dont have so much experience |
14:49:03 | FromGitter | <alehander42> maybe i am missing some other usecases |
14:57:06 | krux02 | @alehander42: http://number-none.com/blow/blog/programming/2014/09/26/carmack-on-inlined-code.html |
14:58:08 | * | rayman22201 joined #nim |
15:01:24 | FromGitter | <alehander42> > This email was getting too long . |
15:01:29 | FromGitter | <alehander42> :P |
15:06:03 | FromGitter | <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:16 | FromGitter | <alehander42> and we are talking about pretty specialized usecase |
15:06:41 | FromGitter | <alehander42> and i'd argue it can be again better fixed with proper tooling / better type/effect systems |
15:07:38 | FromGitter | <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:41 | FromGitter | <alehander42> or to expand different possible flows(scenarios) through the code |
15:09:21 | * | endragor joined #nim |
15:10:54 | FromGitter | <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:21 | FromGitter | <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:30 | FromDiscord_ | <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:30 | FromDiscord_ | <eagle> ... Command: sh build.sh |
15:15:30 | FromDiscord_ | <eagle> ... Output: # OS: linux |
15:15:30 | FromDiscord_ | <eagle> ... # CPU: amd64 |
15:15:30 | FromDiscord_ | <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:33 | FromDiscord_ | <eagle> ... gcc: error trying to exec 'as': execvp: No file or folder of this type |
15:15:33 | FromDiscord_ | <eagle> Cleaning failed build |
15:15:35 | FromDiscord_ | <eagle> Tip: 8 posts have been suppressed, use --verbose to show them. |
15:15:36 | FromDiscord_ | <eagle> Error: Build failed |
15:15:37 | FromDiscord_ | <eagle> ``` can someone help me? |
15:16:02 | FromDiscord_ | <eagle> i'm on solus linux |
15:16:48 | krux02 | eagle I don't knnow solus linux |
15:16:56 | krux02 | my recommended way to build nim is via git |
15:17:12 | krux02 | git clone [email protected]:nim-lang/Nim.git |
15:17:17 | krux02 | git checkout devel |
15:17:29 | FromDiscord_ | <eagle> hmm okay |
15:18:15 | krux02 | well, I am working on the compiler, that is of course my prefered way to install nim |
15:18:37 | krux02 | at least that is the way where I can provide support |
15:19:14 | FromDiscord_ | <eagle> okay, thanks |
15:20:20 | jmiven | eagle, the error says that it can't find "as". Check if binutils is installed |
15:21:18 | FromDiscord_ | <eagle> ooooooooh yes |
15:21:30 | FromGitter | <awr1> hm |
15:21:49 | FromDiscord_ | <eagle> i'll try aigen |
15:21:50 | FromGitter | <awr1> rm -rf choosenim |
15:21:54 | FromGitter | <awr1> i mean |
15:21:59 | FromGitter | <awr1> rm -rf ~/.choosenim |
15:22:20 | FromGitter | <awr1> and try again maybe? that's weird |
15:22:23 | FromGitter | <awr1> or that |
15:22:26 | FromGitter | <awr1> the binutils thing |
15:23:16 | FromDiscord_ | <eagle> i install binutims and i try again |
15:23:34 | FromDiscord_ | <eagle> binutils* |
15:26:38 | FromDiscord_ | <eagle> okay it works thanks |
15:32:54 | FromGitter | <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:57 | FromGitter | <zacharycarter> anywhere* |
15:33:09 | FromGitter | <Vindaar> Ah, I added a note to the readme on my branch |
15:33:57 | FromGitter | <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:02 | FromGitter | <zacharycarter> ah okay - I will check the readme - thanks |
15:35:08 | FromGitter | <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:59 | FromGitter | <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:12 | FromGitter | <Vindaar> ok! |
15:36:57 | FromGitter | <zacharycarter> thanks again for putting this together - can't wait to test it out in a few moments :D |
15:37:32 | FromGitter | <Vindaar> glad to help! Hope you aren't disappointed immediately again :D |
15:38:12 | FromGitter | <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:24 | FromGitter | <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:01 | FromGitter | <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:34 | FromGitter | <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:14 | FromGitter | <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:47 | FromGitter | <Vindaar> Helps the macro experience, but doesn't help people reading the code |
15:42:33 | FromGitter | <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:51 | FromGitter | <mratsim> @vindaar the name is fun :p |
15:43:27 | FromGitter | <Vindaar> @mratsim I was being serious. I love the names of your projects :) |
15:45:18 | * | solitudesf joined #nim |
15:46:59 | FromGitter | <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:16 | FromGitter | <mratsim> @federico3 no lobste.rs I don't have an account |
15:47:33 | federico3 | mratsim: URL? |
15:49:28 | FromGitter | <zacharycarter> so one very hacky way of solving having to hack vmhooks is just to include compiler/vm in apiImpl |
15:49:31 | FromGitter | <zacharycarter> less than ideal - but it works |
15:50:27 | FromGitter | <Vindaar> true, that should work |
15:50:28 | FromGitter | <zacharycarter> although I think there is a way to patch Nim modules in your solution |
15:50:34 | FromGitter | <zacharycarter> so that might be the better route |
15:50:53 | FromGitter | <zacharycarter> I just can't remember how off the top of myead |
15:51:22 | FromGitter | <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:29 | FromGitter | <zacharycarter> I think that's what I'm thinking of |
15:54:25 | FromGitter | <zacharycarter> but the macro seems to work great! I'll try to write one for generating the set proc |
15:54:32 | FromGitter | <zacharycarter> and then look at nested objects |
15:55:11 | FromGitter | <Vindaar> awesome! If you get stuck, just ask. |
15:56:21 | FromGitter | <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:10 | FromGitter | <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:23 | FromGitter | <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:57 | FromGitter | <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:43 | FromGitter | <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:09 | FromGitter | <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:21 | FromGitter | <zacharycarter> I'm not sure - if that already happens, one would think you could |
17:29:34 | FromGitter | <zacharycarter> but Araq was kind of the one guiding me on this and he didn't mention anything about that |
17:29:52 | FromGitter | <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:01 | FromGitter | <Vindaar> good point |
17:31:15 | FromGitter | <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:32 | FromGitter | <zacharycarter> basically the set proc just does the opposite of what the get proc does |
17:31:38 | oprypin | hi. 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:42 | FromGitter | <zacharycarter> it parses an instance of an object and then generates a PNode from it |
17:32:58 | FromGitter | <Vindaar> good work. and yes, that makes sense |
17:33:14 | FromGitter | <Vindaar> @oprypin does it only fail on the master branch? |
17:33:26 | oprypin | yes |
17:34:12 | FromGitter | <Vindaar> when do you get that error? |
17:36:31 | leorize | oprypin: the master branch is dead |
17:36:58 | oprypin | understandable. what's the alternative way to download source code of latest release of Nim |
17:37:09 | leorize | please 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:31 | oprypin | i don't want to specify or update this version manually |
17:37:48 | leorize | sorry, this is no longer an option |
17:37:54 | leorize | you could pull the tags though |
17:38:09 | leorize | the latest tag should be the latest released version |
17:38:45 | federico3 | oprypin: on what platform? |
17:38:55 | oprypin | https://bpaste.net/show/tqcp |
17:39:15 | Zevv | zacharycarter: hey, you got it working? |
17:39:21 | oprypin | this is the platform that i care about :p https://travis-ci.org/oprypin/nim-random/jobs/544966661 linux i suppose |
17:39:32 | Zevv | i was travelling today so couldnt look at your link, sorry |
17:40:06 | leorize | oprypin: https://github.com/nim-lang/Nim/wiki/BuildServices#building-nim-projects-on-travis-ci |
17:40:16 | federico3 | oprypin: https://github.com/nim-lang/Nim/wiki/BuildServices |
17:40:51 | FromGitter | <zacharycarter> Zevv: @Vindaar did |
17:41:17 | FromGitter | <zacharycarter> And I am working on enhancements, also no worries at all |
17:41:36 | oprypin | https://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:44 | oprypin | > Building tools (nimble, nimgrep, nimpretty, nimsuggest) |
17:50:44 | oprypin | why tho? :/ |
17:52:20 | federico3 | huh? |
17:55:16 | oprypin | im 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:18 | Zevv | so, vindaar is good at that stuff, maybe he can help me out as well :) |
17:57:56 | dom96 | oprypin, why does it suck? |
17:58:27 | FromGitter | <Vindaar> Zevv: ah, I just like to hack around ;) But sure, I'll try to help |
18:00:26 | oprypin | dom96, 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:28 | dom96 | oprypin, I guess its goals don't align with your expectations then |
18:01:58 | Zevv | vindaar: I like to hack around as well, but I've been hitting walls for a few weeks |
18:01:59 | FromGitter | <alehander42> didnt it get some XDG HOME support |
18:03:28 | FromGitter | <Vindaar> Zevv: what are you trying to do? |
18:03:39 | Zevv | my 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:22 | Zevv | and 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:23 | FromDiscord_ | <treeform> I think choosenim is great. It does exactly want I want. Its a pain setting up the paths. |
18:04:43 | federico3 | oprypin: I'm updating the wiki page |
18:04:48 | oprypin | federico3, hold on |
18:04:54 | oprypin | i'll try to revive that one |
18:05:34 | dom96 | treeform: Thank you <3 |
18:05:39 | Zevv | vindaar: 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:52 | FromGitter | <Vindaar> yeah, was just about to ask for an example |
18:06:09 | Zevv | ill see if i can hack something up from my phone, give me a minute or two |
18:06:25 | FromGitter | <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:24 | FromGitter | <mratsim> @federico3 URL for ? My RFC? https://github.com/nim-lang/RFCs/issues/160 |
18:10:49 | federico3 | mratsim: or your post about it |
18:10:54 | Zevv | vindaar: http://paste.ubuntu.com/p/GvtzDd8KK6/ |
18:15:24 | FromGitter | <alehander42> but why do you need to return a table |
18:15:35 | FromGitter | <alehander42> can you return a pattern? |
18:15:41 | FromGitter | <alehander42> if so it should be easy to make a helper |
18:16:55 | Zevv | how do you mean a pattern? |
18:17:29 | Zevv | I 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:01 | FromGitter | <alehander42> http://ix.io/1R8Y/nim |
18:20:41 | FromGitter | <alehander42> i asked what is Pattern |
18:20:52 | FromGitter | <alehander42> because currently its easy to make it work with newLit |
18:20:57 | FromGitter | <alehander42> but in the worst case you just need a custom |
18:21:01 | FromGitter | <alehander42> newLit for Pattern too |
18:21:32 | FromGitter | <Vindaar> a few minutes away and the problem solves itself ;) |
18:22:07 | FromGitter | <alehander42> sorry, i just saw a possible way and wanted to see if its what is wanted |
18:22:22 | FromGitter | <alehander42> next one is on you :P |
18:22:43 | FromGitter | <Vindaar> haha, that's totally fine :D |
18:23:06 | FromGitter | <alehander42> i am sitting here eating cake with fever |
18:23:11 | FromGitter | <alehander42> and losing my time on the internet :P |
18:25:00 | FromGitter | <Vindaar> sounds like a good time /s at least you still have an appetite |
18:25:34 | Zevv | Pattern is seq[] of an object |
18:27:07 | * | Vladar joined #nim |
18:27:09 | Zevv | which is constructed recursively from the nim ast |
18:28:12 | FromGitter | <Vindaar> then you might have to change the `newLit(v)` in line 15 of @alehander42's code. But it should still work |
18:29:52 | Zevv | let me see - i must admit I didnt think of this solution :) |
18:30:43 | * | clyybber joined #nim |
18:39:58 | FromGitter | <mratsim> The post is just a link to the RFC @federico3 |
18:44:06 | * | Trustable joined #nim |
18:45:06 | federico3 | mratsim: posted on lobste.rs |
18:46:12 | FromGitter | <alehander42> Zevv: i also havent thought of that |
18:46:30 | FromGitter | <alehander42> but i suspect all the "new quote" PR-s had that and i forgot |
18:46:49 | FromGitter | <alehander42> maybe newLit for table should be in macros.nim ? |
18:46:53 | FromGitter | <alehander42> maybe it is in some of the PR-s |
18:46:54 | FromGitter | <alehander42> not sure |
18:52:29 | FromGitter | <zacharycarter> sweet - seqs are working for the set result macro now |
18:52:38 | FromGitter | <zacharycarter> for strings anyway :P |
18:53:02 | FromGitter | <zacharycarter> will add support for other types then work on nested objects |
19:00:46 | FromGitter | <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:44 | oprypin | https://travis-ci.org/oprypin/nim-random/builds/569966942 :> |
19:09:44 | oprypin | https://github.com/nim-lang/Nim/wiki/BuildServices/_compare/456a981971aa013665531941d81134f89fa66d80...33aaa0642e151f3e55d546597dea1890c2c5406e |
19:17:44 | FromGitter | <Varriount> @zacharycarter Whatcha working on? |
19:18:32 | FromGitter | <zacharycarter> @Varriount - so with the Nim VM, passing user define types b/w NimScript and Nim has been a pain |
19:19:06 | FromGitter | <Varriount> Ah, you're trying to use the VM in a program other than the compiler? |
19:19:09 | FromGitter | <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:13 | FromGitter | <zacharycarter> yeah - my game |
19:19:39 | * | Trustable quit (Remote host closed the connection) |
19:19:39 | FromGitter | <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:55 | FromGitter | <zacharycarter> and I gave up this morning and then Vindaar did it in a couple of hours |
19:20:09 | FromGitter | <zacharycarter> so now I'm adding more functionality to the macros |
19:20:13 | FromGitter | <Varriount> :O |
19:20:27 | FromGitter | <Varriount> Sounds like something that should honestly be a standard library module |
19:20:48 | FromGitter | <zacharycarter> it's pretty nice - basically there's a template where you just pass in a typedesc |
19:20:59 | FromGitter | <zacharycarter> and it generates the two procs by calling the two macros |
19:21:31 | FromGitter | <zacharycarter> so far we can handle types with strings, floats, ints and seqs |
19:21:39 | FromGitter | <zacharycarter> and I'm about to work on nested objects |
19:21:39 | FromGitter | <Varriount> But not complex objects? |
19:21:53 | FromGitter | <zacharycarter> well - it should work on nested objects - I just need to write the code |
19:22:01 | FromGitter | <Varriount> Apropos of nothing, I just finished *all* my classes. I am now a summer 2019 graduate. |
19:22:10 | FromGitter | <zacharycarter> congrats man!!!! that's awesome :D |
19:22:32 | FromGitter | <Varriount> I now have time to actually *do* things, like travel. |
19:22:48 | FromGitter | <Varriount> I could even take a trip to wherever-you-work-now. :P |
19:23:01 | FromGitter | <zacharycarter> well - if you ever feel like visiting Finland :P |
19:23:14 | FromGitter | <zacharycarter> it's actually pretty nice here - but it's going to start getting cold soon |
19:23:17 | FromGitter | <zacharycarter> like really really cold |
19:23:45 | FromGitter | <zacharycarter> by October it will be in the 40 degree Fahrenheit range I imagine |
19:24:13 | FromGitter | <alehander42> which is like normal |
19:24:21 | FromGitter | <alehander42> the question is |
19:24:26 | FromGitter | <alehander42> how cold is it in Decem |
19:24:30 | FromGitter | <alehander42> January8 |
19:24:31 | FromGitter | <alehander42> * |
19:24:33 | FromGitter | <Varriount> @zacharycarter What's the closest airport? |
19:24:41 | krux02 | @PMunch: are you around? |
19:25:00 | FromGitter | <zacharycarter> `HEL` |
19:25:05 | FromGitter | <zacharycarter> Helsinki Airport |
19:25:26 | FromGitter | <zacharycarter> it's in an area called Vaanta |
19:25:29 | FromGitter | <Varriount> I could leave today for a little over $800 |
19:25:48 | FromGitter | <zacharycarter> that's about how much it cost me to get over here |
19:25:58 | FromGitter | <zacharycarter> plane ticket wise anyway |
19:26:06 | FromGitter | <alehander42> do you need a visa |
19:26:07 | FromGitter | <alehander42> for eu? |
19:26:19 | FromGitter | <zacharycarter> to visit I think only a passport |
19:26:19 | FromGitter | <Varriount> Just a passport, iirc |
19:26:24 | FromGitter | <alehander42> nice |
19:26:30 | FromGitter | <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:35 | FromGitter | <zacharycarter> or a residence permit I guess is what they call it |
19:26:36 | FromGitter | <Varriount> If I wanted to be cheap, I could go to another airport and drive |
19:26:47 | FromGitter | <alehander42> talin? |
19:27:02 | FromGitter | <zacharycarter> I don't think Estonia is that much cheaper these days - but I could be wrong |
19:27:04 | FromGitter | <alehander42> btw Sankt Peterburg is relatively close and pretty nice |
19:27:09 | FromGitter | <alehander42> but i think you need a visa |
19:27:10 | FromGitter | <zacharycarter> I know that Finns still migrate over there to buy their beer |
19:27:10 | FromGitter | <alehander42> for that |
19:27:39 | FromGitter | <zacharycarter> if you're not going to St. Petersburg by boat - you def need a visa |
19:27:51 | FromGitter | <alehander42> wait, by boat you dont |
19:28:01 | FromGitter | <alehander42> or you mean that you can just take a look from it |
19:28:03 | FromGitter | <alehander42> without entering |
19:28:08 | FromGitter | <zacharycarter> well - like if you take a ferry from Helsinki to St. Petersburg you don't |
19:28:14 | * | laaron joined #nim |
19:28:15 | FromGitter | <alehander42> i dont think so |
19:28:17 | FromGitter | <zacharycarter> you can get in with a passport - but you can't leave St. Petersburg |
19:28:21 | FromGitter | <alehander42> huh |
19:28:27 | FromGitter | <zacharycarter> yeah it's weird af |
19:28:29 | FromGitter | <Varriount> @zacharycarter Do you speak Finnish? |
19:28:29 | FromGitter | <alehander42> i wonder if thats true for us as well |
19:28:38 | FromGitter | <zacharycarter> @Varriount negative - it's a complicated ass language |
19:28:48 | FromGitter | <zacharycarter> and with a population of 5 mil - IMO it's not worth learning |
19:29:20 | FromGitter | <alehander42> suomi |
19:29:27 | FromGitter | <alehander42> kimi raikonen |
19:29:28 | FromGitter | <zacharycarter> it sounds cool though - I always crack up when I hear Finnish people conversing |
19:29:34 | FromGitter | <alehander42> oh well thata ll my words |
19:29:38 | FromGitter | <zacharycarter> like `Joo` is informal for yes |
19:29:47 | FromGitter | <zacharycarter> but they pronounce `J's` as `Y's` |
19:29:52 | FromGitter | <zacharycarter> so it sounds like they're saying `Yo` |
19:29:59 | FromGitter | <zacharycarter> and they'll say `Joo` repeatedly |
19:30:08 | FromGitter | <zacharycarter> so it sounds like they're saying `Yo Yo Yo` |
19:30:14 | FromGitter | <zacharycarter> like they're about to break out into a rap song |
19:30:21 | FromGitter | <alehander42> hahha |
19:30:25 | clyybber | lol |
19:30:37 | FromGitter | <alehander42> i cant imagine finnish people doing it |
19:30:49 | FromGitter | <zacharycarter> people walk around here with like the modern day boom box |
19:30:54 | FromGitter | <zacharycarter> playing Finnish hip hop |
19:31:06 | FromGitter | <alehander42> is it good |
19:31:07 | FromGitter | <zacharycarter> it's like a suit case with speakers |
19:31:26 | FromGitter | <zacharycarter> I guess it's hard to judge - like IMO no, but I also come from the country that invented hip hop |
19:31:38 | FromGitter | <zacharycarter> but maybe if I understood the lyrics... but even then I don't know |
19:32:08 | FromGitter | <zacharycarter> their metal is definitely on point |
19:32:28 | FromGitter | <zacharycarter> and there was this whole thing pretty recently - https://www.youtube.com/watch?v=Ad3cGfLC5v8 |
19:34:32 | FromGitter | <zacharycarter> Finns really love their metal and their knitting |
19:37:16 | FromGitter | <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:29 | FromGitter | <zacharycarter> I'm not sure if there's a way to avoid the `parseInt` `parseFloat` etc - or not |
19:38:17 | FromGitter | <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:42 | FromGitter | <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:12 | FromGitter | <Vindaar> hm, the parsing is sure weird. Do you accidentally convert the values to strings somewhere? |
19:42:56 | FromGitter | <zacharycarter> I don't think so - unless it's the assignment at the top of that proc |
19:43:07 | FromGitter | <zacharycarter> where I wrote - `seqKind = dtype.nodeToVal().strVal` |
19:43:37 | FromGitter | <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:50 | FromGitter | <Vindaar> but that only converts the NimNode of the inner type (`seq[float]` -> `float`) to a string |
19:43:55 | FromGitter | <zacharycarter> yeah |
19:44:03 | FromGitter | <Vindaar> if anything it'd have to happen outside of that proc |
19:44:12 | FromGitter | <Vindaar> did you push the code in full somewhere already? |
19:44:25 | FromGitter | <zacharycarter> no but I can put up a gist with the latest version |
19:44:32 | FromGitter | <zacharycarter> let me do that now |
19:45:02 | * | aq60 joined #nim |
19:46:07 | FromGitter | <zacharycarter> https://gist.github.com/zacharycarter/e3e30f5277d62364d48d957e75f47ddc |
19:46:26 | FromGitter | <Vindaar> let's see :) |
19:51:21 | rayman22201 | @zacharycarter and @Vindaar. this is a very cool thing you are doing. Please make it a nimble package when you are done! |
19:54:26 | FromGitter | <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:32 | FromGitter | <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:04 | FromGitter | <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:06 | FromGitter | <zacharycarter> that sets up the vm |
19:57:41 | FromGitter | <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:23 | FromGitter | <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:37 | FromGitter | <zacharycarter> that makes sense - thanks for explaining that |
19:59:48 | rayman22201 | That 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:02 | FromGitter | <zacharycarter> I actually just issued a PR to it a few weeks ago |
20:00:08 | FromGitter | <zacharycarter> to make it work with 0.20.0 |
20:00:14 | FromGitter | <zacharycarter> and it was accepted |
20:00:20 | FromGitter | <zacharycarter> so I think it's still alive maybe |
20:00:41 | rayman22201 | Oh nice. In that case. A PR to that may be a good way to go. |
20:00:47 | FromGitter | <zacharycarter> just not actively being worked on - I mean in Serenitor's defense - he already pretty much made everything work besides this |
20:01:01 | rayman22201 | True |
20:01:11 | FromGitter | <zacharycarter> so I think it's just really stagnant since most people aren't embedding NimScript into their projects |
20:01:40 | FromGitter | <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:00 | FromGitter | <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:26 | FromGitter | <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:40 | rayman22201 | Definitely 👍 |
20:04:07 | FromGitter | <Vindaar> yeah, something like this should work: |
20:04:07 | FromGitter | <Vindaar> https://gist.github.com/Vindaar/15cba3d524c6b73e36546fd52ad551b7 |
20:04:50 | FromGitter | <Vindaar> ups, forgot to add the body to result :P |
20:05:11 | FromGitter | <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:24 | FromGitter | <Vindaar> :) |
20:05:32 | FromGitter | <zacharycarter> because of the for loop and doing `obj`.`fieldName` |
20:05:55 | FromGitter | <zacharycarter> I need to remember that in these cases I can just generate more Nim code |
20:06:02 | FromGitter | <zacharycarter> but it's like a backwards way of thinking for me |
20:06:30 | FromGitter | <Vindaar> I know the feeling. It has gotten much easier for me, but sometimes I'm still confused about it all :D |
20:08:08 | FromGitter | <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:31 | FromGitter | <zacharycarter> yeah, that's very true |
20:11:10 | krux02 | Vindaar: before I write a marco, I write the code that I want to generate by hand. |
20:11:13 | krux02 | More than one example |
20:11:17 | shashlick | Considering the compiler code is already there, we just need a way to import it |
20:11:53 | shashlick | Making the compiler a package is not the best cause you end up with two compilers that can conflict |
20:11:53 | krux02 | just to get an idea of how it is properly done. Then I write the macro. |
20:12:07 | shashlick | That's what happened with c2nim, nimble and others that embed |
20:12:27 | shashlick | Ideally there is a way to get the nim compiler path and just import from there |
20:12:35 | FromGitter | <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:37 | shashlick | @zacharycarter it is easy to pull the stdlib into the binary |
20:13:52 | shashlick | The question is how to treat it as a file system for imports to work |
20:13:55 | FromGitter | <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:12 | krux02 | :p |
20:14:27 | shashlick | Or alternatively modify imports to allow loading from memory |
20:14:55 | krux02 | no macros have local effect only. |
20:15:10 | krux02 | but yea, you have to figure out the limits of your tools first. |
20:16:20 | FromGitter | <Vindaar> indeed |
20:17:24 | krux02 | I also wish macros could do more, e.g. call into C functions |
20:17:51 | FromGitter | <zacharycarter> okay - got that working - also had to generate an ident for `val` but once I did that it works great |
20:18:02 | FromGitter | <zacharycarter> time for complex objects now :D |
20:18:12 | FromGitter | <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:50 | aq60 | How to increase ref? |
20:32:19 | aq60 | Do I have to cast it to int, add, then back to ref? |
20:33:14 | FromGitter | <zacharycarter> `gcRef` `gcUnref` I think? |
20:33:42 | leorize | why would you want to do that by hand though? |
20:33:55 | leorize | but yea, GcRef and GcUnref should do |
20:34:36 | Zevv | alehander42: 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:25 | FromGitter | <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:00 | aq60 | In C: `tnode_t *tnode_p, *t`; `t = tnode_p++;` |
20:37:46 | Zevv | because my original DSL I parsed can contain snippets of callback code :) |
20:38:15 | Zevv | vindaar: https://github.com/zevv/npeg#quickstart |
20:42:02 | FromGitter | <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:18 | Zevv | at this time it is just a stmtlist |
20:54:03 | FromGitter | <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:21 | Zevv | so 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:22 | FromGitter | <Vindaar> but a `StmtList` of valid nim code or also some DSL? |
20:54:45 | Zevv | vindaar: 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:33 | Zevv | it might explain a bit better, everytime I abstract or simplify I miss relevant details |
20:56:08 | FromGitter | <Vindaar> so you're talking about e.g. the `words[$1] = parseInt($2)` line? |
20:56:21 | Zevv | right, but that can be any code |
20:57:15 | * | stefanos82 joined #nim |
20:57:24 | Zevv | now 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:31 | Zevv | right, thanks for being my teddy bear :) |
20:58:14 | Zevv | this might just work with the newLit()s |
20:58:22 | Zevv | first some sleep, more later. |
20:59:13 | FromGitter | <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:51 | FromGitter | <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:04 | FromDiscord_ | <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:52 | FromGitter | <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:04 | FromDiscord_ | <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:02 | FromDiscord_ | <slymilano> Hey boys! |
23:39:29 | FromDiscord_ | <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:58 | FromDiscord_ | <Kiloneie> I am about to start making videos on Nim and use it with Godot Engine via a binding and such, im new too. |