00:01:28 | * | Guest25720 quit (Ping timeout: 250 seconds) |
00:36:36 | * | Noob_ quit (Quit: Page closed) |
00:48:06 | * | flaviu quit (Remote host closed the connection) |
00:53:18 | * | brson joined #nim |
01:04:09 | * | BitPuffin quit (Ping timeout: 276 seconds) |
02:14:42 | * | brson quit (Quit: leaving) |
02:15:29 | * | darkf joined #nim |
02:47:23 | * | Senketsu quit (Read error: Connection reset by peer) |
02:47:51 | * | Senketsu joined #nim |
02:52:35 | * | darkf_ joined #nim |
02:53:43 | * | darkf quit (Ping timeout: 245 seconds) |
03:05:51 | * | Senketsu_ joined #nim |
03:07:37 | * | pidg quit (Ping timeout: 246 seconds) |
03:09:18 | * | Senketsu quit (Ping timeout: 272 seconds) |
03:16:04 | * | darkf_ is now known as darkf |
03:25:13 | * | endragor joined #nim |
03:25:25 | * | Kingsquee joined #nim |
03:28:21 | * | saml_ quit (Quit: Leaving) |
03:35:43 | * | ChrisMAN joined #nim |
03:44:21 | * | ChrisMAN quit (Ping timeout: 248 seconds) |
03:49:08 | * | TEttinger joined #nim |
03:50:14 | * | anthony joined #nim |
03:50:37 | * | anthony is now known as Guest77832 |
04:17:03 | * | Senketsu_ quit (Quit: Leaving) |
05:36:48 | * | HakanD___ quit (Quit: Be back later ...) |
05:37:25 | * | HakanD___ joined #nim |
05:41:38 | * | HakanD___ quit (Ping timeout: 252 seconds) |
06:14:57 | * | BlaXpirit joined #nim |
06:23:19 | * | a5i quit (Quit: Connection closed for inactivity) |
06:32:03 | * | polde joined #nim |
06:45:25 | * | bjz joined #nim |
06:49:25 | * | endragor quit (Ping timeout: 248 seconds) |
06:51:53 | * | endragor joined #nim |
06:54:21 | * | cmk_zzz_ joined #nim |
07:01:51 | * | Ven joined #nim |
07:05:29 | * | endragor_ joined #nim |
07:06:41 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
07:09:22 | * | endragor quit (Ping timeout: 264 seconds) |
07:14:39 | * | cmk_zzz_ quit (Ping timeout: 276 seconds) |
07:16:20 | * | cmk_zzz_ joined #nim |
07:18:40 | * | endragor_ quit (Remote host closed the connection) |
07:30:17 | * | Trustable joined #nim |
07:35:24 | * | HakanD___ joined #nim |
07:36:19 | * | HakanD____ joined #nim |
07:36:52 | * | TEttinger quit (Ping timeout: 255 seconds) |
07:40:39 | * | HakanD___ quit (Ping timeout: 276 seconds) |
07:49:04 | * | OnO joined #nim |
08:03:45 | * | bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
08:19:17 | * | banister joined #nim |
08:21:33 | * | HakanD____ quit (Quit: Lingo: www.lingoirc.com) |
08:22:05 | * | bjz joined #nim |
08:22:24 | * | HakanD joined #nim |
08:23:46 | * | endragor joined #nim |
08:26:29 | * | bjz quit (Ping timeout: 248 seconds) |
08:54:21 | * | bjz joined #nim |
09:04:09 | * | HakanD quit (Quit: Be back later ...) |
09:08:07 | Araq | so ... good news ... I got compile-time lexer generation to work |
09:08:27 | Araq | but generating a lexer for a toy language takes ~23 seconds ... |
09:10:00 | * | Guest77832 quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
09:12:55 | fowlmouth | what did that require |
09:13:10 | Araq | 3 fixes to the VM |
09:13:34 | Araq | and some patience :P |
09:13:40 | fowlmouth | please make passing functions around possible so glossolalia can work |
09:14:03 | Araq | oh yeah I fixed a bug for that too |
09:15:01 | Araq | I'm adding caching primitives to the VM. so the lexer gen step can be completely cached |
09:15:11 | Araq | but still ... it sucks |
09:15:29 | Araq | first compilation 23 seconds, second compilation ~2 seconds |
09:15:50 | * | HakanD_ joined #nim |
09:17:25 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:17:41 | Araq | a JIT would really help for it, I wonder if we partially compile .compiletime code via our JS or C backend |
09:17:47 | Araq | *we can |
09:25:39 | * | milosn quit (Ping timeout: 265 seconds) |
09:32:59 | HakanD_ | is -app:gui windows only? |
09:33:18 | Araq | no, but it might be that it doesn't do anything on linux |
09:34:47 | HakanD_ | tried on osx to build a working sfml app, it gives an error on linking : clang: error: unknown argument: '-mwindows' |
09:35:13 | HakanD_ | any pointers on how can I build it so it doesn't open a terminal when i launch the app? |
09:35:16 | Araq | that's a configuration problem then |
09:35:48 | Araq | dunno how this stuff works on osx |
09:36:33 | HakanD_ | ok thanks, I'll search more on the internets |
09:38:42 | HakanD_ | it gives the same error even on a echo hello world, I'll post it on github |
09:38:59 | Araq | hrm running this stuff at compiletime requires 63434182 obj.foo read accesses and 598960 function calls and 6 million integer comparisons |
09:40:52 | Araq | HakanD_: sure |
09:41:16 | BlaXpirit | HakanD_, can you not use app:gui?? |
09:41:41 | HakanD_ | I can, and I do (: |
09:41:53 | Araq | BlaXpirit: btw my code constructs 'refs' at compile time and it works |
09:41:54 | HakanD_ | just looking for a way to run the app without it spawning a terminal window |
09:42:11 | BlaXpirit | Araq, did u change anything? because it sure didn't for me |
09:42:21 | Araq | BlaXpirit: not for 'ref' handling |
09:42:30 | Araq | but I only use it to construct trees |
09:42:31 | HakanD_ | BlaXpirit: thanks again for the nim-sfml btw, used it to create a game for ludum dare last weekend. |
09:42:38 | BlaXpirit | HakanD_, :o cool |
09:42:53 | BlaXpirit | tell more |
09:47:21 | HakanD_ | some silly game, http://ludumdare.com/compo/ludum-dare-32/?action=preview&uid=50151 |
09:47:55 | HakanD_ | plan was to ship something that resembles a game, in time |
09:48:04 | HakanD_ | it was fun |
09:49:25 | Araq | bbl |
09:50:18 | BlaXpirit | HakanD_, and u encountered no bugs? |
09:51:25 | HakanD_ | nope, I haven't done anything serious tho, some sprites, some shapes, some movement, some collission |
09:53:00 | HakanD_ | linking sfml and csml was a bit of pain tho, messed with dynlib files to make it work. |
09:53:08 | HakanD_ | im new to compiling and linking, probably because of that. |
09:53:53 | * | Ven joined #nim |
10:07:39 | * | a5i joined #nim |
10:34:08 | * | milosn joined #nim |
10:53:51 | * | milosn quit (Read error: Connection reset by peer) |
10:54:49 | * | milosn joined #nim |
10:58:09 | * | cmk_zzz_ quit (Ping timeout: 245 seconds) |
11:07:33 | * | milosn quit (Ping timeout: 248 seconds) |
11:27:40 | * | johnsoft quit (Read error: Connection reset by peer) |
11:32:48 | * | milosn joined #nim |
11:37:37 | * | milosn quit (Ping timeout: 264 seconds) |
11:39:58 | * | johnsoft joined #nim |
11:40:19 | * | BitPuffin joined #nim |
11:44:04 | * | arnetheduck joined #nim |
12:06:07 | * | Kingsquee quit (Quit: Konversation terminated!) |
12:09:28 | * | milosn joined #nim |
12:15:09 | * | milosn quit (Read error: Connection reset by peer) |
12:36:00 | * | milosn joined #nim |
12:43:46 | * | milosn quit (Read error: Connection reset by peer) |
12:44:10 | * | milosn joined #nim |
12:44:44 | dom96 | HakanD_: really cool! |
12:51:13 | HakanD_ | dom96: ty |
12:57:21 | * | milosn quit (Read error: Connection reset by peer) |
12:57:44 | * | milosn joined #nim |
12:58:59 | * | mpthrapp joined #nim |
13:12:59 | * | saml joined #nim |
13:22:16 | * | milosn quit (Ping timeout: 250 seconds) |
13:51:06 | a5i | whats cool ? |
13:58:28 | saml | girls |
13:58:41 | a5i | i |
13:58:44 | a5i | o* |
13:59:12 | * | bcinman joined #nim |
14:13:24 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
14:14:16 | * | BitPuffin quit (Ping timeout: 240 seconds) |
14:19:00 | * | gokr_ quit (Read error: Connection reset by peer) |
14:19:18 | * | gokr_ joined #nim |
14:19:39 | * | Zulmin joined #nim |
14:26:32 | * | MyMind joined #nim |
14:26:56 | * | adam12 quit (Ping timeout: 240 seconds) |
14:27:48 | * | adam| joined #nim |
14:36:00 | * | banister quit (Remote host closed the connection) |
14:36:43 | * | milosn joined #nim |
14:40:10 | * | ChrisMAN joined #nim |
14:41:29 | * | ChrisMAN quit (Client Quit) |
14:41:48 | * | ChrisMAN joined #nim |
14:51:57 | * | darkf quit (Quit: Leaving) |
14:56:38 | * | phI||Ip quit (Ping timeout: 245 seconds) |
14:57:08 | * | BitPuffin joined #nim |
15:05:51 | * | banister joined #nim |
15:14:21 | * | phI||Ip joined #nim |
15:17:55 | * | pregressive joined #nim |
15:27:49 | * | banister quit (Ping timeout: 248 seconds) |
15:30:56 | * | untitaker quit (Ping timeout: 272 seconds) |
15:33:20 | * | untitaker joined #nim |
15:33:24 | * | kashyap_ joined #nim |
15:34:21 | kashyap_ | Hi...can someone please tell me what is a good way to write a nimble file for a project that has both client and server side code - client is essentially nim->js |
15:34:54 | kashyap_ | so I'll have top level src directory under which I want to have browser and server directories ... how can I tell nimble about it |
15:43:37 | * | banister joined #nim |
15:43:42 | * | banister quit (Max SendQ exceeded) |
15:43:43 | Araq | kashyap_: well nimble is only for installation and deps then, write in the readme what needs to be built |
15:43:59 | Araq | well that's how I'd do it, dom96 surely knows better |
15:44:34 | kashyap_ | sure ... I can then go with Makefile for the build and nimble only for the packaging |
15:45:06 | * | banister joined #nim |
15:45:07 | fowlmouth | kashyap_, use nake |
15:45:09 | * | banister quit (Max SendQ exceeded) |
15:45:12 | kashyap_ | what about koch ... is that generic or only for bootstraping/ |
15:45:23 | kashyap_ | oh okay |
15:45:25 | kashyap_ | nake |
15:45:37 | Araq | koch is only for bootstrapping / compiler development |
15:45:51 | fowlmouth | nimble install is for building and installing a binary, not sure if it would work for you |
15:45:56 | Araq | also |
15:46:16 | Araq | if you have a project that uses the JS codegen, please submit JS related tests |
15:46:43 | Araq | I recently fixed a JS codegen bug and then felt bad because we have so few tests for it |
15:47:08 | fowlmouth | this compiles to JS or sdl2, pretty neat https://github.com/yglukhov/nimx |
15:47:31 | Araq | fowlmouth: and with a bit of luck, it still works for JS :P |
15:47:38 | kashyap_ | sure ... I am just about to start it actually ... I've seen multiple browser based terminals that allow us to use bash on a remote VM , I want to do the same thing for the local machine |
15:48:21 | kashyap_ | thaks Araq fowlmouth - I'll keep the tests in mind |
15:49:12 | kashyap_ | thanks for the link fowlmouth |
15:52:52 | dom96 | kashyap_: currently the only way to do that is to separate your client and server side code into two packages. |
15:52:55 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:53:39 | * | OnO joined #nim |
15:53:41 | kashyap_ | the only thing that seems to come in the way at this time is the ability to give multiple backend's |
15:53:44 | fowlmouth | different build targets for android, ios, desktop, js, https://github.com/yglukhov/nimx/blob/master/test/nakefile.nim |
15:59:02 | * | justicefries joined #nim |
16:03:01 | * | arnetheduck quit (Ping timeout: 248 seconds) |
16:05:11 | * | HakanD_ quit (Quit: Be back later ...) |
16:08:39 | * | banister joined #nim |
16:15:04 | * | smelod joined #nim |
16:19:23 | * | banister is now known as banisterfiend |
16:21:47 | * | Arrrrrr joined #nim |
16:28:34 | * | BitPuffin quit (Ping timeout: 245 seconds) |
16:33:07 | * | Matthias247 joined #nim |
16:33:41 | * | Pisuke joined #nim |
16:35:14 | * | MyMind quit (Ping timeout: 245 seconds) |
16:35:36 | * | brson joined #nim |
16:40:16 | * | Pisuke quit (Ping timeout: 240 seconds) |
16:41:42 | * | Pisuke joined #nim |
16:43:09 | * | milosn quit (Ping timeout: 245 seconds) |
16:46:02 | Araq | BlaXpirit: oh btw I like your optional module but I think it's overengineered for the stdlib |
16:46:15 | BlaXpirit | Araq, yyup |
16:46:28 | BlaXpirit | look at what flaviu said though |
16:46:57 | BlaXpirit | without fixing the bug, the module will be either overengineered or oversimplified |
16:47:29 | * | milosn joined #nim |
16:51:06 | BlaXpirit | the initial "dual" implementation looked simple, but it was very inflexible |
16:51:45 | BlaXpirit | Nim really should be able to do this within one class |
16:51:52 | Araq | type Maybe*[T] = object |
16:51:55 | Araq | case hasValue*: bool |
16:51:57 | Araq | of false: nil |
16:52:00 | Araq | of true: value: T |
16:52:12 | Araq | that's a Maybe in Nim |
16:52:47 | Araq | 4 lines of code. |
16:53:06 | BlaXpirit | Araq, the thing that got some people excited was the memory optimization if the object is nullable |
16:53:23 | BlaXpirit | not using an additional boolean |
16:53:55 | BlaXpirit | if you think it should be dropped, then such a module would be nothing new, people have made them before |
16:54:11 | Araq | the point of this module is interop |
16:54:23 | BlaXpirit | ? |
16:54:31 | Araq | so that everybody can start to use the same Maybe[T] |
16:54:58 | Araq | bbs |
16:55:38 | BlaXpirit | welp, you haven't given me any direction |
16:55:56 | renesac | BlaXpirit: one question is: is the memory optimization really important? |
16:56:05 | fowlmouth | the point of BlaXpirit 's is that you can use the (bool,T) version for PRopes (a type for which the nil state is valid) |
16:56:08 | BlaXpirit | the answer is: sometimes |
16:56:26 | renesac | you are not likely to make large seqs of maybes, you would normally unpack them |
16:56:34 | BlaXpirit | renesac, or are you |
16:56:51 | renesac | and for stack alloacation (normal simple returns) I don't think a extra byte matters |
16:57:24 | renesac | well, it would matter for heap alloactions, as that would probably be an extra 8 bytes per element |
16:58:09 | fowlmouth | you figure a (bool,int) should be 5 or 9 bytes? |
16:58:35 | renesac | fowlmouth: more like 8 or 16 bytes, because alignment issues |
17:00:26 | fowlmouth | oh the heap or stack |
17:00:33 | fowlmouth | doesnt matter |
17:00:56 | renesac | oh == on ? |
17:00:59 | fowlmouth | yea |
17:01:06 | renesac | indeed |
17:02:06 | BlaXpirit | ok so flaviu has such a simple module |
17:02:59 | fowlmouth | it should be a tuple if the nullable part is rejected |
17:03:18 | * | BlaXpirit quit (Read error: Connection reset by peer) |
17:04:04 | * | BlaXpirit joined #nim |
17:04:41 | renesac | fowlmouth: it should be an object if one ever want's to change it's implementation |
17:04:54 | BlaXpirit | definitely an object |
17:05:18 | Arrrrrr | What's the overhead of using object? |
17:06:01 | fowlmouth | runtime checks in debug mode |
17:06:21 | renesac | what type of checks? |
17:07:01 | * | Pisuke quit (Ping timeout: 264 seconds) |
17:07:02 | fowlmouth | if you use a discriminator it checks that the field is valid or throws an exception |
17:07:35 | * | vendethiel joined #nim |
17:10:02 | Arrrrrr | Then, on release, there is no difference between int and an object with one int ? |
17:10:05 | * | banisterfiend quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:10:28 | renesac | so Araq's version of Maybe[T] would not throw exceptions in release mode? |
17:10:39 | renesac | Arrrrrr: objects are basically C structs |
17:10:54 | BlaXpirit | renesac, that's just the base |
17:11:51 | BlaXpirit | what should be done based on it is a function that just accesses value and a function that may throw an exception |
17:13:15 | fowlmouth | why have a function do what accessing the field would already do? |
17:13:34 | BlaXpirit | fowlmouth, because fields should not be assignable |
17:13:47 | BlaXpirit | and i assume these functions wouldn't have any overhead at all |
17:14:04 | BlaXpirit | also to allow replacing the implementation |
17:14:29 | BlaXpirit | also to ensure immutability |
17:14:39 | Arrrrrr | I'd like to do opt.ifExists(i => echo i) |
17:15:26 | BlaXpirit | that would be if i ?= opt: echo i |
17:16:56 | * | jfchevrette joined #nim |
17:17:24 | Arrrrrr | mm.. |
17:23:41 | BlaXpirit | no idea why cast[int]((a: 6)) crashes the compiler |
17:24:37 | * | justicefries quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
17:25:42 | BlaXpirit | i was gonna advocate swapping the values of optional object |
17:25:52 | BlaXpirit | so that value goes first, then the boolean |
17:25:58 | BlaXpirit | so it can be casted to value |
17:26:21 | BlaXpirit | but that doesn't even compile, whatever |
17:28:34 | fowlmouth | should it? |
17:28:34 | * | milosn quit (Ping timeout: 252 seconds) |
17:29:32 | BlaXpirit | fowlmouth, I don't see a reason why not |
17:29:40 | BlaXpirit | it shouldn't crash, in any case |
17:30:28 | BlaXpirit | ok, echo cast[ptr int](addr(x))[] works |
17:33:28 | Arrrrrr | What is exactly '(a: 6)' in your code? |
17:34:02 | BlaXpirit | tuple |
17:35:04 | * | milosn joined #nim |
17:35:47 | * | endragor_ joined #nim |
17:35:55 | Arrrrrr | a tuple of one element? Is that possible? |
17:36:23 | BlaXpirit | cuz why not |
17:36:30 | BlaXpirit | i dont know actually, it may be bugged |
17:36:56 | fowlmouth | yes i think we can even have 0 element tuples now |
17:38:41 | * | justicefries joined #nim |
17:39:01 | * | endragor quit (Ping timeout: 248 seconds) |
17:40:24 | Araq | (x,) for single element tuples has not been implemented yet though |
17:40:35 | * | endragor_ quit (Ping timeout: 264 seconds) |
17:45:37 | kashyap_ | Hi, can we use channels with js backend (like clojurescript) .... |
17:47:52 | Araq | no and why do you need them? |
17:48:01 | Araq | js doesn't have threads |
17:49:04 | * | gsingh93 joined #nim |
17:49:12 | kashyap_ | exactly ... so clojurescript has this nice thing where one could write "inifinte loops waiting for events" that get trasformed into the necessary nested callbacks ... so the programmer can write "linear" code ... the same thing is available in C# -- the async keyword |
17:50:08 | kashyap_ | anyway ... just being able to use proper modules and having type checking is significant advantage compared to using plain js |
17:50:46 | fowlmouth | if fake threading interests you why not use closure iterators |
17:51:15 | kashyap_ | is there an example you can point me to fowlmouth? |
17:53:09 | fowlmouth | https://gist.github.com/fowlmouth/c142a2089a4a77a85b04 |
17:53:09 | kashyap_ | the beauty in clojurescript is that the "core.async" module is the same for regular clojure and clojurescript - on jvm where threads are available, it uses threads - for js it does the necessary transformations to make appropriate callback handlers |
17:53:49 | fowlmouth | nim has async/spawn stuff, i've never used it though |
17:54:46 | kashyap_ | thanks fowlmouth ... |
17:57:00 | * | HakanD_ joined #nim |
17:57:25 | * | untitaker quit (Ping timeout: 255 seconds) |
18:00:02 | * | untitaker joined #nim |
18:01:57 | kashyap_ | When I tried to compile the httpserver example http://nim-lang.org/httpserver.html - I get sockets, asyncio deprecated .... what should be used instead? |
18:03:29 | fowlmouth | kashyap_, http://nim-lang.org/asynchttpserver.html ? |
18:04:59 | kashyap_ | ok |
18:08:25 | * | banister joined #nim |
18:08:29 | * | banister quit (Max SendQ exceeded) |
18:13:34 | * | endragor joined #nim |
18:14:03 | * | justicefries quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
18:17:22 | * | HakanD_ quit (Quit: Be back later ...) |
18:18:00 | * | HakanD_ joined #nim |
18:19:13 | * | buMPnet_ quit (Remote host closed the connection) |
18:19:14 | * | HakanD_ quit (Client Quit) |
18:19:39 | * | buMPnet joined #nim |
18:19:49 | * | HakanD_ joined #nim |
18:20:00 | * | buMPnet quit (Remote host closed the connection) |
18:27:26 | * | dtscode is now known as dts|pokeball |
18:32:53 | * | banister joined #nim |
18:33:20 | * | mwbrown joined #nim |
18:44:14 | dhasenan | I thought I found another compiler bug, but it disappeared when I looked at it sideways. Guess I was imagining things. |
18:46:09 | * | brson quit (Quit: leaving) |
18:46:19 | * | brson joined #nim |
18:46:37 | Araq | dhasenan: don't find bugs, *fix* them :P |
18:47:08 | dhasenan | Araq: I'm following half of that, at least... |
18:47:29 | dhasenan | I still haven't gotten around to filing for open source approval for Nim at my job. |
18:47:41 | Araq | fowlmouth: test typesapi2 fails for me |
18:47:57 | dts|pokeball | Araq, does the compiler have documentation? |
18:48:05 | dts|pokeball | internally i mean |
18:48:17 | Araq | yes, though people tend to ignore it |
18:48:21 | * | Pisuke joined #nim |
18:49:02 | dts|pokeball | link? |
18:49:25 | dts|pokeball | if i had known that exists i probably would have been better about bug fixes:3 |
18:50:08 | Araq | http://nim-lang.org/intern.html |
18:50:11 | Arrrrrr | You have to catch'em all. |
18:50:22 | Araq | linked from our 'docs' tab |
18:50:32 | Araq | yes, it's part of the website |
18:50:38 | dts|pokeball | thanks |
18:52:30 | Araq | https://github.com/Araq/Nim/wiki/Compiler-module-reference |
18:53:10 | Araq | fowlmouth: my fixes for the 'is' operator break your typesapi2 test ... :-/ |
18:56:38 | * | endragor quit (Remote host closed the connection) |
18:56:59 | * | endragor joined #nim |
18:59:34 | Arrrrrr | How do sets and seqs work under the hood? Are them allocated on heap? |
18:59:56 | * | jfchevrette quit (Ping timeout: 272 seconds) |
19:00:53 | Araq | no, like everywhere else they are allocated in the free space of your BIOS |
19:02:37 | * | mwbrown quit (Quit: Leaving) |
19:03:24 | Arrrrrr | Thanks, that was useful |
19:04:06 | Araq | Arrrrrr: 'set[T]' is of a fixed size and so on the stack |
19:04:51 | * | kashyap_ quit (Quit: Page closed) |
19:07:58 | * | dts|pokeball is now known as dtscode |
19:08:03 | fowlmouth | Araq, ok i'll fix it |
19:08:13 | Araq | fowlmouth: no, I fixed it |
19:08:31 | Araq | the thing is ... a nimcall<->closure conversion is a conversion |
19:08:38 | Araq | so 'is' now fails |
19:08:42 | Araq | as it should IMHO |
19:08:48 | Araq | I adapted your test |
19:08:54 | fowlmouth | where is that used |
19:08:59 | Araq | proc foo11 : testTypesym(void) = |
19:09:01 | Araq | echo "HI!" |
19:09:02 | Araq | static: assert foo11 is (proc():void {.nimcall.}) |
19:09:13 | Araq | but I have no idea what that breaks in practice |
19:09:34 | fowlmouth | im looking at this https://github.com/Araq/Nim/blob/devel/tests/macros/typesapi2.nim |
19:09:48 | Araq | yes |
19:09:51 | Araq | so am I |
19:10:04 | fowlmouth | oh you added the {.nimcall.} part? |
19:10:11 | Araq | exactly |
19:10:15 | Araq | then it works again |
19:10:50 | fowlmouth | ah ok |
19:12:06 | * | TEttinger joined #nim |
19:15:30 | Araq | well? good enough for your stuff? |
19:17:13 | fowlmouth | i'd prefer if closure was required to make proc a closure instead but that would probably break things |
19:18:14 | Araq | yup |
19:18:44 | * | justicefries joined #nim |
19:18:49 | fowlmouth | how about constraints |
19:19:06 | fowlmouth | closure,cdecl,nimcall |
19:19:45 | Araq | so instead of {.nimcall.} you write {nimcall}? |
19:19:46 | * | HakanD_ quit (Quit: Be back later ...) |
19:19:54 | Araq | what's the point? |
19:22:35 | fowlmouth | i cant think of one at the moment >_> |
19:24:29 | fowlmouth | constraints are underused though |
19:27:44 | * | endragor quit (Remote host closed the connection) |
19:28:26 | renesac | by the way, seqslices creates a copy of the seq when doing slice() on a seq |
19:28:31 | renesac | only reslices are free |
19:29:27 | Araq | renesac: depends on how it's implemented |
19:30:04 | renesac | yeah, I guess I just want a object with a ref to the seq, low and high |
19:30:50 | renesac | the risk is of someone triggering a realloc() on the original seq, I guess |
19:31:03 | renesac | the ref I get won't follow, or will it? |
19:32:25 | Araq | I don't understand your question |
19:32:47 | renesac | if I add things to the seq original, and it must be resized |
19:32:58 | Araq | 'ref seq' is a ptr to a ptr under the hood so it should work |
19:33:13 | renesac | hum |
19:34:38 | * | Jehan_ joined #nim |
19:35:20 | * | BitPuffin joined #nim |
19:37:30 | renesac | and if I try to avoid this double indirection, will the GC keep the old seq around if I keep pointing to it? |
19:38:10 | renesac | or I can only get an unmaneged pointer to where the seq is pointing, so it is unsafe anyway? |
19:39:07 | Araq | well you can simply use .shallow on an object with a seq in it and things work, I think |
19:39:52 | * | Arrrrrr quit (Quit: Page closed) |
19:40:01 | Araq | to answer your question: it depends on how you avoid the double indirection |
19:43:50 | * | Pisuke quit (Ping timeout: 265 seconds) |
19:44:13 | renesac | how so? |
19:46:10 | * | BitPuffin quit (Ping timeout: 272 seconds) |
19:50:17 | * | smelod quit (Remote host closed the connection) |
19:55:46 | * | justicefries quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
19:56:34 | renesac | shallow should be applied to the object as a whole, not just to the seq in it, right? (as the compiler won't let me do the latter) |
19:58:05 | renesac | and what is the advantage over just using shallowCopy() |
19:58:09 | renesac | ? |
19:59:05 | * | dtscode is now known as shikhins |
19:59:50 | * | shikhins is now known as dtscode |
20:00:37 | * | HakanD_ joined #nim |
20:03:01 | * | wb joined #nim |
20:04:01 | Araq | renesac: well you type '=' and it does shallowCopy for you. that's what .shallow does. |
20:04:13 | renesac | right |
20:05:29 | renesac | I would still need the shallowCopy() for the initial construction, then |
20:08:08 | renesac | uh, so the upper and lower bounds of the slice type are really called "a" and "b" |
20:08:20 | renesac | ok, not really difficult to remember |
20:11:22 | OnO | Araq: hi, let me know if you have any Q regarding my PR fixing compiler error diagnostics https://github.com/Araq/Nim/pull/2565 https://github.com/Araq/Nim/pull/2566 https://github.com/Araq/Nim/pull/2575 |
20:11:35 | * | filcuc joined #nim |
20:12:13 | Araq | OnO: haven't found the time to review it yet, sorry |
20:14:44 | OnO | Araq: sure, reason I am asking is that you gave a question on GH about having parser error location to be a start of current token, so I did reply... and now I just rebased to ensure everything merges nicely |
20:15:23 | Araq | oh sorry, actually I wanted to merge your stuff before pushing mine |
20:15:40 | Araq | *I wanted to review and merge |
20:19:05 | * | filwit joined #nim |
20:25:22 | * | saml_ joined #nim |
20:26:07 | Araq | hey filwit can you contribute your JS test to the test suite? |
20:26:21 | filwit | sure |
20:26:32 | filwit | but it doesn't work properly |
20:26:33 | Araq | I fixed the codegen but have no idea what I broke |
20:26:43 | Araq | well now it might :P |
20:26:53 | filwit | i see, very cool, let me try it out |
20:29:30 | Araq | I also fixed the refcounting bug that you never reported :P |
20:30:12 | filwit | gah, sorry.. i can't even remember what that bug was now... |
20:32:29 | filwit | hmm.. getting javascript erros |
20:32:36 | filwit | one sec though, might be something in my code |
20:32:55 | filwit | also, we're talking about Nim's JS backend right? not Emscripten. |
20:36:03 | Araq | Nim's JS backend, yes |
20:36:20 | * | anthony_ joined #nim |
20:36:22 | filwit | Araq: looks like there's a "document[0]" in the JS output.. i personally have never seen document accessed like that, and I doubt it's cross-browser compatible (but I'm going to look it up real quick) |
20:36:48 | filwit | well obviously it's not, cause my Chrome is giving 'undefined' for it |
20:37:05 | Araq | aha, I see the problem |
20:37:29 | Araq | I knew it would break things |
20:37:36 | filwit | :) |
20:45:18 | * | gmpreussner|lapt joined #nim |
20:45:45 | OnO | I have a question regarding string, tutorial says (a) 'string's are mutable, (b) assignment copies string |
20:46:00 | OnO | so.. how the string manipulation procs work ? |
20:46:21 | OnO | coz if I pass string as a argument to proc it will be effectively copied, am I wrong? |
20:47:18 | fowlmouth | they are passed by reference and const as a param |
20:47:25 | fowlmouth | to make it mutable its "var string" |
20:47:30 | Araq | OnO: no, parameters are immutable, so no copy is necessary |
20:47:41 | Araq | it's passed like 'const &' in C++ |
20:49:00 | OnO | so when it is exactly copied? assigning to var? or any assign including let ? |
20:49:36 | Araq | assigning to var though 'let' seems to become a new gotcha |
20:49:50 | Araq | let x = y.field |
20:49:57 | Araq | y.field.add "bar" |
20:50:11 | Araq | # argh, 'x' is modified under the hood |
20:50:40 | Araq | so ... I guess I need to change that though it's consistent with parameter passing semantics |
20:51:02 | Araq | aliasing is bad, mmmkay |
20:51:08 | OnO | that looks pretty inconsistent indeed |
20:51:45 | OnO | but if you change let asignment you will effectively copy also on argument passing to proc, right? |
20:52:08 | OnO | coz I understand all arguments are "let" by default |
20:52:37 | Araq | hell no, that would be desastrous for performance |
20:53:43 | OnO | well, in terms of C++, what is then an argument "const &" ? |
20:54:03 | * | HakanD_ quit (Quit: Be back later ...) |
20:55:15 | Araq | hrm? |
20:55:43 | * | transfuturist joined #nim |
20:55:50 | Araq | hey transfuturist |
20:56:02 | transfuturist | how are you supposed to get command line arguments on posix? |
20:56:12 | transfuturist | also hi :p |
20:56:14 | Araq | os.paramStr |
20:56:19 | BlaXpirit | D: |
20:56:33 | BlaXpirit | commandLineParams |
20:56:34 | OnO | okie: proc(string s) <- if I pass some instance of string to add(...) that is "s" in fact? |
20:57:01 | Araq | you need to patch nimbase.h or the codegen so that symbols are not exported or maybe hack around with linker flags |
20:57:02 | transfuturist | so... is the undefined bit actually talking about the 0th argument, aka the command name? |
20:57:18 | OnO | is it const string_impl & or const string_impl * or just value? |
20:57:27 | OnO | when argument is passed by value, and when by reference? |
20:57:44 | fowlmouth | transfuturist, are you trying to use it from a plugin? |
20:57:52 | OnO | again if add modified it's argument then it must be passed by reference implicitly somehow |
20:58:02 | transfuturist | no |
20:58:15 | transfuturist | it says commandLineParams isn't defined on Posix? |
20:58:19 | Araq | OnO: well proc (string s) is not even Nim syntax :P |
20:58:40 | transfuturist | or "the proc" isn't, for each argument-related proc |
20:58:48 | OnO | sorry meant: proc add(s : string) |
20:59:11 | Araq | transfuturist: dunno what docs you are reading but os.paramStr works on all supported OSes |
20:59:40 | transfuturist | http://nim-lang.org/os.html |
20:59:42 | * | transfuturist shrug |
20:59:43 | fowlmouth | transfuturist, this? http://nim-lang.org/os.html#commandLineParams, |
20:59:55 | transfuturist | mhm |
21:00:11 | transfuturist | jsyk, right now i'm working on porting https://lambdacube3d.wordpress.com/2014/11/12/playing-around-with-font-rendering/ to nim |
21:00:34 | fowlmouth | transfuturist, i am wrapping nanovg for this purpose |
21:00:37 | transfuturist | distance field font rendering with sharp edges |
21:00:51 | Jehan_ | OnO: Basically, you can think of any argument being passed as either T& (var) or const T& (non-var). The exceptions are small types and types that have an explicit {.byCopy.} pragma annotation. |
21:01:22 | fowlmouth | transfuturist, well, not exactly super font rendering, but nice vector graphics |
21:01:23 | OnO | Jehan_: this is what I was looking for, thanks |
21:01:36 | transfuturist | heh |
21:01:47 | Jehan_ | OnO: And technically, the small type optimization is something that C++ can also do in principle (dunno if any compiler actually does it). |
21:01:57 | OnO | so any "object of" is passed by reference? and any simple types by value? what about tuples? |
21:01:58 | transfuturist | lambdacube3d seems to be the most advanced implementation of distance field rendering |
21:03:05 | Jehan_ | Ono: I think tuples/objects that are made up from two or fewer elements are also passed by value (for non-var arguments), but I'd have to check. |
21:03:43 | Araq | inheritable objects are always byref to minimize chances of accidental slicing |
21:04:01 | Araq | but apart from that, only its size counts |
21:06:29 | OnO | okie, then how about restricting in-place to string variables: add(s : var string) ? |
21:07:08 | OnO | I somehow miss notion of procedure that modifies its parameter or not |
21:07:38 | Araq | like ... 'var T'? |
21:07:57 | fowlmouth | i need to use a finalizer with unsafeNew |
21:09:08 | OnO | well, I found that in many places (like parser.nim) it acts as mutability qualifier |
21:09:19 | * | mpthrapp quit (Read error: Connection reset by peer) |
21:10:09 | OnO | so assigning immutable to immutable is not copying, in other cases it does copy |
21:10:22 | OnO | but how we could express that in Nim? |
21:12:04 | Araq | let moo = foo.copy ? dunno, it's not a problem to lose sleep over |
21:12:30 | Jehan_ | OnO: What problem are you trying to solve? |
21:12:33 | OnO | how about: let x : var string <- immutable variable to mutable string ? |
21:12:34 | Araq | OnO: well 'var T' is a mutability qualifier, what else |
21:13:26 | Araq | meh if it doesn't work with type inference, it sucks |
21:13:28 | OnO | but is 'var x : string' !== 'let x : var string = other.copy' |
21:15:48 | OnO | just forming the q other way: (1) can we have 'let s' of type 'var string' (2) 'var s' of type 'string' (w/o var) ? |
21:18:04 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:21:29 | * | OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…) |
21:26:31 | fowlmouth | no |
21:27:31 | Jehan_ | Ono: Again, I'm not sure what the problem is you are trying to solve? |
21:27:36 | fowlmouth | he left |
21:27:41 | Jehan_ | Oops. |
21:28:06 | fowlmouth | i hope one day will be `local s: string = "immutable"` |
21:28:16 | fowlmouth | local s: var string = "mutable" |
21:28:43 | fowlmouth | i think that is what he is proposing |
21:28:55 | Araq | that's awful |
21:29:23 | fowlmouth | why |
21:29:24 | * | pregressive quit (Remote host closed the connection) |
21:29:32 | fowlmouth | 5 letters is too much? |
21:29:40 | * | pregressive joined #nim |
21:30:33 | Araq | it's like having no type inference |
21:30:42 | transfuturist | you can have main() in your app, right? |
21:31:20 | BlaXpirit | why not |
21:31:31 | BlaXpirit | then do when isMainModule: main() |
21:31:33 | transfuturist | do you have to call it at the top-level to have it run? |
21:31:37 | transfuturist | ah, that |
21:31:39 | transfuturist | okay |
21:32:40 | fowlmouth | Araq, if you dont specify then its mutable, if you want var you could use local s: var = "hello" :p |
21:33:56 | transfuturist | that's not a type, though |
21:34:15 | transfuturist | if you want immutables, don't you just use let? |
21:34:18 | Jehan_ | Not sure what the difference is supposed to be vs. let/var? |
21:34:23 | transfuturist | ^ |
21:34:36 | Jehan_ | I feel like I'm missing something? |
21:34:59 | filwit | fowlmouth: 'local' is a horrible replacement for 'let' or 'var' 8-| |
21:37:18 | dhasenan | Is there a way to get an enum where values implicitly convert to int? |
21:37:37 | renesac | dhasenan: implementing a converter? |
21:38:19 | dhasenan | renesac: no, a keybinding manager. I want it to work with several distinct collections of actions that can be bound. |
21:38:54 | dhasenan | I could have one giant enum with all possible actions in it, but that would be ugly. |
21:39:18 | renesac | so you are looking at the inverse? |
21:39:26 | renesac | a enum built from an integer range? |
21:39:41 | BlaXpirit | dhasenan, converter toInt , isn't it obvious |
21:39:57 | dhasenan | Oh, right. I forgot about converters. |
21:40:00 | dhasenan | Thanks all. |
21:40:18 | renesac | -_- |
21:40:20 | renesac | np |
21:47:52 | * | Trustable quit (Quit: Leaving) |
22:00:00 | * | anthony_ quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
22:01:52 | * | anthony_ joined #nim |
22:05:39 | fowlmouth | filwit, well everybody seems to want let mut |
22:06:03 | filwit | no, not everyone |
22:07:45 | filwit | Nim's 'let' and 'var' is much better than Rust's IMO, even though what you can do with multiple params in Rust `let (mut x, y) = ...` is nice, it's mostly just useful for Rust because multiple return vars is important there (for error handling) |
22:08:39 | BlaXpirit | let mut is the stupidest syntax i've seen in my life |
22:08:50 | filwit | lol |
22:10:17 | filwit | i wouldn't call it that, but I do think Nim's solution is much more elegant in general |
22:11:24 | def- | wasn't the reason for "let mut" instead of "var" so that it's longer and people don't use it by default? |
22:11:54 | * | filcuc quit (Ping timeout: 245 seconds) |
22:12:42 | dhasenan | Maybe, but you get 90% of the way there by putting the one you want people to use in all your documentation and tutorials. |
22:12:54 | * | Kingsquee joined #nim |
22:12:59 | * | pregressive quit (Remote host closed the connection) |
22:13:09 | dhasenan | At least as long as you start it early enough. |
22:14:53 | filwit | 'var' is easily just as distinct as 'let mut', and making something verbose as a way to discourage it's use is just silly when it has to be used all over the place. |
22:19:49 | Jehan_ | Yeah, not really a fan of that, either. In the end, verbosity only creates the risk of introducing errors in code that needs to do the stuff that is being made verbose (because extra noise). |
22:23:19 | * | a5i quit (Quit: Connection closed for inactivity) |
22:44:07 | * | transfuturist quit (Quit: Lost terminal) |
22:45:32 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:50:01 | * | BitPuffin joined #nim |
22:50:10 | * | transfuturist joined #nim |
22:50:25 | transfuturist | why are hyphens illegal characters for module names? |
22:51:39 | BlaXpirit | transfuturist, because they are not valid identifiers |
22:51:48 | BlaXpirit | and you can use module names in code |
22:51:53 | transfuturist | ah |
22:52:09 | transfuturist | no matter, then :V |
22:54:11 | * | vendethiel quit (Ping timeout: 256 seconds) |
22:58:17 | * | vendethiel joined #nim |
23:21:12 | * | vendethiel quit (Ping timeout: 244 seconds) |
23:22:54 | * | vendethiel joined #nim |
23:27:46 | * | Jehan_ quit (Quit: Leaving) |
23:30:33 | * | brson quit (Quit: leaving) |
23:32:32 | * | brson joined #nim |
23:33:05 | * | a5i joined #nim |
23:35:31 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:38:23 | * | brson quit (Quit: leaving) |
23:38:41 | * | brson joined #nim |