00:01:14 | * | vlad1777d joined #nim |
00:07:11 | * | rnrwashere quit (Remote host closed the connection) |
00:14:13 | * | theelous3 quit (Ping timeout: 245 seconds) |
00:49:22 | * | mosORadi quit (Quit: Connection closed for inactivity) |
01:00:42 | leorize | Araq, narimiran: I think "sophisticate364" on github got their email hacked |
01:01:06 | leorize | maybe we should ban them for the time being |
01:04:45 | * | rnrwashere joined #nim |
01:32:58 | * | vlad1777d quit (Ping timeout: 245 seconds) |
01:33:33 | * | ng0 quit (Ping timeout: 256 seconds) |
01:36:40 | FromGitter | <kaushalmodi> why didn't I do this earlier (allows me to type "nim json <hit enter>" and such in Firefox address bar) |
01:36:43 | FromGitter | <kaushalmodi> (https://files.gitter.im/nim-lang/Nim/h61z/image.png) |
01:41:00 | * | rnrwashere quit (Remote host closed the connection) |
01:42:37 | * | dddddd quit (Remote host closed the connection) |
01:47:59 | * | vaios joined #nim |
01:48:33 | * | vaios left #nim ("+++++++++++++++++++++++") |
01:53:47 | * | rnrwashere joined #nim |
01:56:17 | * | rnrwashere quit (Remote host closed the connection) |
01:56:48 | * | rnrwashere joined #nim |
01:59:38 | * | neceve quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
01:59:59 | * | neceve joined #nim |
02:02:04 | * | banc quit (Quit: Bye) |
02:20:08 | shashlick | I just keep theindex open in links |
02:20:31 | shashlick | Super fast and doesn't hog ram |
02:23:16 | * | banc joined #nim |
02:24:09 | FromGitter | <kaushalmodi> shashlick: I should do that, in eww |
02:25:10 | * | rnrwashere quit (Remote host closed the connection) |
02:26:15 | * | rnrwashere joined #nim |
02:30:05 | * | Snircle joined #nim |
02:30:46 | * | laaron quit (Remote host closed the connection) |
02:34:57 | * | laaron joined #nim |
02:36:25 | * | laaron quit (Remote host closed the connection) |
02:36:45 | * | rnrwashere quit (Remote host closed the connection) |
02:39:18 | * | laaron joined #nim |
02:42:55 | * | rnrwashere joined #nim |
02:46:19 | * | laaron quit (Remote host closed the connection) |
02:48:51 | * | laaron joined #nim |
03:05:56 | * | neceve quit (Read error: Connection reset by peer) |
03:44:40 | * | laaron quit (Remote host closed the connection) |
03:44:45 | * | laaron- joined #nim |
04:00:18 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:05:31 | leorize | I got bored, so... here's 32 bit linux testing on travis: https://travis-ci.org/alaviss/Nim/builds/537061173 |
04:12:55 | * | seerix joined #nim |
05:18:34 | * | rnrwashere quit (Remote host closed the connection) |
05:19:38 | * | seerix quit (Remote host closed the connection) |
05:33:56 | * | rnrwashere joined #nim |
05:33:58 | Araq | leorize: NICE! :-) |
05:34:01 | * | rnrwashere quit (Read error: Connection reset by peer) |
05:34:12 | * | rnrwashere joined #nim |
05:55:04 | * | seerix joined #nim |
06:09:07 | * | pydsigner_ joined #nim |
06:17:20 | * | Trustable joined #nim |
06:19:41 | * | narimiran joined #nim |
06:20:04 | * | kapilp joined #nim |
06:20:06 | * | solitudesf joined #nim |
06:20:44 | * | pydsigner quit (Disconnected by services) |
06:20:54 | * | pydsigner joined #nim |
06:22:10 | * | pydsigner quit (Disconnected by services) |
06:22:21 | * | pydsigner joined #nim |
06:22:59 | * | pydsigner quit (Disconnected by services) |
06:23:01 | * | pydsigner_ is now known as pydsigner |
06:23:43 | * | pydsigner_ joined #nim |
06:25:14 | FromGitter | <kaushalmodi> this was a fun little project today: https://github.com/kaushalmodi/p4ztag_to_json |
06:35:56 | leorize | Araq: it worked quite well, except that boehm gc is trashed due to a docker bug or something |
06:36:30 | leorize | since getcontext() is completely broken, I guess what's holding my builds from finishing is tcoroutines |
06:45:51 | * | stefanos82 joined #nim |
06:48:42 | * | Trustable quit (Remote host closed the connection) |
06:51:53 | * | rnrwashere quit (Remote host closed the connection) |
06:58:18 | * | laaron- quit (Remote host closed the connection) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:01:59 | * | laaron joined #nim |
07:04:01 | * | laaron quit (Remote host closed the connection) |
07:04:57 | * | gmpreussner joined #nim |
07:06:06 | * | laaron joined #nim |
07:31:10 | * | rnrwashere joined #nim |
07:35:58 | * | rnrwashere quit (Ping timeout: 268 seconds) |
07:45:40 | Araq | https://pldi18.sigplan.org/details/pldi-2018-papers/20/Ry-Fast-Float-to-String-Conversion we needs this in Nim's stdlib |
07:47:28 | * | nsf joined #nim |
08:10:26 | * | Vladar joined #nim |
08:13:28 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
08:15:21 | * | laaron joined #nim |
08:31:06 | * | solitudesf quit (Ping timeout: 258 seconds) |
08:31:44 | Zevv | hmm looking at the paper its not your typical saturday-morning side project |
08:34:41 | * | laaron quit (Remote host closed the connection) |
08:36:23 | * | laaron joined #nim |
08:57:31 | FromDiscord_ | <j$> is there a way to see the code a macro generates? |
08:57:51 | FromGitter | <alehander42> echo result.repr |
09:00:35 | FromDiscord_ | <j$> that didnt really work but the vscode error thing showed me, the macro generates an if statement and I cant repr that |
09:00:50 | FromGitter | <alehander42> хмм |
09:00:57 | FromGitter | <alehander42> i thought you can change the macro |
09:01:11 | FromDiscord_ | <j$> I dont follow |
09:01:12 | FromGitter | <alehander42> if you cannot |
09:01:17 | FromGitter | <alehander42> if you wrote the macro |
09:01:22 | FromDiscord_ | <j$> ohhhh |
09:01:23 | FromGitter | <alehander42> and just add to the macro itself |
09:01:25 | FromDiscord_ | <j$> nevermind |
09:01:31 | FromDiscord_ | <j$> I see what you're saying |
09:01:40 | FromGitter | <alehander42> something that shows its code with .repr or .treerepr |
09:01:42 | FromGitter | <alehander42> you can debug it |
09:01:47 | FromGitter | <alehander42> but if its coming from a lib etc |
09:01:50 | FromGitter | <alehander42> its harder you're right |
09:03:15 | FromDiscord_ | <j$> well i thought you meant for me to repr the macro call but that would be dumb, Im tired and need to sleep |
09:06:33 | FromGitter | <alehander42> no problem |
09:14:33 | Araq | Zevv: https://github.com/dragon-lang/mar/blob/master/src/mar/ryu.d D to Nim translation and that's all there is to it :P |
09:16:43 | FromGitter | <alehander42> time for d2nim |
09:17:14 | FromGitter | <alehander42> Araq |
09:17:19 | FromGitter | <alehander42> i dont think i use method in gara |
09:17:22 | FromGitter | <alehander42> not sure what happens |
09:17:31 | Araq | it was just some hiccup |
09:25:18 | * | rnrwashere joined #nim |
09:25:19 | FromGitter | <alehander42> araq, what do you dislike most in unix-like os-es |
09:25:25 | FromGitter | <alehander42> i remember you had some pain points with them |
09:29:34 | * | rnrwashere quit (Ping timeout: 252 seconds) |
09:35:39 | * | al_ joined #nim |
10:00:14 | dom96 | In case there are some here who still haven't ordered my Nim book, now is your chance. It's 50% off with code wm052419au :) https://manning.com/books/nim-in-action?a_aid=niminaction&a_bid=78a27e81 |
10:00:42 | Zevv | Araq: yeah, I just found the C implementation, and it's not too bad |
10:00:47 | Zevv | The paper is mostly proof it seems |
10:01:59 | Zevv | alehander42: I do know about the fork()/exec() model, but there's probably tons more |
10:07:53 | * | luis_ joined #nim |
10:18:15 | * | WilhelmVonWeiner quit (Quit: Changing server) |
10:23:34 | * | WilhelmVonWeiner joined #nim |
10:24:07 | * | narimiran quit (Ping timeout: 258 seconds) |
10:26:25 | enthus1ast | have you tried to create a async ssl server lateley? It seems broken atm |
10:26:50 | * | dddddd joined #nim |
10:28:22 | enthus1ast | the server does not send it's "hello" msg, non async seems functional |
10:34:31 | * | luis_ quit (Read error: Connection reset by peer) |
10:34:32 | leorize | is there even an async ssl serve? |
10:34:36 | leorize | server* |
10:35:09 | * | jasper quit (Quit: Page closed) |
10:35:43 | * | luis_ joined #nim |
10:35:50 | xace | last time i checked: no |
10:35:54 | enthus1ast | you can also wrap an async socket in ssl yes |
10:38:38 | enthus1ast | when i get the example code we tried yesterday i'll open an issue |
10:39:52 | * | al_ quit (Quit: al_) |
10:41:43 | * | mal`` quit (Quit: Leaving) |
10:41:56 | * | seerix quit (Ping timeout: 272 seconds) |
10:45:06 | * | luis_ quit (Ping timeout: 272 seconds) |
10:51:55 | * | seerix joined #nim |
10:51:56 | * | mal`` joined #nim |
11:21:52 | * | neceve joined #nim |
11:36:33 | * | rnrwashere joined #nim |
11:40:43 | * | rnrwashere quit (Ping timeout: 248 seconds) |
11:42:41 | * | laaron- joined #nim |
11:46:07 | * | laaron quit (Ping timeout: 256 seconds) |
11:53:15 | FromGitter | <kaushalmodi> Araq: the Nim doc PR passes after your last suggested change to keep `--out:` in the test too: https://github.com/nim-lang/Nim/commit/27f1c0d3d509712ec2e700ffa5f110bb69df5c51 |
11:56:09 | * | lritter joined #nim |
11:56:13 | * | natrys joined #nim |
11:58:34 | * | joshbaptiste quit (Ping timeout: 272 seconds) |
12:12:44 | FromGitter | <alehander42> Zevv: i've heard criticism that the windows kernel doesn have efficient fork |
12:16:14 | * | al1 joined #nim |
12:21:50 | * | luis_ joined #nim |
12:23:55 | * | al1 quit (Quit: WeeChat 2.4) |
12:24:02 | * | alexander92 joined #nim |
12:24:59 | * | joshbaptiste joined #nim |
12:35:46 | * | narimiran joined #nim |
12:36:36 | Zevv | who needs fork |
12:36:50 | Zevv | 99% of the forks are followed by exec |
12:39:08 | alexander92 | yeah |
12:40:12 | alexander92 | buit |
12:40:15 | alexander92 | its composability |
12:40:31 | alexander92 | the fact that you have two "functions" and the one is used rarely alone |
12:40:36 | alexander92 | doesnt mean its a bad idea |
12:40:51 | alexander92 | you can just have a fork_exec abstraction which is used most of the time and still keep primitives |
12:41:22 | * | luis_ quit (Ping timeout: 246 seconds) |
12:41:23 | alexander92 | or you mean that it's just not worth it to copy the program: it seems that programs exploit that ability tho |
12:42:34 | * | natrys quit (Ping timeout: 258 seconds) |
12:43:41 | * | natrys joined #nim |
12:54:55 | Zevv | yeah, but usually its just a pita. You need either enough memory to have an actual copy, or your system needs to bluff and hope it will not get busted later on |
12:56:06 | alexander92 | well it depends on the program |
12:56:23 | alexander92 | some cases can afford to just fail/show an "not enough memory" message |
12:59:33 | * | vlad1777d joined #nim |
12:59:35 | Zevv | but when do you do that? the kernel might find out it does not actually have enough memory because it lied to you, it might do so when your code is happily writing something in memory somewhere |
12:59:53 | Zevv | so no nice way to tell you, no system call that can fail and recover |
13:00:08 | Zevv | it's just a bullet through the head and your program is dead |
13:08:48 | alexander92 | yeah makes sense |
13:11:24 | * | vlad1777d quit (Ping timeout: 272 seconds) |
13:19:48 | * | alexander92 quit (Quit: WeeChat 2.4) |
13:19:58 | * | Snircle joined #nim |
13:23:58 | * | laaron- quit (Quit: ZNC 1.7.1 - https://znc.in) |
13:24:45 | * | laaron joined #nim |
13:29:45 | * | luis_ joined #nim |
13:38:06 | shashlick | Nightlies is breaking on 32-bit |
13:41:06 | * | luis_ quit (Ping timeout: 252 seconds) |
13:42:48 | * | SenasOzys joined #nim |
13:49:43 | * | deech joined #nim |
13:50:03 | * | natrys quit (Ping timeout: 245 seconds) |
13:51:22 | deech | Araq, just found the `using` keyword (https://github.com/nim-lang/Nim/blob/devel/tests/modules/treorder.nim#L40). How does it work? |
13:51:48 | FromGitter | <liquid600pgm> it's basically a type "alias" |
13:52:20 | FromGitter | <liquid600pgm> say you have `win: Window` used repetitively throughout your code, you can do `using win: Window` and use just `win` as a proc param |
13:52:47 | FromGitter | <liquid600pgm> like: `proc onClick(win; callback: OnClickCallback)` |
13:52:50 | FromGitter | <alehander42> very useful for some dsl-s imo |
13:53:52 | deech | In the linked example the `using` is declared after usage. If it's just a type alias shouldn't it be before? Also it seems to not just be a type alias but an argument name alias as well. |
13:54:10 | FromGitter | <liquid600pgm> yes, it's an argument name alias |
13:54:13 | FromGitter | <alehander42> i also didnt know you can use it after |
13:54:25 | FromGitter | <liquid600pgm> that's what I meant, I just used the incorrect wording |
13:54:49 | FromGitter | <liquid600pgm> see https://nim-lang.github.io/Nim/manual.html#statements-and-expressions-using-statement |
13:56:23 | deech | The coming after part is confusing me the most, it suggests that I can rebind eg. win: Window to win: int or something and call some proc with that. |
13:59:56 | deech | And are those aliases automatically exported from the module? I guess they would have to be if a function using them is also exported. And do they share the same namespace as functions/bindings etc? |
14:00:40 | FromGitter | <liquid600pgm> those aliases are not exported from the module, they simply replace their usages as proc parameters |
14:02:55 | * | makerj joined #nim |
14:08:37 | Araq | deech: well what can I say? the *test* tests that using can come later thanks to {.experimental: "codeReordering".} |
14:08:57 | Araq | usually you need to write the 'using' before you use it |
14:09:35 | Araq | and you cannot export it because it's just a syntactic shortcut, there is nothing to export for client modules which might not want to use it |
14:10:49 | deech | Araq, Cool, my concern was not the order but whether it can be redefined in another module. Do you know if it plays nice with doc generation? |
14:11:14 | Araq | sadly it doesn't (yet) |
14:11:22 | Araq | it's not hard to fix though |
14:13:13 | deech | Cool! And I just verified that it doesn't clash with let/proc bindings: |
14:13:24 | deech | using a : int |
14:13:32 | deech | proc foo (a) = echo a |
14:13:40 | deech | let a = "some other thing" |
14:13:46 | deech | The above works. |
14:15:19 | deech | Oh this works too! `proc foo(a):typeof(a) = a` Nice! |
14:15:19 | Araq | sure, it only affects parameters. |
14:27:31 | * | rnrwashere joined #nim |
14:34:21 | * | rnrwashere quit (Remote host closed the connection) |
14:36:24 | * | rnrwashere joined #nim |
14:42:11 | * | rnrwashere quit (Remote host closed the connection) |
14:43:48 | * | rnrwashere joined #nim |
14:48:12 | * | rnrwashere quit (Ping timeout: 252 seconds) |
14:54:39 | * | tefter joined #nim |
15:04:25 | * | solitudesf joined #nim |
15:05:18 | * | ng0 joined #nim |
15:08:55 | * | diver joined #nim |
15:09:06 | * | barrett joined #nim |
15:15:56 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
15:16:52 | * | laaron joined #nim |
15:26:28 | FromGitter | <liquid600pgm> why does `cpuTime` not count time in seconds but rather in some strange unit? |
15:26:42 | FromGitter | <liquid600pgm> I can clearly see cpuTime increases slower than epochTime |
15:28:59 | FromGitter | <liquid600pgm> glfw.getTime also counts time in seconds |
15:30:26 | * | diver left #nim (#nim) |
15:33:37 | Zevv | if your cpu sleeps, so does cputime |
15:33:48 | Zevv | use epochTime if you want clock time |
15:34:52 | Zevv | cputime is usually ok for profiling, as it only counts the time spent in your process, not while the os is doing other things |
15:35:26 | FromGitter | <liquid600pgm> ah, that's likely the problem as I'm trying to use cpuTime in a game loop |
15:35:30 | FromGitter | <liquid600pgm> I'll use glfw.getTime then |
15:35:31 | Zevv | dont :) |
15:35:47 | Zevv | or epochTime |
15:36:26 | Zevv | you probably want a monotonic clock. Test what your game does when you set your system clock back or forward one hour |
15:36:50 | FromGitter | <liquid600pgm> I'm just trying to benchmark my game's performance |
15:36:58 | Zevv | ah ok |
15:37:00 | FromGitter | <liquid600pgm> I want reasonably precise measurements, epochTime likely won't give me that precision since it's a float with a large value |
15:37:16 | FromGitter | <liquid600pgm> that means less decimal precision |
15:38:48 | Zevv | you'd be surprised how precise a 64 bit float is, even at this magnitude |
15:41:10 | FromGitter | <liquid600pgm> I'm more used to 32-bit floats (thanks Processing), so I don't know the true precision of a 64-bit float :/ |
15:46:39 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
15:47:07 | * | laaron joined #nim |
15:51:53 | * | rnrwashere joined #nim |
15:56:45 | * | NimBot joined #nim |
15:58:25 | * | uvegbot quit (Ping timeout: 250 seconds) |
16:11:45 | * | deech_ joined #nim |
16:12:00 | * | deech quit (Remote host closed the connection) |
16:13:16 | * | nsf quit (Quit: WeeChat 2.4) |
16:14:56 | * | Vladar_ quit (Remote host closed the connection) |
16:15:32 | shashlick | Leorize can you please see why nightlies 32 bit are failing? I'm out on vacation |
16:17:51 | leorize | xmltree examples failed on assertion error |
16:19:12 | * | Vladar joined #nim |
16:19:12 | * | Vladar quit (Remote host closed the connection) |
16:21:05 | * | solitudesf quit (Read error: Connection reset by peer) |
16:21:23 | * | solitudesf joined #nim |
16:25:34 | * | pydsigner quit (Excess Flood) |
16:25:45 | * | pydsigner joined #nim |
16:27:41 | * | couven92 joined #nim |
16:28:58 | leorize | first completed 32bit travis ci build: https://api.travis-ci.org/v3/job/537189089/log.txt |
16:29:11 | leorize | Araq: ^ please take a look at the failed tests |
16:29:52 | * | barrett quit (Ping timeout: 248 seconds) |
16:31:26 | * | barrett joined #nim |
16:39:08 | * | dddddd quit (Quit: Hasta otra..) |
16:39:16 | shashlick | Cc @narimiran for nightlies |
16:39:26 | * | dddddd joined #nim |
16:41:48 | shashlick | @leorize we should use your brew fix in nightlies too |
16:44:39 | * | uvegbot joined #nim |
16:51:52 | * | uvegbot quit (Ping timeout: 276 seconds) |
17:03:05 | * | poopBot joined #nim |
17:04:39 | * | vlad1777d joined #nim |
17:05:00 | * | pydsigner_ quit (Ping timeout: 244 seconds) |
17:14:46 | * | englosh joined #nim |
17:15:40 | englosh | Is there a thing/keyword in Nim that allows me to write raw C code? |
17:15:52 | FromGitter | <liquid600pgm> there's the inject pragma |
17:16:23 | FromGitter | <liquid600pgm> wait a sec, it's not inject |
17:16:38 | FromGitter | <liquid600pgm> it's emit |
17:16:39 | FromGitter | <liquid600pgm> https://nim-lang.github.io/Nim/manual.html#implementation-specific-pragmas-emit-pragma |
17:17:17 | * | tefter quit (Remote host closed the connection) |
17:18:07 | englosh | ah |
17:21:15 | leorize | thanks to this line our travis has been testing the JS backend :p https://github.com/nim-lang/Nim/blob/devel/testament/categories.nim#L698 |
17:22:46 | * | Vladar joined #nim |
17:26:57 | * | theelous3 joined #nim |
17:29:52 | deech_ | Currently tuple destructuring version of the following let form: `let a,b,c = 10` doesn't work: `let (a,b),(c,d) = (1,2)`. Should we expect it to? |
17:33:31 | * | rnrwashe_ quit (Remote host closed the connection) |
17:35:05 | FromGitter | <matrixbot> `poopBot` hmm |
17:35:14 | * | rnrwashere joined #nim |
17:35:50 | poopBot | @poopBot hmm |
17:43:25 | Araq | deech_: no, it should not |
17:51:42 | * | rnrwashe_ joined #nim |
17:51:42 | * | rnrwashere quit (Remote host closed the connection) |
17:57:36 | Zevv | well, with minimal efforts I'm now able to use some parts of the stdlib in linux kernel space. portability-a-gogo \o/ |
18:01:48 | * | nsf joined #nim |
18:02:34 | Araq | cool! please blog about it! |
18:02:49 | Araq | what gc mode do you use? |
18:04:29 | * | rnrwashe_ quit (Remote host closed the connection) |
18:05:23 | Zevv | none :( |
18:05:54 | Araq | --gc:none ? |
18:06:03 | Araq | at least try --newruntime :P |
18:06:08 | Zevv | That was my goal |
18:06:22 | Zevv | but first I need to get around exceptions. I hope quirky might fit inhere |
18:06:25 | * | englosh quit (Ping timeout: 256 seconds) |
18:06:30 | Zevv | not setjmp/longjmp |
18:07:18 | * | barrett quit (Quit: We out here) |
18:08:27 | Araq | yup |
18:09:03 | * | theelous3 quit (Ping timeout: 248 seconds) |
18:16:33 | Zevv | Why do I see DatInit stuff happening while I don't do anything with hcr? |
18:16:46 | Zevv | stdlib_allocatorsDatInit000 for example |
18:16:49 | * | luis_ joined #nim |
18:17:47 | Zevv | oh wait its not only hcr |
18:19:11 | Araq | well stuff needs to be initialized |
18:19:26 | Zevv | well yeah :) but I was just looking in the wrong places |
18:20:02 | * | rnrwashere joined #nim |
18:20:19 | Zevv | there's no "how to port nim to your average-platform-without-libc" howto |
18:22:17 | Araq | what could it contain? without-libc is a wide, wide field |
18:23:18 | Zevv | no, that was ironic, of course there is no guide. it's just that I get to new suburbs in the nim codebase I never saw before |
18:23:59 | * | luis_ quit (Ping timeout: 252 seconds) |
18:24:18 | * | rnrwashere quit (Remote host closed the connection) |
18:28:17 | * | kapilp quit (Quit: Connection closed for inactivity) |
18:38:03 | * | rnrwashere joined #nim |
18:39:10 | * | Vladar quit (Remote host closed the connection) |
18:40:08 | Zevv | how do I create a const function argument in the C function generated from an .exportc. proc? |
18:41:34 | Araq | I don't think that you can |
18:52:14 | * | rnrwashere quit (Remote host closed the connection) |
18:52:27 | * | rnrwashere joined #nim |
18:52:54 | * | SenasOzys quit (Remote host closed the connection) |
18:53:05 | * | SenasOzys joined #nim |
18:58:00 | * | neceve quit (Read error: Connection reset by peer) |
18:58:29 | * | SenasOzys quit (Remote host closed the connection) |
19:09:59 | * | uvegbot joined #nim |
19:16:33 | * | neceve joined #nim |
19:25:27 | * | rnrwashere quit (Remote host closed the connection) |
19:35:18 | FromGitter | <Varriount> Araq: How hard would it be to implement ordered choice for the scanp macro? https://nim-lang.org/docs/strscans.html#the-scanp-macro |
19:35:48 | FromGitter | <Varriount> Or alternately, can anyone recommend a good library for building a tokenizer/lexer? |
19:37:36 | FromGitter | <Varriount> Zevv: Does your NPeg library use a bytecode/vm approach for generating parsers, or convert everything to actual code constructs? |
19:38:46 | FromGitter | <liquid600pgm> iirc it generates code constructs using macros |
19:39:57 | FromGitter | <liquid600pgm> I remember a discussion between Zevv and Araq, where Araq was explaining to Zevv that PEG parsing can be done using regular flow control |
19:41:43 | Zevv | Varriount: actual code |
19:41:55 | FromGitter | <Varriount> @liquid600pgm Yeah. I've seen two approaches for pattern matching in various languages - generate a mini-vm and use bytecodes to represent parts of the pattern, or translate the pattern to actual code coonstructs. |
19:42:08 | Zevv | what would you like to parse today, sir? |
19:42:34 | Zevv | only until the end of this month Npeg offers one *free* example perser implementation for all new customers! |
19:42:42 | FromGitter | <Varriount> Zevv: I'm improving my command shell for my independent study project (my final university course) |
19:42:49 | FromGitter | <Varriount> https://github.com/Varriount/commandant |
19:43:19 | FromGitter | <Varriount> I was hoping to simplify the tokenization logic. |
19:43:40 | FromGitter | <Varriount> Can it handle streams? |
19:43:43 | Zevv | well, these pegs can probably eaten by npeg without much trouble |
19:43:52 | Zevv | Ha - the streams, that keeps coming back |
19:43:59 | Zevv | it did streams, but I threw it out because of performance |
19:44:08 | Zevv | (drum roll - araq enters) |
19:44:57 | Zevv | there are some issues with streams: for ease of use npeg allows captures which are available as strings |
19:44:58 | FromGitter | <alehander42> LEXBASE COME ON MAN WHAT IS THIS |
19:45:09 | FromGitter | <alehander42> ops this is about streams |
19:45:12 | Zevv | haha |
19:45:26 | Zevv | but in order to capture these strings, I need the source string around at the time the capture closes |
19:46:08 | FromGitter | <Varriount> Zevv: Can't it hold a buffer (or external code hold a buffer)? |
19:46:12 | Zevv | also, my inner loops are only a few instructions. Adding logic for advancing through the stream slowed stuff down considerably |
19:46:19 | FromGitter | <alehander42> varriount looks interest |
19:46:49 | Zevv | basically, its simply string based at this time. Until I figure out how to handle streams effectively |
19:47:14 | Araq | as opposed to lexbase's inner loops that can avoid the "buffer needs refill" check? |
19:47:32 | Araq | no idea how you can know about lexbase and *not* use it :P |
19:47:52 | Araq | as I wrote 10 years ago, "it uses a buffering scheme that I've seen nowhere else" |
19:47:52 | Zevv | lexbase is almost nothing, it's trivial buffering on top of a stream |
19:48:01 | Araq | it is not trivial. |
19:48:11 | Araq | I invented the technique. |
19:48:24 | FromGitter | <liquid600pgm> Araq: I know about lexbase and don't use it for some reason |
19:48:47 | FromGitter | <alehander42> seriously lexbase does sound good but not sure if it fits for the pegs |
19:49:25 | Zevv | I really looked into getting it in, but I didn't get it to fit properly |
19:53:01 | * | rnrwashere joined #nim |
19:53:38 | Zevv | But I would love to be proved wrong |
19:59:21 | FromGitter | <Varriount> Zevv: Are there non-greedy repeat patterns? |
19:59:43 | Zevv | it is a peg, so no |
20:00:42 | Zevv | do you have example or test input for the lexer/parser? |
20:02:01 | FromGitter | <Varriount> Zevv: Yes |
20:02:38 | Zevv | send me some? |
20:05:14 | FromGitter | <Varriount> Zevv: `echo "Hello world @(join "," "this" "that")"` |
20:05:41 | * | clyybber joined #nim |
20:05:41 | FromGitter | <Varriount> Where the test input are all the characters between backticks |
20:08:20 | FromGitter | <Varriount> Though, I am debating whether to follow the bash-style command subshell syntax, where it magicially does the right thing with regards to quotes |
20:10:11 | * | apodo joined #nim |
20:10:45 | Zevv | How is strToken supposed to handle the nested quotes here? |
20:14:21 | * | alumno_ joined #nim |
20:16:10 | FromGitter | <Varriount> Zevv: Hm, good question. |
20:17:04 | Zevv | and where does the @ come in? from what I understand, your example will not match the grammar |
20:17:50 | * | rnrwashere quit (Remote host closed the connection) |
20:19:22 | FromGitter | <Varriount> Oh, sorry, I meant to put `$` |
20:19:22 | * | Snircle_ joined #nim |
20:21:58 | Zevv | I'm sure I don't understand you right. But the string you pasted will not properly match at all. 'echo' will match through start->command->wordToken, but the following quote does not match since there is no way to get to strToken without going through redirectionToken, right? |
20:22:42 | * | Snircle quit (Ping timeout: 272 seconds) |
20:23:14 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
20:24:06 | * | laaron joined #nim |
20:24:42 | FromGitter | <Varriount> Zevv: What are you looking at for reference? parser.nim? |
20:25:01 | FromGitter | <Varriount> Now I'm confused. :/ |
20:25:03 | Zevv | No, your language spec in the readme? |
20:26:36 | Zevv | https://github.com/Varriount/commandant#language |
20:27:14 | FromGitter | <Varriount> Ah, that appears to be an error |
20:27:46 | Zevv | :) |
20:29:58 | FromGitter | <Varriount> Zevv: Currently the lexer attempts to match something like a JSON string, then a regular identifier. |
20:30:36 | FromGitter | <Varriount> (an identifier being consecutive, visible, non-whitespace characters) |
20:31:13 | FromGitter | <Varriount> If an identifier is matched, it then attempts to "specialize" the identifier, checking if it's a redirection operator |
20:31:18 | FromGitter | <Varriount> or something |
20:31:38 | FromGitter | <Varriount> https://github.com/Varriount/commandant/blob/master/commandant/lexer.nim#L224 |
20:32:04 | FromGitter | <Varriount> I'll admit it's not elegant, but it got the job done. |
20:33:57 | Zevv | :) |
20:35:11 | * | rnrwashere joined #nim |
20:35:57 | dom96 | hm, should it be possible to easily convert a set[T] or a HashSet[T] to a seq[T] via the `@` operator? |
20:36:33 | dom96 | I yearn for a one liner to allow me to write: chunk.particles.map(id => game.sim.particles[id]) and get a seq not another set |
20:37:20 | * | arecaceae quit (Remote host closed the connection) |
20:37:39 | * | arecaceae joined #nim |
20:38:19 | Zevv | varriount: ok, the definitions in parser.nim make more sense, but still will not match your example |
20:39:25 | Zevv | dom96: yes, I've been looking for the same for set[T] |
20:39:54 | narimiran | dom96: there is `toSeq` ;) http://ix.io/1K3V |
20:41:07 | dom96 | does it work with HashSet too? |
20:41:22 | dom96 | I did end up using it, but have an items() around it too |
20:41:56 | narimiran | it does |
20:42:12 | narimiran | http://ix.io/1K3W |
20:42:43 | dom96 | cool |
20:42:45 | FromGitter | <Varriount> Zevv: I know. It's a feature I plan to add |
20:43:01 | Zevv | varriount: off to bed, here is a start http://p.zevv.nl/?3544 |
20:46:56 | * | alumno_ quit (Ping timeout: 248 seconds) |
20:51:31 | * | rnrwashere quit (Remote host closed the connection) |
20:52:02 | * | rnrwashere joined #nim |
20:54:20 | * | nsf quit (Quit: WeeChat 2.4) |
20:56:24 | * | narimiran quit (Ping timeout: 268 seconds) |
21:03:49 | * | poopBot quit (Remote host closed the connection) |
21:09:21 | * | rnrwashere quit (Remote host closed the connection) |
21:18:54 | * | rnrwashere joined #nim |
21:24:21 | * | rnrwashere quit (Remote host closed the connection) |
21:25:01 | * | rnrwashere joined #nim |
21:48:02 | * | solitudesf quit (Ping timeout: 252 seconds) |
21:51:29 | * | theelous3 joined #nim |
22:00:24 | * | rnrwashere quit (Remote host closed the connection) |
22:10:09 | * | Kaivo quit (Quit: WeeChat 2.4) |
22:16:10 | * | Kaivo joined #nim |
22:33:36 | * | apodo quit (Ping timeout: 244 seconds) |
22:53:20 | * | lritter quit (Ping timeout: 248 seconds) |
22:54:35 | * | jasper joined #nim |
22:55:16 | * | rnrwashere joined #nim |
22:55:16 | * | rnrwashere quit (Read error: Connection reset by peer) |
22:55:30 | * | rnrwashere joined #nim |
23:03:20 | * | rnrwashere quit (Remote host closed the connection) |
23:13:52 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:24:49 | * | matti_ quit (Quit: Reconnecting) |
23:24:58 | * | matti joined #nim |
23:24:58 | * | matti quit (Changing host) |
23:24:58 | * | matti joined #nim |
23:30:16 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
23:34:25 | * | laaron joined #nim |
23:43:53 | * | clyybber quit (Quit: WeeChat 2.4) |
23:59:00 | * | stefanos82 quit (Remote host closed the connection) |