00:16:22 | * | PrimHelios joined #nim |
00:34:13 | * | PrimHelios quit (Quit: Leaving) |
00:35:00 | * | zachk quit (Quit: Leaving) |
00:58:47 | * | abm quit (Ping timeout: 240 seconds) |
01:16:46 | * | endragor joined #nim |
01:19:22 | * | vivus quit (Remote host closed the connection) |
01:21:06 | * | endragor quit (Ping timeout: 252 seconds) |
02:03:43 | * | stefanos82 joined #nim |
02:05:00 | * | banc quit (Quit: ZNC - http://znc.in) |
02:09:09 | * | ftsf joined #nim |
02:20:40 | * | banc joined #nim |
02:21:22 | * | endragor joined #nim |
02:26:59 | * | ftsf quit (Remote host closed the connection) |
02:27:19 | * | ftsf joined #nim |
02:31:13 | * | darithorn joined #nim |
03:00:24 | * | gangstacat quit (Quit: Ĝis!) |
03:04:43 | * | gangstacat joined #nim |
03:18:41 | * | dddddd quit (Remote host closed the connection) |
03:21:15 | * | smt quit (Read error: Connection reset by peer) |
03:28:37 | * | chemist69_ joined #nim |
03:31:27 | * | chemist69 quit (Ping timeout: 240 seconds) |
03:34:44 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:43:11 | * | ftsf quit (Remote host closed the connection) |
03:43:21 | * | ftsf joined #nim |
04:27:27 | * | crem quit (Ping timeout: 250 seconds) |
04:29:34 | * | crem joined #nim |
04:46:41 | * | ftsf_ joined #nim |
04:49:02 | * | ftsf_ quit (Remote host closed the connection) |
04:49:32 | * | ftsf_ joined #nim |
04:50:07 | * | ftsf quit (Ping timeout: 240 seconds) |
04:53:36 | * | nsf joined #nim |
05:02:10 | * | darithorn quit () |
05:13:58 | * | narimiran joined #nim |
05:27:14 | * | kapil____ joined #nim |
05:41:09 | * | ftsf_ quit (Read error: Connection reset by peer) |
05:58:38 | * | narimiran quit (Quit: Konversation terminated!) |
06:11:16 | * | krux02 joined #nim |
06:53:17 | FromGitter | <xmonader> Any idea how to use variables for (alignments and such) in `fmt` |
06:53:49 | FromGitter | <yyyc514> can i have a proc generate code at compile time or does it absoultey hace to be a macro at that point? |
06:54:05 | leorize | xmonader: it's not supported IIRC, there is an open issue for it |
06:54:33 | leorize | yyyc514: generate code at compile time? isn't that a macro/template? :P |
06:55:03 | FromGitter | <yyyc514> well i was trying to do most of the work in a proc and then just push off the compile time piece to a template |
06:55:15 | FromGitter | <xmonader> @leorize you think i can get around with a template or macro to generate it? |
06:55:26 | FromGitter | <yyyc514> feel like i need the equiv of “eval” in other languages |
06:55:39 | leorize | xmonader: no idea, try it |
06:55:48 | FromGitter | <timotheecour> https://github.com/nim-lang/Nim/issues/9199 ; feel free to upvote to raise awareness : |
06:56:00 | FromGitter | <xmonader> yup thanks |
06:56:01 | leorize | yyyc514: you mean you want to build the AST in a proc then push it out later? |
06:56:28 | FromGitter | <yyyc514> https://gist.github.com/yyyc514/f354f8ff2e8204a8221cadeba24dbe41 |
06:56:54 | FromGitter | <yyyc514> i’d like to know the best way to mix this stuff… only one TINY part of that needs to be a macro |
06:57:23 | leorize | oh, and you don't need `quote` in template |
06:57:31 | leorize | use {.inject.} |
06:58:07 | FromGitter | <yyyc514> huh? |
06:58:59 | leorize | is that your own `quote`? :P |
06:59:13 | leorize | I mistook it for `macros.quote` |
06:59:31 | FromGitter | <yyyc514> no i was being silly :) |
06:59:39 | FromGitter | <timotheecour> regarding eval: for runtime eval see evalString (i added it to https://github.com/timotheecour/Nim/blob/56606db7bf0bfc8d84c5a26ef957ee9392caa61a/tests/compilerapi/tcompilerapi.nim) ; for compile time eval: your macro can be a thin wrapper around a regular proc |
06:59:42 | FromGitter | <gogolxdong> Is there a comparison between .nims and Ninja? |
06:59:52 | leorize | you can't |
07:00:24 | * | mech422_ joined #nim |
07:00:52 | FromGitter | <yyyc514> @timotheecour ok i dont actually need eval() i need evalLater :-) |
07:01:38 | FromGitter | <yyyc514> i was just trying to psuh the macro part deeper inside to the only part that actually NEEDS the macro stuff |
07:01:43 | FromGitter | <yyyc514> instead of making the whole templat egeneration macro |
07:01:57 | FromGitter | <yyyc514> which i could just do |
07:02:01 | leorize | zero idea of what you're doing :P |
07:02:32 | FromGitter | <yyyc514> var html = textarea("person","name", opts = {"rows": "23"}) |
07:02:36 | FromGitter | <yyyc514> trying to make that work |
07:02:52 | FromGitter | <yyyc514> WITHOUT the whoel textarea function being a macro |
07:03:23 | * | mech422 quit (Ping timeout: 268 seconds) |
07:03:35 | FromGitter | <timotheecour> again, u can have a thin wrapper macro: ⏎ `proc fooImpl(…): auto = …; macro foo(…): untyped = fooImpl(…)` |
07:03:48 | leorize | yyyc514: it already looks like working... |
07:04:03 | FromGitter | <yyyc514> it’s not because person.name needs to be compiled |
07:04:10 | FromGitter | <yyyc514> to get the value |
07:04:31 | FromGitter | <yyyc514> from a person object |
07:05:46 | leorize | use a template with `astToStr()` |
07:06:10 | leorize | then it could become: var html = textarea(person, name, opts = {}) |
07:06:43 | FromGitter | <yyyc514> templates can’t run code |
07:06:50 | FromGitter | <yyyc514> i need to loop over opts and turn it into html |
07:08:09 | FromGitter | <yyyc514> Error: request to generate code for .compileTime proc: textarea |
07:08:51 | leorize | so basically you want that `for` loop to run in compile time |
07:09:13 | leorize | tried a `static:` block? |
07:09:31 | FromGitter | <yyyc514> lol, never even heard of it |
07:09:33 | * | FromGitter * yyyc514 looking |
07:11:29 | FromGitter | <yyyc514> Error: cannot evaluate at compile time: result |
07:11:32 | FromGitter | <yyyc514> interesting |
07:11:50 | * | sagax_ joined #nim |
07:11:52 | leorize | remember that in `template` there's no `result` |
07:12:20 | FromGitter | <yyyc514> i was trying to part part of the proc static just to see how it work |
07:14:58 | FromGitter | <yyyc514> ha it doesn’t blow up but it doesn’t output the value either |
07:15:10 | FromGitter | <yyyc514> oh wait |
07:16:06 | FromGitter | <yyyc514> yeah that one thing doesn’t work, i feel like i just have to make the whole thing a macro and then write some string helpers for macros |
07:16:24 | leorize | well let me try writing a template version for it |
07:16:35 | leorize | based on what I know abt this function of yours :P |
07:16:41 | FromGitter | <yyyc514> ok |
07:16:48 | FromGitter | <yyyc514> you have the full code :) |
07:17:50 | FromGitter | <yyyc514> check html == """<textarea name="person[name]" rows="23">Bob</textarea>""" |
07:17:51 | FromGitter | <yyyc514> and test |
07:18:05 | FromGitter | <yyyc514> well assuming the persons name is bob :) |
07:20:34 | FromGitter | <yyyc514> the runtime version was easy and i could drop to a macro just for the one part that fetches the value |
07:21:41 | FromGitter | <yyyc514> adding runtime version to gist |
07:22:32 | FromGitter | <yyyc514> maybe i just should have gone straight to macro vs template for the inner side |
07:24:49 | FromGitter | <yyyc514> ah the problem is proc isn’t going to have access to the outside scope anyways, is it? |
07:25:17 | FromGitter | <yyyc514> i just got it “working” with a macro but of course person has no meaning inside the proc |
07:25:32 | FromGitter | <yyyc514> still curiosu to see what a template form might look like |
07:25:38 | FromGitter | <yyyc514> right now it feels like the whole thing needs to be a macro |
07:25:45 | FromGitter | <yyyc514> (or template) |
07:26:14 | leorize | the compiler doesn't like my code (yet) :P |
07:30:12 | leorize | ah, method call syntax limitation |
07:30:18 | leorize | never thought I'd actually trip it :P |
07:30:43 | FromGitter | <yyyc514> congrats? lol |
07:30:43 | * | Widdershins left #nim ("WeeChat 2.2") |
07:40:16 | * | Jesin quit (Ping timeout: 264 seconds) |
07:40:58 | * | Jesin joined #nim |
07:41:59 | leorize | yyyc514: maybe it's better of with a macro |
07:42:44 | leorize | I wrote a working template version, but the loop only runs at runtime :( |
07:43:20 | FromGitter | <yyyc514> still would like to see |
07:45:58 | leorize | wait a second |
07:46:00 | leorize | I've an idea |
07:47:44 | leorize | it worked! |
07:50:54 | leorize | yyyc514: https://ptpb.pw/hfoV/nim |
07:51:09 | leorize | if you look into the `nimcache`, you'll find the string inlined :D |
07:57:33 | FromGitter | <yyyc514> what the heck kind of node is HiddenSubConv |
07:59:47 | FromGitter | <yyyc514> hmmm |
08:02:23 | FromGitter | <yyyc514> that whole inline proc idea is pretty neat |
08:03:20 | * | floppydh joined #nim |
08:04:02 | leorize | initially I was binding it with `{lit}`, which (hopefully) would avoid that inline `proc` |
08:04:44 | leorize | but `{lit}` triggered the symbol binding pass, so `name` was treated as invalid :( |
08:28:54 | * | abm joined #nim |
08:31:30 | * | PMunch joined #nim |
08:40:00 | * | Perkol joined #nim |
08:47:58 | FromGitter | <yyyc514> does nim have a line continuation char? |
08:48:22 | Araq | no, it does not need it |
08:48:41 | Araq | commas and binary operators are line continuations |
08:48:58 | FromGitter | <yyyc514> yeah i was wanting to do a prefix style |
08:49:17 | FromGitter | <yyyc514> blah ⏎ << more blah ⏎ << more etc |
08:49:30 | FromGitter | <yyyc514> works with << on the end but it’s not readable imho |
08:49:46 | FromGitter | <kayabaNerve> ... prefix style looks ugly as hell IMO. |
08:50:02 | FromGitter | <kayabaNerve> Postfix says there's more. Prefix says you thought the line was over but PSYCH |
08:50:30 | FromGitter | <narimiran> i didn't know we can use binary operators as line continuations without enclosing everything in parentheses |
08:50:39 | FromGitter | <narimiran> but i'm not sure i'll adopt that :) |
08:51:57 | FromGitter | <yyyc514> lol |
08:52:16 | FromGitter | <yyyc514> luke: i guess it depends on whether you’re reading blocks or lines |
08:52:25 | FromGitter | <yyyc514> the point of prefix i to make the BLOCK more readable |
08:52:31 | FromGitter | <yyyc514> for postfix also lies |
08:52:38 | FromGitter | <yyyc514> if you’re only looking at a single line |
08:52:53 | FromGitter | <yyyc514> it’s just whether you want to require the user to look forward or backward it seems is the question |
08:53:39 | FromGitter | <yyyc514> i think for some things (like templating) there is no harm with “add one line, add another line” it’s still very understanable |
08:53:42 | FromGitter | <yyyc514> templating is my context :) |
08:54:49 | FromGitter | <alehander42> well, it's not supported |
08:55:09 | FromGitter | <yyyc514> yeah :) now i know |
08:59:04 | FromGitter | <yyyc514> https://gist.github.com/yyyc514/5fb452ce471cfb52d9d0f810f44c4b93 |
08:59:08 | FromGitter | <yyyc514> any nice way to clean up the dup << |
08:59:30 | FromGitter | <yyyc514> i tried to do chaining but that gets upset when you don’t chain because then you have to discard |
08:59:36 | FromGitter | <alehander42> @yyyc514 are you working on a different template system? |
08:59:46 | FromGitter | <alehander42> because this looks very similar to karax/emerald to me |
09:00:05 | FromGitter | <yyyc514> this is definitely not emerald :) |
09:00:27 | FromGitter | <alehander42> so that's a helper |
09:00:45 | FromGitter | <yyyc514> yep |
09:00:46 | FromGitter | <alehander42> the cool thing about the DSL-s is that they support this for all tags |
09:01:06 | FromGitter | <alehander42> so if you want this opts behavior for other helpers |
09:01:15 | FromGitter | <alehander42> you might want to reuse it somehow |
09:01:39 | FromGitter | <yyyc514> which DSL are you referring to? |
09:01:42 | FromGitter | <alehander42> (e.g. you'll probably need to pass attributes to other helpers, right) |
09:01:59 | FromGitter | <yyyc514> well the ops stuff would be abstracted |
09:02:06 | FromGitter | <yyyc514> so you’d call tag() |
09:02:11 | FromGitter | <alehander42> emerald / karax |
09:02:36 | FromGitter | <alehander42> well literally that: `tagName(attr=value, otherAttr=value..):` |
09:02:48 | FromGitter | <alehander42> ok |
09:03:14 | FromGitter | <yyyc514> for my templates mostly it’ll be static HML |
09:03:19 | * | gmpreussner_ quit (Ping timeout: 244 seconds) |
09:03:25 | FromGitter | <yyyc514> the programatic stuff is really only needed for dynamic stuff like form helpers, etc |
09:03:33 | FromGitter | <yyyc514> if you just nede to write <div> you’d just write <div> :) |
09:03:42 | FromGitter | <yyyc514> in HTML |
09:03:44 | * | gmpreussner joined #nim |
09:03:49 | FromGitter | <alehander42> if you just need to write <textarea> you'd just write <textarea> :) |
09:03:54 | FromGitter | <alehander42> but you have a helper :P |
09:04:01 | FromGitter | <yyyc514> except that you need it bound to an object |
09:04:13 | * | druonysus quit (Ping timeout: 245 seconds) |
09:04:17 | FromGitter | <yyyc514> i mean i guess you’re saying you could just do it at a very low level |
09:04:31 | FromGitter | <yyyc514> <textarea><%= blah.value %></textarea> |
09:04:33 | FromGitter | <alehander42> you mean that textarea is one of the form helpers |
09:04:49 | FromGitter | <alehander42> ok |
09:04:51 | FromGitter | <yyyc514> yes textarea is a form helper like all the inputs, etc |
09:05:10 | FromGitter | <yyyc514> but now you got me wondering why that is lol :) |
09:05:26 | FromGitter | <yyyc514> rails started turning everything into a helper so soon i don’t know how to write sa styleheet tag anymore |
09:05:33 | FromGitter | <yyyc514> it’s just stylesheet(blah) :-) |
09:05:38 | FromGitter | <yyyc514> which i kind of get |
09:05:39 | FromGitter | <alehander42> exactly |
09:05:59 | FromGitter | <alehander42> the thing I like about the dsl-s is that normal tags and helpers have the same syntax (<name>(props)) |
09:06:28 | FromGitter | <alehander42> so extensions look more natural to me |
09:06:30 | FromGitter | <yyyc514> yeah, not a goal here :) |
09:06:40 | FromGitter | <yyyc514> at least not for ERB style templates |
09:06:49 | FromGitter | <alehander42> I know, I know |
09:07:00 | FromGitter | <yyyc514> but you do have me wondering about going the other direction |
09:07:16 | FromGitter | <alehander42> adding fake tags? |
09:07:26 | FromGitter | <yyyc514> i think part of the value was for automatic errors and such things… with progamatic generation of the form fields you can easily add classes and such |
09:07:31 | FromGitter | <yyyc514> <input class=“hasError”) etc |
09:07:41 | FromGitter | <yyyc514> that’d be hard to do otherwise |
09:08:00 | FromGitter | <yyyc514> so it makes it easier to build out things like that |
09:08:24 | FromGitter | <yyyc514> i’m still just trying to work ont he best/prettiest way to write the code for this kind of templating engine |
09:08:45 | FromGitter | <yyyc514> creating a tempalte object i can just pass AST pieces too is a big help |
09:08:56 | FromGitter | <yyyc514> then you just << everything and call toAST when you’re done |
09:09:02 | FromGitter | <yyyc514> but i’m wondering if it can be better still |
09:17:10 | * | Vladar joined #nim |
09:17:12 | FromGitter | <alehander42> perfect is the enemy of good |
09:19:21 | FromGitter | <yyyc514> lol true |
09:19:26 | FromGitter | <yyyc514> not trying for perfect though :) |
09:19:29 | FromGitter | <yyyc514> not sure it’s good yet |
09:29:28 | * | Perkol quit (Quit: Leaving) |
09:31:54 | FromDiscord | <PusiteGA> hmm is nim good for game server? |
09:32:31 | FromGitter | <yyyc514> hmmmm, no built in table merge? |
09:32:35 | FromGitter | <yyyc514> other than count table? |
09:32:48 | FromGitter | <alehander42> hahaha yesterday there was a long discussion about table merge |
09:33:07 | FromGitter | <alehander42> not yet, but I guess somebody will PR it soon |
09:33:31 | leorize | PusiteGA: Nim is good for everything, except when it isn't :) |
09:33:41 | FromGitter | <alehander42> for now you can make your own util, it's 3 lines |
09:33:54 | FromGitter | <yyyc514> yeah just asking before i went off and wrote it :) |
09:34:28 | FromDiscord | <PusiteGA> game server should handle a 500+ connection in and sync the, so my guess it has to be greate at parraler , and i duno if it is |
09:35:34 | FromDiscord | <PusiteGA> whenewer i google nim vs others, rust pops up with some rayon thing whining how Nim paraler sux |
09:35:48 | FromGitter | <yyyc514> yep 3 loc :) |
09:35:58 | FromGitter | <mratsim> 500 connections is nothing and Rayon is about data parallelism not task level parallelism |
09:36:17 | FromGitter | <alehander42> hm I checked and my own util merge is 5, better fix it :D |
09:36:22 | * | banc quit (Quit: ZNC - http://znc.in) |
09:38:10 | FromGitter | <mratsim> Also I don’t expect Rayon to be faster than OpenMP. Source: I’m doing high performance computing at the moment and in Rust there is no way to pass info about pointer aliasing, data alignment and i.e. SIMD usage is so-so |
09:39:23 | FromDiscord | <PusiteGA> i am newbi but from what i get i need to , recive client info and sync it on server and then send to other players, my only issue is from what i read is that it duplacates data per thread or meybe i am wrong |
09:39:53 | FromDiscord | <PusiteGA> i dont know rust anyway, my plan was if Nim cant do i can try C++ |
09:41:15 | FromGitter | <mratsim> data parallelism is processing an array in parallel: same operation on different data. For a webserver each threads are processing different things, and it’s not always on shared memory data structure. |
09:42:47 | FromGitter | <mratsim> You have several solutions for communication between threads, one is channel, it indeed requires deepcopy, but it’s thread safe. The other is shared memory by using raw pointers. It’s very performant but you will have the same issue as in C and C++, data races, pointer invalidation and such. |
09:42:48 | * | banc joined #nim |
09:44:33 | FromDiscord | <PusiteGA> ty you cleared some stuff for me , anyway will reaserch little more |
09:48:26 | PMunch | mratsim, have you ever tried the shared data structures? |
09:49:28 | PMunch | As in the shared* modules here: https://github.com/nim-lang/Nim/tree/devel/lib/pure/collections |
09:56:19 | * | kapil____ quit (Quit: Connection closed for inactivity) |
10:16:07 | * | dom96_w joined #nim |
10:33:52 | * | couven92 joined #nim |
10:36:29 | FromGitter | <mratsim> not at all |
10:36:53 | FromGitter | <mratsim> For now, besides Nim in action, I only used parallelism on tensors |
10:37:23 | * | elrood joined #nim |
10:39:55 | PMunch | Hmm, I'm curios on how well they work. |
10:41:49 | * | smt joined #nim |
10:41:59 | FromGitter | <yyyc514> hmmmm does macro have no way to autogen a new ident? |
10:45:00 | leorize | genSym? |
10:48:10 | FromGitter | <yyyc514> perfect thanks! |
10:56:44 | FromGitter | <kaushalmodi> leorize: "remember that in template there's no result" I need to make a note of that. Thanks. |
10:58:59 | Araq | actually we have with .guard some ways of fighting data races |
10:59:38 | Araq | but the pieces are only now coming together IMO, thanks to destructors shared memory is much easier to deal with |
11:00:06 | Araq | and while seqs and strings are still not destructor based, you can write your own seq that uses allocShared etc |
11:13:58 | * | Snircle joined #nim |
11:39:03 | FromGitter | <zacharycarter> PMunch: they work - but there are only a few |
11:39:06 | FromGitter | <zacharycarter> string I think and queue |
11:39:12 | FromGitter | <zacharycarter> maybe dequeue |
11:39:56 | PMunch | list, string, and tables according to GitHub |
11:41:04 | FromGitter | <zacharycarter> ah okay |
11:41:20 | FromGitter | <zacharycarter> I find queue to be the one I really need |
11:41:36 | FromGitter | <zacharycarter> but there's a github repo out there named tart - and I also pulled a lot of code form it for the new iteration of FRAG I plan on working on |
11:41:59 | FromGitter | <zacharycarter> he has a lot of shared data structures - although the code needs to be updated to use unchecked arrays instead of whatever container it's currently using |
11:42:35 | FromGitter | <zacharycarter> https://github.com/sheosi/tart |
11:42:49 | FromGitter | <zacharycarter> https://github.com/sheosi/tart/tree/master/tart/structures |
11:42:57 | PMunch | Hmm, interesting |
11:50:37 | FromGitter | <zacharycarter> think my next laptop is - https://www.amazon.com/MSI-GS63VR-Stealth-Pro-229-i7-7700HQ/dp/B01N1WRY0Q?SubscriptionId=AKIAJ76EIXAV3V6D6JEQ&tag=globalnetwork-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B01N1WRY0Q&th=1 |
11:50:50 | FromGitter | <zacharycarter> to replace the macbook pro I have from work - which I'll have to give back soon I"m hoping |
11:53:12 | PMunch | That's quite a machine |
11:54:20 | PMunch | I actually like the one I've got for work |
11:54:27 | PMunch | Fujitsu U747 |
11:56:18 | FromGitter | <zacharycarter> well - I want it for game development |
11:56:39 | FromGitter | <zacharycarter> so I need a gfx card and lots of ram |
11:56:45 | FromGitter | <zacharycarter> and a ssd - and a large HD |
11:57:23 | FromGitter | <zacharycarter> the only thing I don't like about that one - is no trackpad buttons |
11:57:42 | FromGitter | <zacharycarter> but the one that has them is SOOOOO much bigger and weighs 5+ lbs |
11:58:23 | FromGitter | <zacharycarter> this one is just under 4 |
11:58:23 | PMunch | Yeah, for game-dev it's probably a good machine |
11:58:28 | FromGitter | <zacharycarter> yeah |
11:58:42 | PMunch | At least if you're doing heavy games |
11:58:48 | FromGitter | <zacharycarter> I'd go with a desktop - but I'm doing the whole digital nomad thing |
11:58:53 | FromGitter | <zacharycarter> well - I'm going to be working on my own engine |
11:59:00 | FromGitter | <zacharycarter> which is going to be doing PBR rendering - etc |
11:59:04 | FromGitter | <zacharycarter> so I'll need a decent machine |
11:59:58 | PMunch | I've always stuck to 2D, but then I've been developing on really underpowered hardware :P |
12:00:29 | FromGitter | <zacharycarter> I get bored quickly of 2d |
12:00:33 | PMunch | I mean my desktop is decent enough (it's starting to need an upgrade as well though), but my laptops are pretty shit |
12:00:45 | FromGitter | <zacharycarter> and 3d opens so many more opportunities IMO for creativity |
12:01:54 | PMunch | Well, since I don't have a team and don't really do 3D graphics myself all my little hobby project games are limited to what I can do myself. And I find that sticking with 2D means I spend more time thinking about cool concepts and not just cool graphics |
12:03:38 | livcd | I am switching to Windows desktop soon as I cant justify spending that much on mbp. Am a bit worried about sw bloat :/ |
12:03:51 | FromGitter | <zacharycarter> is also super nice - but almost 3k |
12:03:52 | FromGitter | <zacharycarter> https://www.amazon.com/Zephyrus-8th-Gen-IPS-Type-i7-8750H-processor/dp/B07BSKLV3K/ref=pd_rhf_ee_s_cp_1_8?_encoding=UTF8&pd_rd_i=B07BP9LSVS&pd_rd_r=2cc2fcd1-1d06-40f4-aa4c-5800982888ca&pd_rd_w=D0q9M&pd_rd_wg=TJENf&refRID=RWK1KP6ZQHBWYK383ARH&th=1 |
12:04:02 | livcd | I need to contain software in docker containers or VMs |
12:07:24 | livcd | Windows is a pain. I want to be restricted in Mac :-( |
12:08:23 | FromGitter | <narimiran> livcd why are you not considering linux? |
12:09:01 | FromGitter | <narimiran> (btw all this is offtopic, isn't it? ;)) |
12:09:29 | FromGitter | <zacharycarter> let's not get all strict about off-topicness when there is no on-topic conversation going on |
12:09:44 | FromGitter | <zacharycarter> I mean - we'r ea all nim devs talking about computers / OS's |
12:09:49 | FromGitter | <zacharycarter> we could be way way more off topic |
12:09:59 | livcd | so we move to #nim-offtopic ? |
12:10:30 | livcd | narimiran: because linux on desktop is a mess |
12:11:04 | FromGitter | <vegai> yeah. I used Linux from 1996 and moved to Apple this year |
12:11:06 | PMunch | As long as we don't bother anyone here then it's normally fine |
12:11:38 | FromGitter | <vegai> which doesn’t of course mean that I don’t use any Linuxes anymore, but I really rather would not use it as my desktop anymore |
12:11:45 | PMunch | I still use Linux, another thing to take into consideration when getting a lap-top |
12:12:14 | PMunch | vegai, why the change? |
12:12:23 | * | vlad1777d_ joined #nim |
12:12:31 | livcd | I personally dont want to care about those little things that are just so painful. Like updating and finding out that all of a sudden you need sound/graphics working and it just does not |
12:12:41 | FromGitter | <vegai> PMunch: not sure. I think I just got old :P |
12:12:43 | FromGitter | <yyyc514> any way to get a bacck stacktrace for compile time errors? |
12:12:49 | livcd | also I do not care about updating all the software at once. I do not need that. I do not want that. |
12:12:52 | FromGitter | <vegai> “I’m too old to deal with all this shit” -type of scenario |
12:13:17 | PMunch | yyyc514, you'll need a dev build of Nim for that |
12:13:38 | leorize | yyyc514: if compiler crash then use `./koch temp` to generate a debug build |
12:13:43 | PMunch | vegai, I can see that. Some distros are quite hard to maintain |
12:13:54 | FromGitter | <vegai> PMunch: :) |
12:13:56 | PMunch | Only one I've tried that I really like is Manjaro |
12:14:12 | PMunch | Still has left to horribly mess something up on that |
12:14:29 | FromGitter | <vegai> my gaming box is running Arch, though. If you just stick to i3 and minimal configurations, everything pretty much works |
12:14:44 | FromGitter | <yyyc514> pmunch: it’s not a compiler crash it’s just a compile error |
12:14:45 | FromGitter | <vegai> I might go back to that world some day, who knows |
12:15:14 | FromGitter | <yyyc514> have compiler errors been much improved since the last release? |
12:15:45 | PMunch | yyyyc514, not quite sure what you mean by compiler errors |
12:16:33 | FromGitter | <yyyc514> errors compiling the source |
12:16:38 | FromGitter | <yyyc514> "compile errors” |
12:16:39 | FromGitter | <yyyc514> ? |
12:17:26 | PMunch | Do you have an example? |
12:18:41 | FromGitter | <yyyc514> ../../../../.brew/Cellar/nim/0.19.0/nim/lib/core/macros.nim(476, 7) Error: undeclared field: 'n' |
12:18:52 | FromGitter | <yyyc514> it’d be ncie if that would actually stack trace back into what caused it |
12:18:59 | FromGitter | <yyyc514> but i only get that one line |
12:19:24 | PMunch | Oh yeah, those errors suck :P |
12:20:13 | FromGitter | <yyyc514> talk about it :) |
12:20:27 | FromGitter | <zacharycarter> well it's a compile time error no? |
12:20:36 | FromGitter | <zacharycarter> you can get a stack trace using koch temp |
12:20:55 | FromGitter | <zacharycarter> but it doesn't sound like a runtime error - it sounds like you're referencing an undeclared field on an object |
12:20:58 | FromGitter | <zacharycarter> with the name `n` |
12:21:07 | FromGitter | <zacharycarter> error makes perfect sense to me |
12:21:27 | FromGitter | <zacharycarter> and you have a line number to see exactly where it's happening - 476, col 7 |
12:22:32 | FromGitter | <yyyc514> it’s in parseStmt, which would be nice if the compiler even mentioned that vs JUST the line number |
12:22:35 | FromGitter | <yyyc514> i’m not asking for help with the error |
12:22:44 | FromGitter | <yyyc514> i’m asking if there is a way to get better stack traces for such errors |
12:22:45 | PMunch | in macros.nim.. |
12:23:07 | * | kapil____ joined #nim |
12:23:08 | PMunch | Yeah it would be nice to see where in your own code called something that triggered macros.nim to error out |
12:23:16 | FromGitter | <yyyc514> exactly |
12:24:10 | FromGitter | <zacharycarter> hrm - the only way I know to get a stack trace from the compiler is using koch temp |
12:25:36 | FromGitter | <zacharycarter> I'm not sure if that will help though :( |
12:48:53 | FromGitter | <yyyc514> *sigh* |
12:48:57 | FromGitter | <yyyc514> so streams doesn’t work with VM? |
12:49:35 | FromGitter | <yyyc514> should the module dos maybe mention which modules work inside the VM and which don't |
12:51:48 | * | anamok joined #nim |
12:51:50 | anamok | hello |
12:52:52 | anamok | With `-d:release`, debug info is removed. However, with `strip exe` we can further reduce the size of the exe. So what does strip do that -d:release doesn't? |
12:55:27 | PMunch | Strip removes symbols IIRC |
12:55:49 | * | seni joined #nim |
12:57:07 | * | vlad1777d_ quit (Ping timeout: 240 seconds) |
12:58:14 | anamok | PMunch, and the release mode? What does it remove? Just the debug info? |
12:59:18 | FromGitter | <kaushalmodi> anamok: `-d:release` does these things: https://github.com/nim-lang/Nim/blob/16c3d4332fac56b275ca3c66dcf12573738bdc91/config/nim.cfg#L55-L70 |
13:00:21 | anamok | I see. Thanks. |
13:01:21 | FromGitter | <alehander42> @yyyc514 what are you using streams for on compile time? probably there is an alternativ |
13:02:01 | FromGitter | <alehander42> just reading the file? |
13:16:32 | * | endragor quit (Remote host closed the connection) |
13:28:25 | FromGitter | <yyyc514> template parser |
13:28:41 | FromGitter | <yyyc514> i mean i can write my own streams stuff, but just seems like i hit this all the time trying to do stuff at compile time :) |
13:40:10 | * | endragor joined #nim |
14:06:58 | * | endragor quit (Remote host closed the connection) |
14:07:23 | * | PrimHelios joined #nim |
14:08:38 | * | vivus joined #nim |
14:08:53 | vivus | Hi all. How do I specify the output folder for my compiled program? |
14:09:18 | FromGitter | <kaushalmodi> vivus: You cannot specify an output folder AFAIK |
14:09:28 | FromGitter | <kaushalmodi> but you can specify the output binary file with path |
14:09:43 | vivus | example? |
14:09:54 | FromGitter | <kaushalmodi> so you can do `mkdir -p foo && nim c src/blah.nim -o:foo/blah` |
14:10:16 | FromGitter | <kaushalmodi> `nim --fullhelp | grep out` |
14:11:08 | vivus | so if the folder already exists then: `nim c myfile.nim -o:/path/to/myfile` |
14:11:51 | FromGitter | <kaushalmodi> try it |
14:11:53 | FromGitter | <kaushalmodi> :) |
14:21:27 | * | PrimHelios quit (Ping timeout: 240 seconds) |
14:37:10 | * | PrimHelios joined #nim |
14:45:12 | stefanos82 | vivus: you don't need to create a folder |
14:45:42 | vivus | stefanos82: ? can you explain a bit more? |
14:45:46 | stefanos82 | personally I prefer using .nims file with the following option: switch("out", "bin/foo") |
14:46:13 | stefanos82 | whereas foo is your binary name you want to give to your program |
14:46:45 | vivus | switch() is a programming parameter? where do I use it? |
14:46:55 | FromGitter | <kaushalmodi> stefanos82: You're correct |
14:47:09 | stefanos82 | vivus: what is the name of your .nim file? |
14:47:10 | FromGitter | <kaushalmodi> looks like `-o:` creates dir hierarchy if not present |
14:47:30 | FromGitter | <kaushalmodi> I got confused with the behavior of `nim doc -o:..` where the dir does not get created |
14:47:31 | vivus | test.nim |
14:47:37 | FromGitter | <kaushalmodi> \*consistency |
14:47:58 | stefanos82 | vivus: very nice. create a test.nims right next to it and place in there the aforementioned switch() command |
14:48:09 | stefanos82 | then run your nim command |
14:48:37 | stefanos82 | my project skeleton is: project_name/{bin,src,tests} |
14:48:43 | vivus | I was wondering if you made a typo there. so .nims is a file recognized file format also |
14:48:46 | FromGitter | <kaushalmodi> correcting myself.. looks like `nim doc` creates the required missing dir hierarchy too |
14:49:04 | FromGitter | <kaushalmodi> I much be confusing with something else, or this got fixed on devel some time |
14:49:10 | stefanos82 | .nims is for nimscript |
14:49:44 | stefanos82 | @kaushalmodi: possibly both lol |
14:50:29 | Araq | https://akrzemi1.wordpress.com/2014/06/02/ref-qualifiers/ |
14:50:44 | Araq | https://docs.microsoft.com/en-us/dotnet/csharp/reference-semantics-with-value-types |
14:50:55 | stefanos82 | there he is :) |
14:50:59 | Araq | ooh look, other languages are growing new feature |
14:51:02 | Araq | s |
14:51:24 | Araq | in fact, replicating a bit what Nim is getting with sink and lent |
14:52:07 | Araq | feels like we're converging to single ideal PL |
14:52:40 | Araq | and that is Nim, ofc :P |
14:52:57 | stefanos82 | Araq: I have noticed we have reached a peak point with programming languages that most of them look much alike, which eventually they will become one, semantically speaking |
14:53:41 | PMunch | https://github.com/dom96/choosenim/issues/98 <- choosenim should really do some cleanup |
14:54:15 | FromGitter | <kaushalmodi> Hello PMunch! I just added a PR to run toml-test for parsetoml |
14:54:40 | FromGitter | <kaushalmodi> great to see that it already passes 100/113 tests! |
14:55:34 | Araq | kaushalmodi: what is the state of the nightlies? |
14:56:18 | PMunch | toml-test? |
14:56:49 | PMunch | Hmm, did something change there |
14:56:50 | stefanos82 | PMunch: my Nim repo is 1.6G :S |
14:56:59 | PMunch | Last I ran it it passed 100% |
14:57:11 | stefanos82 | just the tests consume 171MB |
14:57:12 | PMunch | stafanos82, how did you managed that? :P |
14:57:42 | stefanos82 | a Nim local repo |
14:57:47 | PMunch | kaushalmodi, try to run it on the 0.5.0 branch |
14:57:55 | stefanos82 | so I guess it's full of git deltas |
14:58:05 | FromGitter | <kaushalmodi> Araq: Looks like they are happening fine: https://github.com/nim-lang/nightlies/releases Waiting for today's travis cron to start |
14:58:24 | FromGitter | <kaushalmodi> yest was a mess (as you see the last release in that link) because of GitHub issues |
14:58:51 | stefanos82 | ugh...csources are 481M |
14:59:10 | FromGitter | <kaushalmodi> stefanos82: I run this script to build Nim: https://ptpb.pw/sV74/bash |
14:59:26 | FromGitter | <kaushalmodi> see line 182 onwards to see the cleanup I do |
15:00:02 | FromGitter | <kaushalmodi> My build dir size is 180MB, while the installation size is 37MB |
15:00:17 | PMunch | Yeah, choosenim should really do something similar |
15:00:46 | stefanos82 | @kaushalmodi: quite unnecessary for me this script of yours. all I do is: git -C csource pull && sh build_all.sh |
15:01:30 | Araq | er, excuse my ignorance, do you have write access to nightlies? |
15:02:03 | FromGitter | <kaushalmodi> stefanos82: It's built very much to my requirements: build in stow hierarchy; ability to switch branches, do extra cleanup, add workarounds for config.nims presence bug, etc. |
15:02:19 | stefanos82 | Araq: me? |
15:02:21 | FromGitter | <kaushalmodi> Araq: I do.. I already committed |
15:02:57 | stefanos82 | I committed once as well |
15:03:05 | stefanos82 | about a docs typo |
15:03:10 | FromGitter | <kaushalmodi> Araq: the builds show failures because of Appveyor fails |
15:04:05 | Araq | what does Appveyor say? |
15:04:23 | Araq | though ... maybe use the new travis on windows for nightlies |
15:05:28 | FromGitter | <kaushalmodi> Araq: I thought of using windows, but may be someone else is more experienced with travis windows builds |
15:06:14 | FromGitter | <kaushalmodi> https://ci.appveyor.com/project/Araq/nightlies/builds/19696990/job/i7a9w7c4k17e4thv |
15:09:18 | FromGitter | <kaushalmodi> Araq: Also this needs your attention: https://github.com/nim-lang/nightlies/issues/4 |
15:09:22 | FromGitter | <kaushalmodi> the compiler.ini is outdated |
15:09:36 | FromGitter | <kaushalmodi> so koch testinstall is failing to find testament/ |
15:09:43 | * | sagax_ quit (Remote host closed the connection) |
15:09:52 | FromGitter | <kaushalmodi> \* compiler/installer.ini |
15:10:52 | * | PrimHelios quit (Ping timeout: 264 seconds) |
15:15:07 | anamok | On the page https://nim-lang.org/docs/os.html I don't find getEnv, but os.getEnv does exist. |
15:15:42 | vivus | @kaushalmodi I tried to run it, but it tells me: Error: arguments can only be given if the '--run' option is selected |
15:16:24 | vivus | my command I ran was: `nim c -d:release test.nim -o:/home/path/to/test` |
15:17:31 | vivus | anamok: check the nim code and see if any comments exist for `getEnv`. I think the documentation is within the code |
15:18:01 | FromGitter | <kaushalmodi> vivus: yeah, put the nim file arg as the very last |
15:18:11 | FromGitter | <kaushalmodi> all switches need to come first |
15:18:18 | vivus | oh I thought as much |
15:19:12 | anamok | vivus: getEnv is used in os but not defined |
15:20:05 | anamok | vivus: however, on top of os doc, getEnv is under Exports, in a list. I don't know what it means. |
15:20:13 | PMunch | kaushalmodi, did you try to run it on the 0.5.0 branch? |
15:20:18 | FromGitter | <kaushalmodi> yes |
15:20:26 | PMunch | Results? |
15:20:36 | FromGitter | <kaushalmodi> PMunch: https://travis-ci.org/NimParsers/parsetoml/builds/445177784?utm_source=github_status&utm_medium=notification |
15:20:51 | FromGitter | <kaushalmodi> that should be failing any time soon |
15:21:00 | FromGitter | <kaushalmodi> but I tested the same fails to happen locally |
15:21:53 | Araq | kaushalmodi: the appveyor problem seems to be still my incompetence to write scripts |
15:22:07 | PMunch | Hmm, strange |
15:22:20 | FromGitter | <kaushalmodi> PMunch: let's continue the conversation here :P |
15:22:32 | FromGitter | <kaushalmodi> so my merging step introduced quite many diffs |
15:22:40 | FromGitter | <kaushalmodi> so 0.5.0 was never merged into master |
15:23:12 | FromGitter | <kaushalmodi> PMunch: that branch failed: https://travis-ci.org/NimParsers/parsetoml/builds/445177784#L2035 |
15:23:18 | shashlick | @kaushalmodi: is there any plan to post the nightly binaries as well? |
15:23:39 | FromGitter | <kaushalmodi> shashlick: they are already posted |
15:23:59 | shashlick | there's only xz files which need to be compiled |
15:24:00 | PMunch | I think I merged 0.5.0 into master, just not with the exact same commits. I cherry-picked them over and squashed them with some other changes IIRC |
15:24:48 | FromGitter | <kaushalmodi> shashlick: ah, yeah, not compiling binaries ATM |
15:25:32 | FromGitter | <kaushalmodi> will need to then deal with a big matrix of 32/64 bits vs OSes |
15:25:35 | shashlick | that will be useful - can eventually add to choosenim so that you can simply install nightly |
15:25:53 | shashlick | musl it man 🙂 |
15:26:22 | FromGitter | <kaushalmodi> won't musl builds too need 32 vs 64 bit? |
15:26:40 | Araq | anamok, it's listed in the "exports" section because it comes from ospaths originally |
15:27:03 | shashlick | yes but probably won't need for each Linux distro |
15:27:35 | shashlick | eventually, will be cool to have a linux release binary as well, like we do for windows |
15:27:55 | anamok | Araq, under https://nim-lang.org/docs/ospaths.html I can't find it either |
15:28:59 | Araq | that's a bug :-) |
15:29:19 | Araq | the new docgen surely has terrible bugs, 0.19.2 will come soon |
15:29:32 | anamok | OK :) Thanks. |
15:31:37 | PMunch | Hmm, this is very strange kaushalmodi |
15:31:57 | PMunch | I'll check once I get home if I have some changes that I forgot to push or something |
15:32:07 | PMunch | I checked the toml-test repo and it hasn't changed |
15:32:18 | * | PrimHelios joined #nim |
15:33:14 | PMunch | Because I'm pretty sure all the tests should pass |
15:34:05 | PMunch | I mean I even have a commit that states that it should pass all the tests.. |
15:34:40 | stefanos82 | Araq: now that you are here, I wanted to ask: how can anyone distinguish user-defined pragmas from standard pragmas that Nim offers by default? |
15:34:48 | vivus | my awesome nim code is now on the interwebz XD |
15:35:41 | * | dom96_w quit (Changing host) |
15:35:41 | * | dom96_w joined #nim |
15:36:23 | dom96_w | choosenim grabbing nightlies would be beautiful |
15:37:05 | FromGitter | <kaushalmodi> PMunch: checkout the run-toml-test branch (the one PR'd) and add missing commits if any to that one. |
15:37:19 | PMunch | Will do |
15:37:30 | PMunch | If not I'll fix the issues |
15:37:34 | FromGitter | <kaushalmodi> Once passing the `nimble run_toml_test`, you can merge it and bump the version |
15:37:44 | FromGitter | <kaushalmodi> Awesome, thanks! |
15:38:49 | * | PrimHelios_ joined #nim |
15:41:07 | * | PrimHelios quit (Ping timeout: 240 seconds) |
15:41:14 | Araq | stefanos82, well not really but iirc it's impossible to override the builtin pragmas and they are mostly documented |
15:41:32 | Araq | occasionally we find undocumented pragmas :P |
15:42:01 | Araq | but new ones are always documented and so it's getting rarer |
15:42:13 | stefanos82 | Araq: I see. It would be a nice concept if builtin pragmas had a different set of braces than the user-defined |
15:43:02 | shashlick | dom96: can you please merge PR #91 and #97 on choosenim? |
15:43:03 | stefanos82 | Araq: for instance, builtin pragmas: {. foo .}, user-defined (. .), template pragmas [. .] |
15:43:05 | FromGitter | <yyyc514> so there is currentSourcePath, is there any type of callingSourcePath? |
15:43:06 | Araq | I disagree |
15:43:17 | Araq | stefanos82, that should just be a highlighter feature |
15:43:28 | Araq | keywords are in bold and so could be builtin pragmas |
15:43:34 | dom96_w | shashlick: when I get home, possibly |
15:43:45 | stefanos82 | Araq: another option would be a label right next to each custom pragma |
15:43:48 | shashlick | cool thanks |
15:44:12 | stefanos82 | Araq: for instance, {. user-defined: foo .} |
15:44:20 | leorize | please don't make them harder to use |
15:44:30 | stefanos82 | leorize: pragmas? |
15:44:46 | leorize | yes, we have `{.async.}` for example |
15:45:04 | leorize | it wouldn't be nice to do `{. user-defined: async .}` |
15:45:17 | stefanos82 | yeah, you are right |
15:45:20 | stefanos82 | hmm... |
15:45:40 | leorize | is there really a need to distinguish them? |
15:46:00 | stefanos82 | well, how can we figure out which pragma is user-defined or not? |
15:46:00 | * | platoff joined #nim |
15:46:11 | Araq | stefanos82, the builtin list is fixed |
15:46:16 | leorize | why would we need to do that? |
15:47:02 | Araq | and new pragmas will be written as __Uppercased, oh no, that was that other lang ... :P |
15:47:16 | stefanos82 | Araq: lol |
15:47:26 | * | darithorn joined #nim |
15:47:39 | dom96_w | Python decorators are pretty nice... *cough* |
15:47:58 | stefanos82 | that's another story dom96_w |
15:50:06 | dom96_w | wow, this channel is only 2 people off the record |
15:50:16 | FromGitter | <kaushalmodi> PMunch: Looks like that last toml-test PR for extra tests introduced the new fails: https://github.com/BurntSushi/toml-test/pull/48 |
15:51:57 | Araq | Unlink of file '.git/objects/pack/pack-132fec132a642d32c02f754401210b0d1c2864fa.idx' failed. Should I try again? (y/n) n |
15:52:04 | Araq | yay, git fun on Windows |
15:52:04 | PMunch | Hmm, I might've run the tests at home with an old copy of the repo then |
15:52:06 | * | nsf quit (Quit: WeeChat 2.2) |
15:52:18 | PMunch | kaushalmodi ^ |
15:52:27 | PMunch | I'll look at it later |
15:52:30 | FromGitter | <kaushalmodi> thanks |
15:52:33 | PMunch | dom96_w, which record? |
15:52:42 | dom96_w | This channel's user count record |
15:52:43 | dom96_w | It's 170 |
15:53:01 | FromGitter | <kaushalmodi> what's the "_w"? |
15:53:16 | PMunch | Oh right |
15:53:17 | FromGitter | <alehander42> @dom96_w I sometimes wish pragmas used the @name syntax :D |
15:53:30 | FromGitter | <alehander42> @yyyc514 |
15:53:35 | PMunch | Oh well, you're going to be down one now :P |
15:53:37 | PMunch | Bye |
15:53:39 | * | PMunch quit (Quit: Leaving) |
15:53:46 | FromGitter | <yyyc514> @alehander42 ? |
15:53:48 | FromGitter | <alehander42> you can still just readFile a template source and parse it |
15:53:59 | FromGitter | <alehander42> maybe I am missing something |
15:54:33 | FromGitter | <yyyc514> I'm using walkDir and it’s very picky about dirs |
15:54:46 | FromGitter | <yyyc514> i just moved my code and now it doesn’t work, grrrr |
15:55:06 | FromGitter | <yyyc514> since the templates were relative to the controller, not the library itself |
15:56:29 | stefanos82 | Araq: are you using Cmder on Windows? |
15:56:36 | FromGitter | <alehander42> I mean I don't know why do you need IO streaming for parsing them |
15:56:45 | Araq | stefanos82, yes |
15:56:52 | stefanos82 | Araq: awesome |
15:57:28 | stefanos82 | any progress with the tiny c REPL implementation? |
15:57:37 | FromGitter | <alehander42> @yyyc514 I actually started using `for view in walkDir(path, relative=true):` again in my view lib |
15:57:46 | FromGitter | <alehander42> and it seems to work fine in a different repo |
15:57:49 | FromGitter | <alehander42> for me |
15:58:24 | FromGitter | <alehander42> (my templates are relative to the controller that invokes the macro which has walkDir) |
15:59:36 | FromGitter | <yyyc514> yeah i’m playing with relative agian now |
16:00:12 | FromGitter | <alehander42> no, relative=true is just for the resulting paths in `view` I think |
16:00:34 | FromGitter | <alehander42> I meant that path is relative (if you meant that too, sorry, kinda confusing) |
16:01:41 | FromGitter | <yyyc514> yeah, but my staticRead isn’t working then… i think becaue it’s in a different file |
16:03:08 | FromGitter | <yyyc514> nope… did you use static read with relative paths? |
16:04:53 | FromGitter | <alehander42> that's what I do https://github.com/alehander42/view-loader/blob/master/src/view_loader.nim |
16:06:22 | FromGitter | <alehander42> the template lib which is invoked with render does a staticRead |
16:06:29 | FromGitter | <alehander42> and it seems to work with relative paths |
16:06:38 | FromGitter | <yyyc514> where do you load the file |
16:06:44 | FromGitter | <yyyc514> hmmmm |
16:07:17 | FromGitter | <alehander42> well, in my template function |
16:07:26 | FromGitter | <alehander42> which does |
16:07:28 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bcf4740600c5f6423f66cb2] |
16:07:52 | FromGitter | <alehander42> renderBase is also relative (it's the view folder in my case) |
16:08:04 | FromGitter | <alehander42> so e.g. staticRead("./views/main_view.nim") |
16:09:56 | FromGitter | <yyyc514> pwd seems to be the same, no idea why mine isn’t working |
16:09:57 | FromGitter | <kaushalmodi> Araq: https://github.com/nim-lang/Nim/issues/9451 is related to that installer.ini fix |
16:10:14 | FromGitter | <kaushalmodi> The installer.ini is references many outdated/non-existing files |
16:13:17 | FromGitter | <yyyc514> yeah the `pwd` effectively is NOT the same always for slurp vs walkDir |
16:20:16 | FromGitter | <yyyc514> can i set a constant in one file and have it carry across the entire project / all the child imports? |
16:22:31 | FromGitter | <alehander42> `const NAME* = ..` ? |
16:26:46 | FromGitter | <yyyc514> nope |
16:27:03 | FromGitter | <yyyc514> i’m wanting it to flow downwards not up |
16:27:06 | FromGitter | <yyyc514> i know how import works |
16:27:27 | FromGitter | <yyyc514> i want to set something like APP_ROOT and have it available everywhere |
16:27:58 | FromGitter | <alehander42> well, you can have a compileTime var |
16:28:10 | FromGitter | <alehander42> but you need to define it in some kind of base file that is imported |
16:28:17 | FromGitter | <alehander42> everything flows downwards |
16:28:38 | FromGitter | <yyyc514> to me import is upwards |
16:28:49 | FromGitter | <alehander42> ok, then upwards |
16:28:50 | FromGitter | <alehander42> :D |
16:29:12 | * | PrimHelios_ quit (Ping timeout: 244 seconds) |
16:29:26 | FromGitter | <yyyc514> i guess i could do that with the include feature of the compiler though |
16:33:29 | * | Trustable joined #nim |
16:34:22 | FromGitter | <alehander42> sounds good, but I think it will work only for the directly included file |
16:37:23 | FromDiscord | <bentech> How well does nim do web stuff? |
16:54:24 | anamok | bye |
16:54:27 | * | anamok quit (Remote host closed the connection) |
16:58:08 | FromGitter | <xmonader> It was smooth for a pre-release ⏎ https://github.com/threefoldtech/zos |
16:59:52 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:03:19 | * | nsf joined #nim |
17:04:21 | FromGitter | <tim-st> why is it deprecated?: `import unicode; echo "ÜU".isUpper(skipNonAlpha=false)` |
17:04:38 | FromGitter | <kaushalmodi> loooong history |
17:04:56 | FromGitter | <tim-st> `Deprecated since version 0.20 since its semantics are unclear;` |
17:05:15 | FromGitter | <tim-st> not sure where the semantics are unclear here |
17:06:08 | leorize | there is an issue dedicated to it |
17:06:08 | FromGitter | <kaushalmodi> history: https://github.com/nim-lang/Nim/issues/7963 |
17:07:05 | FromGitter | <tim-st> ok, but with the parameter the semantics should be clear |
17:07:27 | FromGitter | <tim-st> otherwise I'm not sure which proc to use instead for this |
17:07:52 | FromGitter | <kaushalmodi> yeah, now you need to "roll your own" |
17:08:13 | FromGitter | <kaushalmodi> to get the v0.18.0 behavior, simply run a for loop and return on false |
17:08:41 | FromGitter | <tim-st> that's pretty bad, I think the deprecated warning should be removed, maybe just add it as a comment |
17:09:32 | FromGitter | <kaushalmodi> here's my implementation that I think should have been the right fix for 7963: notes |
17:09:45 | FromGitter | <kaushalmodi> hehe, trying again: https://scripter.co/notes/string-fns-nim-vs-python/#better_islower_isupper |
17:10:07 | * | SenasOzys joined #nim |
17:10:17 | * | SenasOzys quit (Remote host closed the connection) |
17:11:31 | FromGitter | <tim-st> I think the current implementation with forced bool parameter is ok, I just dont understand what to use instead if that is removed one day |
17:21:33 | * | nolan_d left #nim ("User left") |
17:26:18 | Araq | tim-st: never seen a convincing usecase and I like the stdlib bloat-free |
17:32:25 | Araq | mystr.allIt(isUpper(it)) seems to do the same |
17:33:00 | Araq | or the check x == toUpper(x) |
17:34:19 | Araq | unless you really want the containsAtleastOneUpperAndNoLower semantics in which case isUpper() is a terrible name for this... |
18:07:41 | FromGitter | <timotheecour> the only reason isUpper exists in python is because they don’t have a character type, `”foo”[0]` has type str, so they can’t have a dedicated isUpper just for chars; another limitation of dynamic languages which we really don’t need to inherit. |
18:18:49 | FromGitter | <yyyc514> does nim have strtr or equiv? |
18:18:53 | FromGitter | <yyyc514> to translate chars? |
18:20:32 | * | Arrrr joined #nim |
18:22:31 | leorize | anyone know how to insert `NULL` with `db_sqlite`? |
18:23:42 | FromGitter | <yyyc514> NULL doens’t work? |
18:24:02 | FromGitter | <yyyc514> or are you using the binding stuff? |
18:25:19 | FromGitter | <alehander42> @yyyc514 yes, it's called replace |
18:25:47 | FromGitter | <alehander42> (strutils) |
18:25:47 | FromGitter | <yyyc514> it has a TR mode? |
18:25:54 | leorize | certainly not when you use `db.exec(sql"insert into table (col) values (?)", "NULL")` |
18:26:01 | FromGitter | <yyyc514> or you just mean call it multiple times? |
18:26:34 | FromGitter | <yyyc514> leorize: read the C API and see if there is a magic value |
18:26:39 | FromGitter | <alehander42> @yyyc514 what is TR mode |
18:26:55 | FromGitter | <yyyc514> http://php.net/manual/en/function.strtr.php |
18:27:01 | FromGitter | <yyyc514> translate |
18:27:12 | FromGitter | <yyyc514> i already wrote my own :) |
18:27:14 | FromGitter | <kaushalmodi> @yyyc514 may be `multiReplace` |
18:27:16 | leorize | yyyc514: well the thing is `db_sqlite` auto quotes those thing... |
18:27:38 | leorize | and without nil string it's not possible to tell it to insert null :/ |
18:27:44 | FromGitter | <kaushalmodi> @yyyc514 https://nim-lang.org/docs/strutils.html#multiReplace%2Cstring%2Cvarargs%5B%5D |
18:28:39 | FromGitter | <alehander42> well, it just replaces a character by other char |
18:28:54 | FromGitter | <kaushalmodi> leorize: may be it needs Option[string] support |
18:28:56 | FromGitter | <alehander42> i think this "translate" naming is very .. bizarre |
18:29:14 | FromGitter | <alehander42> you can replace substrings of course |
18:29:23 | FromGitter | <kaushalmodi> @alehander42 that's what the Unix `tr` utility does |
18:29:31 | FromGitter | <kaushalmodi> and also what @yyyc514 wants, I believe |
18:29:33 | FromGitter | <alehander42> and multiReplace is useful if you want to replace different strings in the same pass |
18:29:43 | FromGitter | <alehander42> otherwise, normal replace should be enough |
18:30:15 | FromGitter | <yyyc514> multireplace looks like it could work |
18:30:18 | FromGitter | <alehander42> I see |
18:30:25 | FromGitter | <alehander42> yeah sounds like multireplace |
18:30:33 | FromGitter | <alehander42> now the tr name makes sense |
18:31:38 | FromGitter | <kaushalmodi> for completeness, as @alehander42 said, this already works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bcf690a600c5f6423f76c88] |
18:38:17 | FromGitter | <yyyc514> rigth i just needed multiple replacements :) |
18:38:22 | FromGitter | <yyyc514> one could also chain replace if one was lazy :) |
18:40:02 | FromGitter | <kaushalmodi> above led me think.. below doesn't compile.. but is it possible to do so using the right syntax? ⏎ ⏎ ```import strutils ⏎ const ⏎ tr = strutils.replace ⏎ ...``` [https://gitter.im/nim-lang/Nim?at=5bcf6b021c100a4f29d194fe] |
18:40:31 | FromGitter | <kaushalmodi> the compilation error is "cannot generate VM code for replace" |
18:40:42 | * | voiceftp joined #nim |
18:40:43 | * | voice_ftp joined #nim |
18:41:22 | * | voiceftp quit (Client Quit) |
18:41:30 | * | voice_ftp quit (Remote host closed the connection) |
18:41:47 | * | voiceftp joined #nim |
18:41:53 | * | voice_ftp joined #nim |
18:44:45 | * | voice_ftp quit (Client Quit) |
18:45:15 | * | PrimHelios_ joined #nim |
18:48:07 | FromGitter | <yyyc514> interesting didn’t know you could do taht |
18:48:12 | FromGitter | <yyyc514> maybe you can’t :) |
18:51:40 | FromGitter | <kaushalmodi> it kinda works. "kinda" because you need to specify all types, it seems: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bcf6dbc82893a2f3b2b2b97] |
18:53:37 | FromGitter | <kaushalmodi> hmm, this works too: ⏎ ⏎ ```template tr(a, b, c: auto): auto = replace(a, b, c)``` [https://gitter.im/nim-lang/Nim?at=5bcf6e3182893a2f3b2b2ecc] |
18:55:43 | FromGitter | <yyyc514> any splat syntax? to turn an object into vargs just based on all it’s fields? |
18:56:59 | FromGitter | <kaushalmodi> no idea.. I am discovering this just today with you |
18:57:11 | Araq | use a macro for splat() |
18:57:57 | FromGitter | <kaushalmodi> I tried `template tr3(args: varargs[auto]): auto = replace(args)` but that doesn't work |
18:58:14 | Araq | macros.unpackVarargs |
18:59:55 | FromGitter | <yyyc514> ah |
18:59:56 | FromGitter | <yyyc514> nice |
19:00:16 | FromGitter | <kaushalmodi> it worked! |
19:00:19 | FromGitter | <kaushalmodi> ```template tr3(args: varargs[untyped]): auto = replace.unpackVarArgs(args)``` |
19:00:49 | FromGitter | <kaushalmodi> now we need a macro for that so that we can do: ⏎ ⏎ ```alias: ⏎ tr3 = replace``` [https://gitter.im/nim-lang/Nim?at=5bcf6fe11e23486b9307a44a] |
19:00:52 | FromGitter | <kaushalmodi> any takers? |
19:01:12 | Araq | if you understand why f(*args) can't work but unpack(f, args) can, you have understood Nim |
19:01:38 | Araq | or to make it more obvious, why f(unpack args) can't but unpack(f, args) can |
19:01:44 | FromGitter | <kaushalmodi> because Nim resolves type of each arg, one at a time? |
19:02:10 | Araq | no. |
19:02:24 | FromGitter | <kaushalmodi> oh well, was worth a try |
19:02:30 | FromGitter | <kaushalmodi> I was looking at https://github.com/nim-lang/Nim/blob/master/lib/core/macros.nim#L1431-L1432 |
19:02:49 | FromGitter | <kaushalmodi> and thought that breaking down in that for loop was important |
19:03:19 | * | narimiran joined #nim |
19:03:19 | Araq | no, that is the "why unpackVarags cannot be template" lesson |
19:05:53 | Araq | any takers? |
19:07:21 | * | stefanos82 quit (Quit: Quitting for now...) |
19:08:41 | FromGitter | <kaushalmodi> I have only understood, not written, just one Nim macro so far |
19:08:52 | FromGitter | <kaushalmodi> so I am certainly not a taker |
19:09:00 | * | TheLemonMan joined #nim |
19:09:03 | narimiran | and i have written, not understood, one macro :D |
19:09:51 | Araq | macros cannot go "up" in the AST, that's why |
19:10:21 | Araq | when you have f(unpack args) the unpack cannot influence the 'f' |
19:11:34 | Araq | there is no NimNode "kind" that unpack could create to cause f(a, b, c) |
19:12:05 | Araq | unless TheLemonMan patches Nim to support nkArgList everywhere |
19:12:11 | TheLemonMan | nkArgList? |
19:12:18 | TheLemonMan | hah, you beat me to that |
19:12:47 | TheLemonMan | the idea was to use nkBracket everywhere though |
19:13:01 | Araq | what's the scheme name for this? |
19:13:15 | FromGitter | <kaushalmodi> emacs uses `apply` |
19:13:18 | Araq | I forgot but iirc it has the same |
19:14:10 | TheLemonMan | apply |
19:14:23 | FromGitter | <kaushalmodi> https://www.gnu.org/software/emacs/manual/html_node/elisp/Calling-Functions.html |
19:14:54 | Araq | not what I meant |
19:15:10 | Araq | I thought scheme has its own variant of nkArgList |
19:15:49 | TheLemonMan | ...a list? scheme has nothing but lists |
19:16:40 | TheLemonMan | and no argument lists, you just have curried lambdas taking a single argument :) |
19:19:38 | Araq | I was sure at least Clojure had the same but I'm unable to find it |
19:19:45 | Araq | so it was probably just a dream |
19:28:27 | FromGitter | <Quelklef> Araq, is there any possibility if allowing args to climb up the AST in the future? |
19:28:40 | FromGitter | <Quelklef> I understand that the idea in and of itself is kind of ugly |
19:28:52 | Araq | unlikely |
19:28:55 | FromGitter | <Quelklef> Since it breaks the nice recursive and "clean" structure of trees |
19:28:58 | FromGitter | <Quelklef> Darmn |
19:29:09 | FromGitter | <Quelklef> It'd allow for some really cool stuff |
19:29:39 | Araq | well never say "never" but I think it would be too much |
19:29:45 | * | zachk joined #nim |
19:29:49 | TheLemonMan | Araq, should `let _ = something` just be rewritten as `=destroy`(something)? (Instead of the usual sink + destroy @ scope end) |
19:29:57 | FromGitter | <Quelklef> Yeah, I can understand that |
19:30:04 | * | PrimHelios_ quit (Ping timeout: 264 seconds) |
19:30:05 | FromGitter | <Quelklef> Maybe an experimental feature? :-) |
19:30:16 | Araq | Quelklef: workaround, proc foo() {.mytransf.} |
19:30:41 | FromGitter | <Quelklef> Right, but enclosing it in a macro "context" is kinda what I want to avoid |
19:30:44 | Araq | TheLemonMan, not in my opinion |
19:31:09 | * | zachk quit (Changing host) |
19:31:10 | * | zachk joined #nim |
19:31:19 | Araq | and I like to settle the scope vs proc end question with a codesize benchmark |
19:32:11 | Araq | my nose says that the table-based exception cleanup code is heavier for scope than it is for proc ends |
19:34:21 | TheLemonMan | numbers please, noses have no places in benchmarks heh |
19:34:52 | Araq | well it's 1 exception "safepoint" vs N |
19:35:24 | Araq | and I don't have any numbers yet |
19:35:47 | TheLemonMan | the `let _` pattern is nice if you only care about the side effects and it may be nice not to have an un-addressable object persist troughout the function |
19:36:13 | TheLemonMan | I'd expect the cpp codegen to perform much better there |
19:36:33 | Araq | I said "code size", not performance |
19:37:05 | FromGitter | <kayabaNerve> TheLemonMaan why the hell would you do `let _`? Isn't that just `discard` |
19:37:33 | TheLemonMan | code size and performance, I have enough faith in the cpp compiler to be quite smart at compiling those parts |
19:37:48 | FromGitter | <kayabaNerve> But isn't it just discard? |
19:38:16 | * | dddddd joined #nim |
19:38:26 | FromGitter | <kayabaNerve> And wouldn't discard be even better? |
19:39:12 | FromGitter | <kayabaNerve> Please correct me if I'm wrong because I do believe you're the superior Nim developer. |
19:39:13 | FromGitter | <kaushalmodi> talking about that earlier supposedly `alias` macro, would it look something like this? https://ptpb.pw/c7rS/nim |
19:39:19 | FromGitter | <kaushalmodi> can someone help finish it? |
19:40:26 | TheLemonMan | sure thing, they're equivalent but even `discard` doesn't get rid of the object asap |
19:41:09 | TheLemonMan | kayabaNerve, you never confirmed if #9357 fixed your problem with threadvars on windows! |
19:44:44 | * | joibll joined #nim |
19:46:05 | FromGitter | <kayabaNerve> :( Now I feel bad |
19:46:23 | FromGitter | <kayabaNerve> It takes me literally around an hour to build on Windows |
19:46:41 | FromGitter | <kayabaNerve> And then I need to keep my 0.19.0 build intact |
19:47:05 | FromGitter | <Vindaar> @kaushalmodi yeah, that's almost it. All those `# ?? Ident "x"` you can replace by `ident"x"`. Using quote do makes this a little easier to read though |
19:47:24 | FromGitter | <kaushalmodi> after that, I got to https://ptpb.pw/lCSc/nim |
19:47:29 | FromGitter | <kaushalmodi> but doesn't compile |
19:47:42 | FromGitter | <kaushalmodi> error: alias.nim(69, 15) Error: attempting to call routine: 'nnkIdent' ⏎ found 'nnkIdent' of kind 'enumfield' |
19:48:37 | FromGitter | <kayabaNerve> TheLemonMan I'll try to get it |
19:49:13 | * | Trustable quit (Remote host closed the connection) |
19:49:16 | FromGitter | <kaushalmodi> @Vindaar I get `ident` is deprecated |
19:49:23 | FromGitter | <Vindaar> You need to either create a tree of a certain node kind (as done in the previous paste of yours for `nnkTemplateDef` for instance), or for some types you can use procs like `newIdentNode` or `newEmptyNode` |
19:49:30 | TheLemonMan | no worries, take your time as long as you manage to give an answer before 0.20 :) |
19:51:10 | FromGitter | <Vindaar> @kaushalmodi Maybe it is. Although the documentation is a little weird regarding that. Under `newIdentNode(string)` it says it's an alias for `ident(string)` so, shrug |
19:52:35 | FromGitter | <Vindaar> for a single alias and using quote do, you can do: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ of course it's easy to wrap a for loop for multiple statements (as you already do) [https://gitter.im/nim-lang/Nim?at=5bcf7c0382893a2f3b2b8908] |
19:53:35 | FromGitter | <kaushalmodi> @Vindaar that looks so much better! |
19:53:40 | FromGitter | <kaushalmodi> let me try that |
19:53:52 | FromGitter | <kaushalmodi> so we don't need to dissect each and every identifier |
19:54:12 | FromGitter | <kaushalmodi> and expectKind is a special form of doAssert I suppose |
19:54:53 | FromGitter | <kaushalmodi> looked at the source, it has a better error message |
19:55:05 | FromGitter | <Vindaar> as far as I understand it, if you put a so far unknown identifier into `quote do` it'll just call `genSym` on it. And normal identifiers like `untyped` are just supported |
19:56:49 | TheLemonMan | quote do takes your expression, wraps it in a template and then expands it in the current scope |
19:57:10 | FromGitter | <Vindaar> see, let him^ speak :D |
19:58:09 | FromGitter | <Vindaar> I've looked at that at some point, but the details of that compiler code were way over my head at the time |
19:58:33 | FromGitter | <Vindaar> (and probably still are) |
19:59:01 | TheLemonMan | Araq, why do you pack all the temporaries in a `:d` object? |
19:59:56 | FromGitter | <alehander42> I remember you could use a different symbol than ` |
20:00:14 | FromGitter | <alehander42> for quoting, but this seems like something you should do as a last resort |
20:00:53 | TheLemonMan | you can, but you're still bound by the rules imposed by the lexer |
20:01:32 | Araq | TheLemonMan, there is no good reason, I need to change this |
20:01:45 | Araq | was easier to write it this way |
20:01:56 | FromGitter | <kaushalmodi> thanks @Vindaar! This works!! https://ptpb.pw/J40K/nim |
20:02:23 | FromGitter | <kaushalmodi> now the only thing.. what should `ident` be replaced with? |
20:02:29 | TheLemonMan | such an object may produce suboptimal code since alignment and stuff come into play |
20:02:44 | Araq | yeah, I know it's bad. |
20:02:56 | Araq | I also want to change how "sink" parameters work |
20:03:20 | Araq | they should be consistent with everything else, if the compiler cannot prove it's the last read, it copies |
20:04:05 | TheLemonMan | isn't that the current behaviour? |
20:04:47 | FromGitter | <Vindaar> @kaushalmodi once again, glad to help. No idea why, but you always ask the most interesting questions (that I can answer) :D |
20:05:49 | * | Jesin quit (Quit: Leaving) |
20:05:53 | FromGitter | <kaushalmodi> you are my macro goto guy it seems |
20:06:00 | FromGitter | <Vindaar> haha |
20:06:06 | FromGitter | <kaushalmodi> btw fixed that warning with ⏎ ⏎ ``` # toWrap = ident(e[1]) # deprecated ⏎ toWrap = newIdentNode($e[1])``` [https://gitter.im/nim-lang/Nim?at=5bcf7f2e6e5a401c2dbc28f3] |
20:06:24 | FromGitter | <kaushalmodi> the deprecated syntax was certainly nicer |
20:06:37 | FromGitter | <kaushalmodi> Araq: Is there a better way to write the above? ^ |
20:07:21 | Araq | TheLemonMan, no, it raises an exception MoveError instead. iirc. |
20:07:43 | * | Jesin joined #nim |
20:08:39 | Araq | https://monoinfinito.wordpress.com/series/exception-handling-in-c/ |
20:08:48 | Araq | / Loop through each entry in the CS table |
20:08:49 | Araq | while (lsda < lsda_cs_table_end) |
20:09:07 | Araq | my way keeps the CS table shorter |
20:14:02 | TheLemonMan | how much shorter and how big the impact on the binary size is? That's what matters |
20:15:59 | * | Vladar quit (Remote host closed the connection) |
20:27:14 | * | xet7 quit (Remote host closed the connection) |
20:30:13 | * | xet7 joined #nim |
20:30:20 | FromGitter | <yyyc514> hmmm |
20:35:53 | FromGitter | <yyyc514> is there an equiv of `` if iw ant to use parseStmt instead of quote? |
20:36:14 | * | PMunch joined #nim |
20:38:15 | * | nsf quit (Quit: WeeChat 2.2) |
20:39:40 | * | narimiran quit (Ping timeout: 264 seconds) |
20:43:23 | Araq | TheLemonMan, non-trivial lifetime extension of temporaries in C++ also matters :-) |
20:47:33 | TheLemonMan | oh, right, it's C++ we're talking about |
20:47:46 | TheLemonMan | C++17 added even more rules, it seems |
20:49:10 | Araq | the lifetime extension exists for a reason |
20:49:23 | * | poopBot joined #nim |
20:49:31 | Araq | but it's not yet clear if we need the same. |
20:50:39 | FromGitter | <kaushalmodi> Araq: What does nnk prefixes in macro kinds mean? "n n kind"? But what is "n n"? |
20:50:41 | poopBot | PMunch, am back i think i figured out what i need to use for to make gtk window look like i want, anyway i just tryed to nimble install gtk3genui but it crys package not found, i tryed link directly to github installed it bug get erros |
20:50:52 | poopBot | expression cannot be cast to GCallback=proc (){.cdecl.} |
20:50:56 | TheLemonMan | n node kind |
20:51:13 | poopBot | on genui: 8 row, i just compy pasted example |
20:51:25 | FromGitter | <yyyc514> how do i convert from time to DateTime |
20:51:29 | FromGitter | <yyyc514> utc isn’t seeming to work |
20:51:40 | PMunch | Huh, apparently only gtkgenui was added to nimble for some reason.. |
20:51:45 | FromGitter | <yyyc514> utc(t297493)' has no type (or is ambiguous) |
20:51:50 | FromGitter | <kaushalmodi> TheLemonBoy: thanks. What's the first n then? |
20:52:23 | PMunch | http://ix.io/1pSw |
20:52:30 | PMunch | I can install it just fine from direct link |
20:52:30 | TheLemonMan | Nim (I guess) |
20:53:01 | Araq | "Nim node kind" |
20:53:14 | TheLemonMan | the sk* compiler enum is also exported as nsk* for the macros to use, the N prefix is there too |
20:53:41 | FromGitter | <kaushalmodi> Ah oh course thanks |
20:53:49 | Araq | the first N exists so that I can import "macros" within the Nim compiler... :D |
20:54:01 | FromGitter | <kaushalmodi> The node type is `NimNode` |
20:54:08 | poopBot | hmm meybe vscode bugging will try to comple |
20:54:31 | Araq | nowadays with semi-pure enums we could just use IfStmt, Asgn etc as enum field names |
20:55:40 | poopBot | PMunch, https://hastebin.com/fujonebugi.coffeescript |
20:56:09 | poopBot | i can install too from direct link but example shoots erros |
20:56:33 | PMunch | poopBot, that's because it tries to call example.destroy (line 11) but the file isn't named example.nim |
20:56:52 | PMunch | Try to change example.destroy to <whatever your nim file is called>.destroy |
20:57:04 | * | gmpreussner quit (Ping timeout: 264 seconds) |
20:57:09 | PMunch | Or rename destroy to something else and call it without a prefix |
20:57:51 | TheLemonMan | Araq, "XXX toptree crashes without this workaround. Figure out why" -> it doesn't crash anymore :D |
20:57:52 | poopBot | PMunch, lol sorry :) |
20:58:26 | poopBot | it was even marked red, tought i stoped at first line of error dident even look next |
20:58:33 | poopBot | anyway now it works sorry again |
20:58:54 | PMunch | Haha, no problem :) |
21:05:48 | * | gmpreussner joined #nim |
21:07:57 | Araq | TheLemonMan, the compilation pipeline changed |
21:08:04 | Araq | that's probably why |
21:11:33 | * | vlad1777d_ joined #nim |
21:12:40 | * | xet7 quit (Ping timeout: 264 seconds) |
21:13:27 | * | xet7 joined #nim |
21:27:22 | * | PrimHelios joined #nim |
21:27:32 | TheLemonMan | Araq, that's it, `genOp` creates a nkHiddenAddr with no type |
21:28:31 | TheLemonMan | you have to be extra careful and make sure every node you generate has a proper type |
21:28:44 | krux02 | sombody messed with the internal structure of types and aliases |
21:28:58 | krux02 | my macros to resolve aliases is now broken |
21:29:04 | krux02 | it was a lot of work to implement it |
21:30:07 | Araq | krux02, that's bad but why isn't this STILL not covered by tests? they seemed excessive |
21:30:28 | krux02 | I don't know |
21:30:59 | krux02 | it used to be when there is a generic T, I can use getImpl |
21:31:06 | krux02 | now getImpl returns nil |
21:31:13 | krux02 | nnkNilLit to be precise |
21:31:39 | krux02 | and from the type kind I know that it is a float32 type |
21:32:08 | krux02 | I don't get to the symbol int32 anymore |
21:33:06 | krux02 | maybe there were tests, and they have been "fixed" |
21:33:06 | TheLemonMan | and you can drop `emptyNode` and replace it with `graph.emptyNode` |
21:33:26 | Araq | sure |
21:35:11 | Araq | you also need to fix my DFA |
21:35:41 | Araq | I'm sure it's wrong in some subtle fashion, but I couldn't create a test case to break it |
21:36:23 | dom96 | joibll: nimforum implements auth. It's a little bit rough but might help you out, simply search for usages of the functions exported here: https://github.com/nim-lang/nimforum/blob/master/src/auth.nim |
21:36:27 | krux02 | well the problem I mentioned isn't the problem I just figured it out, but the problem remains, my algorithm to normalized away the stupid T that I would never need for anything doesn't work anymore |
21:36:38 | Araq | this abstract interpretation pass without explict 'join' opcodes seems doomed |
21:37:31 | krux02 | what do you mean with 'join'? |
21:38:39 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
21:40:09 | * | PMunch quit (Remote host closed the connection) |
21:41:36 | Araq | fork+join control flow |
21:42:26 | Araq | aka "structured programming" vs "goto" |
21:44:18 | * | Arrrr quit (Quit: Arrrr) |
21:47:02 | shashlick | Araq: adding -d:mingw to nim.cfg to cross compile from Linux/OSX to Windows easily - will submit a PR if there is no objection |
21:53:35 | krux02 | yay I fixed it |
21:55:26 | Araq | ok |
21:59:25 | FromGitter | <kaushalmodi> Araq: Delighted to see fork/join lingo here :) |
21:59:49 | FromGitter | <kaushalmodi> In SystemVerilog, we use fork/[join/join_any/join_none] |
22:04:59 | FromGitter | <kayabaNerve> Can Nim handle C++ Exceptions? |
22:05:54 | FromGitter | <kayabaNerve> I'm not saying it can get the exception type or message. I'm saying if I put a C++ call in a `try` statement, and the call throws, will Nim crash or go to `except`? I assume the latter. |
22:06:08 | FromGitter | <kayabaNerve> And I wouldn't be surprised if it could get the Exception data. |
22:06:45 | Araq | indeed but I don't know the details |
22:06:59 | Araq | but there is interop with C++ exceptions |
22:11:12 | FromGitter | <iffy> If I have an Objective-C source file next to my Nim file, how do I include that file? I'm reading this which includes the Obj-C source inline in an emit: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importobjc-pragma |
22:12:45 | * | elrood quit (Quit: Leaving) |
22:15:20 | FromGitter | <zacharycarter> compile pragma maybe? |
22:15:34 | FromGitter | <iffy> Yes, I guess I'm asking which one |
22:16:24 | FromGitter | <iffy> (my C, C++ and Obj-C knowledge is very limited) |
22:21:18 | FromGitter | <iffy> could I `include myfile.mm` but emit it like in an `emit` pragma? |
22:21:31 | FromGitter | <zacharycarter> I'm not sure - I don't think so |
22:21:53 | FromGitter | <zacharycarter> I've only done interop with C involving bindings / using the compile pragma once |
22:22:07 | FromGitter | <zacharycarter> I'll be quiet and let someone more knowledgeable in that area try to help you |
22:22:22 | FromGitter | <iffy> oh, you said "compile" pragma -- you were telling me a specific one. derp |
22:23:47 | FromGitter | <iffy> {.compile: "myfile.mm".} seems to do the trick :) |
22:23:54 | FromGitter | <iffy> thanks @zacharycarter |
22:24:59 | FromGitter | <zacharycarter> np! |
22:25:02 | FromGitter | <zacharycarter> glad I could help! |
22:44:55 | FromGitter | <iffy> hmm.. well it's close, but doesn't actually seem to work. The docs say that the `compile` pragma is for C/C++ so maybe Obj-C is not supported |
22:46:33 | * | poopBot quit (Remote host closed the connection) |
22:46:48 | FromGitter | <zacharycarter> damn |
23:06:11 | Araq | Obj-C is supported, try an .m extension |
23:08:32 | Araq | so ... nimpretty is getting into shape, enjoy |
23:08:46 | FromDiscord | <treeform> I have started using nimpretty |
23:08:57 | FromDiscord | <treeform> its mostly complains about the over 80 line stuff |
23:09:33 | ryuo | how does Nim handle other architectures like ARM? |
23:09:34 | FromDiscord | <treeform> I guess my code now will conform, I hate this limitation, but I like standardization more... |
23:09:45 | ryuo | s/does/well does/ |
23:09:57 | FromDiscord | <treeform> My friend does Pi development in nim. |
23:10:15 | FromDiscord | <treeform> He made a docker thing to build nim on the PI everyday. |
23:10:31 | ryuo | I see. |
23:10:59 | FromDiscord | <treeform> this: https://hub.docker.com/r/monofuel/nim/ |
23:11:17 | FromDiscord | <treeform> I would say it works "pretty well" |
23:11:45 | * | krux02 quit (Remote host closed the connection) |
23:32:08 | * | kapil____ quit (Quit: Connection closed for inactivity) |
23:50:27 | FromGitter | <iffy> Araq: nim is magical; thank you! (Also, I'll try to come up with a concrete example of {.compile.} with obj-c not working for me) |
23:56:05 | * | vivus quit (Remote host closed the connection) |