00:03:44 | * | skrzyp quit (Ping timeout: 255 seconds) |
00:04:49 | * | smt quit (Ping timeout: 248 seconds) |
00:06:42 | * | Guest56145 joined #nim |
00:11:49 | * | leorize joined #nim |
00:23:06 | * | skrylar joined #nim |
00:25:12 | * | CodeVance_ is now known as CodeVance |
00:25:47 | skrylar | CodeVance, low level bullshit for gtk3 |
00:26:27 | * | Guest56145 quit (Ping timeout: 240 seconds) |
00:26:32 | CodeVance | ? Yeah and ? What's new ? |
00:26:55 | CodeVance | Are you trustable-code ? |
00:27:11 | CodeVance | Cause he's the only one I know who's working with gtk |
00:28:56 | * | Guest56145 joined #nim |
00:29:35 | * | kunev quit (Ping timeout: 240 seconds) |
00:30:15 | * | kunev joined #nim |
00:32:23 | skrylar | no, but i want to write gui applications for some things and i'd rather not use a language that is painful |
00:32:48 | skrylar | used vala for some stuff. it's okay-esque. had issues getting some stuff working |
00:34:10 | CodeVance | So your using a gtk wrapper? |
00:34:56 | * | Pisuke joined #nim |
00:35:34 | * | MyMind quit (Ping timeout: 260 seconds) |
00:35:47 | * | Guest56145 quit (Ping timeout: 256 seconds) |
00:37:46 | * | Guest56145 joined #nim |
00:55:59 | * | Guest56145 quit (Ping timeout: 260 seconds) |
00:57:14 | * | Guest56145 joined #nim |
01:04:39 | * | vivus joined #nim |
01:37:15 | FromGitter | <brentp> any ideas why the `%` gets called in nim 0.17.2 and not in 0.18.0 |
01:37:27 | FromGitter | <brentp> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aefadd697e5506e04a143d5] |
01:39:18 | skrylar | glib/gtype.nim(1, 2) Error: module names need to be unique per Nimble package; module clashes with /home/skrylar/Code/ngtk3/gobject/gtype.nim |
01:39:24 | skrylar | But it's not a nimble package '_' |
01:40:07 | skrylar | since when did the compiler become a nanny |
01:41:09 | * | sz0 quit (Quit: Connection closed for inactivity) |
01:42:46 | * | CodeVance quit (Quit: Leaving) |
01:45:57 | * | CodeVance joined #nim |
02:05:10 | * | dddddd quit (Remote host closed the connection) |
02:18:32 | * | Guest56145 quit (Quit: WeeChat 2.0.1) |
02:19:12 | * | Guest48411 joined #nim |
02:19:41 | * | sz0 joined #nim |
02:21:37 | * | Guest48411 quit (Client Quit) |
02:22:19 | * | skrzyp1 joined #nim |
02:23:19 | * | skrzyp1 quit (Client Quit) |
02:24:03 | * | skrzyp1 joined #nim |
02:25:03 | * | skrzyp1 quit (Client Quit) |
02:25:45 | * | skrzyp joined #nim |
02:35:43 | * | rockcavera joined #nim |
03:31:49 | * | vivus quit (Quit: Leaving) |
03:44:39 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:53:07 | * | endragor joined #nim |
04:12:37 | * | skrylar quit (Remote host closed the connection) |
04:15:03 | * | MypMyp joined #nim |
04:22:16 | * | MypMyp quit (Quit: Leaving.) |
04:30:57 | * | CodeVance quit (Read error: Connection reset by peer) |
04:43:12 | * | leorize quit (Quit: WeeChat 2.1) |
05:08:11 | * | miran joined #nim |
05:11:52 | * | nsf joined #nim |
05:27:02 | * | CodeVance joined #nim |
05:33:49 | * | CodeVance quit (Quit: Leaving) |
06:03:03 | * | xet7 quit (Ping timeout: 255 seconds) |
06:03:39 | * | xkapastel quit (Quit: Connection closed for inactivity) |
06:05:21 | * | miran quit (Ping timeout: 248 seconds) |
06:14:03 | * | leorize joined #nim |
06:25:59 | * | xet7 joined #nim |
06:28:16 | * | brainpro1 joined #nim |
06:29:45 | * | arecaceae quit (Remote host closed the connection) |
06:29:51 | * | brainproxy quit (Ping timeout: 240 seconds) |
06:30:11 | * | arecaceae joined #nim |
06:57:05 | * | MypMyp joined #nim |
06:57:46 | * | xet7 quit (Read error: Connection reset by peer) |
07:04:43 | * | yglukhov joined #nim |
07:30:27 | * | CodeVance joined #nim |
07:30:45 | * | yglukhov_ joined #nim |
07:34:24 | * | yglukhov quit (Ping timeout: 260 seconds) |
07:41:51 | * | PMunch joined #nim |
07:44:51 | PMunch | skrylar, did you try genui? |
07:46:09 | PMunch | https://github.com/PMunch/gtkgenui or https://github.com/PMunch/gtk3genui |
07:48:59 | PMunch | gogolxdong, did you see my latest updates to protobuf? |
07:49:13 | PMunch | @gogolxdong ^ |
07:49:31 | PMunch | Hmm, has the gitter bot stopped adding @ to usernames? |
07:50:30 | FromGitter | <gogolxdong> sure. |
07:50:42 | FromGitter | <gogolxdong> I wonder how to make it support js. |
07:52:28 | FromGitter | <gogolxdong> I'm stuck at parsing protobuf binary data through websocket on the frontend side. |
07:53:06 | PMunch | It should support JS out of the box I think |
07:53:17 | FromGitter | <mratsim> @skrylar, Still have to had recurrent neural net to Arraymancer anyway ;) |
07:54:11 | FromGitter | <gogolxdong> There are some issues of protobuf.js which prevents the whole thing working. |
07:54:40 | * | CodeVance quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org) |
07:54:44 | FromGitter | <gogolxdong> What do you mean out of the box , compiled with nim js complains copyMem something. |
07:55:39 | PMunch | Hmm |
07:56:44 | PMunch | From the re module of all places.. |
07:57:27 | PMunch | But it doesn't tell me where it's imported from.. |
07:57:35 | FromGitter | <gogolxdong> yes. |
07:58:34 | PMunch | Aaah, it's from combparser |
07:58:38 | PMunch | But it's not used |
07:58:40 | PMunch | Hold on |
07:59:35 | FromGitter | <gogolxdong> Have you removed combparser already? |
08:02:03 | PMunch | Removed? |
08:02:36 | FromGitter | <gogolxdong> How to you get rid of combparser ? I remembered it's full of generic transformation. |
08:03:12 | FromGitter | <gogolxdong> which you said would replace it because of string copy. |
08:04:15 | FromGitter | <gogolxdong> You mean copyMem is not used? |
08:04:16 | PMunch | Yeah it's pretty slow because of the string copy stuff. I kinda want to see if I can speed it up though |
08:04:40 | PMunch | Well, combparser imports pegs and the re module in order to have matchers with them. But that's not used for protobuf |
08:05:06 | PMunch | So I just have to throw in a "when not defined(js)" or something like that around those two calls |
08:05:29 | FromGitter | <gogolxdong> clear. |
08:08:50 | planetis[m] | what happened to the combinatorics package? |
08:11:10 | PMunch | Combinatorics package? |
08:11:29 | * | MypMyp quit (Quit: Leaving.) |
08:13:46 | planetis[m] | yes |
08:14:34 | FromGitter | <mratsim> this one? https://github.com/barnybug/nim-combinatorics |
08:15:18 | planetis[m] | oh thought it was in bitbucket |
08:16:04 | planetis[m] | https://bitbucket.org/nimcontrib/nimcombinatorics/src |
08:16:13 | PMunch | Hmm, is there a way to "detect" if a procedure is called on compile-time or runtime? |
08:16:16 | planetis[m] | ?? |
08:16:22 | planetis[m] | and there is none on nimble |
08:20:30 | * | sendell joined #nim |
08:22:06 | FromGitter | <mratsim> @PMunch, if they have NimNode or {.compiletime.} in their signature they are called at compile-time |
08:22:17 | FromGitter | <mratsim> otherwise at runtime |
08:22:35 | FromGitter | <alehander42> maybe something like `when defined(<something only true on compiletime>)` |
08:22:40 | FromGitter | <mratsim> Visual check can be done in the generated C, compile-time proc do not appear |
08:23:12 | FromGitter | <alehander42> but yeah that wouldnt work |
08:23:17 | FromGitter | <alehander42> the when thing |
08:24:16 | * | MypMyp joined #nim |
08:26:00 | PMunch | Hmm, can you define two procs, one with compileTime and one without? |
08:26:24 | PMunch | I want to call staticRead on compile-time and readFile on runtime |
08:31:08 | * | Vladar joined #nim |
08:31:24 | FromGitter | <mratsim> staticRead is always compiletime |
08:31:38 | PMunch | Yeah I know |
08:31:53 | FromGitter | <mratsim> do they need to have the same name? |
08:32:49 | FromGitter | <mratsim> Maybe you can pass a static[bool] flag and when foo: staticRead else: readFile? |
08:33:35 | PMunch | But I have a procedure I want to be able to call both on compile-time and on runtime on the C target and only compile-time on JS target. In it I need to read a file. This works fine on the C backend using readFile as Nim is able to see it and use it on compile-time no problem. But when I try to run it on the js target it fails because it doesn't know about readFile |
08:35:13 | FromGitter | <mratsim> I didn’t work with the JS backend enough to help you on that :/ |
08:38:16 | FromGitter | <alehander42> can u define a runtime readFile for the js backend and make it do whatever you want (like error msg or something) |
08:41:23 | PMunch | Hmm, I guess I could |
08:46:25 | * | xet7 joined #nim |
08:46:56 | PMunch | Hmm, internal error: (filename: "vmgen.nim", line: 1475) |
08:47:00 | PMunch | That can't be good.. |
08:48:46 | FromGitter | <alehander42> can you share a snippet |
08:51:07 | PMunch | Not really.. |
08:51:29 | PMunch | The error occurs on the line that starts the protobuf parsing macro |
08:51:37 | PMunch | And it's ~2000 lines.. |
08:51:56 | FromGitter | <alehander42> hahaha i see |
08:52:57 | PMunch | Holy shit, I think I need to get back into GUI programming. Just checked the page hit counter on my web-page and my post on "Cross-platform GUIs and Nim macros" is by far the most populer with 22319 views! |
08:53:03 | FromGitter | <alehander42> :D |
08:53:34 | FromGitter | <alehander42> is the js support working otherwise |
08:53:57 | FromGitter | <alehander42> oh I have to read it then |
08:54:07 | PMunch | Well, I have no idea if it works or not |
08:54:14 | PMunch | Never really tried it until now.. |
08:59:37 | * | MypMyp quit (Quit: Leaving.) |
09:07:54 | * | MypMyp joined #nim |
09:09:05 | * | MypMyp quit (Client Quit) |
09:13:58 | * | leorize quit (Ping timeout: 265 seconds) |
09:14:27 | * | leorize joined #nim |
09:17:40 | * | MypMyp joined #nim |
10:00:31 | * | leru_ joined #nim |
10:02:34 | * | leorize quit (Ping timeout: 260 seconds) |
10:04:50 | leru_ | Hi, I just wanted to compile my code on Windows, but I get this error: https://pastebin.com/EZuRdzEc |
10:06:05 | FromGitter | <leruu> Please use my gitter handle, if you know a solution. Thanks! |
10:06:12 | * | leru_ quit (Quit: Page closed) |
10:09:12 | PMunch | Araq, any idea what could generate this: Error: internal error: (filename: "vmgen.nim", line: 1475, column: 22) |
10:09:21 | PMunch | Trying to compile protobuf on the JS target |
10:10:08 | FromGitter | <mratsim> @leruu seems like a bug, you should report it on the tracker with a snippet to reproduce |
10:10:18 | FromGitter | <mratsim> especially if it works on linux/mac |
10:14:43 | FromGitter | <leruu> @mratsim The "funny" thing is, the error even shows up, when I try to compile an empty file |
10:16:03 | FromGitter | <mratsim> It’s probably an issue on your Nim install, Appveyor (windows testing) is green at the moment |
10:16:23 | FromGitter | <mratsim> Try using choosenim? https://github.com/dom96/choosenim#windows |
10:19:06 | FromGitter | <leruu> No, just the default install from https://nim-lang.org/install_windows.html |
10:22:04 | * | xet7 quit (Quit: Leaving) |
10:22:11 | FromGitter | <leruu> Oh, sorry |
10:22:31 | FromGitter | <leruu> Didn't read correctly. I was distracted |
10:22:36 | FromGitter | <leruu> Will try |
10:24:58 | * | yglukhov_ quit (Remote host closed the connection) |
10:25:33 | * | yglukhov joined #nim |
10:30:04 | * | yglukhov quit (Ping timeout: 268 seconds) |
10:33:50 | * | yglukhov joined #nim |
10:35:33 | FromGitter | <gogolxdong> @PMunch what is your GUI project? |
10:51:46 | * | dddddd joined #nim |
10:53:14 | * | MypMyp quit (Quit: Leaving.) |
10:55:37 | FromGitter | <dom96> @leruu your C and Nim compiler's architectures don't match. That's your problem. |
10:55:58 | FromGitter | <dom96> You've got a 32 bit C compiler and a 64bit Nim compiler or vice versa. |
10:57:00 | PMunch | @gogolxdong, The one I wrote about was my GenUI macro for wxWidgets |
10:59:14 | * | noonien joined #nim |
11:00:16 | FromGitter | <gogolxdong> What the difference with nimx? |
11:00:50 | PMunch | Well nimx only draws to a canvas |
11:01:02 | PMunch | wxWidgets uses the native GUI toolkit on each platform |
11:07:29 | FromGitter | <gogolxdong> Doesn't compile. |
11:08:19 | FromGitter | <gogolxdong> Does native GUI toolkit mean performant? |
11:09:38 | FromGitter | <gogolxdong> Can we use it to make a browser? |
11:15:24 | PMunch | What doesn't compile? |
11:15:37 | PMunch | Native means both performant and properly integrated on the target platform |
11:15:50 | FromGitter | <gogolxdong> https://github.com/PMunch/wxnim |
11:16:03 | PMunch | So on Windows it will use Win32, on OSX it will use Cocoa (or whatever it's called), and on Linux it will use Gtk |
11:16:19 | PMunch | Do you have wxWidgets installed? |
11:16:24 | PMunch | What error do you get? |
11:16:28 | * | MypMyp joined #nim |
11:17:03 | FromGitter | <gogolxdong> first is `Error: the overloaded () operator has to be enabled with {.experimental: "callOperator".}` |
11:17:14 | FromGitter | <gogolxdong> then is overloaded 'getMode' leads to ambiguous calls |
11:30:43 | PMunch | Seems to work better on 0.17.0 |
11:32:36 | FromGitter | <gogolxdong> Doesn't matter ,AFAICS ,it's a candidate. |
11:33:05 | PMunch | Candidiate? |
11:33:43 | FromGitter | <gogolxdong> to make browser. |
11:39:35 | planetis[m] | Regarding the string and seq changes, is it considered ok not to initiate with newSeq? |
11:40:07 | FromGitter | <krux02> planetis: yes at least it should. |
11:40:18 | FromGitter | <krux02> I still found cases where it was required though |
11:40:24 | FromGitter | <krux02> (on the vm) |
11:40:29 | FromGitter | <krux02> (nimvm) |
11:42:06 | planetis[m] | Yes i think i also had an illegal storage access but can reproduce it now |
11:44:43 | planetis[m] | I wonder if it will result in better code or not. |
11:46:00 | planetis[m] | (Meaning safety - readability not performance) |
11:53:12 | FromGitter | <krux02> I think it will result in better code. |
11:53:32 | FromGitter | <krux02> this init for seq types with length os zero is a bit pointless to me. |
11:53:55 | * | leorize joined #nim |
11:53:59 | FromGitter | <krux02> especially for types with members that have seq members |
11:54:34 | FromGitter | <krux02> I my code all that init fucntions did was initializing seq members |
11:54:52 | FromGitter | <krux02> now that I don.t need to do it anymore, I can the init functions entirely. |
11:55:10 | FromGitter | <krux02> I forgot the word "omit" |
12:06:50 | * | Vladar quit (Quit: Leaving) |
12:08:08 | * | MypMyp quit (Quit: Leaving.) |
12:08:22 | * | xkapastel joined #nim |
12:11:08 | dddddd | gogolxdong, I'd love to see a dillo-based nim browser (FLTK) |
12:11:20 | planetis[m] | Good point. On the other hand im 'afraid' to not init seqs since it might produce illigal access |
12:11:46 | * | xet7 joined #nim |
12:12:30 | FromGitter | <krux02> dillo? |
12:12:44 | dddddd | https://www.dillo.org/ |
12:13:03 | FromGitter | <krux02> planetis: you should be able to just omit the initSeq |
12:13:08 | FromGitter | <krux02> when it doesn't work it is a bug |
12:13:17 | FromGitter | <krux02> can't guarantee though that it is bug free |
12:13:23 | FromGitter | <krux02> Nim has quite a few bugs |
12:13:35 | FromGitter | <narimiran> planetis: i would say - don't initialize them as much as possible, so if it produces illegal access in some situation - report that so it can be fixed ASAP |
12:15:53 | planetis[m] | :p so I can test them too |
12:16:21 | FromGitter | <krux02> dillo looks like a 90s browser |
12:17:13 | planetis[m] | More importantly: is newSeqUninitialized affected by these changes? |
12:17:24 | FromGitter | <narimiran> @krux02 so it would go nicely with the current nim forum? :P |
12:18:56 | planetis[m] | krux02: probably bc it is from 90s xD |
12:19:41 | FromGitter | <krux02> so it is a dinosaur that is left over from the 90s |
12:20:08 | FromGitter | <krux02> I shouldn't complain I use emacs as my editor and that is a dinosaur left over from the 80s |
12:20:59 | * | MypMyp joined #nim |
12:22:56 | dddddd | dillo has versions this century :P |
12:23:12 | * | Vladar joined #nim |
12:23:32 | * | kier quit (Ping timeout: 268 seconds) |
12:24:28 | * | couven92 joined #nim |
12:26:44 | FromGitter | <mratsim> @planetis[m] I don’t think newSeqUnitialized is affected. |
12:28:09 | FromGitter | <krux02> what is thats |
12:28:41 | * | kier joined #nim |
12:28:54 | FromGitter | <mratsim> https://github.com/nim-lang/Nim/blob/master/lib/system.nim#L751-L760 |
12:29:26 | FromGitter | <mratsim> I’m wondering why it’s implemented like that instead of like this btw: ⏎ ⏎ https://github.com/mratsim/Arraymancer/blob/00ab694ab86a4bf642e59306db8f1ee33fff66b4/src/private/sequninit.nim#L15-L17 |
12:29:37 | PMunch | gogolxdong, got it working fine on 0.18.0 |
12:29:47 | PMunch | Seems to be some devel stuff breaking it |
12:31:46 | * | gokr joined #nim |
12:35:17 | * | MypMyp quit (Quit: Leaving.) |
12:35:22 | * | Hycryon joined #nim |
12:35:58 | * | Hycryon quit (Remote host closed the connection) |
12:36:24 | * | Hycryon joined #nim |
12:36:54 | * | Snircle joined #nim |
12:38:31 | * | athenot joined #nim |
12:47:15 | * | MypMyp joined #nim |
12:49:31 | FromGitter | <gogolxdong> You've always got quick hand. love you |
12:50:05 | FromGitter | <narimiran> ummm, that's what she said? |
13:02:15 | * | Ieatnerds joined #nim |
13:03:06 | * | thor77_ joined #nim |
13:03:58 | * | BlaXpirit joined #nim |
13:05:55 | * | Sargun_ joined #nim |
13:05:55 | * | nuxdie joined #nim |
13:06:26 | * | hogeland joined #nim |
13:08:52 | * | endragor quit (Remote host closed the connection) |
13:09:18 | * | def-- joined #nim |
13:09:21 | * | Araq_ joined #nim |
13:09:33 | * | MonsterAbyss_ joined #nim |
13:09:34 | * | mwbrown_ joined #nim |
13:09:38 | FromGitter | <leruu> Can anyone tell me what's the best setting for MinGW 64bit for Nim? Threads "posix" or "win32" and Exception "seh" or "sjlj"? |
13:11:08 | * | Hycryon quit (*.net *.split) |
13:11:08 | * | sendell quit (*.net *.split) |
13:11:08 | * | nuxdie_ quit (*.net *.split) |
13:11:08 | * | oprypin quit (*.net *.split) |
13:11:08 | * | mwbrown quit (*.net *.split) |
13:11:08 | * | thor77 quit (*.net *.split) |
13:11:08 | * | def- quit (*.net *.split) |
13:11:08 | * | ofelas quit (*.net *.split) |
13:11:08 | * | MonsterAbyss quit (*.net *.split) |
13:11:09 | * | hogeland_ quit (*.net *.split) |
13:11:09 | * | Araq quit (*.net *.split) |
13:11:09 | * | Sargun quit (*.net *.split) |
13:11:12 | * | BlaXpirit is now known as oprypin |
13:11:13 | * | def-- is now known as def- |
13:11:43 | * | mwbrown_ is now known as mwbrown |
13:13:21 | * | MypMyp quit (Quit: Leaving.) |
13:16:20 | dom96 | leruu: just pick the defaults |
13:16:35 | FromGitter | <data-man> @leruu: https://stackoverflow.com/questions/29947302/meaning-of-options-in-mingw-w64-installer ⏎ https://stackoverflow.com/questions/15670169/what-is-difference-between-sjlj-vs-dwarf-vs-seh ⏎ https://stackoverflow.com/questions/17242516/mingw-w64-threads-posix-vs-win32 |
13:16:37 | dom96 | definitely not "posix" |
13:17:46 | * | ofelas joined #nim |
13:19:59 | FromGitter | <leruu> "just pick the defaults", "definitely not "posix"", posix is default :D |
13:20:20 | * | MypMyp joined #nim |
13:20:24 | FromGitter | <gogolxdong> @PMunch Did you push? |
13:21:02 | dom96 | leruu: lol, then I don't know :) |
13:21:05 | PMunch | No, there were no changes |
13:22:48 | PMunch | If you've got wxWidgets installed properly and run "nim cpp -r controlgallery" in the examples/genuimacro directory using Nim 0.18.0 it should work |
13:23:33 | * | MypMyp quit (Client Quit) |
13:25:53 | FromGitter | <gogolxdong> I'm afraid it doesn't compile for 0.18.1 in linux neither 0.18.0 in windows. |
13:26:28 | PMunch | Errors? |
13:26:30 | FromGitter | <gogolxdong> `nim.cfg(3, 7) Error: invalid directive: 'endif'` for windows 0.18.0 i386 |
13:26:34 | PMunch | 0.18.1? |
13:28:31 | FromGitter | <leruu> @data-man thanks. I've alredy read similiar posts. Sound to me like I just shouldn't use gcc under Windows at all. Probably just going with vcc, since it's supported |
13:28:47 | * | MypMyp joined #nim |
13:28:55 | dom96 | leruu: Nim ships with MINGW already, why are you installing it yourself? |
13:29:44 | PMunch | gogolxdong, hmm. Strange, you can just remove the last @end and replace the @endif with an @end |
13:32:42 | FromGitter | <data-man> @leruu: I don't know why you're so decided. GCC works perfectly under Windows. |
13:35:39 | leorize | hi, is it possible to have a nimscript file as the compiler global configuration file (similar to /etc/nim.cfg)? |
13:36:43 | FromGitter | <leruu> @dom96 I didn't know. It told me there is no gcc.exe, so I installed it |
13:37:39 | dom96 | leruu: You might be interested in trying out choosenim, should make the installation easy for you |
13:37:41 | FromGitter | <gogolxdong> @PMunch I have installed windows installer and the header files locate in C:\wxWidgets-3.1.1\include, how do I specify the include path in windows? |
13:39:45 | PMunch | See the readme :) |
13:40:47 | * | sendell joined #nim |
13:40:50 | PMunch | There's a section on how to make it work which includes the flag for the location of those files |
13:41:17 | FromGitter | <leruu> @dom96 I installed choosenim, but it didn't help. Probably becaus of my default installation? I'll try to reinstall everything |
13:41:38 | dom96 | yes, choosenim will find whatever gcc you have installed |
13:41:41 | dom96 | and use it |
13:41:49 | dom96 | even if the version/arch is wrong |
13:42:16 | shashlick | Leruu, what steps did you follow |
13:42:45 | FromGitter | <leruu> 1) run choosenim |
13:42:51 | FromGitter | <leruu> 1) compile prog.nim |
13:42:54 | FromGitter | <leruu> 1) no gcc was found |
13:44:23 | shashlick | I mean before choosenim |
13:44:26 | * | PMunch quit (Quit: Leaving) |
13:45:14 | FromGitter | <leruu> I just installed the default Nim from https://nim-lang.org/install_windows.html |
13:45:42 | FromGitter | <leruu> I did this before moving to Linux some time ago. Worked just fine with Sublime back then |
13:46:24 | * | PMunch joined #nim |
13:49:42 | FromGitter | <gogolxdong> mingw32-make -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release no makefile.gcc |
13:51:58 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af059fd6f9af87e044bf068] |
13:55:36 | shashlick | leruu: so you extracted which zip? 32-bit or 64-bit? how did you install mingw, etc. |
14:00:44 | FromGitter | <gogolxdong> How to rollback 0.18.1 to 0.18.0? |
14:00:54 | * | leorize quit (Ping timeout: 256 seconds) |
14:02:04 | shashlick | how have you installed nim gogolxdong |
14:02:47 | * | vivus joined #nim |
14:04:20 | * | MypMyp quit (Ping timeout: 255 seconds) |
14:04:26 | FromGitter | <leruu> Ok, I did it. Just wiped off nim completely, redownloaded the default 64 bit files. Added them to path. Now it's working as expected. Well, a bit slow, but I guess that's because of windows |
14:05:14 | * | miran joined #nim |
14:05:44 | FromGitter | <krux02> @gogolxdong I am always on the git repo and if I need an older version I just checkout that older version. when it fails to compile I redownload the c sources for the bootstrapping compiler. |
14:09:38 | PMunch | @gogolxdong, easiest is just to use choosenim |
14:12:09 | FromGitter | <gogolxdong> Does choose nim work for linux ? windows doesn't compile I'm switching to linux and rollback. |
14:13:02 | PMunch | I use Linux and choosenim works just fine :) |
14:15:03 | * | PMunch quit (Quit: Leaving) |
14:15:37 | * | leorize joined #nim |
14:17:23 | * | PMunch joined #nim |
14:29:36 | FromGitter | <gogolxdong> Basically knows how to switch version, didn't make any compilation progress in contrast. |
14:32:14 | FromGitter | <gogolxdong> Choosenim is indeed the most convenient for switching version. |
14:35:23 | FromGitter | <gogolxdong> windows compilation error is above, linux compilation error is `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` |
14:49:45 | FromGitter | <krux02> I use Linux and I use git to choose a nim version |
14:49:47 | FromGitter | <krux02> works nice |
14:52:25 | shashlick | is it possible to get clipboard contents cross-platform with ni |
14:52:27 | shashlick | nim |
14:55:33 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
14:57:41 | PMunch | You could wrap/copy this: https://github.com/jtanx/libclipboard |
15:01:21 | dom96 | ugh, just spent an hour wrapping libsass, when a wrapper already existed... https://github.com/zacharycarter/nim-sass |
15:01:26 | dom96 | Add your packages to Nimble guys! |
15:13:24 | shashlick | dom96: did you try nimgen? :) |
15:14:12 | * | leorize quit (Quit: WeeChat 2.1) |
15:14:21 | shashlick | PMunch: thanks - looks like a good candidate to wrap using nimgen |
15:15:59 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:19:01 | * | sleepyqt joined #nim |
15:19:12 | * | max3 joined #nim |
15:20:58 | shashlick | dom96: actually https://github.com/genotrance/nimgen/issues/2 |
15:26:08 | dom96 | I just used c2nim :) |
15:26:54 | * | Araq_ is now known as Araq |
15:27:32 | Araq | dom96: nimble should also search github |
15:31:13 | * | gokr quit (Ping timeout: 248 seconds) |
15:32:31 | * | thor77_ is now known as thor77 |
15:39:57 | * | PMunch quit (Ping timeout: 240 seconds) |
15:43:57 | * | athenot joined #nim |
15:46:38 | * | rokups joined #nim |
15:48:49 | * | Trustable joined #nim |
15:56:21 | shashlick | dom96, Araq: tissue is now more useful for general nim issue management, run with "tissue -n -v issueid" and it will detect snippet and run locally with verbose output |
15:56:36 | shashlick | -n is to skip checking for compiler crash, so helps debug general issues too |
16:00:00 | * | Vladar quit (Quit: Leaving) |
16:09:29 | * | sendell quit (Remote host closed the connection) |
16:18:19 | * | jrbrt joined #nim |
16:19:03 | * | nsf quit (Quit: WeeChat 2.1) |
16:26:38 | * | MypMyp joined #nim |
16:28:32 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:31:49 | * | CodeVance joined #nim |
16:53:13 | * | athenot joined #nim |
16:57:51 | * | MypMyp quit (Quit: Leaving.) |
17:16:36 | FromGitter | <brentp> what am I doing wrong here? |
17:16:45 | FromGitter | <brentp> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af089fc40f24c43045cc3ee] |
17:17:05 | FromGitter | <brentp> error is: ```t.nim(11, 13) Error: cannot instantiate Data ⏎ got: <type int, type float64> ⏎ but expected: <T: SomeNumber, U: SomeNumber> ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5af08a10f2d2d537046d79c8] |
17:25:37 | dom96 | Good question |
17:25:40 | dom96 | Seems like a possible bug |
17:28:02 | miran | btw, what is the difference between `[T: SomeNumber]` and `[SomeNumber]`? because i've used the latter, and i see most people use the former.... |
17:29:11 | FromGitter | <brentp> @dom96 thanks. I thought mabye I was doing something wrong. shall I open an issue? |
17:29:34 | dom96 | brentp: I think so, I might be missing something though |
17:32:57 | FromGitter | <brentp> ok. |
17:36:25 | FromGitter | <narimiran> changing `Data` to only one type works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af08e986d98e53e045bf939] |
17:41:00 | * | DarkArctic joined #nim |
17:48:08 | * | gokr joined #nim |
17:56:28 | FromGitter | <brentp> yes. but I need 2 types. |
17:56:38 | FromGitter | <brentp> or more, actually |
17:57:33 | FromGitter | <narimiran> i expected at least this to work, but it doesn't: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5af0938c97e5506e04a43291] |
18:00:01 | * | PMunch joined #nim |
18:00:31 | * | MypMyp joined #nim |
18:03:35 | FromGitter | <brentp> seems to be the nested object, eh? |
18:05:35 | * | rokups quit (Quit: Connection closed for inactivity) |
18:06:43 | miran | i'll post this example under your issue |
18:07:55 | PMunch | Hmm, what's the rationale of introducing BackwardsIndex for [0 .. ^1] |
18:07:58 | subsetpark | miran: My understanding is that the latter won't have the semantics you probably expect. [T: SomeType | SomeOtherType] is generic speak for 'this function is generic across all types T, as long as T is SomeType or SomeOtherType'. So if you only have [Foo], whatever it is, then I believe it's acting like `T` in the previous example - not like `SomeType`. That is, it's just a variable bound to any type that code |
18:07:59 | subsetpark | needs to be generated for |
18:08:54 | subsetpark | It could be that if `Foo` happens to be the name of a type, then it is taken to mean [T: Foo] - but I hope not |
18:09:05 | * | gokr quit (Ping timeout: 248 seconds) |
18:09:11 | miran | subsetpark: thanks for the detailed explanation! |
18:09:51 | subsetpark | Any time |
18:10:06 | miran | i have looked, i have this: `proc count*[SomeNumber](start: SomeNumber)` |
18:12:29 | FromGitter | <krux02> that seems a lot like a bug |
18:12:48 | FromGitter | <krux02> If you leave out the :SomeNumber then it will work |
18:13:48 | miran | subsetpark: ...and now i see that it doesn't work as i expected it to work - i can pass a char to it. |
18:14:17 | miran | changing to `[T: SomeNumber]` solves the problem |
18:14:47 | FromGitter | <krux02> @brentp this works http://ix.io/19Hc |
18:15:32 | miran | krux02: yeah, only one type works |
18:15:46 | FromGitter | <brentp> yes @narimiran had same example, but I need T and U to (be able to) differ |
18:15:49 | FromDiscord | <awr> `proc count*(start :SomeNumber)` can also work, depending on how you use it |
18:16:55 | FromDiscord | <awr> i'm confused by what you're talking about. do you need disparate types that are all of the class SomeNumber? |
18:16:56 | FromGitter | <krux02> @brentp I removed the some number restriction, but does that solve your problem? |
18:17:20 | FromGitter | <krux02> awr: I would guss two different types that are both a number type |
18:17:26 | FromGitter | <krux02> that is my interpretation |
18:18:05 | FromDiscord | <awr> when you do a single generic parameter that type is considered "constant" across the whole area |
18:18:21 | FromGitter | <krux02> but to be honest I don't see the point in this example at all. I guess it is just some trying out the language and finding what works and what doesn't |
18:18:40 | FromGitter | <brentp> @krux02 I would want, for example to have element be of type int and data of float64. |
18:18:50 | FromGitter | <brentp> I have a real use-case, not just trying to break things. |
18:19:03 | FromDiscord | <awr> however if you use the type classes directly without explicating a generic parameter, iirc it will create a unique generic parameter for each "instance" of the type |
18:19:25 | FromGitter | <krux02> yea, but what if you remove the limitation of SomeNumber like I did? |
18:19:38 | FromDiscord | <awr> unless you declare multiple params of the same type |
18:19:45 | FromGitter | <krux02> as long as it is not public API it shouldn't clause any problems |
18:20:06 | FromGitter | <brentp> @krux02 in your example, you still can't mix float with int U and T must be same type. |
18:20:17 | FromGitter | <krux02> @brentp really? |
18:20:41 | FromGitter | <brentp> @krux02 yes |
18:20:52 | miran | krux02: you oversimplified the problem :) |
18:20:58 | FromDiscord | <awr> so i think it works like `foo(a, b: SomeNumber)` is `foo[T: SomeNumber](a, b: T)` and `foo(a: SomeNumber, b: SomeNumber` is `foo[T, U: SomeNumber](a: T, b: U)` |
18:21:02 | FromDiscord | <awr> i think so anyway |
18:21:05 | FromGitter | <krux02> you are right I copied the wrong code |
18:21:05 | miran | in the original one @brentp had [T, U] |
18:21:06 | FromGitter | <krux02> sorry |
18:21:53 | miran | awr: indeed it is so! thanks for the help! i think the first version looks the best, i'll use that |
18:22:03 | FromGitter | <krux02> http://ix.io/19Hf |
18:22:05 | miran | @awr ^ |
18:22:13 | FromGitter | <krux02> that one works |
18:22:44 | FromGitter | <brentp> so just remove the constraints? |
18:22:48 | FromGitter | <krux02> yes |
18:23:01 | FromGitter | <krux02> not ideal, but it works and you can go on |
18:23:13 | FromGitter | <krux02> I will make a bug report |
18:23:14 | Araq | sadly generic constraints are super buggy |
18:23:28 | Araq | and even more sadly, I don't know why |
18:23:41 | FromGitter | <krux02> this is my bug report: http://ix.io/19Hg |
18:23:50 | FromGitter | <brentp> @krux02 here is the one I opened: https://github.com/nim-lang/Nim/issues/7794#issuecomment-387153866 |
18:23:52 | miran | krux02: already opened: https://github.com/nim-lang/Nim/issues/7794 |
18:24:09 | FromGitter | <krux02> ah, ok I will post it ther |
18:24:49 | * | Ieatnerds quit (Ping timeout: 260 seconds) |
18:27:29 | FromGitter | <krux02> @brentp why do you box the Element type? |
18:28:04 | FromGitter | <brentp> that's how I found the bug--with nested objects. then realized it wasn't necessary. |
18:28:08 | FromGitter | <krux02> why don't you just take `ref U` or even just `e*: U` |
18:28:09 | FromGitter | <brentp> to reporduce. |
18:28:17 | FromDiscord | <awr> k i did some testing |
18:28:35 | FromDiscord | <awr> any instance of a type class in a function is just considered to be the same type throughout |
18:28:54 | FromDiscord | <awr> if it's not explicitly made generic |
18:29:08 | FromGitter | <krux02> ah ok |
18:29:21 | FromDiscord | <awr> (ofc type classes are implictly generic but you know what i mean) |
18:29:52 | FromDiscord | <awr> so `proc something*(a: SomeNumber, b: SomeNumber)` and `proc something*(a, b: SomeNumber)` are the same |
18:30:14 | * | MypMyp quit (Quit: Leaving.) |
18:32:30 | FromGitter | <krux02> awr: hmm when that is the cause you can write it into the bug report |
18:32:41 | FromGitter | <krux02> that might be good information to find the cause of this bug |
18:33:16 | FromDiscord | <awr> ```nim |
18:33:16 | FromDiscord | <awr> |
18:33:16 | FromDiscord | <awr> import typetraits |
18:33:17 | FromDiscord | <awr> |
18:33:17 | FromDiscord | <awr> when true: |
18:33:17 | FromDiscord | <awr> # compiles |
18:33:17 | FromDiscord | <awr> proc something*[T, U: SomeNumber](a :T, b: U) = |
18:33:19 | FromDiscord | <awr> echo("type `a`:", a.type.name) |
18:33:20 | FromDiscord | <awr> echo("type `b`:", b.type.name) |
18:33:20 | FromDiscord | <awr> else: |
18:33:22 | FromDiscord | <awr> # fails |
18:33:23 | FromDiscord | <awr> proc something*(a, b: SomeNumber) = |
18:33:25 | FromDiscord | <awr> echo("type `a`:", a.type.name) |
18:33:26 | FromDiscord | <awr> echo("type `b`:", b.type.name) |
18:33:28 | FromDiscord | <awr> |
18:33:29 | FromDiscord | <awr> something(2'f32, 2'i32) |
18:33:30 | FromDiscord | <awr> ``` |
18:37:26 | FromGitter | <krux02> awr: well that became a mess on gitter |
18:37:43 | FromGitter | <krux02> if you use ix.io I could actually copy paste it |
18:38:23 | FromDiscord | <awr> wait how did it look on gitter? |
18:40:12 | FromDiscord | <awr> https://glot.io/snippets/f0tlczy9it |
18:41:59 | FromGitter | <krux02> well to me that is supposed to work like that. |
18:42:25 | FromDiscord | <awr> yeah i was wondering if this is |
18:42:29 | FromGitter | <krux02> awr: when you have a generic types "Foo[T]" then you can just reuse the name |
18:42:29 | FromDiscord | <awr> desired behavior or not |
18:42:41 | FromGitter | <krux02> yea I guess so |
18:43:07 | FromGitter | <krux02> the documentation could be better though |
18:44:35 | miran | wait, why is awr's example "supposed to work like that"? |
18:44:50 | miran | what's wrong with `proc something*(a, b: SomeNumber)`? |
18:45:34 | miran | oooooh, because of int and float |
18:45:48 | miran | i didn't see that parameters are of different type |
18:46:04 | FromDiscord | <awr> if you use the same typeclass it's assumed to be the same type everywhere |
18:46:29 | FromDiscord | <awr> unless you make it very clear in the generic parameters that they can be disparate types |
18:47:38 | FromDiscord | <awr> glot io needs syntax highlighting for nim |
18:48:16 | FromDiscord | <awr> it's the only online text file thing i know that supports nim compilation |
18:48:31 | FromDiscord | <awr> it's probably an ancient build tho |
18:49:24 | FromDiscord | <awr> it's 0.17.2 |
18:50:07 | FromGitter | <krux02> well I just use my local Nim to compile it |
18:51:45 | * | CodeVance quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org) |
18:51:51 | FromGitter | <krux02> I have a hotkey in emacs that opens /tmp/scratch.nim |
18:51:58 | * | CodeVance joined #nim |
18:52:13 | FromGitter | <krux02> basically my most important hotkey next to compile |
18:52:13 | dom96 | awr: https://play.nim-lang.org |
18:53:35 | FromDiscord | <awr> hm can you show me your elisp code for that? |
18:54:00 | FromDiscord | <awr> also thanks dom96 |
18:54:25 | dom96 | You can use NimBot for code eval too :) |
18:54:33 | dom96 | !eval echo("Hello World!") |
18:54:36 | NimBot | Hello World! |
18:58:03 | CodeVance | dom96, what happens if it makes an error? |
18:58:09 | dom96 | try it |
18:58:27 | CodeVance | !eval echo(@[111,"asdasd"]) |
18:58:28 | NimBot | Compile failed: in.nim(1, 12) Error: type mismatch: got <string> but expected 'int literal(111)' |
18:58:45 | CodeVance | ok so I didn't break anything |
18:58:51 | subsetpark | miran: You can easily put something like `proc foo[A, B](a: A, b: B) =` - A and B can be the same or different |
19:00:47 | miran | subsetpark: thanks, i'll do something like that |
19:02:05 | miran | dom96: how do i add keywords/tags for my nimble package? |
19:02:31 | dom96 | publish it |
19:02:38 | miran | https://github.com/nim-lang/nimble#nimble-search |
19:03:07 | miran | should i have `tags` field in .nimble file? |
19:03:46 | * | crvnkl joined #nim |
19:04:16 | * | Ieatnerds joined #nim |
19:05:32 | miran | dom96: the package is already published, i would like to modify/add keywords/tags |
19:05:54 | dom96 | Modify the packages.json file then |
19:05:59 | dom96 | The .nimble file doesn't contain any tags |
19:12:40 | * | yglukhov_ joined #nim |
19:14:57 | PMunch | Hmm, I'm getting ambiguous call errors when I call a proc that takes either a string or a ref object. Any way to create a proc that matches on nil? |
19:15:17 | * | yglukhov quit (Ping timeout: 255 seconds) |
19:19:53 | * | nsf joined #nim |
19:21:44 | * | crvnkl quit (Quit: Page closed) |
19:22:28 | * | jrbrt quit (Quit: jrbrt) |
19:27:53 | FromGitter | <Varriount> Oh neat, Sublime Text has an update |
19:28:31 | FromGitter | <Varriount> PMunch: Could you post an example of the code? Or at least the procedure declaration? |
19:29:15 | PMunch | http://ix.io/19HQ |
19:30:16 | FromDiscord | <awr> is it me or does that not load |
19:31:23 | FromDiscord | <awr> oh nvm it was my HTTPS thing |
19:36:15 | FromDiscord | <awr> untested: https://glot.io/snippets/f0tmwie35d |
19:37:35 | PMunch | Of course -_- |
19:37:38 | PMunch | That works fine |
19:48:23 | * | Trustable quit (Remote host closed the connection) |
20:22:02 | * | noonien quit (Quit: Connection closed for inactivity) |
20:24:16 | * | miran quit (Quit: Konversation terminated!) |
20:25:30 | PMunch | Hmm, any ideas: http://ix.io/19I8 |
20:26:00 | FromGitter | <Varriount> What is a StringSlice? |
20:26:04 | PMunch | newStringSlice looks like this: http://ix.io/19I9 |
20:26:33 | * | jrbrt joined #nim |
20:27:05 | PMunch | Hmm, seems like I have messed something up.. |
20:28:33 | PMunch | It used to work.. |
20:31:45 | PMunch | I'm lost.. |
20:31:51 | PMunch | This worked just fine a second ago |
20:34:03 | PMunch | Ooooh |
20:34:12 | PMunch | I know, I changed StringSlice from object to ref object |
20:42:27 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:46:00 | * | odc_ joined #nim |
20:46:04 | * | dashed_ joined #nim |
20:47:03 | * | euantor_ joined #nim |
20:49:47 | * | rockcavera quit (Remote host closed the connection) |
20:50:36 | * | newb_ joined #nim |
20:51:57 | * | JStoker quit (Killed (wolfe.freenode.net (Nickname regained by services))) |
20:51:59 | * | JStoker joined #nim |
20:53:21 | * | dashed quit (*.net *.split) |
20:53:21 | * | EastByte quit (*.net *.split) |
20:53:21 | * | endes[m] quit (*.net *.split) |
20:53:22 | * | macsek1911[m] quit (*.net *.split) |
20:53:22 | * | stisa quit (*.net *.split) |
20:53:22 | * | solitudesf quit (*.net *.split) |
20:53:22 | * | mgdelacroix[m] quit (*.net *.split) |
20:53:22 | * | pqflx3[m] quit (*.net *.split) |
20:53:22 | * | dyce[m] quit (*.net *.split) |
20:53:22 | * | odc quit (*.net *.split) |
20:53:23 | * | euantor quit (*.net *.split) |
20:53:29 | * | euantor_ is now known as euantor |
20:53:38 | * | dashed_ is now known as dashed |
20:53:59 | * | odc_ is now known as odc |
20:54:06 | * | EastByte joined #nim |
20:55:01 | newb_ | hello, kinda a noob question, when you have a ref object created via new, how do you delete it? |
20:55:20 | * | stisa joined #nim |
20:55:21 | * | pqflx3[m] joined #nim |
20:55:23 | * | endes[m] joined #nim |
20:56:08 | * | solitudesf joined #nim |
20:56:08 | * | macsek1911[m] joined #nim |
20:56:12 | * | mgdelacroix[m] joined #nim |
20:57:35 | * | dyce[m] joined #nim |
21:02:42 | FromGitter | <krux02> ref objects are garbage collected. you don't delete it |
21:02:54 | FromGitter | <krux02> and when you initialize it with the object constructor, no new is required |
21:03:05 | FromGitter | <krux02> just a nil ref is initialized with new (I think) |
21:04:22 | newb_ | so if you set a ref to nil, if it used to point to an object it will be garbage collected? |
21:05:04 | FromGitter | <krux02> yes |
21:07:46 | newb_ | do I need to worry about having multiple refs to the same object causing it to live longer than expected? |
21:19:15 | * | rockcavera joined #nim |
21:19:15 | * | rockcavera quit (Changing host) |
21:19:15 | * | rockcavera joined #nim |
21:19:40 | * | newb_ quit (Ping timeout: 260 seconds) |
21:19:47 | PMunch | newb_, yes |
21:22:35 | FromGitter | <Varriount> @dom96 How developed is your nim-jsonrpc library? |
21:22:46 | dom96 | not very |
21:23:26 | * | nsf quit (Quit: WeeChat 2.1) |
21:23:37 | PMunch | Ugh, after all my refactoring: Error: cannot generate VM code for ref string |
21:23:39 | PMunch | -_- |
21:24:19 | PMunch | Does ptr string work? |
21:24:21 | FromGitter | <Varriount> PMunch: How much of your code deals with those string slices? |
21:24:32 | PMunch | At the moment? All of it |
21:24:34 | FromGitter | <Varriount> You might be able to get away with using toOpenArray |
21:24:53 | dom96 | 'ref string'? |
21:24:58 | PMunch | I was having trouble with combparser being slow for parsing protobuf files |
21:25:00 | dom96 | Why are you using a 'ref string'? |
21:25:33 | PMunch | This was probably caused by superfluous string copies from making slices |
21:26:11 | PMunch | So I decided I should create a StringSlice type that kept a reference to a base string, and a start and stop slice point |
21:26:54 | PMunch | http://ix.io/19Iu |
21:27:01 | PMunch | That's what I ended up with |
21:31:48 | PMunch | And it works fine.. But apparently ref string isn't allowed in the VM |
21:33:19 | dom96 | Did this StringSlice type fix your performance problems? |
21:34:17 | PMunch | I don't know.. |
21:34:31 | PMunch | Since I can't run them in the VM, which is very the protobuf parsing is done |
21:37:05 | * | kier quit (Ping timeout: 248 seconds) |
21:37:40 | Araq | huh? |
21:37:47 | Araq | the VM supports ref strings |
21:37:52 | Araq | well it should. |
21:38:03 | Araq | maybe you are using a type where the VM wants a value |
21:38:34 | PMunch | Well the error is: /home/peter/Projects/strslice/strslice.nim(12, 20) Error: cannot generate VM code for ref string |
21:38:45 | FromDiscord | <awr> what is HSlice |
21:38:46 | PMunch | And the strslice file is this one: http://ix.io/19Iu/nim |
21:39:22 | FromDiscord | <awr> oh it's in system |
21:39:40 | PMunch | awr, yeah it's a slice type |
21:39:44 | FromDiscord | <awr> is HSlice something new? i'm on 0.18 |
21:39:57 | PMunch | And what is passed to the `[]` proc when you do "hello"[1..3] |
21:40:01 | PMunch | Nope, it's pretty old |
21:40:31 | FromDiscord | <awr> it's telling me unidentified identifier |
21:40:47 | FromDiscord | <awr> oh what the fuck |
21:41:13 | FromDiscord | <awr> my PATH is fucked up, i've been compiling with some 0.17.3 build i forgot to get rid of |
21:41:22 | * | kier joined #nim |
21:42:48 | FromDiscord | <awr> what are you trying to do here anyway? |
21:42:55 | FromDiscord | <awr> use protobuf at compile time? |
21:42:55 | PMunch | Performance |
21:43:10 | FromDiscord | <awr> in regards to what? |
21:43:19 | PMunch | Oh yeah, it's my protobuf library. It parses the protobuf specification on compile-time and generates Nim code to read and write types |
21:43:37 | PMunch | Problem is the parser is super slow |
21:44:24 | PMunch | I think most of the problem lies in how it copies the input string everywhere it goes |
21:44:55 | PMunch | So I decided to create a slice type so only 1 copy of the string could be kept, and all the slices would just be indices into that one string |
21:47:46 | FromDiscord | <awr> i compiled it and it runs correctly. your issue is that it doesn't work at compiletime? |
21:50:06 | PMunch | Yeah |
21:50:19 | FromDiscord | <awr> change `result.str = new(ref string)` to just `new result.str` |
21:50:25 | PMunch | Yeah the module itself works fine |
21:50:26 | FromDiscord | <awr> it works at compiletime |
21:50:28 | FromDiscord | <awr> when you do that |
21:50:32 | PMunch | It does? |
21:50:34 | FromDiscord | <awr> yes |
21:50:36 | FromDiscord | <awr> just tested it |
21:51:38 | FromDiscord | <awr> hm |
21:51:42 | FromDiscord | <awr> it works slightly differently |
21:53:20 | PMunch | It does? |
21:53:30 | PMunch | Seems to work fine for protobuf though |
21:53:32 | PMunch | http://ix.io/19Iy |
21:53:37 | PMunch | And it gives a speed up :) |
21:54:34 | FromDiscord | <awr> https://glot.io/snippets/f0tqpio8x9 don't use the compiler on the site, copy and paste to text editor and compile |
21:55:28 | FromDiscord | <awr> whoops should've just used the thing dom96 linked me |
21:56:55 | FromDiscord | <awr> something is extremely wrong. it compiles but gives different results |
21:57:25 | FromDiscord | <awr> at compiletime i get `ello worl` for the first echo but i get `ellocworl` at runtime for the first echo |
21:57:37 | PMunch | Oops, I had forgotten to run rm -r nimcache betwene those last runs |
21:57:44 | PMunch | Still a speed-up, but not as great |
21:57:50 | PMunch | But that is only for a very small file |
21:58:08 | PMunch | awr, ouch |
21:58:22 | PMunch | That means it doesn't use the reference on compile time.. |
21:59:07 | FromDiscord | <awr> hm |
21:59:18 | PMunch | Strange that I'm seeing speedups then |
21:59:36 | FromDiscord | <awr> without more rigorously checking if what i'm doing is right |
22:00:24 | FromDiscord | <awr> it fixes itself when i change inside `proc `[]`*(str: StringSlice, slc: HSlice[int, int or BackwardsIndex]): StringSlice =` |
22:00:33 | FromDiscord | <awr> `new result` to `result = str` |
22:01:00 | PMunch | Yeah not surprisingly |
22:01:06 | PMunch | But that mutates the original |
22:01:16 | PMunch | Which is not what you want |
22:01:23 | FromDiscord | <awr> that raises the question of why is StringSlice a ref object |
22:01:46 | PMunch | To more easily be able to replace strings with it |
22:01:47 | FromDiscord | <awr> i understand why you want the ref string |
22:01:56 | FromDiscord | <awr> you don't want string copying anywhere |
22:02:05 | PMunch | Since strings can be nil, it makes sense for StringSlice to be able to be nil as well |
22:02:27 | FromDiscord | <awr> hmmmmm |
22:02:33 | PMunch | It was originally a regular object |
22:02:57 | PMunch | Until I went over and tried to replace everything in protobuf with StringSlices and ran into problems where I had used == nil checks |
22:03:36 | FromDiscord | <awr> you should be using isNil instead of == nil. == nil will not compile for some types (i don't have an example offhand but it's happened to me before) |
22:05:09 | FromDiscord | <awr> although it seems that you do this anyway |
22:11:05 | * | CodeVance is now known as asdafg |
22:11:37 | * | asdafg is now known as CodeVance |
22:13:31 | FromDiscord | <treeform> PMunch, I made a thrift parser, right now it just parsers the thrift def and does not produce any glue code. I actually just needed to parse thrift and turn into SQL (crazy i know). How did you make the parser part? Is your code on github some place? |
22:13:55 | FromDiscord | <treeform> PMunch, I made a thrift parser, right now it just parsers the thrift def and does not produce any glue code. I actually just needed to parse thrift and turn into Json (crazy i know). How did you make the parser part? Is your code on github some place? |
22:14:10 | * | CodeVance is now known as asdafg |
22:14:32 | PMunch | treeform, yeah the parser is called combparser |
22:14:44 | * | asdafg is now known as CodeVance |
22:14:47 | PMunch | You can see how I use it in protobuf under src/protobuf/private/parse.nim |
22:15:16 | PMunch | Araq, this is a bug right? http://ix.io/19IS/nim |
22:16:44 | FromDiscord | <treeform> wow combparser is really different from the way I did it. |
22:19:13 | * | riidom quit (Ping timeout: 248 seconds) |
22:19:18 | FromDiscord | <treeform> Hmm I though the syntax was nearly identical, does not look like that is the case. |
22:20:02 | PMunch | That's the beauty of combparser though |
22:20:27 | PMunch | You can mix and match every piece of it. So it's really easy to change the parser to do something else |
22:20:39 | FromDiscord | <treeform> you don't explain how to use it: https://github.com/PMunch/combparser |
22:21:06 | PMunch | Yeah I know, the documentation is still a bit.. Sparse |
22:21:24 | PMunch | Basically you have parsers and combinators |
22:22:33 | PMunch | A parser like s, regex, regex, peg, charmatch, and allbut returns a proc that takes a string and returns a parse result |
22:22:45 | PMunch | The the combinators are used to chain these procs together |
22:23:08 | PMunch | The repeat proc is perhaps the simplest one, repeating the given procedure on the input until it doesn't match any longer |
22:24:19 | FromDiscord | <treeform> looking at it, maybe its not too hard to figure out. |
22:24:53 | PMunch | All the combinators and parsers are also documented in the file |
22:26:04 | PMunch | Then you can use map which takes a parser (one of the parser procs or a combinator of multiple procs) and a procedure to convert from one type to another. This is how I generate the protobuf nodes from the parsed input |
22:26:47 | PMunch | awr, Araq, created a bug report https://github.com/nim-lang/Nim/issues/7795 |
22:29:30 | PMunch | Hmm, is there a way to show the value of a ref in the VM? |
22:29:48 | PMunch | cast[int](a) complains that the VM is only allowed to cast between ints of the same size.. |
22:30:19 | FromDiscord | <awr> try repr() |
22:30:54 | PMunch | Nope, that repr'd the string |
22:32:35 | PMunch | Oh well, way past bedtime already |
22:32:36 | * | PMunch quit (Quit: leaving) |
22:33:57 | FromDiscord | <awr> hm |
22:34:41 | FromDiscord | <awr> doing shallowCopy doesn't seem to do anything either |
22:39:07 | Araq | the VM deep copies refs |
22:39:18 | Araq | can't be hard to fix :P |
22:40:32 | FromDiscord | <awr> appears to be specific to just ref strings |
22:40:35 | * | sleepyqt quit (Remote host closed the connection) |
22:41:50 | FromDiscord | <awr> it works correctly, for instance, with `ref seq[int]` |
22:41:56 | FromDiscord | <awr> it just breaks for `ref string` |
22:42:54 | FromGitter | <Varriount> Doesn't deep-copying refs break semantics? |
22:44:50 | Araq | well it is a bug |
22:45:17 | FromDiscord | <awr> https://glot.io/snippets/f0ts437d3q |
22:48:02 | * | skrylar joined #nim |
22:48:08 | * | max3 quit (Quit: Connection closed for inactivity) |
22:49:04 | * | CodeVance quit (Read error: Connection reset by peer) |
22:49:13 | * | Hycryon joined #nim |
22:49:23 | * | CodeVance joined #nim |
22:49:37 | * | Sembei joined #nim |
22:52:27 | * | Ieatnerds quit (Ping timeout: 240 seconds) |
22:52:34 | * | Pisuke quit (Ping timeout: 260 seconds) |
23:07:16 | * | CodeVance_ joined #nim |
23:08:04 | * | CodeVance quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org) |
23:08:11 | * | CodeVance_ is now known as CodeVance |
23:14:19 | FromDiscord | <awr> i'm too lazy to check but does nim automatically collapse concatentated string literals that are adjacent to each other |
23:15:15 | FromDiscord | <awr> e.g. if i say `var a = "hello" & " " & "world"` at compile-time in c is that reduced to `"hello world"` |
23:16:38 | Araq | yes |
23:16:45 | FromDiscord | <awr> cool |
23:37:27 | * | leorize joined #nim |
23:38:34 | * | CodeVance quit (Read error: Connection reset by peer) |
23:38:38 | * | CodeVance_ joined #nim |
23:38:38 | * | CodeVance_ quit (Client Quit) |
23:38:56 | * | CodeVance joined #nim |