00:10:01 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
00:12:04 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
00:15:07 | * | vlad1777d quit (Ping timeout: 240 seconds) |
00:20:43 | * | rnrwashere joined #nim |
00:31:19 | * | rnrwashere quit (Remote host closed the connection) |
00:33:06 | * | rnrwashere joined #nim |
00:43:40 | * | abm joined #nim |
00:59:18 | * | solitudesf quit (Quit: ZNC - https://znc.in) |
01:03:47 | * | solitudesf joined #nim |
01:04:56 | * | rnrwashere quit () |
01:18:26 | * | abm quit (Read error: Connection reset by peer) |
01:19:45 | ftsf | what does " Error: usage of 'audioCallback' is a user-defined error" mean? with the line being: audioSpec.callback = audioCallback |
01:24:56 | FromGitter | <Varriount> ftsf: What library is this? |
01:25:18 | FromGitter | <Varriount> Sounds like some code is using the `error` pragma |
01:25:45 | ftsf | setting audioSpec.callback in sdl2_nim: https://github.com/Vladar4/sdl2_nim/blob/master/sdl2/private/audio.nim#L169 |
01:26:52 | * | lf-araujo quit (Ping timeout: 255 seconds) |
01:30:11 | FromGitter | <Varriount> ftsf: What's the full traceback? |
01:30:23 | FromGitter | <Varriount> Or full error message? |
01:30:56 | ftsf | ..\..\nico\nico\backends\sdl2.nim(1047, 26) Error: usage of 'audioCallback' is a user-defined error no traceback |
01:32:17 | ftsf | what does user-defined error mean? |
01:44:16 | FromGitter | <Varriount> It means that an procedure or template was invoked that was decorated with the `error` pragma |
01:49:23 | ftsf | hmm can't find anything with an error pragma =\ |
01:50:25 | ftsf | I guess it must be in the assignment operator |
01:50:59 | * | NimBot joined #nim |
02:21:57 | FromGitter | <gogolxdong> I saw |
02:22:04 | FromGitter | <gogolxdong> (https://files.gitter.im/nim-lang/Nim/yZqA/image.png) |
02:50:37 | * | Cthalupa quit (Ping timeout: 244 seconds) |
02:53:26 | * | Cthalupa joined #nim |
03:02:39 | * | banc quit (Quit: Bye) |
03:25:33 | * | banc joined #nim |
03:52:38 | * | rnrwashere joined #nim |
04:11:14 | FromGitter | <Varriount> ftsf: try turning the verbosity up |
04:11:33 | * | rnrwashere quit (Remote host closed the connection) |
04:30:14 | * | chemist69 quit (Ping timeout: 258 seconds) |
04:31:38 | * | dddddd quit (Remote host closed the connection) |
04:32:16 | * | chemist69 joined #nim |
04:36:43 | FromGitter | <kayabaNerve> @Varriount True devs debug by setting the verbosity to 0 and using a multimeter on their RAM. |
04:39:57 | * | rnrwashere joined #nim |
04:44:43 | * | rnrwashere quit (Remote host closed the connection) |
04:45:21 | * | rnrwashere joined #nim |
06:17:54 | * | arecacea1 quit (Remote host closed the connection) |
06:18:13 | * | arecacea1 joined #nim |
06:22:32 | shashlick | @gogolxdong - might be issues due to non-English setup |
06:45:57 | * | rnrwashere quit (Remote host closed the connection) |
06:53:34 | * | crem1 joined #nim |
06:53:52 | * | skelett1 joined #nim |
06:57:57 | * | spymasterd[m] quit (*.net *.split) |
06:57:57 | * | skelett quit (*.net *.split) |
06:58:00 | * | crem quit (*.net *.split) |
06:58:01 | * | xylef quit (*.net *.split) |
06:58:02 | * | yglukhov[m] quit (*.net *.split) |
06:58:03 | * | deansher quit (*.net *.split) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:00:51 | * | nsf joined #nim |
07:00:58 | * | narimiran joined #nim |
07:01:40 | * | banc quit (Ping timeout: 255 seconds) |
07:03:09 | * | banc joined #nim |
07:04:56 | * | gmpreussner joined #nim |
07:26:17 | * | banc quit (Ping timeout: 245 seconds) |
07:32:29 | * | banc joined #nim |
07:35:36 | FromGitter | <gogolxdong> yeah, the same thought here. |
07:43:42 | * | Trustable joined #nim |
08:15:54 | * | seerix quit (Ping timeout: 252 seconds) |
08:19:09 | ftsf | Varriout, hmm nothing new at higher verbosity levels, i'll try and trim stuff down to a smaller reproduction |
08:21:09 | * | chimez joined #nim |
08:28:18 | * | chimez quit (Quit: chimez) |
08:31:08 | * | seerix joined #nim |
08:43:48 | * | rockcavera quit (Remote host closed the connection) |
08:48:39 | * | Trustable quit (Remote host closed the connection) |
08:52:52 | * | rockcavera joined #nim |
09:04:56 | * | lf-araujo joined #nim |
09:07:01 | * | lf-araujo quit (Remote host closed the connection) |
09:21:22 | * | narimiran quit (Ping timeout: 250 seconds) |
09:27:27 | * | stefanos82 joined #nim |
09:42:23 | * | jjido joined #nim |
09:50:14 | * | Vladar joined #nim |
09:50:34 | Zevv | liquid600pgm and/or Araq, would you have time to listen to and comment on some of my musings? |
09:58:37 | Araq | Zevv: shoot |
09:58:53 | Zevv | https://github.com/zevv/npeg/blob/master/README.md |
09:59:36 | Zevv | I made a lot faster progress on the PEG lib then I expected. PEGs are not constructed from a macro/DSL, but from Nim objects which can be combined with operators. |
09:59:58 | Zevv | The LPEG way. This allows you to create parsers from Nim code, which is pretty flexible |
10:00:20 | Araq | I hate it. |
10:00:23 | Zevv | The PEG patterns get compiled to a very simple row of VM instructions, which are parsed by a tiny machine |
10:00:28 | Zevv | You hate it, I love it, whatever |
10:00:31 | Araq | ;-) |
10:00:56 | Araq | constructing the grammar at runtime is never what I need |
10:01:01 | Zevv | Later on I can provide any kind of macro DSL to construct stuff however you want |
10:01:21 | Zevv | on top of this. Construct from DSL, construct from text, construct from carrot cake, I dont care. |
10:01:36 | Zevv | What I want/need at this time is two things, nto sure if possible: |
10:01:45 | Zevv | - I'd like to get the stuff to compile at compile time into consts |
10:01:55 | Zevv | - I'd like to transliterate the compiled code into Nim |
10:02:19 | Zevv | The first has to do with limitations of the Nim vm, and the second has to do with the fact that I will end up with goto's |
10:03:35 | Zevv | The VM runs non-recursively and does it bookkeeiping on a little stack. Some instructions require the VM to jump around, which I have no clue how to translate to Nim, as we don't have gotos. |
10:03:48 | Araq | yeah, lots of problems, compile the grammar to Nim code, done. I'm tired of the inferior solutions, we have plenty of these already |
10:04:06 | Zevv | So, what would be supirior then |
10:04:08 | Araq | but there is actually an undocumented way to get 'goto' |
10:04:20 | Araq | I forgot how it works but 'lexim' uses it |
10:04:39 | Zevv | ok, that's cool. But still, do you feel my current path leads to something usable? |
10:04:40 | Araq | kind of like 'var pc {.goto.}: int' |
10:05:23 | Araq | no, your current path has been done about 5 times already I never wanted to use the resulting systems |
10:05:46 | Zevv | because of what |
10:05:59 | Araq | here is what you should do: compile the grammar to NimNode in a macro, that's what Nim was built for. |
10:07:02 | Araq | because the result is slower than handwritten code and gives you a bad API where you have case objects/methods etc, pretending you don't know the grammar at compile-time when you always do know. |
10:08:14 | Zevv | I like the API, but that's a matter of taste. The underlying mechanism can still work if I skip the intermediate language of course |
10:08:30 | Zevv | Ok, I feel where you'd like this to go, let me see if I can find out how to get there |
10:08:42 | Araq | listen to me please |
10:08:55 | Araq | PEGs are by their nature already hardly declarative at all |
10:09:22 | * | lf-araujo joined #nim |
10:09:53 | Araq | for example '/*' .* '*/' doesn't match C comment syntax |
10:10:06 | Zevv | sure |
10:10:23 | Araq | that * is literally a simple-minded 'while' loop |
10:10:55 | Araq | / is an ordered choice like 'if' does it |
10:11:51 | Araq | compiling PEGs to Nim constructs is super-straightforward, no need to create a VM, no need to design much an API |
10:12:20 | Zevv | Yeah, well, remember this is the first time I ever do something like this :/ |
10:12:29 | Zevv | So, yes, I'm listeing to you :) |
10:13:14 | Araq | https://nim-lang.org/docs/strscans.html#the-scanp-macro |
10:13:59 | Araq | scanp is pretty bad, I never use it, but it does get the translation process right |
10:14:13 | Zevv | ok, I'll look into that |
10:15:11 | Araq | this is a crucial idea: "The parsing is performed with the help of 3 helper templates that that can be implemented for a custom type." |
10:15:31 | Araq | scanp is bad because it's expression based so you cannot structure the grammar easily |
10:16:11 | Araq | and the inplace bindings 'E -> a' can be hard to read |
10:19:27 | Zevv | I'll do some playing around; Thanks so far - I'll probably get back to you with more at some time. |
10:21:43 | Araq | these 3 helper templates make the macro fully type agnostic, something you don't get with an API |
10:23:02 | Zevv | True |
10:24:41 | Araq | copy 'scanp's implementation, give it a different frontend and then you need one more thing, 'proc' generation so that you can have more than one syntax rule and rules can be recursive |
10:39:10 | * | lf-araujo_ joined #nim |
10:40:16 | * | lf-araujo quit (Ping timeout: 244 seconds) |
10:40:16 | * | lf-araujo_ is now known as lf-araujo |
10:41:02 | * | ng0 joined #nim |
10:44:36 | ftsf | found an interesting thing, initialising a sequence of procs raises type in regards to lock level Error: type mismatch: got <proc (self: Object): bool{.locks: 0.}> but expected 'proc (self: Object): bool{.gcsafe, locks: 0.}' |
10:44:47 | ftsf | but initialising it empty and adding them individually works fine |
10:50:16 | ftsf | x.add([a,b,c]) has the same issues as x = @[a,b,c] |
10:50:30 | ftsf | but x.add(a) x.add(b) x.add(c) is ok |
11:02:09 | * | sealmove joined #nim |
11:02:47 | * | brakmic joined #nim |
11:03:45 | sealmove | hi, Araq: why doesn't nimscript module work in nim secret? |
11:04:53 | Araq | because the REPL is not NimScript |
11:05:02 | sealmove | what exactly is it? :D |
11:05:28 | Araq | ideally the REPL is a REPL for the full Nim language, NimScript is restricted to what the VM supports |
11:06:19 | Araq | ftsf: how strange, can you report it please? |
11:07:03 | sealmove | in theory, is it possible to use compiler components (ast, parser, lexer etc) to construct a "proper" REPL? |
11:07:27 | sealmove | or is there an innate limitation? |
11:07:31 | ftsf | Araq, yep! |
11:12:39 | Araq | we now even have hot-code reloading for the native backend, there is no limit to what the REPL could do |
11:24:06 | sealmove | Araq: what is the state with FFI in nimscript? I saw that you merged some changes 2 weeks ago but wrote that you will disable them later? I also tried using the compiler switch and it didn't work. |
11:25:57 | FromGitter | <BaldEagleX02> I have found a way to debug Nim efficiently in VS Code: https://github.com/pragmagic/vscode-nim/issues/65 |
11:28:09 | sealmove | I know I am late to the party :D but I want to understand what's happening |
11:32:34 | * | deansher joined #nim |
11:34:28 | * | dddddd joined #nim |
11:43:06 | * | nsf quit (Quit: WeeChat 2.4) |
11:46:03 | * | spymasterd[m] joined #nim |
11:46:14 | sealmove | After reading carefully about hot-code reloading, I guess nimscript is becoming completely irrelevant |
11:47:19 | * | yglukhov[m] joined #nim |
11:47:19 | * | xylef joined #nim |
11:50:40 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:51:29 | ftsf | https://github.com/nim-lang/Nim/issues/10817 |
11:52:40 | dom96 | sealmove: it's not. Nimscript is still what is used for configuring Nim and in Nimble files |
11:53:29 | sealmove | @dom96: Sure. I mean it will stay in this niche, and not expand to something more. |
11:54:09 | sealmove | (irrelevant to repls and similar, I meant) |
12:03:55 | sealmove | so is hcr ready to use? |
12:04:13 | dom96 | has gc safety enforcement changes recently? https://github.com/dom96/jester/issues/188 |
12:04:26 | dom96 | *changed |
12:28:36 | * | sz0 quit (Quit: Connection closed for inactivity) |
12:38:05 | * | Trustable joined #nim |
12:40:39 | * | lf-araujo quit (Ping timeout: 244 seconds) |
12:45:35 | * | lf-araujo joined #nim |
13:05:55 | * | natrys joined #nim |
13:06:31 | Araq | dom96: yes, the compiler used to be too lax. but I'm thinking about a switch to mitigate the problem |
13:06:50 | Araq | there is also a simpler solution that so far we overlooked |
13:09:59 | Zevv | scanp lacks ordered choice, which kind of changes the game, right |
13:10:44 | Zevv | hm nevermind, need more time reading up |
13:10:55 | Araq | no, it lacks it because attaching actions to 'or' is flawed |
13:11:39 | Araq | or because I never implemented it, it's not hard to do |
13:12:50 | Zevv | well, that would require adding backtracking up to a certain level |
13:13:25 | Zevv | which is why I called it 'changing the game' |
13:13:53 | Araq | given that * doesn't backtrack either I don't think you need it |
13:14:38 | Zevv | hmm |
13:14:40 | Araq | sure it would be nicer with backtracking but then a really declarative grammar would also be nicer |
13:15:32 | Araq | I would focus on the rules first and that they can be mutually recursive |
13:16:12 | Araq | then you can add the construct 'metaRule = ruleA / ruleB / ruleC' |
13:16:30 | Araq | and if the firstsets of these rules are disjoint you don't need backtracking |
13:16:46 | Zevv | yes, but in real life they are not |
13:16:46 | Araq | that should be the class of LL(1) languages then |
13:17:07 | Araq | LL(1) is widely used in real life. |
13:17:14 | Zevv | Can't parse HTTP or SIP with that |
13:17:28 | Araq | that's news to me |
13:17:47 | Zevv | this is all new to me, so you're probably right |
13:18:22 | Araq | most handwritten recursive descent parsing is naturally LL(1) |
13:18:34 | * | lf-araujo quit (Remote host closed the connection) |
13:19:00 | Araq | c2nim is the only parser I ever wrote that had to use backtracking |
13:20:05 | Araq | you can get fancy and compute the firstsets and report if there is a conflict |
13:21:41 | * | rnrwashere joined #nim |
13:23:29 | FromDiscord | <Zireael> I don't understand - the top-level part is never executed, and if I indent it and/or move to where it's commented out, I get errors |
13:23:29 | FromDiscord | <Zireael> https://cdn.discordapp.com/attachments/371759389889003532/554293246117937152/Code_2019-03-10_14-22-37.png |
13:24:30 | FromDiscord | <Zireael> basically trying to do something like this but in Nim: https://github.com/mozdevs/gamedev-js-tiles/blob/6e25f5a891641cbe4d60bfbbaa11df01ff594add/common.js |
13:24:45 | * | brakmic quit (Remote host closed the connection) |
13:25:14 | FromDiscord | <Zireael> after all, withe core dom module, and the nimble html5_canvas, it ought to work - but I can't even get to the canvas part, I get stuck earlier |
13:25:25 | * | brakmic joined #nim |
13:25:37 | Araq | Zevv: read this http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf page 18 following |
13:26:35 | * | brakmic quit (Remote host closed the connection) |
13:26:52 | * | brakmic joined #nim |
13:27:15 | Zevv | thans |
13:27:16 | Zevv | k |
13:28:23 | * | brakmic_ joined #nim |
13:29:32 | Araq | Zireael: run the compiler from the command line to see what it says, nimsuggest probably doesn't know you use 'nim js ...' |
13:30:53 | Araq | dom96: what do you think about this idea: there is no .gcsafe effect anymore, --threads:on means you cannot use globals with GC'ed memory unless in a ``{.gcsafe.}: body`` block that checks at runtime it runs on the main thread |
13:30:55 | * | brakmic_ quit (Client Quit) |
13:31:18 | * | brakmic quit (Ping timeout: 245 seconds) |
13:32:32 | Araq | the guarantees are in practice identical and we get rid of the .gcsafe annotation everywhere |
13:33:39 | Araq | and don't have to wait until the MM/GC become threadsafe for this, we can do it today. |
13:34:52 | * | brakmic joined #nim |
13:36:04 | dom96 | Araq: That sounds good |
13:36:40 | Araq | any problems with the idea? |
13:36:55 | dom96 | That I'm not sure about :) |
13:37:03 | * | rnrwashere quit (Remote host closed the connection) |
13:37:26 | * | rnrwashere joined #nim |
13:45:17 | * | brakmic_ joined #nim |
13:47:58 | * | brakmic quit (Ping timeout: 245 seconds) |
13:48:34 | dom96 | oh man, recursive dependencies are really killing my productivity here |
13:49:30 | * | rnrwashere quit (Remote host closed the connection) |
13:49:46 | * | rnrwashere joined #nim |
13:53:05 | FromGitter | <Clyybber> Ugh, why is dart code so hard to read... |
13:54:29 | * | rnrwashere quit (Remote host closed the connection) |
13:56:45 | * | rnrwashere joined #nim |
13:57:23 | * | jjido joined #nim |
14:14:04 | * | nsf joined #nim |
14:16:20 | FromGitter | <gogolxdong> How to make svg work in Karax? |
14:18:09 | * | lritter joined #nim |
14:30:32 | FromDiscord | <Zireael> Araq: same error: canvas.nim(90, 14) Error: type mismatch: got <proc (ev: Event){.closure, locks: 0.}> but expected 'proc (event: Event)' |
14:30:38 | * | ofelas joined #nim |
14:30:45 | * | narimiran joined #nim |
14:32:00 | FromDiscord | <Zireael> same thing happens if I try to make the image loading a proc |
14:38:06 | * | abm joined #nim |
14:44:11 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:45:30 | * | jjido joined #nim |
14:50:08 | * | sealmove quit (Quit: WeeChat 2.4) |
14:50:48 | * | brakmic joined #nim |
14:52:26 | Araq | is it the same Event type? |
14:53:26 | * | brakmic_ quit (Ping timeout: 244 seconds) |
14:58:17 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:23:34 | * | vlad1777d joined #nim |
15:32:19 | FromDiscord | <Zireael> yeah |
15:32:27 | FromDiscord | <Zireael> the only thing I change is indentation |
15:33:17 | FromDiscord | <Zireael> I tried to work around this by writing a small js loader class and nim bindings, and I'm having trouble finding Nim equivalent of this: |
15:33:17 | FromDiscord | <Zireael> var Loader = { |
15:33:17 | FromDiscord | <Zireael> images: {} |
15:33:17 | FromDiscord | <Zireael> }; |
15:33:54 | FromDiscord | <Zireael> I have written |
15:33:54 | FromDiscord | <Zireael> ''' type |
15:33:54 | FromDiscord | <Zireael> Loader* = ref object {.importc.} |
15:34:12 | FromDiscord | <Zireael> I have written |
15:34:12 | FromDiscord | <Zireael> ''' type |
15:34:13 | FromDiscord | <Zireael> Loader* = ref object {.importc.} |
15:34:13 | FromDiscord | <Zireael> images {.importc.} ''' |
15:34:33 | FromDiscord | <Zireael> but I'm having trouble finding the correct Nim type so that it maps to {} and not null by default |
15:34:43 | FromDiscord | <Zireael> I have written |
15:34:43 | FromDiscord | <Zireael> ```type |
15:34:43 | FromDiscord | <Zireael> Loader* = ref object {.importc.} |
15:34:44 | FromDiscord | <Zireael> images {.importc.} ``` |
15:35:00 | FromDiscord | <Zireael> I have written |
15:35:00 | FromDiscord | <Zireael> ``` |
15:35:00 | FromDiscord | <Zireael> type |
15:35:00 | FromDiscord | <Zireael> Loader* = ref object {.importc.} |
15:35:00 | FromDiscord | <Zireael> images {.importc.} ``` |
15:35:22 | narimiran | your every edit is another message(s) on irc |
15:35:44 | FromDiscord | <Zireael> I was having trouble with formatting |
15:35:53 | narimiran | https://i.imgur.com/Rg6z5Cu.png |
15:36:10 | FromDiscord | <Zireael> bad irc bot then, sorry 😦 |
15:37:19 | FromDiscord | <Zireael> if it matters, down the line images is used as a images[key] = value kind of a storage |
15:39:03 | FromDiscord | <Zireael> and I can't figure out the Nim equivalent of that - the key is a cstring and the value is... does it matter for the type definition? |
15:55:06 | * | onionhammer1 joined #nim |
15:56:43 | * | onionhammer quit (Ping timeout: 255 seconds) |
16:00:39 | leorize | Zireael: so if I understand this correctly, you'd like to map the images[key] = value of javascript in Nim? |
16:05:10 | FromDiscord | <Zireael> yeah, and init it to {} instead of null |
16:05:35 | FromDiscord | <Zireael> if it can't be done, I'll make a function on the js side and simply make a proc calling it, but... |
16:06:30 | leorize | `proc `[]=`(a: var <type of image here>; key: cstring; value: <type of value>) = {.emit: "`a`[`key`] = `value`".}` |
16:06:38 | leorize | ^ should be something like that |
16:07:02 | leorize | then you can do images[key] = value in Nim |
16:07:16 | leorize | ```proc `[]=`(a: var <type of image here>; key: cstring; value: <type of value>) = {.emit: "`a`[`key`] = `value`".}``` |
16:07:28 | leorize | (added more backticks for discord) |
16:07:41 | FromDiscord | <Zireael> nice, and whatt about initializing it to {} instead of null? |
16:08:55 | leorize | I'm not entirely sure since I don't know what is `{}` in javascript |
16:09:16 | leorize | but my guess is that you could make an init proc in Nim for that |
16:09:49 | FromDiscord | <Zireael> {} in javascript is an empty array |
16:11:05 | leorize | {.emit.} all the way :P |
16:11:33 | Araq | stop hacking around, understand the compiler's error message and make your code compile |
16:11:57 | Araq | gist it and ask for help on the forum. or here. |
16:12:28 | FromGitter | <liquid600pgm> actually, `{}` in JS is an empty object (so an empty `Table[K, V]` in Nim) |
16:12:44 | Araq | most likely is you imported two different dom.nim modules so that Event is two different types and the compiler doesn't tell you |
16:15:38 | FromGitter | <syhpoon> Hey guys, ⏎ I'm trying to understands concepts in Nim and it seems like one cannot use a variable of a concept type as an object field: ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5c853829b4b6ef7bc888ede6] |
16:18:28 | leorize | concept is a kind of generic, so I guess you Wut type would have to be |
16:18:43 | leorize | ```type Wut[T: MyT] = ref object[x: MyT]``` |
16:22:07 | * | abm quit (Ping timeout: 240 seconds) |
16:23:21 | FromGitter | <syhpoon> okay, now it compiles successfully. Thank you leorize! |
16:39:22 | FromGitter | <liquid600pgm> wow, I didn't know it was possible to use concepts like that |
16:39:32 | FromGitter | <liquid600pgm> good to know |
16:49:54 | * | rnrwashere quit (Remote host closed the connection) |
16:53:00 | * | rnrwashere joined #nim |
16:55:03 | * | rnrwashere quit (Remote host closed the connection) |
17:26:47 | * | jjido joined #nim |
18:21:15 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:25:15 | * | ryukoposting joined #nim |
18:26:21 | ryukoposting | okay, so I successfully generated type definitions for each of the hundreds of "shapes" used by ec2 from its JSON spec |
18:27:46 | ryukoposting | the problem is, those types form a massive tree of dependencies. I was hoping that, by turning all the objects (or as the AWS spec calls them, structures) into ref objects, the compiler could resolve all the types by just saying "oh this is a pointer" |
18:29:49 | ryukoposting | but it seems like the compiler is still trying to traverse this massive, probably cyclic tree of type declarations. The JSON parser works like a champ, around 24000 lines of JSON parsed in under 2 seconds on my machine, but the compiler sits there for an unknown amount of time (I let it run for 5 minutes once) after the AST is already generated. I know it's sitting in the type declarations because if I remove |
18:29:51 | ryukoposting | those, then the hangup disappears |
18:31:27 | ryukoposting | so the big bottleneck is resolving type dependencies, and that's a big problem bc it's /really/ slow, like I said |
18:32:21 | ryukoposting | the compiler eats up more RAM than usual (~175MB) once it has 20000 lines worth of JSON tokens sitting in memory, but it's not overwhelmingly slow |
18:33:04 | ryukoposting | I was hoping someone with some insight into how the compiler resolves types might be able to offer me some advice on how to generate code that will play nice with it |
18:33:14 | * | jjido joined #nim |
18:35:18 | * | jjido quit (Client Quit) |
18:41:19 | FromGitter | <liquid600pgm> yay, `if` statements/expressions are now a thing in rod |
18:43:57 | FromGitter | <liquid600pgm> now `loop`, `for`, `while` and `loop...while` |
18:44:32 | * | brakmic quit (Remote host closed the connection) |
18:44:59 | FromGitter | <liquid600pgm> fortunately primitive loops (`loop, `while` and `loop...while`) are quite simple as they don't make use of an iterator protocol |
18:48:18 | * | jjido joined #nim |
18:50:00 | * | brakmic joined #nim |
18:51:07 | ryukoposting | liquid600pgm nice |
18:51:26 | * | jjido quit (Client Quit) |
18:58:19 | * | nsf quit (Quit: WeeChat 2.4) |
19:01:20 | FromGitter | <liquid600pgm> by the way, which do you think is better? `do...while`, or `loop...while`? |
19:01:52 | ryukoposting | what would a loop while be, |
19:02:07 | * | jjido joined #nim |
19:02:09 | FromGitter | <liquid600pgm> they're semantically the same, the only difference is the first keyword |
19:02:20 | ryukoposting | the exact same thing as a do-while? I'd just stuck to traditional semantics unless changing it would offer a noteworthy benefit |
19:02:49 | * | jjido quit (Client Quit) |
19:03:19 | FromGitter | <liquid600pgm> I'm afraid `do...while` would clash with `do` blocks (they're blocks that evaluate to a single expression) in terms of readability |
19:03:48 | ryukoposting | that's fair |
19:11:46 | Araq | ryukoposting, type sections are processed in 3 phases but afaik there is no recursion or complex graph processing involved |
19:12:03 | Araq | so it should scale linearily |
19:17:15 | * | narimiran_ joined #nim |
19:19:45 | * | narimiran quit (Ping timeout: 268 seconds) |
19:24:55 | * | jjido joined #nim |
19:26:50 | * | jjido quit (Client Quit) |
19:28:34 | shashlick | Araq: can you please share why you think removing the vm from nimble is a good idea? My logic is that it allows nimble to evolve separately, inherits all nimscript improvements with zero effort and simplifies the code. But curious to hear your thoughts. |
19:29:42 | shashlick | Also curious if nimble files should be compiled rather than run thru nimscript - will allow all sorts of possibilities |
19:30:11 | Araq | well I'm out of words. Couldn't say it better than you did. |
19:30:38 | Araq | I also agree on compiling Nimble files, it's an interesting idea |
19:31:24 | Araq | though it might be bad for "security". Better run 40K LOC Bash scripts aka ./configure instead ;-) |
19:31:33 | * | stefanos82 quit (Remote host closed the connection) |
19:32:05 | shashlick | The only obstacles is setting an entry point - today, I'll have to modify the file every time you run a command |
19:32:47 | shashlick | Well I could have a generic main function too never mind |
19:32:53 | dom96 | Compiling will be far too slow |
19:33:18 | shashlick | But only need to compile once, then it can be cached |
19:33:23 | Araq | dom96, I think it can be cached |
19:33:47 | dom96 | Removing the VM from Nimble is a good idea because having two separate binaries that implement the same things is a bad idea and leads to tons of incompatibilities |
19:35:27 | shashlick | So assuming we can compile, where should we cache the binary |
19:36:16 | Araq | $home/.cache/nimblebins/$projectname/ |
19:36:36 | dom96 | lol, might just be crazy enough to work |
19:36:41 | shashlick | Same applies to generated nims file if that's the route we take |
19:36:44 | dom96 | but no, just put the binary beside the .nimble file |
19:39:03 | shashlick | it could conflict with the project binary |
19:40:22 | dom96 | not if you name it `projname.nimble.cache` |
19:41:24 | * | abm joined #nim |
19:42:01 | shashlick | on windows that will be projname.nimble.cache.exe |
19:42:10 | shashlick | reminds me of java 🙂 |
19:47:29 | * | krux89 joined #nim |
19:48:30 | dom96 | Doesn't have to be AFAIK, does Windows refuse to execute binaries that don't have the .exe extension? |
19:50:18 | shashlick | i'll try |
19:50:48 | shashlick | meanwhile, can you please update choosenim's init.sh with the latest in git so that it starts working in git bash on windows |
19:51:02 | Araq | give the exe its extension ffs |
19:51:16 | Araq | I hate extensionless files, it's like dynamic typing |
19:51:57 | dom96 | shashlick: done |
19:52:12 | dom96 | Araq: there are two extensions... |
19:52:25 | dom96 | but yeah, alright |
19:52:39 | shashlick | yay it works |
19:53:16 | shashlick | now need to get a new choosenim binary uploaded - 0.3.2 is so old |
19:54:28 | * | vlad1777d quit (Ping timeout: 250 seconds) |
19:55:30 | ryukoposting | thanks Araq |
19:56:03 | * | vlad1777d joined #nim |
19:56:55 | shashlick | dom96: to post a new choosenim, need a new tag - do you plan on bumping to 0.4.0 |
20:00:43 | shashlick | great I need more init.sh fixes to run on travis - https://travis-ci.org/genotrance/feud/builds/504399550 |
20:02:33 | FromDiscord | <hkg> anybodoy is using vscode nim extension? |
20:03:05 | FromDiscord | <hkg> 'cause, I'm having a weird error. `No 'nim' binary could be found in PATH environment variable` |
20:03:09 | FromDiscord | <hkg> but nim is in path |
20:03:38 | FromGitter | <Varriount> dom96: Technically you can execute binaries without the exe extension, however you would have to do it through the CreateProcess API call |
20:04:33 | FromGitter | <Varriount> Most Windows programs use `.exe` as a filter, rather than relying on the executable permission |
20:04:49 | * | narimiran_ is now known as narimiran |
20:05:18 | narimiran | hkg: wild guess, you added nim to path in .bashrc, and you use some other shell? |
20:07:04 | FromDiscord | <hkg> I'm on windows |
20:07:29 | narimiran | then "have you tried to turning it off and on again" :D |
20:07:53 | FromDiscord | <hkg> yeah |
20:13:48 | FromDiscord | <hkg> idk what's wrong, it was working properly before |
20:14:37 | narimiran | i just checked and nim plugin (unlike some other similar plugins) doesn't have an option to manually provide path to nim binary.... |
20:15:07 | narimiran | and i'm not on windows so i cannot help you, sorry |
20:15:43 | FromGitter | <liquid600pgm> was `generic` a keyword in older versions of Nim? |
20:15:46 | * | Trustable quit (Remote host closed the connection) |
20:16:14 | * | jjido joined #nim |
20:18:34 | * | jjido quit (Client Quit) |
20:23:25 | FromDiscord | <hkg> what the- |
20:23:44 | FromDiscord | <hkg> every nim file is gone |
20:24:17 | FromDiscord | <hkg> 4 files in the entire *nim* directory |
20:24:21 | FromDiscord | <hkg> what happened |
20:24:31 | FromGitter | <liquid600pgm> what did you use to install Nim? |
20:24:57 | FromDiscord | <hkg> i manually installed it |
20:25:01 | FromGitter | <liquid600pgm> also, what's your Windows version? |
20:25:16 | FromDiscord | <hkg> win 10, of course |
20:25:52 | FromGitter | <liquid600pgm> I mean, which build (eg. 1803, 1809, or something) |
20:26:16 | FromDiscord | <hkg> https://i.imgur.com/hIbBpfk.png |
20:26:55 | FromDiscord | <hkg> and it's working now |
20:27:09 | FromGitter | <liquid600pgm> hm, strange |
20:27:23 | FromDiscord | <hkg> I've reinstalled nim |
20:27:26 | FromDiscord | <hkg> so it's working |
20:27:34 | * | xet7 joined #nim |
20:27:36 | rayman22201 | hkg, windows has a "system" Path and a "user" path. which one is set? |
20:27:50 | FromGitter | <liquid600pgm> I thought this might be related to the Windows deleting files bug, but you're on an Insiders build, so probably not the case |
20:28:02 | FromDiscord | <hkg> both of them were set |
20:28:10 | rayman22201 | depending on how the path was set, it could have been a temporary change. |
20:28:18 | rayman22201 | Windows is weird about that |
20:28:24 | rayman22201 | Reinstalling worked? |
20:28:28 | FromDiscord | <hkg> but, the problem was that |
20:28:32 | FromDiscord | <hkg> all files from nim directory |
20:28:34 | FromDiscord | <hkg> disappeared |
20:29:17 | rayman22201 | weird |
20:31:08 | ryukoposting | hey dom96, so when nimble installs a package, how would I make it install miscellaneous resource files required by the package? |
20:32:32 | solitudesf | https://github.com/nim-lang/nimble#optional installDirs, InstallExt, installFiles |
20:34:36 | ryukoposting | noice, thanks |
20:38:07 | * | jjido joined #nim |
20:38:36 | ryukoposting | ok this is kinda strange |
20:39:53 | ryukoposting | i have a call to a macro that returns a fairly large chunk of AST, and putting a static: echo at the end of the file where the call is made, it never gets there even though a debug message right at the end of the macro prints just fine |
20:41:22 | ryukoposting | i think the type declaration block is just that massive, I'll have to change up how I approach it |
20:43:06 | FromGitter | <Varriount> ryukoposting: I have an update for that signing code. |
20:43:15 | ryukoposting | nice |
20:43:23 | FromGitter | <Varriount> It's going to need future updates to support S3 |
20:43:31 | ryukoposting | I was having issues getting it to compile, missing calls to some external modules |
20:45:19 | ryukoposting | TIL declaring 1447 codependent types in a single type block is a bad idea |
20:49:12 | FromGitter | <Varriount> You need nimcrypto |
20:49:24 | FromGitter | <Varriount> That should be it though |
20:49:45 | ryukoposting | okay, I'll give it another shot |
20:50:34 | FromGitter | <Varriount> In total, it's two files, and nimcrypto |
20:53:33 | * | brakmic quit (Ping timeout: 244 seconds) |
20:55:03 | * | brakmic_ joined #nim |
20:57:57 | * | vlad1777d quit (Ping timeout: 245 seconds) |
20:59:51 | * | vlad1777d joined #nim |
21:01:54 | * | rnrwashere joined #nim |
21:10:39 | FromGitter | <kayabaNerve> Someone say Nimcrypto? |
21:11:02 | FromGitter | <kayabaNerve> :P |
21:12:07 | FromGitter | <kayabaNerve> Great lib. I hated how it required devel back in the 0.17 days though... |
21:13:10 | * | brakmic_ quit (Remote host closed the connection) |
21:13:31 | * | abm quit (Ping timeout: 255 seconds) |
21:15:13 | * | brakmic joined #nim |
21:17:36 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:18:00 | * | brakmic quit (Remote host closed the connection) |
21:18:09 | * | brakmic joined #nim |
21:23:45 | * | rnrwashere quit (Remote host closed the connection) |
21:26:05 | * | Vladar quit (Remote host closed the connection) |
21:28:49 | * | narimiran quit (Ping timeout: 255 seconds) |
21:31:05 | * | thomasross quit (Remote host closed the connection) |
21:31:17 | * | thomasross joined #nim |
21:34:11 | * | vlad1777d quit (Ping timeout: 268 seconds) |
21:46:15 | * | natrys quit (Quit: natrys) |
21:50:41 | ryukoposting | how would i resolve paths to resource files for an installed nimble package? I can get it to put all the JSON files where I want them, but then I can't make a file path to them |
21:52:09 | FromGitter | <danielecook> Has anyone compiled a shared lib and loaded it into R? |
21:53:08 | ryukoposting | i have not |
21:53:20 | ryukoposting | not too familiar with R, probably can't help sorry :( |
21:54:00 | FromGitter | <danielecook> well, it may be something obvious b/c I'm not too familiar with compiled languages |
21:56:13 | FromGitter | <danielecook> Was testing with this: ⏎ ⏎ ```dyn.load("test.so")``` [https://gitter.im/nim-lang/Nim?at=5c8587fd293ac75db586aeb6] |
21:56:23 | FromGitter | <danielecook> but it can't find the function |
21:57:12 | ryukoposting | did you disable name mangling for the function you want to call? |
21:57:40 | FromGitter | <danielecook> Probably not. I do not know what that is! Coming from a python background here |
21:58:07 | * | Jesin quit (Quit: Leaving) |
21:59:33 | * | rnrwashere joined #nim |
22:03:03 | * | Jesin joined #nim |
22:05:06 | ryukoposting | oh, alright so inside a shared lib there are little strings that correspond with the functions exposed by the library |
22:05:43 | FromGitter | <danielecook> ok - so can you use a pragma to ensure they don't get mangled? |
22:05:51 | FromGitter | <danielecook> I was trying a few... .extern, .exportc |
22:06:06 | ryukoposting | in C, those strings are just whatever you named the function. However, in Nim, C++, Rust, and a lot of other languages, you can have many functions with the same name, so they get mangled so there's no collisions |
22:06:07 | * | rnrwashere quit (Remote host closed the connection) |
22:06:18 | ryukoposting | it's exportc, if I recall |
22:07:24 | ryukoposting | if you're using nimble, you'll want to be set up as a library project |
22:07:41 | ryukoposting | if you're just calling the nim compiler directly, you'll want to add the flag --app:lib |
22:08:17 | FromGitter | <danielecook> ok - yep looks like I got that |
22:08:44 | FromGitter | <danielecook> I think the issue might be something I am missing on the R side at this point because it can't find any 'symbols' in the library |
22:10:16 | FromGitter | <danielecook> Also nim can't seem to find the `.byref` pragma |
22:10:39 | FromGitter | <danielecook> test.nim(1, 42) Error: attempting to call undeclared routine: 'byref' |
22:11:08 | * | rnrwashere joined #nim |
22:12:02 | ryukoposting | can you show me how you're using it? |
22:12:30 | FromGitter | <danielecook> ```proc add5(s: int): int {.exportc: "add5", byref.} = ⏎ return s + 5``` [https://gitter.im/nim-lang/Nim?at=5c858bce1fae6423ca640256] |
22:12:48 | ryukoposting | what are you trying to do |
22:13:02 | FromGitter | <danielecook> heh, ok, so R is a slow language |
22:13:17 | FromGitter | <danielecook> So i'm just trying to figure out how to call a function I compile in Nim from within R |
22:13:31 | FromGitter | <danielecook> Just as a starting point, I've written this function `add5` which adds 5 to a number |
22:13:33 | ryukoposting | byref isn't a valid pragma to use on the return type of a pragma |
22:13:45 | FromGitter | <danielecook> right - ok I see...good point |
22:13:48 | ryukoposting | or shoot, on a function signature sorry lol |
22:14:12 | FromGitter | <danielecook> so the reason I was doing that to begin with is that the R FFI requires things to be passed by reference |
22:14:29 | ryukoposting | if you want to pass by reference, you can do something like proc add5(s: var int), probably the easiest way to do it while you're still getting used to the lang |
22:14:57 | FromGitter | <danielecook> ok i'll give that a go real quick |
22:16:32 | dom96 | Maybe you want a `ptr int`? |
22:17:10 | FromGitter | <danielecook> hmm, I think the hold up here is probably more on the R side of things |
22:17:29 | FromGitter | <danielecook> If anyone is curious here is the background: http://adv-r.had.co.nz/C-interface.html#calling-c ... This may not be something I can figure out in an evening |
22:17:56 | FromGitter | <danielecook> Looks like the examples call some R-lib headers |
22:18:17 | FromGitter | <danielecook> However, I'll not that R also can run C++ code through a sep. interface |
22:18:32 | ryukoposting | oi dom, is it possible to get a relative file path at compile time |
22:18:53 | FromGitter | <danielecook> in any event, helpful start really appreciate it |
22:18:56 | ryukoposting | im trying to get it to successfully find some json resource files once nimble has installed it |
22:19:07 | ryukoposting | no problem, best of luck |
22:20:01 | Araq | https://github.com/nim-lang/RFCs/issues/142 |
22:24:24 | * | brakmic quit () |
22:38:21 | * | jjido joined #nim |
22:44:43 | * | rnrwashere quit () |
23:00:28 | shashlick | dom96: why is this not working? https://travis-ci.org/genotrance/feud/builds/504445781 - I added -y to the install command |
23:04:46 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:14:23 | Araq | aww no feedback for https://github.com/nim-lang/RFCs/issues/142 |
23:14:31 | ryukoposting | one sec |
23:14:38 | Araq | you all like .gcsafe :-) |
23:14:38 | ryukoposting | you're not gonna like me for this |
23:14:47 | ryukoposting | i like .gcsafe lol |
23:14:51 | ryukoposting | i actually like it a lot |
23:15:16 | Araq | wow, never heard that before, from anybody |
23:15:40 | Araq | but I like you for it, it's always good to hear different opinions |
23:16:05 | ryukoposting | it's actually one of my favorite things about the language |
23:17:02 | ryukoposting | i think i've had to use a gcsafe block once, ever |
23:18:09 | ryukoposting | I kinda hint at this in the post, but it's not like Nim code looks like Rust, with unsafe {} blocks littered across the entire codebase |
23:18:53 | ryukoposting | I can see the argument, though. Sometimes it can be a little finicky. I think it's for the best though |
23:19:53 | * | catgirl joined #nim |
23:20:02 | Araq | well what wins the debate for me is this: if you don't use globals the language is as safe as before, but without the .gcsafety idea |
23:20:10 | catgirl | hey |
23:20:35 | Araq | and if you use globals you're made to think about "oh this can only run on the main thread, ok" |
23:21:10 | Araq | much more ergonomic than writing .gcsafe to your callback types and forward declarations |
23:21:27 | Araq | hi catgirl |
23:21:32 | ryukoposting | I suppose. Sometimes there just isn't a good way around it, and I guess my approach to that would just be to remove global variables |
23:21:44 | ryukoposting | but I'm not the language designer lol |
23:21:58 | Araq | that's what the stdlib does, it replaced effectively all globals by .threadvar |
23:22:10 | ryukoposting | hello catgirl |
23:22:40 | Araq | so yeah, we use .threadvar much more often but still have to add .gcsafe to please the effect system god. |
23:23:45 | ryukoposting | my worry is just that there's really only two combinations that keep Nim as safe as it is now- either leave gcsafe and threadvar alone, or remove gcsafe and make threadvar the default |
23:24:14 | ryukoposting | the latter would probably be "safer" overall, but it would be kind of awkward and inconsistent with the rest of the language |
23:28:54 | * | rnrwashere joined #nim |
23:29:03 | * | rnrwashere quit (Remote host closed the connection) |
23:34:20 | shashlick | Struggling with choosenim tty issues |
23:34:30 | shashlick | What a bore |
23:34:48 | ryukoposting | wat |
23:34:52 | ryukoposting | what's wrong? |
23:35:07 | shashlick | https://travis-ci.org/genotrance/feud/builds/504445781 |
23:35:20 | shashlick | Trying to get the init script working on Travis in windows |
23:42:19 | ryukoposting | looks like a call to choosenim in init.sh is missing a -y |
23:42:31 | ryukoposting | had the same thing happen on my gitlab CI scripts a few times |
23:45:36 | shashlick | I am editing the init file on Travis |
23:45:43 | shashlick | I've printed the output as well |
23:45:50 | shashlick | It does get updated |
23:47:14 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:47:21 | ryukoposting | weird |
23:47:57 | ryukoposting | i know almost nothing about travis, so I can't really comment on that part |
23:53:31 | shashlick | Ya debugging remotely is a royal pain |
23:55:29 | ryukoposting | yeah, thankfully my pipelines are pretty straightforward lol |
23:55:47 | ryukoposting | pretty much use the same container for everything, then just call "nimble test" and let it do its thing |
23:56:00 | shashlick | Windows? |
23:56:06 | ryukoposting | linux |
23:56:12 | ryukoposting | devuan, specifically |
23:56:18 | * | lritter quit (Ping timeout: 245 seconds) |
23:56:54 | shashlick | Neat, I've been trying to expand choosenim init to work on windows so have to run into some roadblocks |
23:57:01 | shashlick | Can't be easy now can it |
23:57:41 | ryukoposting | the most consistent way I've found to support windows is to not support windows, then tell people to install MSYS2 |
23:58:40 | shashlick | Well this is in msys |
23:58:46 | shashlick | That's what Travis runs |
23:58:56 | ryukoposting | which is crappy, but the dumb, weird little inconsistencies are not worth dealing with for any project that isn't specifically targeting windows |
23:59:05 | ryukoposting | oh interesting, i did not know that |
23:59:24 | shashlick | Well I think I should try bash instead of sh |
23:59:33 | ryukoposting | probably yeah |
23:59:36 | shashlick | Who knows if that's different on windows |
23:59:59 | shashlick | Don't know why choosenim didn't see the -y though |