<< 27-03-2015 >>

00:06:29*girvo joined #nim
00:06:33girvoHi all :)
00:12:16*fizzbooze quit (Ping timeout: 255 seconds)
00:14:55*Demos joined #nim
00:14:59*jholland quit (Quit: Connection closed for inactivity)
00:36:28filwithello
00:45:56*Matthias247 joined #nim
00:46:46*irrequietus quit ()
00:46:53*bjz joined #nim
00:53:31filwitdoes anyone know why I can't use `proc foo(t:type Foo)` anymore? (i have to use `proc foo(t:typedesc[Foo])` always).. was this a planned change or a bug?
00:53:41filwitdevel branch
00:56:00Araqfilwit: parsing of type changed but your code should still work
00:56:18filwitso it's a bug
00:56:34filwit(cause it defines correctly, but call doesn't resolve)
00:57:38Araqaha yeah
00:57:45Araqit still parses properly
00:59:31*gokr quit (Ping timeout: 255 seconds)
00:59:55filwitAraq: going to report it now unless you don't need it.
01:00:27*sampwing quit (Ping timeout: 252 seconds)
01:00:36*Matthias247 quit (Read error: Connection reset by peer)
01:00:38*reem quit (Remote host closed the connection)
01:01:59Araqdon't bother I fixed it
01:03:28filwitawesome! can you push that? I want to work on my project, but it makes heavy use of `type Foo` and I don't want to have to change it all just temporarily.
01:04:13Araqtesting it
01:04:21filwitthank you
01:07:53Araqhrm ... my fix breaks other stuff
01:08:06filwitAraq: btw, I tried my ray-tracer on the nim-js backend and runs faster than the nim -> emcc -> asm.js code, and has "more accurate" results (although both results are inaccurate)
01:08:31Araqand actually, thinking about it
01:09:15AraqI don't think proc foo(x: type Foo) was a documented feature
01:09:39filwitwas it not? I can't remember when that happened...
01:09:40*brson quit (Quit: leaving)
01:10:24Araqhrm wait
01:10:29Araqmy fix is completely wrong lol
01:10:46filwitoh :|
01:11:01filwitoh well, i can change my code to use typedesc for now
01:11:01*brson joined #nim
01:11:33filwiti'm generating most of the places I use this with a macro anyways, but I do hand-write it out in many places
01:12:27Araqno, just a minute
01:13:19filwitoh, okay sorry.. not trying to rush you, if you think you'll have it done soon I'll wait and toy with something else for a bit
01:13:57*bjz quit (Ping timeout: 248 seconds)
01:15:42Araqpushed
01:15:52filwitawesome, thanks!
01:16:58*fizzbooze joined #nim
01:17:24Araqbtw the refcounting bug you found is a general codegen bug
01:17:41Araqbut as far as I can tell the owning thread messes up the refcounts
01:17:49Araqand it has nothing to do with spawn
01:18:04filwitinteresting.. i completely forgot to report that too, sorry
01:18:22AraqI have it, no worries
01:18:41filwiti'm getting and ICE now
01:18:47Araqyay
01:18:56AraqI need to sleep
01:18:56filwitone sec, let me rebuild in debug
01:19:01filwitah, okay
01:19:35reactormonkfilwit, ./koch temp ;-)
01:19:48filwitwhat does that do?
01:19:49reactormonkgirvo, o/
01:20:16Araqfilwit: revert to some nim version that works for you then. I need to sleep, sorry
01:20:16reactormonkfilwit, read the ICE ^^
01:20:27Araqgood night
01:20:28filwitAraq: np. later
01:20:41filwitreactormonk: i c
01:22:07*elbow_jason joined #nim
01:42:58*reem joined #nim
01:43:57*wink-s joined #nim
01:44:14*reem quit (Remote host closed the connection)
01:44:16*dashed quit (Quit: Connection closed for inactivity)
01:50:10*brson quit (Ping timeout: 250 seconds)
01:50:29wink-sJust ran into a problem. I created a template with the same name as the module/file and then imported and tried to use it and got a uknown symbol error.
01:50:51wink-sIf it was a proc instead of a template it works!
01:52:43filwitwink-s: yeah the semantic handling around that is sometimes odd.. this is actually another reason I like PascalCase module names.. but anyways, you can usually get it to work by calling things more explicitly, eg `mymodule.foo(...)`
01:53:31*reem joined #nim
01:54:15wink-sThis feels like a bug to me, at a minimum I wish it would have given a better error message.
01:55:22filwityes, I agree. it certainly sounds like a bug if simply changing it to a proc makes it work.
01:56:02*bjz joined #nim
01:56:09*reem quit (Remote host closed the connection)
01:56:30reactormonkwink-s, post an inssue
01:56:40wink-swill do
01:57:12*brson joined #nim
01:57:57*reem joined #nim
01:59:58*reem quit (Remote host closed the connection)
02:02:26*bjz quit (Ping timeout: 272 seconds)
02:06:13*elbow_jason quit (Ping timeout: 248 seconds)
02:06:47*darkf joined #nim
02:08:07wink-sI created the issue: https://github.com/Araq/Nim/issues/2416
02:16:35*bmaxa joined #nim
02:17:23*reem joined #nim
02:19:25*reem quit (Remote host closed the connection)
02:26:30*bjz joined #nim
02:30:21*reem joined #nim
02:39:05*brson quit (Quit: leaving)
02:39:32EXetoCauto dereference. neat
02:40:20fowlwink-s, you should put blocks of text between ``` ```
02:41:09fowlwhat an odd error Error: internal error: expr(skTemplate); unknown symbol
02:45:31*reem quit (Remote host closed the connection)
02:50:09*gsingh93 quit (Ping timeout: 256 seconds)
02:50:49*reem joined #nim
03:04:37*fizzbooze quit (Ping timeout: 264 seconds)
03:05:03*gsingh93 joined #nim
03:09:26gmpreussner|workAraq: according to the commits, NimLime uses nimsuggest
03:11:39*fizzbooze joined #nim
03:34:36*bmaxa quit (Remote host closed the connection)
03:52:53*wink-s_ joined #nim
03:57:29*wink-s_ quit (Client Quit)
04:03:55*wink-s quit (Ping timeout: 246 seconds)
04:32:02*dhertz joined #nim
04:56:04dhertzI cannot seem to run /koch boot -d:release successfully on a raspberrypi - I keep getting this: Error: execution of an external program failed
04:56:56dhertzDoes anyone have any idea how I can convince it to compile?
05:10:32*Senketsu quit (Read error: Connection reset by peer)
05:11:49*dhertz quit (Ping timeout: 246 seconds)
05:21:49*filwit quit (Quit: Leaving)
05:26:03reactormonkaww, he left. was an interesting idea.
05:26:39reactormonkdoes koch boot report the --parallelBuild:1 part?
05:29:15*nande quit (Read error: Connection reset by peer)
06:02:55fowl'generic' is now 'concept'
06:03:10fowlthats good to know
06:03:33fowlreactormonk, do you know much about hacking on the compiler? how to dump the state of a symbol or type specifically
06:03:46reactormonkfowl, debug(sym)
06:04:05reactormonkit's listed somwhere, I think in the documentation "how to hack the compiler"
06:04:33reactormonkfowl, http://nim-lang.org/intern.html#debugging-the-compiler
06:05:11fowlthanks
06:10:17fowli fixed a bug :p
06:11:31*Demos quit (Read error: Connection reset by peer)
06:13:15*reem quit (Remote host closed the connection)
06:17:40*reem_ joined #nim
06:18:38*reem_ quit (Remote host closed the connection)
06:20:10*reem joined #nim
06:35:23reactormonk\o/
06:41:18*MyMind quit (Read error: Connection reset by peer)
06:42:07*Pisuke joined #nim
06:42:13*bjz_ joined #nim
06:44:49*bjz quit (Ping timeout: 264 seconds)
06:47:50*reem quit (Remote host closed the connection)
06:54:14*reem joined #nim
06:55:21*Pisuke quit (Read error: Connection reset by peer)
06:55:52*Sembei joined #nim
07:10:32*gsingh93_ joined #nim
07:22:33*reem quit (Remote host closed the connection)
07:23:37*fizzbooze quit (Ping timeout: 252 seconds)
07:30:47*reem joined #nim
07:36:33*Demon_Fox quit (Quit: Leaving)
07:40:07*girvo quit (Ping timeout: 252 seconds)
07:43:49*BlaXpirit joined #nim
07:56:48*reem quit (Remote host closed the connection)
08:00:14*gsingh93 quit (Ping timeout: 250 seconds)
08:00:15*gsingh93_ is now known as gsingh93
08:07:47*reem_ joined #nim
08:12:56*reem_ quit (Ping timeout: 272 seconds)
08:18:20*darkf_ joined #nim
08:18:36*darkf_ quit (Changing host)
08:18:36*darkf_ joined #nim
08:22:04*darkf quit (Ping timeout: 265 seconds)
08:28:20*Ven joined #nim
08:35:12fowlcan i tell koch to run a subset of tests?
08:36:42fowlnvm
08:36:48*girvo joined #nim
08:36:51BlaXpiritok
08:37:04Araqkoch tests cat macros
08:37:18Araq<-- runs the tests in the macros dir/category
08:38:02Araqbut I usually run the tester directly
08:38:13Araqtests/testament/tester cat macros
08:40:07Araqbtw anybody dislikes that 'i -1' will be parsed as 'i (-1)'?
08:40:28Araq(stupid question, of course somebody dislikes it)
08:40:34fowleverything success
08:41:06Araqyeah we cleaned up all tests by now.
08:41:14*girvo quit (Ping timeout: 264 seconds)
08:41:41Araqand def- is keeping them all green :-)
08:42:19Araqfowl: does your code use a[^1] everywhere now?
08:42:23*fizzbooze joined #nim
08:42:33fowlno i dont know what that is
08:42:37Araqha!
08:42:42Araqyou're behind the times :P
08:42:53Araqa[^1] == a[a.len-1]
08:43:07fowli had some code that used infix @ for slicing that way
08:43:25AraqI see
08:43:32fowlno wait someseq @ 0.. -1 would be 0 length
08:43:44fowltoday it seems to be invalid
08:45:43Araqwell no?
08:45:59Araq0.. -1 still produces the full seq
08:46:04Araqbut it's deprecated
08:47:39BlaXpiritis the change already in?
08:48:07Araqyes
08:48:17Araqpushed it yesterday
08:48:28fowlhmm let me try it again
08:49:46BlaXpiritcooool
08:52:18*BlaXpirit_ joined #nim
08:52:27BlaXpirit_uhh it doesn't seem to work
08:52:35BlaXpirit_wait, i'm stupid, i didnt pull, just recompiled
08:52:56AraqBlaXpirit_: it's only detected statically
08:53:01Araqlet x = -1
08:53:13Araqecho s[0..x] # too bad
08:53:24Araqecho s[0.. -1] # produces warning
08:53:26fowlAraq, https://gist.github.com/fowlmouth/574e163378b012a89b4f
08:53:54Araqfowl: oh yeah, need to update the vm too
08:54:13Araqsee? this is why you should exhaustive 'case' everywhere
08:54:24fowlare negative numbers not to be allowed in Slice?
08:54:39fowlor "negative length" slices not allowed?
08:54:40*irrequietus joined #nim
08:55:06BlaXpirit_sure they're allowed
08:55:30*BlaXpirit quit (Ping timeout: 256 seconds)
08:55:31BlaXpirit_var s = @[1,2,3,4,5,6]; echo s[-2] i'm getting index out of bounds
08:55:33BlaXpirit_what's up
08:55:41BlaXpirit_.eval var s = @[1,2,3,4,5,6]; echo s[-2]
08:55:43MimbusBlaXpirit_: Error: unhandled exception: index out of bounds [IndexError]
08:56:01AraqBlaXpirit_: negative indexing never was supported for a[i]
08:56:05Araqonly for slices
08:56:17BlaXpirit_allllrighty then
08:56:19Araqso yes, it never was consistent to begin with
08:56:46AraqI'm really happy with this solution
08:57:15Araqfowl: eventually s[0.. -1] will produce @[]
08:57:32Araqso it's not disallowed but produces sane results
08:57:35BlaXpirit_now it's srsly time for a release
08:58:02AraqBlaXpirit_: my todo still has 3 points and 1 unreported showstopper bug :-/
08:58:33BlaXpirit_if devel is better in every way than 0.10.2, there is no excuse
08:58:42fowlhow does ^ work?
08:58:57Araqfowl: it's a magic that rewrites the AST
08:59:13Araqso ... it just works when you overloaded [] and len :-)
08:59:13fowlTR macro?
08:59:32Araqno, it's a magic
09:00:03fowli wonder how much compiler logic you could replace now with macros
09:00:14Araqbut yes, conceptually it works like a TR macro
09:00:49Araqit even has the same limitation, 'a' in 'a[^1]' must not have a side-effect
09:01:03Araqas it literally duplicates the AST
09:01:44fowli want to get constraints working with getType() then i can generate 'interface' types
09:02:02Araqyou mean 'concept'?
09:02:08fowlyea
09:02:11*Trustable joined #nim
09:04:14AraqBlaXpirit_: another problem is that varriount has no time and he is the guy who builds the installers...
09:07:27fowlbtw i hate that i -1 will be i(-1), by this logic 1 .. ^1 should be 1(.. ^1)
09:07:57BlaXpirit_this is unacceptable
09:08:29BlaXpirit_honestly, this command call syntax is not a good fit for the language
09:09:03BlaXpirit_but if significant whitespace is adopted in all aspects of the language, i'm all for it
09:09:56BlaXpirit_i guess it's good that proc `^`(a:int):int overrides the behavior?
09:10:30Araqfowl: no. that's not how parsing works
09:11:05Araq.. ^ <-- here .. is clearly a binary operator. space before and after ..
09:11:09BlaXpirit_i -1 turning into i(-1) is unacceptable. is this really planned?
09:11:14fowlyour example is because -1 is a negative int, not -(1)?
09:11:38fowlthere must be a space after it, ..^ would be a different operator
09:11:41Araqnote that it's i <space> - <nospace> 1
09:12:04BlaXpirit_who cares
09:12:12BlaXpirit_people are not ready for significant whitespace
09:12:28BlaXpirit_especially if it's not consistent throughout the language
09:12:30fowl0 +1 is 0 + 1 or 0(+1)
09:12:52AraqRuby does the same iirc and people don't care
09:13:13Araqalso I run this over thousands of lines of code
09:13:32Araqand I always was like "ok, this was stupid to write it this way"
09:13:54Araqbtw it also caused no bug.
09:14:01Araqalways a compile-time error
09:14:16*fizzbooze quit (Ping timeout: 265 seconds)
09:14:50*BlaXpirit joined #nim
09:15:10Araqthis just looks at the spacing to disambiguate between unary and binary ops, this is not fullblown strong spaces.
09:15:15fowlAraq, no, ruby is weird
09:15:31fowl1 -1 is 0, f -1 is f(-1)
09:15:55*MyMind joined #nim
09:15:58fowlif f is a variable, f -1 is 0
09:17:26Araqsorry but echo $foo should do what it looks like
09:17:40Araqand it's stupid to parse it as (echo $ foo)
09:17:50Araqeverybody stumbles over that
09:18:07fowlthe difference is echo is a function and 1 is an integer
09:18:42Araqwell we're more consistent than Ruby then?
09:19:07fowllol thats not hard
09:19:40fowlanother fun example from ruby: f & 1, bitwise and, f &1, try to call #to_proc on 1
09:20:37Araqso how would YOU solve the 'echo' problem?
09:20:51fowlonly allow it at the top level
09:21:10Araqlet x = spawn foo $x
09:21:10fowlbut then it would be inconsistent with the inner command syntax
09:21:18Araqexactly
09:21:37fowli cant do echo(repr foo) right now either though
09:21:50Araqyou can
09:21:54AraqI finally fixed that
09:21:57BlaXpiritoooooh
09:22:37fowlcool
09:22:52fowlim glad this will finally work
09:23:07BlaXpirityup, this is great
09:23:23Araqwell tbh it's was quite embarrassing that our tests didn't cover that to begin with
09:23:51Araqwe had an extensive test for this feature ...
09:24:30Araqoh well, shit happens
09:39:47Araqspeaking of which ... there is another thing I like to do
09:41:07Araqand that is ensure we can change the parsing again for 1.0
09:41:13Araqso this:
09:41:18Araqlet x = case x
09:41:23Araq of Foo:
09:41:45Araqwill need to be aligned properly so that the 'of' is under the 'case'
09:42:26AraqI think in the long run it will really help us to further unify expressions and statements
09:42:41fowlAraq, have you ever heard the phrase "you're breaking my balls"
09:42:53Araqno.
09:43:15fowlare you trying to antagonize someone into writing another syntax
09:43:43BlaXpiritno, Araq, that is not good
09:43:57Araqwell you can convince me to not touch this.
09:44:07Araqbecause I don't really care that much
09:44:46Araqand we can always do
09:44:52Araq#! newsyntax
09:44:54Araqanyway
09:45:24BlaXpiriti have considered this scheme
09:45:31BlaXpiritaligning with 4 spaces
09:45:40BlaXpiritbut aligning these "of" with 2 spaces
09:46:10BlaXpiritthat's stupid anyway but
09:46:49BlaXpiritalso consider that someone may not like no alignment at all
09:46:52fowli hate the idea
09:47:03BlaXpiritcase x|of 5: 6|of 6: 7
09:47:19BlaXpiriti'd definitely rather write this as case x| of 5: 6| of 6: 7
09:48:31AraqBlaXpirit that's not my point though
09:48:42Araqindentation for 'of' is still fine
09:48:56Araqbut it has to be indented with respect to 'case's column
09:49:22fowli love how indentation is not that rigorously enforced, you can indent 4 spaces some places and 2 spaces
09:49:34Araqagain, not my point!
09:49:38fowlalso iirc you can throw of on anything
09:49:52fowllet x = 1+2\n of 42: "hello"
09:50:09Araqyeah that parses
09:50:21Araqhrm
09:50:29BlaXpiritoh, Araq, you're saying an even worse idea
09:50:30fowlwhere does of need to be aligned to here
09:50:45Araqfowl: yeah that's a valid objection
09:51:51fowlno actually i get invalid indentation errors
09:52:23Araqlol
09:52:33Araqbut
09:52:36Araqmatches x:
09:52:39Araqof foo: ...
09:52:44Araqshould work
09:52:53BlaXpiritmaan that's powerful
09:54:29fowlAraq, i can't make that work as an expression
09:55:19BlaXpiritAraq, that doesn''t work
09:56:12fowlit only works as a command
09:56:34Araqyeah well. that's actually what I'm talking about
09:56:37ggVGcwish I had time to hack some Nim..
09:56:58Araqfurther unification of exprs and stmts
09:57:22ggVGchas anyone here built anything for android armv7, or iOS with Nim?
09:57:44Araqarmv7 is in out test setup
09:57:47AraqI think
09:57:58Araqbbl
09:58:14fowlggVGc, there is a template for using sdl2 and deploying to android/iOS, also gradha has a few examples
09:58:42ggVGcsweet
09:58:55fowlhttps://github.com/yglukhov/nim-sdl-template
09:58:57ggVGcfowl: just wanted a real world proof of it working
09:59:00ggVGcthanks
09:59:21ggVGcI plan to start porting my game framework(in C) to Nim
09:59:28ggVGcbut it needs to build on mobile
09:59:37ggVGcseems like that shouldn't be a problem though
09:59:43fowlcool
10:02:49fowlwhat do you use for graphics?
10:03:29fowleh i guess opengles
10:03:49def-if it's a 2D game you can also use SDL2 directly
10:05:55*BlaXpirit quit (Ping timeout: 256 seconds)
10:06:59*girvo joined #nim
10:11:09*darkf_ is now known as darkf
10:11:50*girvo quit (Ping timeout: 264 seconds)
10:25:11*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:45:38*gsingh93 quit (Quit: Connection closed for inactivity)
10:49:12Araqback
10:55:17LoneTechwb
10:57:47AraqLoneTech: still waiting for your PR
11:08:13*reem joined #nim
11:12:52*reem quit (Ping timeout: 244 seconds)
11:17:01def-Araq: I just saw we have [..2], any chance of also getting [2..]?
11:20:46LoneTechyou optimist. Might get around to that sort of thing tonight, but I wouldn't recommend holding your breath. Thanks for the vote of confidence.
11:21:40LoneTechI am not a great language or compiler hacker, I just want to make my game controllers work
11:22:12LoneTechI suppose the good news is I finished the PC joystick electronics two days ago
11:22:50*TEttinger quit (Ping timeout: 265 seconds)
11:26:10LoneTech(I'm also going about making my game controllers work in a rather impractical way)
11:27:40*jefus_ joined #nim
11:31:32*jefus quit (Ping timeout: 265 seconds)
11:31:35fowlooo
11:33:07fowltype Container[T] = concept x,var y
11:33:36fowluse y when you need var access
11:33:46fowltoo cool brah
11:52:42Araqdef-: that's actually easy to parse but then we need yet another pragma like .postfix to make it resolve to the proper '..'
11:53:08Araqand people are already scared by our "evil" operator overloading
11:53:33*vendethiel quit (Ping timeout: 250 seconds)
11:54:34*vendethiel joined #nim
11:56:09*girvo joined #nim
11:56:10LoneTechoperator overloading is not so bad when you can easily track whence the operators came
12:00:29*girvo quit (Ping timeout: 250 seconds)
12:01:52def-Araq: should `^` behave exactly like `-` right now or is there a difference?
12:03:25Araqdef-: right now there is no difference
12:03:53def-Araq: then i found a bug
12:04:29def-https://gist.github.com/def-/afd1d583e8688428cb3c
12:05:18def-i guess ^2 means g.len-2, so this becomes 1-2, which is -1 and we get g[0..-1]
12:07:29Araqwell yes, '..' is still buggy
12:07:55Araqmaybe we need to fix it already then
12:08:00Araqthis transition is hard
12:11:08Araqor we make ^ return a Backwards[int] and overload '..'
12:11:34Araqbut I dislike that due to the combinatorial explosion it causes
12:12:56*Etheco- joined #nim
12:19:58Araqhrm this sucks ... we cannot tell people to use ^ instead of - when ^ doesn't work yet
12:20:02fowlnah.. just do it that way :)
12:20:12fowlbackwards[t:ordinal] = distinct t
12:21:00*arnetheduck_ quit (Read error: Connection reset by peer)
12:24:26*Ven joined #nim
12:29:41Araqfowl: hrm?
12:30:11EXetoCfowl: that's a workaround for the 'var' issue that I reported?
12:30:49fowlAraq, make ^ return a diff type and overload on it
12:32:51AraqEXetoC: is that bug still open?
12:33:08EXetoCI'll check
12:33:55Araqfowl: ugh. no, let's break code instead
12:33:57EXetoCyes https://github.com/Araq/Nim/issues/1033
12:34:15EXetoCmaybe I should have just used ptr in the meantime
12:35:30fowlEXetoC, try the second container[t] with generic var c
12:45:40*Strikecarl joined #nim
12:45:47StrikecarlHey everyone.
12:46:03StrikecarlAraq are you here?
12:46:16Araqhey
12:46:19StrikecarlSup
12:46:24Strikecarlidk what is wrong with my code
12:46:28Strikecarlbut
12:46:32Strikecarlwhen i include these
12:46:33Strikecarlinclude strutils, parseutils
12:46:35Strikecarli get an error
12:46:44Araqdon't include, import
12:46:48Strikecarloh
12:46:50Strikecarl(Facepalm)
12:47:11Strikecarlyup, errors is gone.
12:47:15StrikecarlThanks :)
12:47:17Araqbtw there are a few others here to that can answer questions
12:47:24StrikecarlAh, great.
12:47:28Araqyou don't have to catch me
12:47:32Strikecarlkk.
12:47:37EXetoCfowl: ok. what about the two last assertions?
12:49:32fowlEXetoC, i guess you cant use Container without params like you can with seq
12:53:44*dhertz joined #nim
12:55:10*dyu quit (Quit: Leaving)
12:57:02Araqhi dhertz
12:57:07dhertzHI
12:57:24AraqI think the external program failure is just because you run out of RAM
12:57:31dhertzWhoops - sorry it is still early :P
12:57:42dhertzInteresting
12:59:01dhertzIs there a way I could cross compile for the pi easily?
13:00:08Araqsure thing
13:00:25Araqhttp://nim-lang.org/nimc.html#cross-compilation
13:00:30EXetoCfowl: ok well there are some other problems: "proc putStuff[T](x: var Container[T], values: varargs[x.type.elemT])". I don't know if anything like this is possible yet
13:01:09dhertzAwesome! Thanks
13:01:18EXetoCif not, then it's simply a significant limitation
13:01:21fowlEXetoC, T here is int, not seq[int]
13:02:34def-dhertz: or you could add some swap. but i hope the Nim compiler will use less memory in the future
13:03:48dhertzI am hesitant to swap on the SD card - it was fairly cheap
13:05:47def-right, not a good idea
13:05:56Araqdef-: we will use less memory but GCC itself uses lots of RAM too
13:06:21emilspdoesn't clang use less memory ?
13:06:22EXetoCfowl: is that relevant? I don't know what to do
13:06:48fowlEXetoC, proc putStuff[T](x: var Container[T], values: varargs[T])
13:09:34Strikecarllet
13:09:34Strikecarl sum = 0
13:09:34Strikecarlsum = amount / rate
13:09:37Strikecarlwhat is wrong with that code?
13:09:43Strikecarlpretty new to Nim.
13:09:46Strikecarlgetting the error:
13:09:49Strikecarl'sum' cannot be assigned to
13:10:31emilspif you define a variable with let, you cannot mutate it. make sum a var with 'var sum =0' and it will be fine
13:11:29Strikecarl"type mismatch: got (TaintedString, TaintedString)
13:11:29Strikecarlbut expected one of:
13:11:29Strikecarlsystem./(x: int, y: int): float
13:11:29Strikecarlsystem./(x: float, y: float): float
13:11:29Strikecarlsystem./(x: float32, y: float32): float32"
13:11:36Strikecarlnow i get that error
13:11:50dom96you can't divide a string by a string
13:12:30Strikecarlhttp://pastebin.com/LHkwVR52
13:12:35Strikecarltried to make a fee simulator.
13:13:57EXetoCfowl: ofc -.- doesn't work though
13:14:01*filcuc joined #nim
13:14:12emilspyou'll have to convert the string into a float or integer
13:14:57StrikecarlHow exactly?
13:15:31fowlEXetoC, paste
13:16:05fowlStrikecarl, use parseFloat or parseInt from strutils
13:17:47Strikecarllittle question
13:17:53Strikecarllike in parseint
13:17:54EXetoCgist and some other sites using javascript still behave oddly in firefox. strange
13:18:08Strikecarltheres {.noSideEffect, procvar, gcsafe, extern: "nsuParseInt", raises: [OverflowError, ValueError], tags: [].}
13:18:12Strikecarlwhat is this?
13:18:15Strikecarland can i safely remove it?
13:18:25Strikecarlis it flags?
13:18:49fowlgithub was getting hit with ddos earlier
13:19:13Strikecarlwho would hit off github.
13:19:14Strikecarllol.
13:19:14def-Strikecarl: Those are pragmas that specify various stuff about the proc, but you can just ignore them for now
13:19:22StrikecarlAh, great.
13:19:48emilspis .noSideEffects pragma just a decleration or a way of ensuring that there are no side effects ?
13:20:31fowlemilsp, there is analysis to it
13:20:31def-emilsp: from my understanding it's a declaration, and then the compiler can use those declarations to automatically mark other procs as side-effect-free
13:20:48EXetoCfowl: https://gist.github.com/EXetoC/bd712a39ac6f0c2b2fbf works only without put(c, T)
13:21:03EXetoCand "proc p[T](x: Container[T])" doesn't work in any case
13:21:34fowlEXetoC, if you're testing a UDTC with no conditions just put true in it
13:21:49fowli dunno if thats the issue though, brb
13:21:50EXetoCso, bugs yet again. I'll report some more things
13:22:09EXetoCfowl: no, it works with discard but not 'put'
13:22:16emilspthanks
13:22:30Araqhey, not "yet again". I still haven't fixed 'concept'. I haven't even started really.
13:22:37Strikecarlin parseint, i use this parseInt(s: amount): int. but i get an type error.
13:22:54Strikecarldo i replace int with something?
13:22:55fowlEXetoC, well you pass typedesc to put()
13:25:18EXetoCfowl: wasn't that the case for type(T)? keep in mind that the first two assertions pass
13:25:25AraqStrikecarl: let foo = parseInt("123"); echo foo+123
13:25:41fowlEXetoC, there are 0 assertions in this 5 line gist
13:26:02fowlEXetoC, its like im having two conversations with you at once
13:26:43EXetoCfowl: no but in the code in the issue tracker, so what you said regarding typedesc doesn't seem to be true
13:27:11Strikecarlbut Araq, i use readLine to get the value of my "amount"
13:27:20Strikecarlso like
13:27:33Strikecarlvar amount = parseInt(readLine) ?
13:27:46def-parseInt(readLine(stdin))
13:28:02EXetoCAraq: I found some bugs before, and now it seems like even more things are broken, is what I meant
13:29:07Strikecarldef- type mismatch: got (float) but expected 'int'
13:29:22Strikecarlsource: http://pastebin.com/qVgCLnaA
13:29:27def-Strikecarl: if you want a float, use parseFloat
13:29:52Strikecarldont want float
13:29:54fowldef-, he gets that when he divides ints
13:29:56Strikecarli want int.
13:30:05Strikecarloh.
13:30:35fowlint(amount / rate)
13:31:22Strikecarlthanks!
13:33:56EXetoCAraq: great work on the engine. that'll probably have an effect on the popularity
13:34:29Araqlol cannot tell if you're sarcastic or not
13:37:50dhertzHow do I add extra flags to the arm gcc invocations?
13:39:55*jacksnipe joined #nim
13:42:49Araqdhertz: --passC:"foo bar"
13:43:54dhertzArguments can only be given if the run option is selected
13:44:02def-before the program
13:44:19def-nim c --passC:--foo file
13:44:56*girvo joined #nim
13:45:05Araqadd it to your config
13:45:23dhertz../Nim/bin/nim c -d:ssl --cpu:arm --os:linux --parallelBuild:1 --passC:"-mcpu=arm1176jzf-s -mfloat-abi=soft" main. nim
13:45:58dhertzThere is a space where it wrapped - but you get the idea
13:46:32dhertz@Araq as arm.gcc.options.always?
13:46:33def-dhertz: i guess you need a new --passC for each argument
13:47:11dhertz@def- that worked!
13:47:17Araqdhertz: arm.gcc.options.always seems the better choice yes
13:48:02Strikecarlcan i calculate percentage?
13:49:45*girvo quit (Ping timeout: 256 seconds)
13:53:03EXetoCAraq: not sarcasm of course. I've been here for about 2 years and have seen great progress
13:55:57*darkf quit (Quit: Leaving)
13:57:12LoneTechoh. does nim name mangling mean foo_0 is foo0?
13:57:34AraqLoneTech: yep
13:57:59LoneTechI have to mangle the msp430 includes more to compensate
13:58:38Araqso the msp430 uses both foo_0 and foo0 and it means different things?
13:59:03LoneTechyes, foo0 is a register within which foo_0 is a possible value
14:00:03LoneTechor wait.. it's messier
14:00:50LoneTechADC10SHT[0-3] are the bits where ADV10SHT_[0-9]* are values for the same field
14:01:23LoneTechi.e. foo_3 = foo0+foo1
14:02:20LoneTechthey go into some other register, which is typically defined in four ways: bar for 16 bit, bar_[LH] for 8 bit halves, and bar_ for the address.
14:03:48LoneTechso I'm mangling bar_ to bar_ADDR
14:04:20LoneTechalso, in some cases foo.* is named foo_.*, meaning field values have double underscores, which nim also doesn't like
14:05:03LoneTechthese headers are a mess, but slightly less so than their sample code.
14:06:35LoneTechI'm trying to import them with c2nim to reduce the imports I have to write
14:08:45*vendethiel quit (Ping timeout: 250 seconds)
14:10:20*vendethiel joined #nim
14:14:50EXetoCAraq: are there any inconvenient aspects of the urhonimo interface as a consequence of being based on C++ code? I did see some emitted code but that might not be so bad
14:16:32AraqEXetoC: yeah. I'm slowing adding stuff on top that makes sense ;-)
14:17:07EXetoCok
14:17:35Araqurho uses every c++ technique under the sun, templates with virtual functions, multiple inheritance, recursive deps everywhere
14:18:48Araqand even though it doesn't use the STL, it calls 'seq' a vector
14:19:18Araqbut then it also has the vectors from math named Vector2, Vector3, Vector4
14:20:30Araqso Vector has nothing to do with Vector3. sometimes I wonder if there is a single name in C/C++ that makes any sense
14:21:13EXetoCit's a little confusing
14:21:31EXetoCI recall seeing really long vector constructor names :p
14:26:59*Strikecarl quit (Remote host closed the connection)
14:28:28AraqEXetoC: I picked the "construct" prefix to scream "C++ constructor"
14:28:38Araqit's a c2nim option
14:28:49Araqyou can easily use a different prefix
14:31:45*banister quit (Read error: Connection reset by peer)
14:40:04EXetoCok
14:42:27*untitaker quit (Ping timeout: 265 seconds)
14:42:53LoneTechnow I'm even hitting duplicate definitions
14:43:34*singul42 joined #nim
14:44:03singul42hi there
14:45:05Araqwelcome
14:46:40EXetoCAraq: does it compile significantly slower than other code since it's C++ and uses templates?
14:47:17AraqEXetoC: building the Urho3D.lib takes its time
14:47:24*saml_ joined #nim
14:47:28Araqbut then we don't recompile it often
14:47:35Araqand link against it
14:47:45Araqurhonimo compiles fast
14:47:47*untitaker joined #nim
14:49:04EXetoCok
14:54:43*xet7 joined #nim
14:56:11*Matthias247 joined #nim
15:00:20*girvo joined #nim
15:02:14*vendethiel quit (Ping timeout: 264 seconds)
15:03:08*jholland joined #nim
15:05:14*girvo quit (Ping timeout: 272 seconds)
15:09:48gmpreussner|workAraq: is linking against Xcode frameworks supported yet? i remember you mentioned having a PR for it...
15:11:06*irrequietus quit ()
15:15:56*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:19:09LoneTechdoes template not support block syntax like var, let and const?
15:19:20*Strikecarl joined #nim
15:20:14BlaXpirit_LoneTech, false
15:21:25*vendethiel joined #nim
15:21:58BlaXpirit_ping me when u have a detailed question
15:22:16LoneTechI'm trying to patch up a c2nim ported header file
15:22:36LoneTechit was full of define name1 = name2 where it only wants an alias, so I figured I'd replace those with templates
15:22:37EXetoCBlaXpirit_: he means section (no :) I think
15:22:43LoneTechah
15:22:47LoneTechyes
15:23:06BlaXpirit_ooh
15:23:26BlaXpirit_then the answer is no
15:23:36LoneTechI tried just replacing const \n foo = bar.. with s/const/template/ and the compiler got upset
15:24:17LoneTechit would be nice imho if the language handled template, proc, const, var, let similarly
15:26:54Araqgmpreussner|work: well I applied the PR
15:27:54gmpreussner|workAraq: oh ok. are the frameworks linked statically, or does it support dynamic loading, too? are there any special command line switches needed?
15:28:01EXetoCLoneTech: the different syntaxes are used for different things though, and I don't know if a template will do
15:28:45gmpreussner|workAraq: or more specifically, will Xcode frameworks work with the {dynlib} pragma?
15:28:57EXetoCLoneTech: so what does it do other than creating aliases? I don't know what the context is
15:30:13Araqgmpreussner|work: my educated guess: nothing ever works in Unix land. ;-)
15:31:03EXetoCgeneralisations :p
15:31:18LoneTechit creates tons of aliases, constants, and SFR references (which for the moment I try to translate to ptr templates, but I need to fit in the explicit address and volatile target somehow)
15:31:19gmpreussner|workAraq: {.dynlib.} works well with .so libraries on Linux. i've just never used Xcode frameworks on MacOS, so I don't know how that will work out.
15:31:47gmpreussner|workfrom what i understand, the dynamic libraries are embedded within the framework, and once installed, MacOS will figure out what to load
15:31:57gmpreussner|worki'll give it a try tonight
15:32:23gmpreussner|workbut i still don't know how to tell Nim to link against a framework
15:32:47gmpreussner|worki suppose i just forward the appropriate option to the linker on the command line?
15:33:04gmpreussner|workand gcc as well
15:33:24gmpreussner|worki think -framework is the parameter
15:34:20*Ven joined #nim
15:34:23Araqgmpreussner|work: yes.
15:34:24*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
15:34:36LoneTechyou could do that using the pass[CL] pragmas
15:35:50gmpreussner|workLoneTech, ah, good idea
15:37:26*sampwing joined #nim
15:38:06LoneTechI do {.passC: "-mmcu="&mcu.}
15:38:42dhertzFinally got my cross compilation toolchain up - thanks for all your help
15:46:12dhertzI do have a few questions on how to do things better however!
15:46:12*BitPuffin joined #nim
15:47:33*vendethiel quit (Ping timeout: 250 seconds)
15:47:37dhertzAt the moment I am getting an array slice that may be too long - so I end up with something like this arr[0..min(2, arr)]
15:47:55dhertzIs there a nicer way
15:48:30BlaXpirit_0..2
15:48:50BlaXpirit_.eval echo [1][0..2]
15:48:51MimbusBlaXpirit_: eval.nim(3, 6) Error: type expected
15:48:54BlaXpirit_dang it
15:48:58dhertzThat was throwing a pointer error
15:49:26*vendethiel joined #nim
15:49:56BlaXpirit_ok, i was wrong. this surprised me
15:50:19BlaXpirit_0..min(2, arr) is great then
15:50:43dhertzCool
15:51:11EXetoCyeah, we have plenty of shortcuts by now I think
15:52:46EXetoCwait, min(2, arr)?
15:53:23BlaXpirit_arr.len hopefullty
15:53:27BlaXpirit_"unknown magic 'Roof' might crash the compiler"
15:53:40EXetoCprobably
15:54:01dhertzWhoops yes
15:54:34EXetoChm roof
15:55:39BlaXpirit_roof is definitely ^
15:55:46BlaXpirit_sounds funny
15:57:37*BlaXpirit_ quit (Quit: Quit Konversation)
15:57:53*BlaXpirit joined #nim
15:58:15*nande joined #nim
15:58:31*banister joined #nim
15:58:43EXetoCwhy not Pow? but it barely matters, and it does have a roof shape
15:59:02BlaXpiritni() { echo $* | tr ';' '\n' | nim compile --cc:tcc --verbosity:0 --run - }
15:59:10BlaXpiritto get .eval in your command line
16:00:09EXetoCneat
16:01:40EXetoCjust needs a couple more conveniences
16:02:30*Senketsu joined #nim
16:02:42*Gonzih joined #nim
16:12:05*BitPuffin quit (Ping timeout: 246 seconds)
16:15:07*BitPuffin joined #nim
16:16:37EXetoCand it chokes on imports
16:24:17*BitPuffin quit (Ping timeout: 246 seconds)
16:29:03*Demon_Fox joined #nim
16:34:17*gsingh93 joined #nim
16:35:11*saml_ quit (Remote host closed the connection)
16:35:24EXetoC"import macros" to stdin: lib/core/macros.nim(407, 31) Error: undeclared identifier: '-'"
16:35:44*Ven_ joined #nim
16:36:21*Ven quit (Ping timeout: 252 seconds)
16:36:54EXetoCso all instances of '-' break
16:37:08*mpthrapp joined #nim
16:39:36*Gonzih quit (Ping timeout: 272 seconds)
16:42:19*filcuc quit ()
16:47:29*mpthrapp quit (Remote host closed the connection)
16:47:46*mpthrapp joined #nim
16:48:46LoneTech... and now I find that there is both OP2_L (low half of OP2) and OP2L. nim's name mangling is causing a bit of a headache
16:49:05*girvo joined #nim
16:51:21*BitPuffin joined #nim
16:51:31EXetoCok. please report it
16:51:44EXetoCI thought such issues had been reported, but I couldn't find anything.
16:52:08*Gonzih joined #nim
16:52:19LoneTechthis isn't a nim bug, it's just the insignificance of underscores making it a pain to port TI's headers
16:52:35LoneTechsorry for the confusion
16:53:46*girvo quit (Ping timeout: 256 seconds)
16:55:37*Ven_ quit (Ping timeout: 252 seconds)
16:57:51EXetoCoh
16:58:20*brson joined #nim
16:59:47LoneTechhm, I think my first attempt at using nimble automatically downgraded my nim compiler to one that doesn't support avr.
17:01:46LoneTechor I forgot to remove an echo
17:02:34LoneTechError: system module needs 'copyString'. And I don't know what I broke.
17:05:15*Gonzih quit (Ping timeout: 256 seconds)
17:05:23*irrequietus joined #nim
17:16:17*a5i quit ()
17:17:43*silven_ is now known as silven
17:22:13*dhertz_ joined #nim
17:24:22*dhertz quit (Ping timeout: 246 seconds)
17:27:08*Matthias247 quit (Quit: Matthias247)
17:30:52*Gonzih joined #nim
17:33:10*BlaXpirit quit (Quit: Quit Konversation)
17:35:22*BlaXpirit joined #nim
17:38:14*Gonzih quit (Ping timeout: 264 seconds)
17:47:00*UberLambda joined #nim
18:01:18*vendethiel quit (Ping timeout: 272 seconds)
18:10:37*jefus_ is now known as jefus
18:22:22AraqLoneTech: it's unfortunately very hard to improve this error message
18:22:47Araqbut if you use 'string', you're likely doing it wrong for embedded. you should use 'cstring' instead
18:23:04Araqwhich is C's char*
18:28:52*vendethiel joined #nim
18:34:56*Matthias247 joined #nim
18:37:50*girvo joined #nim
18:42:25*girvo quit (Ping timeout: 264 seconds)
18:47:48*DemonOne joined #nim
18:56:00*reem joined #nim
19:00:36*reem quit (Remote host closed the connection)
19:08:38flyxnim tells me the VM is not allowed to cast
19:08:51flyxdoes that mean it's impossible to use ptr types at compile time?
19:12:49BlaXpiritflyx, yes, and ref too
19:13:12flyxwell I decided to use ptr because ref doesn't work too well
19:13:37flyxif ptr doesn't work either… I'm running out of options
19:15:37flyxhow do seqs work at compile time then? they allocate memory too if necessary
19:17:05*banister is now known as banisterfiend
19:19:57*reem joined #nim
19:23:39*reem quit (Remote host closed the connection)
19:24:23*mpthrapp_ joined #nim
19:26:14*reem joined #nim
19:27:22*reem quit (Remote host closed the connection)
19:28:04*mpthrapp quit (Ping timeout: 272 seconds)
19:41:23*fizzbooze joined #nim
19:42:27*sampwing quit (Ping timeout: 252 seconds)
19:43:32*MyMind quit (Ping timeout: 250 seconds)
19:44:38*singul42 quit (Quit: Page closed)
19:54:34reactormonkflyx, vm magic.
19:56:57*reem joined #nim
19:59:06*reem quit (Remote host closed the connection)
19:59:39*reem joined #nim
20:00:32*dashed joined #nim
20:01:32*reem quit (Remote host closed the connection)
20:02:07mpthrapp_I'm trying to compile the nim source on Mint, but I'm getting an error about not being able to find limits.h. I'm following the instructions on github. I can give any debug info that's needed.
20:02:11*reem joined #nim
20:04:32mpthrapp_It's on #include_next <limits.h> in, (I think), compiler_nim.c
20:05:33*fizzbooze quit (Ping timeout: 244 seconds)
20:05:56*fizzbooze joined #nim
20:08:42*BitPuffin quit (Ping timeout: 256 seconds)
20:13:26*irrequietus quit ()
20:21:17*sampwing joined #nim
20:24:32*banisterfiend quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:26:37*girvo joined #nim
20:29:01*phira quit (Quit: ZNC - http://znc.sourceforge.net)
20:29:54*phira joined #nim
20:31:02*girvo quit (Ping timeout: 246 seconds)
20:34:31*sampwing quit (Ping timeout: 252 seconds)
20:40:38*sampwing joined #nim
20:47:51BlaXpiritmpthrapp_, that's really weird
20:47:59BlaXpiritisn't limits.h standard library
20:48:02mpthrapp_Yup.
20:48:14mpthrapp_It's a brand new installation of Mint on a VM.
20:48:23BlaXpiritah, mpthrapp_, that explains it
20:48:34BlaXpiritu dont have library headers at all
20:48:39BlaXpiritinstall build-essential?
20:48:56mpthrapp_BlaXpirit: I did locate limits.h and it said I had it, but I'll give that a shot. Thanks.
20:49:01BlaXpirithm
20:49:59mpthrapp_That fixed it.
20:50:02mpthrapp_Thanks. :)
20:51:14BlaXpirittoo bad i saw your message so late
20:51:55*irrequietus joined #nim
20:52:18mpthrapp_Eh, it's all good. I'm working on getting a new machine set up, and one of like 20 things is getting a Linux VM with Nim.
20:57:47*UberLambda quit (Quit: Leaving)
21:02:23*sampwing quit (Ping timeout: 252 seconds)
21:04:35*pigmej joined #nim
21:11:55*polkm joined #nim
21:13:22*mpthrapp_ quit (Remote host closed the connection)
21:13:55dhertz_.eval [1,2,3][1..^1]
21:13:56Mimbusdhertz_: eval.nim(3, 9) Error: undeclared identifier: '..^'
21:30:45dhertz_is there a good way to base the binary name on what I am building for?
21:31:30*sampwing joined #nim
21:35:45*sampwing quit (Ping timeout: 252 seconds)
21:42:30*girvo joined #nim
21:42:31BlaXpiritgonna have to elaborate
21:46:47*girvo quit (Ping timeout: 250 seconds)
21:49:03*BitPuffin joined #nim
21:52:40*BlaXpirit quit (Remote host closed the connection)
21:54:28*BlaXpirit joined #nim
22:00:38*cir0x joined #nim
22:09:00*Matthias247 quit (Read error: Connection reset by peer)
22:12:46*dhertz_ quit (Ping timeout: 246 seconds)
22:19:20*reem quit (Remote host closed the connection)
22:24:31*Demon_Fox quit (Ping timeout: 252 seconds)
22:26:29*reem joined #nim
22:27:57*brson quit (Quit: leaving)
22:44:05*Strikecarl joined #nim
22:48:36StrikecarlI have an question
22:48:42StrikecarlI am working on an simple calculator.
22:48:46Strikecarland i want it so i can do
22:48:48Strikecarl1 + 1
22:48:50Strikecarlon the same line
22:48:52Strikecarland no
22:48:54Strikecarlnot*
22:48:55Strikecarl1
22:48:56Strikecarl+
22:48:56Strikecarl1
22:49:05Strikecarlhow would i pull that off?
22:50:21Araqparse it properly
22:50:31Araqparseutils helps with that, a bit.
22:51:59StrikecarlI'll look into that tomorrow
22:52:02Strikecarlgot 10 minutes.
22:52:03Strikecarlcba.
22:52:12EXetoCand plenty of unit tests
22:52:17Strikecarlsource: http://pastebin.com/84hsw2Xq
22:52:18EXetoCgood luck
22:52:22Strikecarlanything i can improve?
22:52:23Strikecarlbefore i go?
22:54:35*reem quit (Remote host closed the connection)
22:55:54*reem joined #nim
22:56:36StrikecarlGuess not.
22:56:39StrikecarlNight everyone.
22:56:44*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
23:18:04*reem quit (Remote host closed the connection)
23:27:28*reem joined #nim
23:27:43*jefus_ joined #nim
23:31:12*girvo joined #nim
23:31:13*jefus quit (Ping timeout: 250 seconds)
23:36:03*girvo quit (Ping timeout: 265 seconds)
23:38:31*cir0x quit (Quit: Leaving.)
23:42:05*TEttinger joined #nim
23:51:31*reem quit (Remote host closed the connection)
23:52:05*reem joined #nim
23:53:21*reem quit (Remote host closed the connection)
23:57:26*reem joined #nim
23:58:53*reem quit (Remote host closed the connection)
23:59:05*BitPuffin quit (Ping timeout: 244 seconds)
23:59:25*reem joined #nim