<< 28-12-2019 >>

00:00:05disruptekdo i need to add more examples?
00:09:47disruptekclearly, i need to add more bugs.
00:14:15FromDiscord<Zachary Carter> since gitter doesn't seem to be working...
00:14:34FromDiscord<Zachary Carter> worked on improving splat mapping today -
00:14:34FromDiscord<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:13FromDiscord<Clyybber> damn
00:17:16FromDiscord<Clyybber> looking sick
00:17:41FromDiscord<Clyybber> disruptek: ugprade cutelog to include more bugs
00:18:42FromDiscord<Clyybber> or maybe you need this ```
00:18:42FromDiscord<Clyybber> \
00:18:42FromDiscord<Clyybber> '-.__.-'
00:18:42FromDiscord<Clyybber> /oo |--.--,--,--.
00:18:43FromDiscord<Clyybber> \_.-'._i__i__i_.'
00:18:43FromDiscord<Clyybber> """""""""
00:18:43FromDiscord<Clyybber> ```
00:19:50FromDiscord<Auriel> tho this ascii looks pretty bad on riot mobile app
00:20:08aeverr[m]Yeah.
00:20:58sealmovecentipede?
00:21:46lqdev[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:40shashlickdisruptek: is nimph installable from nimble now?
00:47:20*Trustable quit (Remote host closed the connection)
01:18:01*ofelas joined #nim
01:18:30disruptekshashlick: 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:16leorizedisruptek: it's the same feeling when I released nim.nvim :p
01:51:01blackbeard420nim.nvim is awesome!
01:52:12leorizethanks :)
01:52:43leorizedisruptek: sometimes whatever we made just have less bugs than we expected :p
01:54:45disruptekusually it seems that way because no one is really exercising the code.
01:59:18disruptekmfiano will be your toughest user. solitude is mine, and that's just not tough enough.
02:00:31leorizeit sounds like they were trying to make their own plugin though :P
02:02:03leorizeI think what you need for marketing nimph is: why should I use it over nimble?
02:02:26leorizeeasy to install can also score some great points
02:04:20disruptekyep, it's annoyingly difficult to build from scratch.
02:05:00disruptekbut i feel like if it doesn't buy you something over nimble, then i want you to use nimble.
02:05:26disruptekthe goal isn't to replace nimble, but to offer something different by design.
02:05:46leorizeyea but people has been using nimble for so long
02:05:58disruptekpeople happy with nimble should stick with it.
02:06:11disruptekthat's the customer that nimble is written for.
02:06:23disruptekit works they way they expect, etc.
02:07:08leorizewell you know nimble problems, you gotta advertise how nimph avoided them
02:07:19leorizebut easy to install is also something crucial :/
02:07:28leorizeone of the main reasons I wrote nim.nvim in vimscript
02:08:14disrupteki do need to have more examples. not sure how to fix installation; it's basically complicated by bugs in nimble.
02:08:42disruptekthere's a powershell script waiting to merge, at least.
02:13:12leorizehmm, maybe you can make a dummy nimble package that runs nimph installation script when installed?
02:13:30leorizeand then wrote the installation script in nimscript
02:13:39leorizeit'll be 100% portable (hopefully)
02:14:12leorizethen you just need to tell people to `nimble install nimph_bootstrap`
02:14:38leorizehttps://github.com/StefanSalewski/gintro/blob/master/gintro.nimble
02:14:50leorize^ this is an example of running something during nimble install
02:19:07disruptekthat's a neat idea.
02:19:29disrupteka little crazy, but...
02:20:38disrupteknot 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:15FromDiscord<Zachary Carter> this procedural terrain is pretty awesome - I can adjust the heightmap and see the terrain deform in real time
04:41:33FromDiscord<Zachary Carter> now what I need to figure out is how to mouse pick and get the correct pixel in the heightmap
04:41:49FromDiscord<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:47yumaikasSo... 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:30sealmovehow to import everything from a module except some symbols?
06:15:44sealmoveyumaikas: I think it's possible
06:16:08sealmoveuse x {.compileTime.}: Table
06:16:48sealmoveor you don't even need the pragma if you do it in a proc I think
06:16:52yumaikassealmove: import from x except y, I think. The docs for nre have an example
06:17:03sealmovethx
06:17:16*marmotini_ quit (Ping timeout: 268 seconds)
06:17:28yumaikasimport x except y
06:17:50yumaikasimport nre except toSeq
06:17:59yumaikasIs the example I was remembering
06:21:22yumaikassealmove: I think I want to make a const seq or something like it...
06:21:32sealmoveshow me your code
06:21:47sealmoveconst seq is no problem for the VM
06:25:06*ponyrider joined #nim
06:25:17yumaikasI 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:49yumaikasThe goal is to have a basic macro for parsing "// require: " out of JS files
06:26:21yumaikasAnd to render a set of script tags based on the results
06:28:04*marmotini_ joined #nim
06:30:00sealmoveif you are worried if this is feasible then don't, it's 101 for Nim
06:30:02FromDiscord<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:46sealmovepotatotot you can also try out nimph
06:32:03FromDiscord<potatotot> what is nimph?
06:32:18FromDiscord<potatotot> are you referring to the nimblePath flag in nim?
06:32:26FromDiscord<potatotot> that was what I could gather from a google search
06:32:33*marmotini_ quit (Ping timeout: 260 seconds)
06:35:01FromDiscord<potatotot> but it's also not super clear to me where I can set that
06:35:25yumaikassealmove: ok, better question: how do I read files at compile time?
06:36:12sealmovereadFile or staticRead (they are pretty synonymous)
06:37:06sealmoveslurp is also an alias
06:37:16sealmovehttps://nim-lang.org/docs/system.html#staticRead,string
06:38:11yumaikasHuh, ok
06:39:15yumaikasI was trying to use open/readLine but these should work
06:39:28sealmovethere is strutils.splitLines
06:40:01yumaikasRight, was just only wanting to read in the first few lines is all
06:40:02FromDiscord<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:04sealmoveto something like `staticRead(filePath).splitLines` should work
06:40:25sealmoveyumaikas: ah, I see
06:40:47yumaikasBut, staticExec would probably get what I want anyway
06:41:10*marmotini_ joined #nim
06:42:41sealmovewell, 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:24yumaikasYeah, that's fine by me. Probably faster than using an outside program.
06:44:03sealmovepotatotot: 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:22sealmoveyumaikas: definately, don't use external program
06:44:40FromDiscord<potatotot> np, thanks. I will dig in the bazel direction to see if I can beat the sandbox into submission
06:44:43yumaikasstaticExec is a no-go then?
06:45:57sealmoveI mean it's not needed/much less effective for your use-case
06:47:06yumaikasIndeed
06:47:35yumaikasThanks for the pointers
06:55:44yumaikasAnd 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:22yumaikasOr not... I don't think compile-time getEnv would be righr
06:56:32yumaikasFor some config things I was thinking of
07:02:13Araqsorry, I'm still on holidays and will be offline today
07:02:28sealmovehave fun :]
07:03:50sealmoveyumaikas: 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:09yumaikasBecause the ENV values I want are not there at compile time
07:08:33yumaikasThey are config values that I want to get at application startup
07:10:04yumaikasSo 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:13sealmovei see
07:26:32sealmovewow! Raku (perl 6) has built-in peg 0.0
07:26:35sealmovethis is awesome
07:26:47sealmovehttps://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:47Zevvsealmove: sweet - anything we can learn from that?
09:05:09sealmovehey, happy xmas :]
09:05:17Zevvsame same!
09:05:58sealmoveso.. what do you think? wanna take npeg in another direction? (it's cool as it is though)
09:06:34sealmovei wanted to write to Nim forum but don't have my password atm lol
09:07:41Zevvalways open to ideas. Even if I find something crappy at first sight it usually pays to think about it
09:12:20sealmovewell, 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:19sealmoveof 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:53FromDiscord<mratsim> I have a state machine generator :p
09:15:19Zevvtrue!
09:15:31Zevvsealmove: but what would that bring, why parse from a string?
09:15:54Zevvit's not too hard and I did it before, but what is the advantage?
09:16:03sealmovemainly better (standard PEG) syntax
09:16:39Zevvyeah but you lose support for syntax highlighting, suggestion, autocompletion in your strings
09:16:57sealmoveyeah, would have to implement seperate tools for .npeg files
09:17:16Zevvcrap
09:17:38sealmoveyeah, it's grand project, could be a seperate repo, but I think we need something like bison
09:17:46Zevvno its not grand, it's a days work I guess
09:17:47*Hideki joined #nim
09:17:53sealmovewow
09:17:56Zevvit is already there
09:18:07Zevvcheck misc/mouse2peg
09:18:10*Hideki is now known as Guest36554
09:18:14Zevvit converts mouse peg to npeg
09:18:26Zevvif you do that at compile time you can compile the generated npeg as usual
09:18:51Zevvand sure, mouse peg is not quite standard peg, but that is a detail
09:19:02FromDiscord<mratsim> rather than string wuldn't it make more sense to have the npeg conf in something like json format?
09:19:04Zevvbut I'd loathe to have nim code in strings
09:19:25FromDiscord<mratsim> then then generate a npeg parser that read the npeg parser configuration from the json
09:19:38Zevvsure, all cool and possible, but again: what does it bring?
09:19:41Zevvis the NPeg syntax that bad?
09:19:48FromDiscord<mratsim> and another parser that read the parser conf of the seoncd parser that read the target parser conf
09:19:59Zevvhave you ever looked at PEGTL? It's awful and everybody loves it
09:20:10FromDiscord<mratsim> "I heard you like parsers, so I put a parser in your parser ...." 😉
09:20:19sealmoveZevv: yeah it is imo... :| I mean it's fine for small projects, but for larger ones grammar syntax is most important.
09:21:19Zevvsealmove: 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:51Zevvremember that nimsuggest now truly groks the whole chain of npeg - code inside the code block is actually checked *throug* npeg by nimsuggest
09:22:03Zevvwhich is absolutely fabulous imho
09:22:13*endragor joined #nim
09:22:16sealmoveyes it has helped me, it's awesome :]
09:22:18*Guest36554 quit (Ping timeout: 260 seconds)
09:22:42Zevvotoh: that should also work if you go through strings at compile time, now that I think of it
09:23:02sealmovebtw can you explain again why '*' is needed?
09:23:16Zevvbecause it needs to be parsed by nim :)
09:23:22Zevvwhich is your point
09:23:42Zevvchange the nim parser and we're fine :)
09:23:59ZevvBut as everybody knows: "Macros cannot change Nim's syntax because there is no need for it — the syntax is flexible enough."
09:24:21sealmoveNim can't parse `identifier1 identifier2 identifier3`?
09:24:59Zevvnope
09:25:17sealmovehmm
09:26:02sealmoveso... as you said, this would require to pretty much abandon the implemention as macro idea
09:26:14Zevvwell, I lied there I think, it does parse that
09:26:41Zevvso maybe we can take a good look at that again to see if things can be simplified somehow
09:27:10Zevvthe 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:53sealmoveehh, Nim can't parse it but it parses `a b c d e` as:
09:28:55sealmove Command
09:28:57sealmove Ident "a"
09:28:59sealmove Command
09:29:01sealmove Ident "b"
09:29:03sealmove Command
09:29:05sealmove Ident "c"
09:29:05*marmotini_ quit (Remote host closed the connection)
09:29:07sealmove Command
09:29:09sealmove Ident "d"
09:29:11sealmove Ident "e"
09:29:13sealmove:D
09:29:51Zevvyeah I just checked, thus my "i think i lied there"
09:30:18Zevvso 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:45Zevvbut 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:03sealmoveI don't know, '*' is just part of it. Whatever you do macro implementation can't reach the level of say bison ease.
09:31:04Zevvit is just another language - you learn it and you use it. But I get your point, sure
09:31:31sealmoveso I agree npeg is fine, more than fine, for its purpose
09:31:43ZevvMy current feeling is to leave the syntax as it is, as it suits the problem well. But/and
09:31:51sealmoveyeah I agree
09:32:01Zevvwe are free to provide additional layers of DSLs on top of that to be closer to certain problem domains.
09:32:28ZevvLike 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:43sealmoveexactly!
09:32:56Zevvtokenizing will almost always do the same thing: match a string and put one or two of its fields into a sum type
09:33:12Zevvso we make a tiny lexer DSL which simply generates some NPeg
09:33:36sealmoveDSL should provide lexer/parser interop
09:33:55Zevvsure
09:34:03sealmovegreat :)
09:34:35Zevvbut 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:05sealmoveparsing not?
09:35:26ZevvI think not - what is the result of a parse? I almost never make ASTs
09:35:34ZevvI just do the work at parse time
09:35:44Zevvand what does AST look like? There's tons of ways to do that
09:36:19Zevvanyway, 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:05Zevvlet'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:13Zevvits layers all the way down
09:37:33sealmoveyup I agree with 99% of what you said
09:37:35sealmovehave 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:24Zevvwhich is the remaining 1%? :)
11:20:04*ofelas quit (Ping timeout: 248 seconds)
11:28:21*ofelas joined #nim
11:30:59sealmoveI 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:35sealmoveparser can know about symbols in lexer
11:33:08sealmovefor example no need for defining enums (they can be auto-generated)
11:36:34sealmoveExample of API: lexer has 2 keywords (or some notation to distinguish): rule and token
11:36:53sealmoveif a pattern is defined as token then the capture is automatically added to the token stack
11:37:13sealmoveand also to the a token symbol table which is known to the parser
11:38:20sealmoveso no need for code blocks in lexer at all!
11:38:54sealmoveor we can still allow them for error messages
11:40:30sealmovebut 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:24Zevvmy 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:41Zevvso I can concentrate on npeg itself and keep it lean and mean
11:59:25ZevvI think getting to the stage you describe will also require a fair amount of trial and error and experimentation
12:00:33ZevvI 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:42Zevvalso 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:41FromDiscord<Clyybber> yeah
12:16:13zedeushmm, 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:20zedeuslots of people including myself have requested this and there's plenty of "TODO: support FutureStream for body" comments in the source
12:16:24zedeusmy solution is different though and probably not the best, should I just open a PR with what I have?
12:26:35sealmoveZevv: I totally agree
12:27:17sealmovethe 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:51Zevvoh no clue - whatever works best
12:59:52Zevvbut I guess getting started from scratch is always harder then getting started from something that works
13:01:50lqdev[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:30sealmovewe just came to the conclusion it shouldn't be made bigger :P
13:03:53sealmovebtw Zevv, I get this error "inconsistent environment type", any ideas?
13:04:10dom96zedeus, yep, open the PR. Thanks for working on this!
13:09:16Zevvsealmove: never seen it, how can I reproduce?
13:10:27sealmovelet me see
13:11:28Zevvleorize: 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:56Zevvleorize: http://zevv.nl/div/wrong.png for example
13:14:17lqdev[m]<Zevv "leorize: ">http://zevv.nl/div/wron"> I don't think so, strings are handled by the syntax
13:14:56lqdev[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:18Zevvright
13:25:28sealmoveZevv: I can't reproduce :| made a minimal example which works fine
13:26:19sealmoveit says: npeg-0.22.0/npeg/codegen.nim(405, 10) Error: internal error: inconsistent environment type
13:29:24ZevvI dont understand, you can reproduce but you can't?
13:35:08sealmoveI can't reproduce it in a minimal example
13:37:21sealmovewhich means I don't understand the error msg basically
13:37:56Zevvwell, it's an internal Nim error
13:37:58Zevvso it's not our fault
13:49:20*Vladar quit (Ping timeout: 258 seconds)
14:12:02*Vladar joined #nim
14:12:48FromDiscord<mratsim> I always break highlighting with `{.emit:["""`
14:15:08ZevvSo I guess when Syntehsis gets going I can throw out npeg, performance wise
14:17:29sealmoveuse synthesis in npeg?
14:17:59Zevvnaah just throw out npeg
14:18:15Zevvrewrite your grammar to a FSM like ragel does
14:19:33sealmoveso npeg for prototyping and then port to Synthesis when grammar is stable?
14:19:40Zevvnaah just throw out npeg
14:19:46sealmove>_>
14:19:54Zevvit was fun while it lasted
14:20:03Zevvbut let's be real, once mratsim enters the field, everyone else is out
14:20:12sealmovehaha
14:30:50sealmovehow does this look like in source code:
14:30:52sealmove Prefix
14:30:54sealmove ClosedSymChoice
14:30:56sealmove Sym "@"
14:30:58sealmove Sym "@"
14:31:00sealmove Bracket
14:31:02sealmove UInt8Lit
14:31:04sealmove UInt8Lit
14:31:13*krux02 joined #nim
14:31:37sealmovedouble sigil... wtf
14:32:25FromDiscord<Clyybber> `@[1'8, 6'8]`
14:32:29FromDiscord<Clyybber> I s'ppose
14:32:52sealmovewhy the double sigil?
14:33:16FromDiscord<Clyybber> I think closedsymchoice includes all choices of `@`
14:33:22FromDiscord<Clyybber> So all overloads of `@`
14:33:27FromDiscord<Clyybber> or something like that
14:33:29sealmoveoh I see, thanks!
14:33:33FromDiscord<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:12belamensod
15:00:21*nsf joined #nim
15:02:35belamensoHi, 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:49leorizeZevv: the exact file looks fine to me
15:08:31leorizeI think you got hit by vim/neovim infamous syntax synchronization issue
15:08:51leorizeit couldn't find the start of the syntax so it highlighted wrongly
15:09:09leorizeif you manually get to the correct start then it might work
15:10:13*ng0 quit (Ping timeout: 258 seconds)
15:10:14leorizebelamenso: try this: https://play.nim-lang.org/#ix=25Ih
15:10:17Zevvyeah right, so it's a vim thing
15:10:36ZevvI guessed that much, you can't go highlight the whole file, and there's simply not enough context
15:10:52Zevvand using the same """ terminator on both ends is a mistake of course :)
15:12:29belamenso<leorize>: thanks
15:17:44narimiranZevv: use #[ ........ ]# ;)
15:18:43Zevv*almost*
15:19:22Zevvwhat about [[...]], and if you want to have [[ in your string you can do [=[...]=]
15:19:33*sammich joined #nim
15:20:09narimiranwhat's the problem with #[ ... ]# ?
15:20:31Zevvthat that's a comment and not a string?!
15:20:32lqdev[m]I don't think he wants a comment
15:20:35Zevv:)
15:20:38narimiranoh!
15:20:56narimiranbased on the content, i thought it is some internal comment
15:21:02lqdev[m]Lua has pretty nice multiline strings, with [[ string goes here ]] as zevv said
15:21:31lqdev[m]and the [=[ string ]=] thing too
15:21:36lqdev[m]also, the [[]] can nest
15:21:45lqdev[m]which is not possible with """ ;)
15:22:44ldleworktoo bad everything else about lua is a horror show
15:23:20lqdev[m]haha, lol
15:23:22Zevvlike the coroutines, terrible. Or the patterns, horrific The
15:23:47lqdev[m]npeg is better than patterns ;)
15:24:01lqdev[m]and you can achieve your coroutine stuff with iterators
15:24:25lqdev[m]I suppose Idlework was referring to oddities like ~=, indexing from 1, and others
15:25:57FromDiscord<Clyybber> those probably stem from the isolation lua was created in
15:26:06leorizeZevv: well I do think I could fix nvim's syntax synchronization
15:26:20leorizeI just need a good example file
15:26:26lqdev[m]@Clyybber yeah, but it's also why lots of programmers don't like Lua
15:26:43lqdev[m]I personally don't mind it, it's just another language. every language has its oddities :)
15:36:29leorizeZevv: let me know if you found any file that's have desynchronized highlighting that can be easily reproduced :)
15:37:00leorizeI do have some sync hook in nim.nvim, but they don't seem to be effective
15:43:09solitudesfgitter bridge died?
15:50:40*lqdev joined #nim
15:50:52lqdev[m]yeah, seems like it
15:50:58*lqdev quit (Client Quit)
15:51:33*ng0_ is now known as ng0
15:55:45Zevvleorize: compiler/lambdalifting.nim
15:55:51*koltrast quit (Ping timeout: 240 seconds)
15:56:05Zevvopen and :405
15:57:07Zevvhttps://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:22leorizeZevv: just pushed a possible "fix"
16:46:47leorizethanks 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:16Zevvfixed, sweet!
16:57:57lqdev[m]leorize: regarding my highlighting issue, would there be a possibility of adding a :RestartNimsuggest command (or similar)?
16:58:08lqdev[m]sometimes the highlighting disappears until I restart, but I don't want to lose my buffers
16:58:12leorizelqdev[m]: there's already one :)
16:58:30leorize:call nim#suggest#ProjectStop() | call nim#suggest#ProjectStart()
16:58:42leorizefeel free to bind that into a key
16:59:08shashlick@leorize how do I setup a good auto complete
16:59:30shashlickRight now I need to type ctrl-p and then use arrow keys
16:59:36shashlickVery clunky
17:00:03leorizeshashlick: you want the kind of autocomplete that pops up automatically?
17:01:00leorizeassuming that you're using asyncomplete, add this to your configuration file: let g:asyncomplete_auto_popup = 1
17:02:05shashlickOk I'll try that - will tab work?
17:02:36leorizethere are ways to bind tab, you gotta look at asyncomplete documentations
17:04:15shashlickOk will do
17:07:35leorizelqdev[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:43leorizenarimiran actually have something similar :P
17:09:00narimiranleorize shashlick i use https://github.com/ervandew/supertab
17:12:49Zevvsealmove: you here?
17:13:54Zevvhttp://ix.io/25J5
17:14:22lqdev[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:35leorizehttps://github.com/prabirshrestha/asyncomplete.vim#preview-window
17:16:39Zevvsealmove: if I can somehow deduce in the macro which variant field is available for which kind that can even be simplified further
17:17:36lqdev[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:22sealmoveZevv: hey
19:35:02sealmovenot bad
19:35:37sealmoveso the first argument to lex() must be a ref object?
19:43:25Araqmuhahaha, I made it.
19:43:49Araqdeterministic exception handling, to be landing in devel soon.
19:51:09sealmovewow nice xmas gift!
20:04:15*endragor joined #nim
20:05:34*marmotini_ quit (Remote host closed the connection)
20:05:47FromDiscord<exelotl> wtf lua coroutines are stellar
20:06:03FromDiscord<exelotl> would rather use those over async/await any day
20:09:36*endragor quit (Ping timeout: 258 seconds)
20:18:55FromDiscord<treeform> How was it not deterministic before?
20:20:45ZevvAraq: sweet! Is it related to quirkies or something new?
20:21:27Zevvsealmove: 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:23belamensoHi, in JS backend, what types correspond to JS arrays?
20:27:38AraqZevv: it's quirkies without the quirk
20:27:44Zevvha :)
20:31:24Zevvso no c++ exceptions or longjumps under the hood?
20:34:28EvergreenTreebelamenso 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:40belamensoBut 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:05belamensoOh, OK, seq[seq[int]] works, I got something mixed up
20:59:42belamensojust that it has nil instead of @[] for empty JS arrays
21:26:24sealmoveare tables auto-initialized like seq?
21:30:33lqdev[m]sealmove: yes.
21:30:57sealmovenice
21:36:56ZevvI believe all stdlib containers are by now
21:46:01lqdev[m]if a string is stored in a tuple, that's stored in a ref object, will the string become a copy?
21:46:50lqdev[m]s/a copy/a copy when the tuple's initialized/
21:47:34Zevvneed example
21:47:42Zevvbut if you want to make sure print s[0].addr
21:47:48Zevvif 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:26FromDiscord<Clyybber> lqdev[m]: If it can be sinked, no. If not yeah
22:06:42FromDiscord<Clyybber> Basically, they have value semantics, so you shouldn't worry about it
22:14:30*solitudesf quit (Ping timeout: 265 seconds)
22:18:09lqdev[m]right
22:19:10*thiagohubes quit (Remote host closed the connection)
22:19:51lqdev[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:29lqdev[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:12lqdev[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:20lqdev[m]so I guess the instruction approach would be faster?
22:21:29lqdev[m]or would it not matter?
22:24:00lqdev[m]I need to dereference a pointer in both cases, so I thought it wouldn't really have a performance impact
22:35:48AraqZevv: exactly, a perfect fit for --gc:arc
22:37:22shashlickAraq: any suggestion on how to proceed with https://github.com/nim-lang/Nim/pull/12950
22:37:23disbotAdd getCompileOptionString() to get Nim config at compile time
22:38:00Araqkeep in mind we already have system.compileOption
22:39:15shashlickya but that only tells you if a flag is set
22:39:23shashlickit doesn't tell you the value of nimcache if changed
22:39:25Araqgrep for it, based on it implement a new system.compileSetting("key") -> "value" builtin
22:40:01shashlicki added the ability to return some strings but getting a seq (nimblePath, paths, etc) is not possible
22:40:18Araqmeh
22:40:34Araqdon't just dump everything, that's a terrible API
22:41:19shashlickyes, i would like it to be similar to compileOption
22:43:00shashlicki implemented getting strings, open to name changes
22:43:09*Tyresc joined #nim
22:43:12lqdev[m]remove the `get`
22:45:05shashlickcompileOptionString(string): string
22:45:06shashlick?
22:46:37shashlickshould we return nimblePath types which have multiple values as comma separated string?
23:00:10*whaletechno quit (Quit: ha det bra)
23:04:42Araqno.
23:07:54lqdev[m]shashlick: how about `stringCompileOption`?
23:08:08shashlicki'm cool with any name
23:08:19shashlickjust need direction on returning a seq of strings
23:09:28Araqsystem.compileSetting
23:12:02shashlickCool name
23:12:16Araqseq[string] --> nkBracket(nkStrLit, ...)
23:12:38shashlickI've also noticed that if nimcache is not set in command line, it is not set in configRef
23:12:44shashlickYou don't get the default value
23:13:03FromDiscord<Bub_Lite_63_Jr> What are “Oberon-inspired visibility markers”?
23:14:40AraqFoobar* # star for exporting Foobar
23:17:33lqdev[m]Araq: a seq would be nkPrefix(ident"@", nkBracket(nkStrLit, …))
23:18:17AraqI think I know better
23:22:20lqdev[m]but, nkBracket would construct an array, am I right?
23:23:20Araqin the compiler it's often used for both things and n.typ distinguishes
23:23:32Araqn.typ.kind == tySequence vs tyArray
23:24:13lqdev[m]oh ok
23:25:10shashlickOk will check how to use it in semfold
23:26:52Araqand 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