00:00:05 | disruptek | do i need to add more examples? |
00:09:47 | disruptek | clearly, i need to add more bugs. |
00:14:15 | FromDiscord | <Zachary Carter> since gitter doesn't seem to be working... |
00:14:34 | FromDiscord | <Zachary Carter> worked on improving splat mapping today - |
00:14:34 | FromDiscord | <Zachary Carter> https://cdn.discordapp.com/attachments/371759389889003532/660274348409749505/unknown.png |
00:15:44 | * | Hideki joined #nim |
00:16:08 | * | Hideki is now known as Guest52352 |
00:17:13 | FromDiscord | <Clyybber> damn |
00:17:16 | FromDiscord | <Clyybber> looking sick |
00:17:41 | FromDiscord | <Clyybber> disruptek: ugprade cutelog to include more bugs |
00:18:42 | FromDiscord | <Clyybber> or maybe you need this ``` |
00:18:42 | FromDiscord | <Clyybber> \ |
00:18:42 | FromDiscord | <Clyybber> '-.__.-' |
00:18:42 | FromDiscord | <Clyybber> /oo |--.--,--,--. |
00:18:43 | FromDiscord | <Clyybber> \_.-'._i__i__i_.' |
00:18:43 | FromDiscord | <Clyybber> """"""""" |
00:18:43 | FromDiscord | <Clyybber> ``` |
00:19:50 | FromDiscord | <Auriel> tho this ascii looks pretty bad on riot mobile app |
00:20:08 | aeverr[m] | Yeah. |
00:20:58 | sealmove | centipede? |
00:21:46 | lqdev[m] | @Auriel on anything except discord, really. matterbridge removes any leading whitespace from messages for some reason, and doesn't bother with a proper paste site for code blocks. |
00:24:02 | * | dwdv quit (Ping timeout: 240 seconds) |
00:32:34 | * | tane quit (Quit: Leaving) |
00:33:40 | shashlick | disruptek: is nimph installable from nimble now? |
00:47:20 | * | Trustable quit (Remote host closed the connection) |
01:18:01 | * | ofelas joined #nim |
01:18:30 | disruptek | shashlick: i doubt anything has changed. |
01:19:32 | * | Guest52352 quit (Ping timeout: 258 seconds) |
01:19:46 | * | sealmove quit (Ping timeout: 265 seconds) |
01:49:16 | leorize | disruptek: it's the same feeling when I released nim.nvim :p |
01:51:01 | blackbeard420 | nim.nvim is awesome! |
01:52:12 | leorize | thanks :) |
01:52:43 | leorize | disruptek: sometimes whatever we made just have less bugs than we expected :p |
01:54:45 | disruptek | usually it seems that way because no one is really exercising the code. |
01:59:18 | disruptek | mfiano will be your toughest user. solitude is mine, and that's just not tough enough. |
02:00:31 | leorize | it sounds like they were trying to make their own plugin though :P |
02:02:03 | leorize | I think what you need for marketing nimph is: why should I use it over nimble? |
02:02:26 | leorize | easy to install can also score some great points |
02:04:20 | disruptek | yep, it's annoyingly difficult to build from scratch. |
02:05:00 | disruptek | but i feel like if it doesn't buy you something over nimble, then i want you to use nimble. |
02:05:26 | disruptek | the goal isn't to replace nimble, but to offer something different by design. |
02:05:46 | leorize | yea but people has been using nimble for so long |
02:05:58 | disruptek | people happy with nimble should stick with it. |
02:06:11 | disruptek | that's the customer that nimble is written for. |
02:06:23 | disruptek | it works they way they expect, etc. |
02:07:08 | leorize | well you know nimble problems, you gotta advertise how nimph avoided them |
02:07:19 | leorize | but easy to install is also something crucial :/ |
02:07:28 | leorize | one of the main reasons I wrote nim.nvim in vimscript |
02:08:14 | disruptek | i do need to have more examples. not sure how to fix installation; it's basically complicated by bugs in nimble. |
02:08:42 | disruptek | there's a powershell script waiting to merge, at least. |
02:13:12 | leorize | hmm, maybe you can make a dummy nimble package that runs nimph installation script when installed? |
02:13:30 | leorize | and then wrote the installation script in nimscript |
02:13:39 | leorize | it'll be 100% portable (hopefully) |
02:14:12 | leorize | then you just need to tell people to `nimble install nimph_bootstrap` |
02:14:38 | leorize | https://github.com/StefanSalewski/gintro/blob/master/gintro.nimble |
02:14:50 | leorize | ^ this is an example of running something during nimble install |
02:19:07 | disruptek | that's a neat idea. |
02:19:29 | disruptek | a little crazy, but... |
02:20:38 | disruptek | not as crazy as trying to fix nimble bugs. |
03:10:28 | * | muffindrake quit (Ping timeout: 248 seconds) |
03:12:47 | * | muffindrake joined #nim |
04:40:47 | * | yumaikas is now known as yumaikas- |
04:41:15 | FromDiscord | <Zachary Carter> this procedural terrain is pretty awesome - I can adjust the heightmap and see the terrain deform in real time |
04:41:33 | FromDiscord | <Zachary Carter> now what I need to figure out is how to mouse pick and get the correct pixel in the heightmap |
04:41:49 | FromDiscord | <Zachary Carter> then I should be able to start painting terrain |
04:47:12 | * | chemist69 quit (Ping timeout: 252 seconds) |
04:49:13 | * | chemist69 joined #nim |
04:52:43 | * | dddddd quit (Remote host closed the connection) |
05:12:15 | * | yumaikas- is now known as yumaikas |
05:16:08 | * | Hideki joined #nim |
05:16:33 | * | Hideki is now known as Guest32996 |
05:21:09 | * | Guest32996 quit (Ping timeout: 268 seconds) |
05:27:37 | * | sealmove joined #nim |
05:48:38 | * | seerix quit (Ping timeout: 258 seconds) |
05:57:05 | * | seerix joined #nim |
06:08:47 | yumaikas | So... I have some code where I want to build a Table at compile time from scanning some files, is that feasible with compiletime values? |
06:09:24 | * | NimBot joined #nim |
06:12:03 | * | marmotini_ joined #nim |
06:15:30 | sealmove | how to import everything from a module except some symbols? |
06:15:44 | sealmove | yumaikas: I think it's possible |
06:16:08 | sealmove | use x {.compileTime.}: Table |
06:16:48 | sealmove | or you don't even need the pragma if you do it in a proc I think |
06:16:52 | yumaikas | sealmove: import from x except y, I think. The docs for nre have an example |
06:17:03 | sealmove | thx |
06:17:16 | * | marmotini_ quit (Ping timeout: 268 seconds) |
06:17:28 | yumaikas | import x except y |
06:17:50 | yumaikas | import nre except toSeq |
06:17:59 | yumaikas | Is the example I was remembering |
06:21:22 | yumaikas | sealmove: I think I want to make a const seq or something like it... |
06:21:32 | sealmove | show me your code |
06:21:47 | sealmove | const seq is no problem for the VM |
06:25:06 | * | ponyrider joined #nim |
06:25:17 | yumaikas | I don't have it yet, just thinking and trying to sort it out in my head |
06:25:29 | * | ponyrider quit (Client Quit) |
06:25:49 | yumaikas | The goal is to have a basic macro for parsing "// require: " out of JS files |
06:26:21 | yumaikas | And to render a set of script tags based on the results |
06:28:04 | * | marmotini_ joined #nim |
06:30:00 | sealmove | if you are worried if this is feasible then don't, it's 101 for Nim |
06:30:02 | FromDiscord | <potatotot> not sure if this is the right channel to ask, but what is the best way to specify a nim version in a way that it can see nimble packages? I'm trying to build a bazel extension for nim, and because of bazel magic in how it handles the build sandboxing, it cannot read the ~/.choosenim/current file. I tried directly calling the versioned nim with `~/.choosenim/toolchains/nim-1.0.4/bin/nim` but when I did that, it wasn't able to see the nimbl |
06:30:46 | sealmove | potatotot you can also try out nimph |
06:32:03 | FromDiscord | <potatotot> what is nimph? |
06:32:18 | FromDiscord | <potatotot> are you referring to the nimblePath flag in nim? |
06:32:26 | FromDiscord | <potatotot> that was what I could gather from a google search |
06:32:33 | * | marmotini_ quit (Ping timeout: 260 seconds) |
06:35:01 | FromDiscord | <potatotot> but it's also not super clear to me where I can set that |
06:35:25 | yumaikas | sealmove: ok, better question: how do I read files at compile time? |
06:36:12 | sealmove | readFile or staticRead (they are pretty synonymous) |
06:37:06 | sealmove | slurp is also an alias |
06:37:16 | sealmove | https://nim-lang.org/docs/system.html#staticRead,string |
06:38:11 | yumaikas | Huh, ok |
06:39:15 | yumaikas | I was trying to use open/readLine but these should work |
06:39:28 | sealmove | there is strutils.splitLines |
06:40:01 | yumaikas | Right, was just only wanting to read in the first few lines is all |
06:40:02 | FromDiscord | <potatotot> I guess another way to ask my question is: how does `~/.nimble/bin/nim` know where to look for nimble packages, but not `~/.choosenim/toolchains/nim-1.0.4/bin/nim`? What additional magic does the `nim` multiplexer from choosenim perform that allows it to find the nimble packages? |
06:40:04 | sealmove | to something like `staticRead(filePath).splitLines` should work |
06:40:25 | sealmove | yumaikas: ah, I see |
06:40:47 | yumaikas | But, staticExec would probably get what I want anyway |
06:41:10 | * | marmotini_ joined #nim |
06:42:41 | sealmove | well, I think if you play around a bit you can get manual file opening to work at CT. But yeah, if your files are not TOO BIG then you can just use staticRead along with procs from strutils and get the job done with easier and cleaner code. |
06:43:24 | yumaikas | Yeah, that's fine by me. Probably faster than using an outside program. |
06:44:03 | sealmove | potatotot: sorry, I don't use nimble that much, wait for the masters to wake up, but I think they too will suggest that you try out nimph ;_ |
06:44:22 | sealmove | yumaikas: definately, don't use external program |
06:44:40 | FromDiscord | <potatotot> np, thanks. I will dig in the bazel direction to see if I can beat the sandbox into submission |
06:44:43 | yumaikas | staticExec is a no-go then? |
06:45:57 | sealmove | I mean it's not needed/much less effective for your use-case |
06:47:06 | yumaikas | Indeed |
06:47:35 | yumaikas | Thanks for the pointers |
06:55:44 | yumaikas | And that was surprisingly easy to set up... I might have to re-work a couple things with this in mind. I think I can fix some errors... |
06:56:22 | yumaikas | Or not... I don't think compile-time getEnv would be righr |
06:56:32 | yumaikas | For some config things I was thinking of |
07:02:13 | Araq | sorry, I'm still on holidays and will be offline today |
07:02:28 | sealmove | have fun :] |
07:03:50 | sealmove | yumaikas: why is CT getEnv not right? nimscript uses it and nimscript runs on VM which runs at CT. |
07:08:09 | * | solitudesf joined #nim |
07:08:09 | yumaikas | Because the ENV values I want are not there at compile time |
07:08:33 | yumaikas | They are config values that I want to get at application startup |
07:10:04 | yumaikas | So it's not that I can't probe the ENV at compile time, just that it isn't the right time for these values |
07:12:46 | * | solitudesf quit (Ping timeout: 268 seconds) |
07:26:13 | sealmove | i see |
07:26:32 | sealmove | wow! Raku (perl 6) has built-in peg 0.0 |
07:26:35 | sealmove | this is awesome |
07:26:47 | sealmove | https://perl6advent.wordpress.com/2011/12/12/exploratory-parsing-with-perl-6/ |
07:31:41 | * | marmotini_ quit (Remote host closed the connection) |
07:32:03 | * | nsf joined #nim |
07:37:13 | * | marmotini_ joined #nim |
07:46:54 | * | solitudesf joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:05:08 | * | gmpreussner joined #nim |
08:05:35 | * | narimiran joined #nim |
08:13:46 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
08:14:03 | * | solitudesf quit (Ping timeout: 260 seconds) |
08:14:17 | * | ehmry joined #nim |
08:39:32 | * | ponyrider joined #nim |
08:39:51 | * | ponyrider quit (Client Quit) |
09:02:47 | Zevv | sealmove: sweet - anything we can learn from that? |
09:05:09 | sealmove | hey, happy xmas :] |
09:05:17 | Zevv | same same! |
09:05:58 | sealmove | so.. what do you think? wanna take npeg in another direction? (it's cool as it is though) |
09:06:34 | sealmove | i wanted to write to Nim forum but don't have my password atm lol |
09:07:41 | Zevv | always open to ideas. Even if I find something crappy at first sight it usually pays to think about it |
09:12:20 | sealmove | well, the main idea is to implement a separate macro that reads string instead of AST. The string will usually (but not necessarily) be in a .npeg file and it will contain standard PEG mixed with Nim code blocks. The macro will then interpret PEG accordingly and pass Nim code blocks to the Nim parser. |
09:13:19 | sealmove | of course it's a lot of work and would change npeg's initial intention, but Nim is in a lack of parser generator tools |
09:13:53 | FromDiscord | <mratsim> I have a state machine generator :p |
09:15:19 | Zevv | true! |
09:15:31 | Zevv | sealmove: but what would that bring, why parse from a string? |
09:15:54 | Zevv | it's not too hard and I did it before, but what is the advantage? |
09:16:03 | sealmove | mainly better (standard PEG) syntax |
09:16:39 | Zevv | yeah but you lose support for syntax highlighting, suggestion, autocompletion in your strings |
09:16:57 | sealmove | yeah, would have to implement seperate tools for .npeg files |
09:17:16 | Zevv | crap |
09:17:38 | sealmove | yeah, it's grand project, could be a seperate repo, but I think we need something like bison |
09:17:46 | Zevv | no its not grand, it's a days work I guess |
09:17:47 | * | Hideki joined #nim |
09:17:53 | sealmove | wow |
09:17:56 | Zevv | it is already there |
09:18:07 | Zevv | check misc/mouse2peg |
09:18:10 | * | Hideki is now known as Guest36554 |
09:18:14 | Zevv | it converts mouse peg to npeg |
09:18:26 | Zevv | if you do that at compile time you can compile the generated npeg as usual |
09:18:51 | Zevv | and sure, mouse peg is not quite standard peg, but that is a detail |
09:19:02 | FromDiscord | <mratsim> rather than string wuldn't it make more sense to have the npeg conf in something like json format? |
09:19:04 | Zevv | but I'd loathe to have nim code in strings |
09:19:25 | FromDiscord | <mratsim> then then generate a npeg parser that read the npeg parser configuration from the json |
09:19:38 | Zevv | sure, all cool and possible, but again: what does it bring? |
09:19:41 | Zevv | is the NPeg syntax that bad? |
09:19:48 | FromDiscord | <mratsim> and another parser that read the parser conf of the seoncd parser that read the target parser conf |
09:19:59 | Zevv | have you ever looked at PEGTL? It's awful and everybody loves it |
09:20:10 | FromDiscord | <mratsim> "I heard you like parsers, so I put a parser in your parser ...." 😉 |
09:20:19 | sealmove | Zevv: yeah it is imo... :| I mean it's fine for small projects, but for larger ones grammar syntax is most important. |
09:21:19 | Zevv | sealmove: well, I can see a hybrid: make something that takes lines of pegs of whatever syntax as strings, but deploy them as normal nim code blocks so you can write actual nim there which is parsed by the nim compiler |
09:21:51 | Zevv | remember that nimsuggest now truly groks the whole chain of npeg - code inside the code block is actually checked *throug* npeg by nimsuggest |
09:22:03 | Zevv | which is absolutely fabulous imho |
09:22:13 | * | endragor joined #nim |
09:22:16 | sealmove | yes it has helped me, it's awesome :] |
09:22:18 | * | Guest36554 quit (Ping timeout: 260 seconds) |
09:22:42 | Zevv | otoh: that should also work if you go through strings at compile time, now that I think of it |
09:23:02 | sealmove | btw can you explain again why '*' is needed? |
09:23:16 | Zevv | because it needs to be parsed by nim :) |
09:23:22 | Zevv | which is your point |
09:23:42 | Zevv | change the nim parser and we're fine :) |
09:23:59 | Zevv | But as everybody knows: "Macros cannot change Nim's syntax because there is no need for it — the syntax is flexible enough." |
09:24:21 | sealmove | Nim can't parse `identifier1 identifier2 identifier3`? |
09:24:59 | Zevv | nope |
09:25:17 | sealmove | hmm |
09:26:02 | sealmove | so... as you said, this would require to pretty much abandon the implemention as macro idea |
09:26:14 | Zevv | well, I lied there I think, it does parse that |
09:26:41 | Zevv | so maybe we can take a good look at that again to see if things can be simplified somehow |
09:27:10 | Zevv | the good thing of '*' is that there *is* an operator there, which I personally find more natural, and that the operator precedence is right |
09:28:53 | sealmove | ehh, Nim can't parse it but it parses `a b c d e` as: |
09:28:55 | sealmove | Command |
09:28:57 | sealmove | Ident "a" |
09:28:59 | sealmove | Command |
09:29:01 | sealmove | Ident "b" |
09:29:03 | sealmove | Command |
09:29:05 | sealmove | Ident "c" |
09:29:05 | * | marmotini_ quit (Remote host closed the connection) |
09:29:07 | sealmove | Command |
09:29:09 | sealmove | Ident "d" |
09:29:11 | sealmove | Ident "e" |
09:29:13 | sealmove | :D |
09:29:51 | Zevv | yeah I just checked, thus my "i think i lied there" |
09:30:18 | Zevv | so if the * is a pain to you, we could try if we could make that go away. But still you are not 'standard' peg then |
09:30:45 | Zevv | but I never cared for that too much - I found that almost all PEG implementations I found use their own syntax, and noone cares |
09:31:03 | sealmove | I don't know, '*' is just part of it. Whatever you do macro implementation can't reach the level of say bison ease. |
09:31:04 | Zevv | it is just another language - you learn it and you use it. But I get your point, sure |
09:31:31 | sealmove | so I agree npeg is fine, more than fine, for its purpose |
09:31:43 | Zevv | My current feeling is to leave the syntax as it is, as it suits the problem well. But/and |
09:31:51 | sealmove | yeah I agree |
09:32:01 | Zevv | we are free to provide additional layers of DSLs on top of that to be closer to certain problem domains. |
09:32:28 | Zevv | Like tokenizing with the 'new' system is stil a bit messy. It should be fairly trivial to provide a more simple DSL to do The Right Thing from only a few words |
09:32:43 | sealmove | exactly! |
09:32:56 | Zevv | tokenizing will almost always do the same thing: match a string and put one or two of its fields into a sum type |
09:33:12 | Zevv | so we make a tiny lexer DSL which simply generates some NPeg |
09:33:36 | sealmove | DSL should provide lexer/parser interop |
09:33:55 | Zevv | sure |
09:34:03 | sealmove | great :) |
09:34:35 | Zevv | but the closer the DSL matches your problem domain, the worse it might be for someone else. But I agree - lexing is pretty standard and the output is probably mostly the same for most uses |
09:35:05 | sealmove | parsing not? |
09:35:26 | Zevv | I think not - what is the result of a parse? I almost never make ASTs |
09:35:34 | Zevv | I just do the work at parse time |
09:35:44 | Zevv | and what does AST look like? There's tons of ways to do that |
09:36:19 | Zevv | anyway, it's now time for a good coffe, need to play Escape The Dark Castle with the kids and have a stroll in the woods |
09:37:05 | Zevv | let's make a little writeup proposal of this to see where it fits in. Maybe it should not even be part of npeg |
09:37:13 | Zevv | its layers all the way down |
09:37:33 | sealmove | yup I agree with 99% of what you said |
09:37:35 | sealmove | have fun! |
09:46:50 | * | ng0 joined #nim |
09:46:50 | * | ng0 quit (Changing host) |
09:46:50 | * | ng0 joined #nim |
09:58:11 | * | Vladar joined #nim |
10:39:46 | * | dwdv joined #nim |
11:05:37 | * | Trustable joined #nim |
11:14:24 | Zevv | which is the remaining 1%? :) |
11:20:04 | * | ofelas quit (Ping timeout: 248 seconds) |
11:28:21 | * | ofelas joined #nim |
11:30:59 | sealmove | I think parsing is pretty standard too. The output can be whatever you want it to be since you run arbitary code on matches. We can still provide a better DSL for tokens which works in combination with the lexer output. |
11:31:35 | sealmove | parser can know about symbols in lexer |
11:33:08 | sealmove | for example no need for defining enums (they can be auto-generated) |
11:36:34 | sealmove | Example of API: lexer has 2 keywords (or some notation to distinguish): rule and token |
11:36:53 | sealmove | if a pattern is defined as token then the capture is automatically added to the token stack |
11:37:13 | sealmove | and also to the a token symbol table which is known to the parser |
11:38:20 | sealmove | so no need for code blocks in lexer at all! |
11:38:54 | sealmove | or we can still allow them for error messages |
11:40:30 | sealmove | but for parsing sure, the user must construct his structure (ast or whatever) by running his code, no escaping that, and shouldn't make a dsl for say constructing a specific type of ast automatically, this is bad idea. nevertheless the API can be simplified for the parser too. |
11:58:24 | Zevv | my gut feeling is to not pull this into npeg at this time. We should be able to make something that lies on top of it, but I don't think it needs any tight integration |
11:58:41 | Zevv | so I can concentrate on npeg itself and keep it lean and mean |
11:59:25 | Zevv | I think getting to the stage you describe will also require a fair amount of trial and error and experimentation |
12:00:33 | Zevv | I can provide any hooks that might be needed in NPeg, but it does not need to be part of NPeg itself, as I see it now |
12:02:42 | Zevv | also a lot of the complexity npeg has now will not be needed in higher abstraction layers. If you want to make a lexer with the lexer-module-to-be, you don't need to know all about the rest of the stuff - so from that perspecive it also makes sense to separate it. It can use whatever tools under the hood, but you don't need to expose all that |
12:10:41 | FromDiscord | <Clyybber> yeah |
12:16:13 | zedeus | hmm, I've implemented a new httpclient proc that uploads multipart files by streaming them instead of loading them into memory, using async to upload a 50 MB file mem usage went from ~800 MB to ~10 MB |
12:16:20 | zedeus | lots of people including myself have requested this and there's plenty of "TODO: support FutureStream for body" comments in the source |
12:16:24 | zedeus | my solution is different though and probably not the best, should I just open a PR with what I have? |
12:26:35 | sealmove | Zevv: I totally agree |
12:27:17 | sealmove | the only question is if npeg can indeed be leveraged or if it should be an entirely independant project |
12:32:45 | * | solitudesf joined #nim |
12:46:45 | * | Hideki_ joined #nim |
12:49:11 | * | dddddd joined #nim |
12:50:50 | * | Hideki_ quit (Ping timeout: 240 seconds) |
12:58:51 | Zevv | oh no clue - whatever works best |
12:59:52 | Zevv | but I guess getting started from scratch is always harder then getting started from something that works |
13:01:50 | lqdev[m] | why are you trying to make npeg into something gigantic? I like it for what it is (ease of use and readability) |
13:02:48 | * | nsf quit (Quit: WeeChat 2.6) |
13:03:30 | sealmove | we just came to the conclusion it shouldn't be made bigger :P |
13:03:53 | sealmove | btw Zevv, I get this error "inconsistent environment type", any ideas? |
13:04:10 | dom96 | zedeus, yep, open the PR. Thanks for working on this! |
13:09:16 | Zevv | sealmove: never seen it, how can I reproduce? |
13:10:27 | sealmove | let me see |
13:11:28 | Zevv | leorize: nim.nvim has problems with long """ strings spanning more then one page, it often picks the wrong side of the """ as string. Is that a nimsuggest issue? |
13:11:56 | Zevv | leorize: http://zevv.nl/div/wrong.png for example |
13:14:17 | lqdev[m] | <Zevv "leorize: ">http://zevv.nl/div/wron"> I don't think so, strings are handled by the syntax |
13:14:56 | lqdev[m] | though I saw glitches occuring with """ strings sometimes, like portions of the string being highlighted gray as if they were regular statements |
13:17:18 | Zevv | right |
13:25:28 | sealmove | Zevv: I can't reproduce :| made a minimal example which works fine |
13:26:19 | sealmove | it says: npeg-0.22.0/npeg/codegen.nim(405, 10) Error: internal error: inconsistent environment type |
13:29:24 | Zevv | I dont understand, you can reproduce but you can't? |
13:35:08 | sealmove | I can't reproduce it in a minimal example |
13:37:21 | sealmove | which means I don't understand the error msg basically |
13:37:56 | Zevv | well, it's an internal Nim error |
13:37:58 | Zevv | so it's not our fault |
13:49:20 | * | Vladar quit (Ping timeout: 258 seconds) |
14:12:02 | * | Vladar joined #nim |
14:12:48 | FromDiscord | <mratsim> I always break highlighting with `{.emit:["""` |
14:15:08 | Zevv | So I guess when Syntehsis gets going I can throw out npeg, performance wise |
14:17:29 | sealmove | use synthesis in npeg? |
14:17:59 | Zevv | naah just throw out npeg |
14:18:15 | Zevv | rewrite your grammar to a FSM like ragel does |
14:19:33 | sealmove | so npeg for prototyping and then port to Synthesis when grammar is stable? |
14:19:40 | Zevv | naah just throw out npeg |
14:19:46 | sealmove | >_> |
14:19:54 | Zevv | it was fun while it lasted |
14:20:03 | Zevv | but let's be real, once mratsim enters the field, everyone else is out |
14:20:12 | sealmove | haha |
14:30:50 | sealmove | how does this look like in source code: |
14:30:52 | sealmove | Prefix |
14:30:54 | sealmove | ClosedSymChoice |
14:30:56 | sealmove | Sym "@" |
14:30:58 | sealmove | Sym "@" |
14:31:00 | sealmove | Bracket |
14:31:02 | sealmove | UInt8Lit |
14:31:04 | sealmove | UInt8Lit |
14:31:13 | * | krux02 joined #nim |
14:31:37 | sealmove | double sigil... wtf |
14:32:25 | FromDiscord | <Clyybber> `@[1'8, 6'8]` |
14:32:29 | FromDiscord | <Clyybber> I s'ppose |
14:32:52 | sealmove | why the double sigil? |
14:33:16 | FromDiscord | <Clyybber> I think closedsymchoice includes all choices of `@` |
14:33:22 | FromDiscord | <Clyybber> So all overloads of `@` |
14:33:27 | FromDiscord | <Clyybber> or something like that |
14:33:29 | sealmove | oh I see, thanks! |
14:33:33 | FromDiscord | <Clyybber> np |
14:36:20 | * | ofelas quit (Ping timeout: 248 seconds) |
14:48:48 | * | ofelas joined #nim |
14:54:58 | * | krux02 quit (Remote host closed the connection) |
14:59:31 | * | belamenso joined #nim |
15:00:12 | belamenso | d |
15:00:21 | * | nsf joined #nim |
15:02:35 | belamenso | Hi, is it possible for templates to accept int argument and two statement bodies? I tried https://gist.github.com/belamenso/8414fab48929497da1f5f07a33c070bf but it doesn't compile |
15:07:05 | * | ng0_ joined #nim |
15:07:05 | * | ng0_ quit (Changing host) |
15:07:05 | * | ng0_ joined #nim |
15:07:39 | * | seerix quit (Quit: Leaving) |
15:07:49 | leorize | Zevv: the exact file looks fine to me |
15:08:31 | leorize | I think you got hit by vim/neovim infamous syntax synchronization issue |
15:08:51 | leorize | it couldn't find the start of the syntax so it highlighted wrongly |
15:09:09 | leorize | if you manually get to the correct start then it might work |
15:10:13 | * | ng0 quit (Ping timeout: 258 seconds) |
15:10:14 | leorize | belamenso: try this: https://play.nim-lang.org/#ix=25Ih |
15:10:17 | Zevv | yeah right, so it's a vim thing |
15:10:36 | Zevv | I guessed that much, you can't go highlight the whole file, and there's simply not enough context |
15:10:52 | Zevv | and using the same """ terminator on both ends is a mistake of course :) |
15:12:29 | belamenso | <leorize>: thanks |
15:17:44 | narimiran | Zevv: use #[ ........ ]# ;) |
15:18:43 | Zevv | *almost* |
15:19:22 | Zevv | what about [[...]], and if you want to have [[ in your string you can do [=[...]=] |
15:19:33 | * | sammich joined #nim |
15:20:09 | narimiran | what's the problem with #[ ... ]# ? |
15:20:31 | Zevv | that that's a comment and not a string?! |
15:20:32 | lqdev[m] | I don't think he wants a comment |
15:20:35 | Zevv | :) |
15:20:38 | narimiran | oh! |
15:20:56 | narimiran | based on the content, i thought it is some internal comment |
15:21:02 | lqdev[m] | Lua has pretty nice multiline strings, with [[ string goes here ]] as zevv said |
15:21:31 | lqdev[m] | and the [=[ string ]=] thing too |
15:21:36 | lqdev[m] | also, the [[]] can nest |
15:21:45 | lqdev[m] | which is not possible with """ ;) |
15:22:44 | ldlework | too bad everything else about lua is a horror show |
15:23:20 | lqdev[m] | haha, lol |
15:23:22 | Zevv | like the coroutines, terrible. Or the patterns, horrific The |
15:23:47 | lqdev[m] | npeg is better than patterns ;) |
15:24:01 | lqdev[m] | and you can achieve your coroutine stuff with iterators |
15:24:25 | lqdev[m] | I suppose Idlework was referring to oddities like ~=, indexing from 1, and others |
15:25:57 | FromDiscord | <Clyybber> those probably stem from the isolation lua was created in |
15:26:06 | leorize | Zevv: well I do think I could fix nvim's syntax synchronization |
15:26:20 | leorize | I just need a good example file |
15:26:26 | lqdev[m] | @Clyybber yeah, but it's also why lots of programmers don't like Lua |
15:26:43 | lqdev[m] | I personally don't mind it, it's just another language. every language has its oddities :) |
15:36:29 | leorize | Zevv: let me know if you found any file that's have desynchronized highlighting that can be easily reproduced :) |
15:37:00 | leorize | I do have some sync hook in nim.nvim, but they don't seem to be effective |
15:43:09 | solitudesf | gitter bridge died? |
15:50:40 | * | lqdev joined #nim |
15:50:52 | lqdev[m] | yeah, seems like it |
15:50:58 | * | lqdev quit (Client Quit) |
15:51:33 | * | ng0_ is now known as ng0 |
15:55:45 | Zevv | leorize: compiler/lambdalifting.nim |
15:55:51 | * | koltrast quit (Ping timeout: 240 seconds) |
15:56:05 | Zevv | open and :405 |
15:57:07 | Zevv | https://asciinema.org/a/qKDJTZYKTysSiRdcBjrnVrSto |
16:04:41 | * | koltrast joined #nim |
16:07:03 | * | koltrast quit (Read error: Connection reset by peer) |
16:13:25 | * | koltrast joined #nim |
16:31:18 | * | tane joined #nim |
16:46:22 | leorize | Zevv: just pushed a possible "fix" |
16:46:47 | leorize | thanks for finding that example :) |
16:48:30 | * | Hideki joined #nim |
16:48:52 | * | Hideki is now known as Guest66834 |
16:53:05 | * | Guest66834 quit (Ping timeout: 265 seconds) |
16:55:16 | Zevv | fixed, sweet! |
16:57:57 | lqdev[m] | leorize: regarding my highlighting issue, would there be a possibility of adding a :RestartNimsuggest command (or similar)? |
16:58:08 | lqdev[m] | sometimes the highlighting disappears until I restart, but I don't want to lose my buffers |
16:58:12 | leorize | lqdev[m]: there's already one :) |
16:58:30 | leorize | :call nim#suggest#ProjectStop() | call nim#suggest#ProjectStart() |
16:58:42 | leorize | feel free to bind that into a key |
16:59:08 | shashlick | @leorize how do I setup a good auto complete |
16:59:30 | shashlick | Right now I need to type ctrl-p and then use arrow keys |
16:59:36 | shashlick | Very clunky |
17:00:03 | leorize | shashlick: you want the kind of autocomplete that pops up automatically? |
17:01:00 | leorize | assuming that you're using asyncomplete, add this to your configuration file: let g:asyncomplete_auto_popup = 1 |
17:02:05 | shashlick | Ok I'll try that - will tab work? |
17:02:36 | leorize | there are ways to bind tab, you gotta look at asyncomplete documentations |
17:04:15 | shashlick | Ok will do |
17:07:35 | leorize | lqdev[m]: I don't want to make a command out of that because that's not the solution :p but feel free to make your own if you need it |
17:07:43 | leorize | narimiran actually have something similar :P |
17:09:00 | narimiran | leorize shashlick i use https://github.com/ervandew/supertab |
17:12:49 | Zevv | sealmove: you here? |
17:13:54 | Zevv | http://ix.io/25J5 |
17:14:22 | lqdev[m] | leorize: ok, thanks. also regarding autocomplete: how can I close the complete window without having to exit insert mode? pressing enter makes it close for a split second, but it opens right back up. |
17:16:35 | leorize | https://github.com/prabirshrestha/asyncomplete.vim#preview-window |
17:16:39 | Zevv | sealmove: if I can somehow deduce in the macro which variant field is available for which kind that can even be simplified further |
17:17:36 | lqdev[m] | leorize: thanks, will check out |
17:25:29 | * | whaletechno joined #nim |
18:07:31 | * | Vladar quit (Ping timeout: 265 seconds) |
18:22:23 | * | Vladar joined #nim |
18:27:08 | * | endragor quit (Remote host closed the connection) |
18:33:52 | * | azed joined #nim |
18:40:24 | * | azed quit (Quit: WeeChat 2.7) |
18:48:40 | * | marmotini_ joined #nim |
19:15:44 | * | nsf quit (Quit: WeeChat 2.6) |
19:33:22 | sealmove | Zevv: hey |
19:35:02 | sealmove | not bad |
19:35:37 | sealmove | so the first argument to lex() must be a ref object? |
19:43:25 | Araq | muhahaha, I made it. |
19:43:49 | Araq | deterministic exception handling, to be landing in devel soon. |
19:51:09 | sealmove | wow nice xmas gift! |
20:04:15 | * | endragor joined #nim |
20:05:34 | * | marmotini_ quit (Remote host closed the connection) |
20:05:47 | FromDiscord | <exelotl> wtf lua coroutines are stellar |
20:06:03 | FromDiscord | <exelotl> would rather use those over async/await any day |
20:09:36 | * | endragor quit (Ping timeout: 258 seconds) |
20:18:55 | FromDiscord | <treeform> How was it not deterministic before? |
20:20:45 | Zevv | Araq: sweet! Is it related to quirkies or something new? |
20:21:27 | Zevv | sealmove: no, can be any object, just happened to have a ref here. It's just an example of what it could look like with minimal syntax |
20:22:23 | belamenso | Hi, in JS backend, what types correspond to JS arrays? |
20:27:38 | Araq | Zevv: it's quirkies without the quirk |
20:27:44 | Zevv | ha :) |
20:31:24 | Zevv | so no c++ exceptions or longjumps under the hood? |
20:34:28 | EvergreenTree | belamenso not sure about JS interop, but you're probably looking for "seq": https://nim-lang.org/docs/tut1.html#advanced-types-sequences |
20:48:58 | * | luis_ joined #nim |
20:50:12 | * | Hideki joined #nim |
20:50:36 | * | Hideki is now known as Guest661 |
20:54:43 | * | Guest661 quit (Ping timeout: 260 seconds) |
20:56:40 | belamenso | But for example how can i declare an importc variable (in JS backend) to a JS array of arrays of int? |
20:57:48 | * | luis_ quit (Ping timeout: 245 seconds) |
20:59:05 | belamenso | Oh, OK, seq[seq[int]] works, I got something mixed up |
20:59:42 | belamenso | just that it has nil instead of @[] for empty JS arrays |
21:26:24 | sealmove | are tables auto-initialized like seq? |
21:30:33 | lqdev[m] | sealmove: yes. |
21:30:57 | sealmove | nice |
21:36:56 | Zevv | I believe all stdlib containers are by now |
21:46:01 | lqdev[m] | if a string is stored in a tuple, that's stored in a ref object, will the string become a copy? |
21:46:50 | lqdev[m] | s/a copy/a copy when the tuple's initialized/ |
21:47:34 | Zevv | need example |
21:47:42 | Zevv | but if you want to make sure print s[0].addr |
21:47:48 | Zevv | if it is different, it is a copy :) |
21:48:55 | * | sealmove quit (Quit: WeeChat 2.7) |
21:52:20 | * | thiagohubes joined #nim |
21:57:04 | * | narimiran quit (Ping timeout: 268 seconds) |
22:06:26 | FromDiscord | <Clyybber> lqdev[m]: If it can be sinked, no. If not yeah |
22:06:42 | FromDiscord | <Clyybber> Basically, they have value semantics, so you shouldn't worry about it |
22:14:30 | * | solitudesf quit (Ping timeout: 265 seconds) |
22:18:09 | lqdev[m] | right |
22:19:10 | * | thiagohubes quit (Remote host closed the connection) |
22:19:51 | lqdev[m] | I'm wondering, what would be a more efficient way of implementing proc calls in a stack-based bytecode VM? I need to know the number of parameters the procedure has, to calculate the offset from the top of the stack to later pass to the given procedure. however, what would be the better way of storing the number of parameters? would it be better to store it in the opcode, or the procedure struct itself? |
22:20:29 | lqdev[m] | if I store it in the instruction, the access to the number of params is very direct, because I can just read it from an operand, but that of course wastes some space |
22:21:12 | lqdev[m] | if I store it in the proc object, I need to later look its field up, and that needs dereferencing a ref |
22:21:20 | lqdev[m] | so I guess the instruction approach would be faster? |
22:21:29 | lqdev[m] | or would it not matter? |
22:24:00 | lqdev[m] | I need to dereference a pointer in both cases, so I thought it wouldn't really have a performance impact |
22:35:48 | Araq | Zevv: exactly, a perfect fit for --gc:arc |
22:37:22 | shashlick | Araq: any suggestion on how to proceed with https://github.com/nim-lang/Nim/pull/12950 |
22:37:23 | disbot | ➥ Add getCompileOptionString() to get Nim config at compile time |
22:38:00 | Araq | keep in mind we already have system.compileOption |
22:39:15 | shashlick | ya but that only tells you if a flag is set |
22:39:23 | shashlick | it doesn't tell you the value of nimcache if changed |
22:39:25 | Araq | grep for it, based on it implement a new system.compileSetting("key") -> "value" builtin |
22:40:01 | shashlick | i added the ability to return some strings but getting a seq (nimblePath, paths, etc) is not possible |
22:40:18 | Araq | meh |
22:40:34 | Araq | don't just dump everything, that's a terrible API |
22:41:19 | shashlick | yes, i would like it to be similar to compileOption |
22:43:00 | shashlick | i implemented getting strings, open to name changes |
22:43:09 | * | Tyresc joined #nim |
22:43:12 | lqdev[m] | remove the `get` |
22:45:05 | shashlick | compileOptionString(string): string |
22:45:06 | shashlick | ? |
22:46:37 | shashlick | should we return nimblePath types which have multiple values as comma separated string? |
23:00:10 | * | whaletechno quit (Quit: ha det bra) |
23:04:42 | Araq | no. |
23:07:54 | lqdev[m] | shashlick: how about `stringCompileOption`? |
23:08:08 | shashlick | i'm cool with any name |
23:08:19 | shashlick | just need direction on returning a seq of strings |
23:09:28 | Araq | system.compileSetting |
23:12:02 | shashlick | Cool name |
23:12:16 | Araq | seq[string] --> nkBracket(nkStrLit, ...) |
23:12:38 | shashlick | I've also noticed that if nimcache is not set in command line, it is not set in configRef |
23:12:44 | shashlick | You don't get the default value |
23:13:03 | FromDiscord | <Bub_Lite_63_Jr> What are “Oberon-inspired visibility markers”? |
23:14:40 | Araq | Foobar* # star for exporting Foobar |
23:17:33 | lqdev[m] | Araq: a seq would be nkPrefix(ident"@", nkBracket(nkStrLit, …)) |
23:18:17 | Araq | I think I know better |
23:22:20 | lqdev[m] | but, nkBracket would construct an array, am I right? |
23:23:20 | Araq | in the compiler it's often used for both things and n.typ distinguishes |
23:23:32 | Araq | n.typ.kind == tySequence vs tyArray |
23:24:13 | lqdev[m] | oh ok |
23:25:10 | shashlick | Ok will check how to use it in semfold |
23:26:52 | Araq | and be prepared for a little fight because I don't want Nim code to depend on the --path or --nimcache |
23:28:42 | * | Vladar quit (Quit: Leaving) |
23:31:58 | * | endragor joined #nim |
23:36:02 | * | endragor quit (Ping timeout: 240 seconds) |
23:53:16 | * | kahiru quit (Remote host closed the connection) |
23:54:35 | * | kahiru joined #nim |