<< 20-04-2015 >>

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:07Araqso ... good news ... I got compile-time lexer generation to work
09:08:27Araqbut 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:55fowlmouthwhat did that require
09:13:10Araq3 fixes to the VM
09:13:34Araqand some patience :P
09:13:40fowlmouthplease make passing functions around possible so glossolalia can work
09:14:03Araqoh yeah I fixed a bug for that too
09:15:01AraqI'm adding caching primitives to the VM. so the lexer gen step can be completely cached
09:15:11Araqbut still ... it sucks
09:15:29Araqfirst 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:41Araqa JIT would really help for it, I wonder if we partially compile .compiletime code via our JS or C backend
09:17:47Araq*we can
09:25:39*milosn quit (Ping timeout: 265 seconds)
09:32:59HakanD_is -app:gui windows only?
09:33:18Araqno, but it might be that it doesn't do anything on linux
09:34:47HakanD_tried on osx to build a working sfml app, it gives an error on linking : clang: error: unknown argument: '-mwindows'
09:35:13HakanD_any pointers on how can I build it so it doesn't open a terminal when i launch the app?
09:35:16Araqthat's a configuration problem then
09:35:48Araqdunno how this stuff works on osx
09:36:33HakanD_ok thanks, I'll search more on the internets
09:38:42HakanD_it gives the same error even on a echo hello world, I'll post it on github
09:38:59Araqhrm running this stuff at compiletime requires 63434182 obj.foo read accesses and 598960 function calls and 6 million integer comparisons
09:40:52AraqHakanD_: sure
09:41:16BlaXpiritHakanD_, can you not use app:gui??
09:41:41HakanD_I can, and I do (:
09:41:53AraqBlaXpirit: btw my code constructs 'refs' at compile time and it works
09:41:54HakanD_just looking for a way to run the app without it spawning a terminal window
09:42:11BlaXpiritAraq, did u change anything? because it sure didn't for me
09:42:21AraqBlaXpirit: not for 'ref' handling
09:42:30Araqbut I only use it to construct trees
09:42:31HakanD_BlaXpirit: thanks again for the nim-sfml btw, used it to create a game for ludum dare last weekend.
09:42:38BlaXpiritHakanD_, :o cool
09:42:53BlaXpirittell more
09:47:21HakanD_some silly game, http://ludumdare.com/compo/ludum-dare-32/?action=preview&uid=50151
09:47:55HakanD_plan was to ship something that resembles a game, in time
09:48:04HakanD_it was fun
09:49:25Araqbbl
09:50:18BlaXpiritHakanD_, and u encountered no bugs?
09:51:25HakanD_nope, I haven't done anything serious tho, some sprites, some shapes, some movement, some collission
09:53:00HakanD_linking sfml and csml was a bit of pain tho, messed with dynlib files to make it work.
09:53:08HakanD_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:44dom96HakanD_: really cool!
12:51:13HakanD_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:06a5iwhats cool ?
13:58:28samlgirls
13:58:41a5ii
13:58:44a5io*
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:21kashyap_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:54kashyap_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:43Araqkashyap_: well nimble is only for installation and deps then, write in the readme what needs to be built
15:43:59Araqwell that's how I'd do it, dom96 surely knows better
15:44:34kashyap_sure ... I can then go with Makefile for the build and nimble only for the packaging
15:45:06*banister joined #nim
15:45:07fowlmouthkashyap_, use nake
15:45:09*banister quit (Max SendQ exceeded)
15:45:12kashyap_what about koch ... is that generic or only for bootstraping/
15:45:23kashyap_oh okay
15:45:25kashyap_nake
15:45:37Araqkoch is only for bootstrapping / compiler development
15:45:51fowlmouthnimble install is for building and installing a binary, not sure if it would work for you
15:45:56Araqalso
15:46:16Araqif you have a project that uses the JS codegen, please submit JS related tests
15:46:43AraqI recently fixed a JS codegen bug and then felt bad because we have so few tests for it
15:47:08fowlmouththis compiles to JS or sdl2, pretty neat https://github.com/yglukhov/nimx
15:47:31Araqfowlmouth: and with a bit of luck, it still works for JS :P
15:47:38kashyap_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:21kashyap_thaks Araq fowlmouth - I'll keep the tests in mind
15:49:12kashyap_thanks for the link fowlmouth
15:52:52dom96kashyap_: 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:41kashyap_the only thing that seems to come in the way at this time is the ability to give multiple backend's
15:53:44fowlmouthdifferent 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:02AraqBlaXpirit: oh btw I like your optional module but I think it's overengineered for the stdlib
16:46:15BlaXpiritAraq, yyup
16:46:28BlaXpiritlook at what flaviu said though
16:46:57BlaXpiritwithout fixing the bug, the module will be either overengineered or oversimplified
16:47:29*milosn joined #nim
16:51:06BlaXpiritthe initial "dual" implementation looked simple, but it was very inflexible
16:51:45BlaXpiritNim really should be able to do this within one class
16:51:52Araqtype Maybe*[T] = object
16:51:55Araq case hasValue*: bool
16:51:57Araq of false: nil
16:52:00Araq of true: value: T
16:52:12Araqthat's a Maybe in Nim
16:52:47Araq4 lines of code.
16:53:06BlaXpiritAraq, the thing that got some people excited was the memory optimization if the object is nullable
16:53:23BlaXpiritnot using an additional boolean
16:53:55BlaXpiritif you think it should be dropped, then such a module would be nothing new, people have made them before
16:54:11Araqthe point of this module is interop
16:54:23BlaXpirit?
16:54:31Araqso that everybody can start to use the same Maybe[T]
16:54:58Araqbbs
16:55:38BlaXpiritwelp, you haven't given me any direction
16:55:56renesacBlaXpirit: one question is: is the memory optimization really important?
16:56:05fowlmouththe 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:08BlaXpiritthe answer is: sometimes
16:56:26renesacyou are not likely to make large seqs of maybes, you would normally unpack them
16:56:34BlaXpiritrenesac, or are you
16:56:51renesacand for stack alloacation (normal simple returns) I don't think a extra byte matters
16:57:24renesacwell, it would matter for heap alloactions, as that would probably be an extra 8 bytes per element
16:58:09fowlmouthyou figure a (bool,int) should be 5 or 9 bytes?
16:58:35renesacfowlmouth: more like 8 or 16 bytes, because alignment issues
17:00:26fowlmouthoh the heap or stack
17:00:33fowlmouthdoesnt matter
17:00:56renesacoh == on ?
17:00:59fowlmouthyea
17:01:06renesacindeed
17:02:06BlaXpiritok so flaviu has such a simple module
17:02:59fowlmouthit 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:41renesacfowlmouth: it should be an object if one ever want's to change it's implementation
17:04:54BlaXpiritdefinitely an object
17:05:18ArrrrrrWhat's the overhead of using object?
17:06:01fowlmouthruntime checks in debug mode
17:06:21renesacwhat type of checks?
17:07:01*Pisuke quit (Ping timeout: 264 seconds)
17:07:02fowlmouthif you use a discriminator it checks that the field is valid or throws an exception
17:07:35*vendethiel joined #nim
17:10:02ArrrrrrThen, 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:28renesacso Araq's version of Maybe[T] would not throw exceptions in release mode?
17:10:39renesacArrrrrr: objects are basically C structs
17:10:54BlaXpiritrenesac, that's just the base
17:11:51BlaXpiritwhat should be done based on it is a function that just accesses value and a function that may throw an exception
17:13:15fowlmouthwhy have a function do what accessing the field would already do?
17:13:34BlaXpiritfowlmouth, because fields should not be assignable
17:13:47BlaXpiritand i assume these functions wouldn't have any overhead at all
17:14:04BlaXpiritalso to allow replacing the implementation
17:14:29BlaXpiritalso to ensure immutability
17:14:39ArrrrrrI'd like to do opt.ifExists(i => echo i)
17:15:26BlaXpiritthat would be if i ?= opt: echo i
17:16:56*jfchevrette joined #nim
17:17:24Arrrrrrmm..
17:23:41BlaXpiritno idea why cast[int]((a: 6)) crashes the compiler
17:24:37*justicefries quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:25:42BlaXpiriti was gonna advocate swapping the values of optional object
17:25:52BlaXpiritso that value goes first, then the boolean
17:25:58BlaXpiritso it can be casted to value
17:26:21BlaXpiritbut that doesn't even compile, whatever
17:28:34fowlmouthshould it?
17:28:34*milosn quit (Ping timeout: 252 seconds)
17:29:32BlaXpiritfowlmouth, I don't see a reason why not
17:29:40BlaXpiritit shouldn't crash, in any case
17:30:28BlaXpiritok, echo cast[ptr int](addr(x))[] works
17:33:28ArrrrrrWhat is exactly '(a: 6)' in your code?
17:34:02BlaXpirittuple
17:35:04*milosn joined #nim
17:35:47*endragor_ joined #nim
17:35:55Arrrrrra tuple of one element? Is that possible?
17:36:23BlaXpiritcuz why not
17:36:30BlaXpiriti dont know actually, it may be bugged
17:36:56fowlmouthyes 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:24Araq(x,) for single element tuples has not been implemented yet though
17:40:35*endragor_ quit (Ping timeout: 264 seconds)
17:45:37kashyap_Hi, can we use channels with js backend (like clojurescript) ....
17:47:52Araqno and why do you need them?
17:48:01Araqjs doesn't have threads
17:49:04*gsingh93 joined #nim
17:49:12kashyap_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:08kashyap_anyway ... just being able to use proper modules and having type checking is significant advantage compared to using plain js
17:50:46fowlmouthif fake threading interests you why not use closure iterators
17:51:15kashyap_is there an example you can point me to fowlmouth?
17:53:09fowlmouthhttps://gist.github.com/fowlmouth/c142a2089a4a77a85b04
17:53:09kashyap_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:49fowlmouthnim has async/spawn stuff, i've never used it though
17:54:46kashyap_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:57kashyap_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:29fowlmouthkashyap_, http://nim-lang.org/asynchttpserver.html ?
18:04:59kashyap_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:14dhasenanI 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:37Araqdhasenan: don't find bugs, *fix* them :P
18:47:08dhasenanAraq: I'm following half of that, at least...
18:47:29dhasenanI still haven't gotten around to filing for open source approval for Nim at my job.
18:47:41Araqfowlmouth: test typesapi2 fails for me
18:47:57dts|pokeballAraq, does the compiler have documentation?
18:48:05dts|pokeballinternally i mean
18:48:17Araqyes, though people tend to ignore it
18:48:21*Pisuke joined #nim
18:49:02dts|pokeballlink?
18:49:25dts|pokeballif i had known that exists i probably would have been better about bug fixes:3
18:50:08Araqhttp://nim-lang.org/intern.html
18:50:11ArrrrrrYou have to catch'em all.
18:50:22Araqlinked from our 'docs' tab
18:50:32Araqyes, it's part of the website
18:50:38dts|pokeballthanks
18:52:30Araqhttps://github.com/Araq/Nim/wiki/Compiler-module-reference
18:53:10Araqfowlmouth: 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:34ArrrrrrHow do sets and seqs work under the hood? Are them allocated on heap?
18:59:56*jfchevrette quit (Ping timeout: 272 seconds)
19:00:53Araqno, like everywhere else they are allocated in the free space of your BIOS
19:02:37*mwbrown quit (Quit: Leaving)
19:03:24ArrrrrrThanks, that was useful
19:04:06AraqArrrrrr: '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:03fowlmouthAraq, ok i'll fix it
19:08:13Araqfowlmouth: no, I fixed it
19:08:31Araqthe thing is ... a nimcall<->closure conversion is a conversion
19:08:38Araqso 'is' now fails
19:08:42Araqas it should IMHO
19:08:48AraqI adapted your test
19:08:54fowlmouthwhere is that used
19:08:59Araqproc foo11 : testTypesym(void) =
19:09:01Araq echo "HI!"
19:09:02Araqstatic: assert foo11 is (proc():void {.nimcall.})
19:09:13Araqbut I have no idea what that breaks in practice
19:09:34fowlmouthim looking at this https://github.com/Araq/Nim/blob/devel/tests/macros/typesapi2.nim
19:09:48Araqyes
19:09:51Araqso am I
19:10:04fowlmouthoh you added the {.nimcall.} part?
19:10:11Araqexactly
19:10:15Araqthen it works again
19:10:50fowlmouthah ok
19:12:06*TEttinger joined #nim
19:15:30Araqwell? good enough for your stuff?
19:17:13fowlmouthi'd prefer if closure was required to make proc a closure instead but that would probably break things
19:18:14Araqyup
19:18:44*justicefries joined #nim
19:18:49fowlmouthhow about constraints
19:19:06fowlmouthclosure,cdecl,nimcall
19:19:45Araqso instead of {.nimcall.} you write {nimcall}?
19:19:46*HakanD_ quit (Quit: Be back later ...)
19:19:54Araqwhat's the point?
19:22:35fowlmouthi cant think of one at the moment >_>
19:24:29fowlmouthconstraints are underused though
19:27:44*endragor quit (Remote host closed the connection)
19:28:26renesacby the way, seqslices creates a copy of the seq when doing slice() on a seq
19:28:31renesaconly reslices are free
19:29:27Araqrenesac: depends on how it's implemented
19:30:04renesacyeah, I guess I just want a object with a ref to the seq, low and high
19:30:50renesacthe risk is of someone triggering a realloc() on the original seq, I guess
19:31:03renesacthe ref I get won't follow, or will it?
19:32:25AraqI don't understand your question
19:32:47renesacif I add things to the seq original, and it must be resized
19:32:58Araq'ref seq' is a ptr to a ptr under the hood so it should work
19:33:13renesachum
19:34:38*Jehan_ joined #nim
19:35:20*BitPuffin joined #nim
19:37:30renesacand if I try to avoid this double indirection, will the GC keep the old seq around if I keep pointing to it?
19:38:10renesacor I can only get an unmaneged pointer to where the seq is pointing, so it is unsafe anyway?
19:39:07Araqwell 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:01Araqto answer your question: it depends on how you avoid the double indirection
19:43:50*Pisuke quit (Ping timeout: 265 seconds)
19:44:13renesachow 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:34renesacshallow 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:05renesacand what is the advantage over just using shallowCopy()
19:58:09renesac?
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:01Araqrenesac: well you type '=' and it does shallowCopy for you. that's what .shallow does.
20:04:13renesacright
20:05:29renesacI would still need the shallowCopy() for the initial construction, then
20:08:08renesacuh, so the upper and lower bounds of the slice type are really called "a" and "b"
20:08:20renesacok, not really difficult to remember
20:11:22OnOAraq: 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:13AraqOnO: haven't found the time to review it yet, sorry
20:14:44OnOAraq: 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:23Araqoh sorry, actually I wanted to merge your stuff before pushing mine
20:15:40Araq*I wanted to review and merge
20:19:05*filwit joined #nim
20:25:22*saml_ joined #nim
20:26:07Araqhey filwit can you contribute your JS test to the test suite?
20:26:21filwitsure
20:26:32filwitbut it doesn't work properly
20:26:33AraqI fixed the codegen but have no idea what I broke
20:26:43Araqwell now it might :P
20:26:53filwiti see, very cool, let me try it out
20:29:30AraqI also fixed the refcounting bug that you never reported :P
20:30:12filwitgah, sorry.. i can't even remember what that bug was now...
20:32:29filwithmm.. getting javascript erros
20:32:36filwitone sec though, might be something in my code
20:32:55filwitalso, we're talking about Nim's JS backend right? not Emscripten.
20:36:03AraqNim's JS backend, yes
20:36:20*anthony_ joined #nim
20:36:22filwitAraq: 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:48filwitwell obviously it's not, cause my Chrome is giving 'undefined' for it
20:37:05Araqaha, I see the problem
20:37:29AraqI knew it would break things
20:37:36filwit:)
20:45:18*gmpreussner|lapt joined #nim
20:45:45OnOI have a question regarding string, tutorial says (a) 'string's are mutable, (b) assignment copies string
20:46:00OnOso.. how the string manipulation procs work ?
20:46:21OnOcoz if I pass string as a argument to proc it will be effectively copied, am I wrong?
20:47:18fowlmouththey are passed by reference and const as a param
20:47:25fowlmouthto make it mutable its "var string"
20:47:30AraqOnO: no, parameters are immutable, so no copy is necessary
20:47:41Araqit's passed like 'const &' in C++
20:49:00OnOso when it is exactly copied? assigning to var? or any assign including let ?
20:49:36Araqassigning to var though 'let' seems to become a new gotcha
20:49:50Araqlet x = y.field
20:49:57Araqy.field.add "bar"
20:50:11Araq# argh, 'x' is modified under the hood
20:50:40Araqso ... I guess I need to change that though it's consistent with parameter passing semantics
20:51:02Araqaliasing is bad, mmmkay
20:51:08OnOthat looks pretty inconsistent indeed
20:51:45OnObut if you change let asignment you will effectively copy also on argument passing to proc, right?
20:52:08OnOcoz I understand all arguments are "let" by default
20:52:37Araqhell no, that would be desastrous for performance
20:53:43OnOwell, in terms of C++, what is then an argument "const &" ?
20:54:03*HakanD_ quit (Quit: Be back later ...)
20:55:15Araqhrm?
20:55:43*transfuturist joined #nim
20:55:50Araqhey transfuturist
20:56:02transfuturisthow are you supposed to get command line arguments on posix?
20:56:12transfuturistalso hi :p
20:56:14Araqos.paramStr
20:56:19BlaXpiritD:
20:56:33BlaXpiritcommandLineParams
20:56:34OnOokie: proc(string s) <- if I pass some instance of string to add(...) that is "s" in fact?
20:57:01Araqyou need to patch nimbase.h or the codegen so that symbols are not exported or maybe hack around with linker flags
20:57:02transfuturistso... is the undefined bit actually talking about the 0th argument, aka the command name?
20:57:18OnOis it const string_impl & or const string_impl * or just value?
20:57:27OnOwhen argument is passed by value, and when by reference?
20:57:44fowlmouthtransfuturist, are you trying to use it from a plugin?
20:57:52OnOagain if add modified it's argument then it must be passed by reference implicitly somehow
20:58:02transfuturistno
20:58:15transfuturistit says commandLineParams isn't defined on Posix?
20:58:19AraqOnO: well proc (string s) is not even Nim syntax :P
20:58:40transfuturistor "the proc" isn't, for each argument-related proc
20:58:48OnOsorry meant: proc add(s : string)
20:59:11Araqtransfuturist: dunno what docs you are reading but os.paramStr works on all supported OSes
20:59:40transfuturisthttp://nim-lang.org/os.html
20:59:42*transfuturist shrug
20:59:43fowlmouthtransfuturist, this? http://nim-lang.org/os.html#commandLineParams,
20:59:55transfuturistmhm
21:00:11transfuturistjsyk, right now i'm working on porting https://lambdacube3d.wordpress.com/2014/11/12/playing-around-with-font-rendering/ to nim
21:00:34fowlmouthtransfuturist, i am wrapping nanovg for this purpose
21:00:37transfuturistdistance field font rendering with sharp edges
21:00:51Jehan_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:22fowlmouthtransfuturist, well, not exactly super font rendering, but nice vector graphics
21:01:23OnOJehan_: this is what I was looking for, thanks
21:01:36transfuturistheh
21:01:47Jehan_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:57OnOso any "object of" is passed by reference? and any simple types by value? what about tuples?
21:01:58transfuturistlambdacube3d seems to be the most advanced implementation of distance field rendering
21:03:05Jehan_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:43Araqinheritable objects are always byref to minimize chances of accidental slicing
21:04:01Araqbut apart from that, only its size counts
21:06:29OnOokie, then how about restricting in-place to string variables: add(s : var string) ?
21:07:08OnOI somehow miss notion of procedure that modifies its parameter or not
21:07:38Araqlike ... 'var T'?
21:07:57fowlmouthi need to use a finalizer with unsafeNew
21:09:08OnOwell, 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:09OnOso assigning immutable to immutable is not copying, in other cases it does copy
21:10:22OnObut how we could express that in Nim?
21:12:04Araqlet moo = foo.copy ? dunno, it's not a problem to lose sleep over
21:12:30Jehan_OnO: What problem are you trying to solve?
21:12:33OnOhow about: let x : var string <- immutable variable to mutable string ?
21:12:34AraqOnO: well 'var T' is a mutability qualifier, what else
21:13:26Araqmeh if it doesn't work with type inference, it sucks
21:13:28OnObut is 'var x : string' !== 'let x : var string = other.copy'
21:15:48OnOjust 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:31fowlmouthno
21:27:31Jehan_Ono: Again, I'm not sure what the problem is you are trying to solve?
21:27:36fowlmouthhe left
21:27:41Jehan_Oops.
21:28:06fowlmouthi hope one day will be `local s: string = "immutable"`
21:28:16fowlmouthlocal s: var string = "mutable"
21:28:43fowlmouthi think that is what he is proposing
21:28:55Araqthat's awful
21:29:23fowlmouthwhy
21:29:24*pregressive quit (Remote host closed the connection)
21:29:32fowlmouth5 letters is too much?
21:29:40*pregressive joined #nim
21:30:33Araqit's like having no type inference
21:30:42transfuturistyou can have main() in your app, right?
21:31:20BlaXpiritwhy not
21:31:31BlaXpiritthen do when isMainModule: main()
21:31:33transfuturistdo you have to call it at the top-level to have it run?
21:31:37transfuturistah, that
21:31:39transfuturistokay
21:32:40fowlmouthAraq, if you dont specify then its mutable, if you want var you could use local s: var = "hello" :p
21:33:56transfuturistthat's not a type, though
21:34:15transfuturistif you want immutables, don't you just use let?
21:34:18Jehan_Not sure what the difference is supposed to be vs. let/var?
21:34:23transfuturist^
21:34:36Jehan_I feel like I'm missing something?
21:34:59filwitfowlmouth: 'local' is a horrible replacement for 'let' or 'var' 8-|
21:37:18dhasenanIs there a way to get an enum where values implicitly convert to int?
21:37:37renesacdhasenan: implementing a converter?
21:38:19dhasenanrenesac: no, a keybinding manager. I want it to work with several distinct collections of actions that can be bound.
21:38:54dhasenanI could have one giant enum with all possible actions in it, but that would be ugly.
21:39:18renesacso you are looking at the inverse?
21:39:26renesaca enum built from an integer range?
21:39:41BlaXpiritdhasenan, converter toInt , isn't it obvious
21:39:57dhasenanOh, right. I forgot about converters.
21:40:00dhasenanThanks all.
21:40:18renesac-_-
21:40:20renesacnp
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:39fowlmouthfilwit, well everybody seems to want let mut
22:06:03filwitno, not everyone
22:07:45filwitNim'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:39BlaXpiritlet mut is the stupidest syntax i've seen in my life
22:08:50filwitlol
22:10:17filwiti wouldn't call it that, but I do think Nim's solution is much more elegant in general
22:11:24def-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:42dhasenanMaybe, 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:09dhasenanAt least as long as you start it early enough.
22:14:53filwit'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:49Jehan_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:25transfuturistwhy are hyphens illegal characters for module names?
22:51:39BlaXpirittransfuturist, because they are not valid identifiers
22:51:48BlaXpiritand you can use module names in code
22:51:53transfuturistah
22:52:09transfuturistno 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