<< 21-06-2015 >>

00:01:28*boopsies is now known as boopsiesisaway
00:01:36*NhanH joined #nim
00:04:53*skroll2 quit (Ping timeout: 252 seconds)
00:04:54*ioctl_ quit (Ping timeout: 252 seconds)
00:05:02*ioctl joined #nim
00:05:10*skroll2 joined #nim
00:05:35*biscarch joined #nim
00:07:49*mikolalysenko joined #nim
00:07:49*EastByte joined #nim
00:18:15*johnsoft joined #nim
00:37:17*NimBot joined #nim
00:40:30*gyeates joined #nim
00:40:39*NhanH_ is now known as NhanH
00:41:56*Heartmender joined #nim
00:41:56*tmku joined #nim
00:41:56*shevy joined #nim
00:41:56*OnO joined #nim
00:42:10*Heartmender quit (Changing host)
00:42:10*Heartmender joined #nim
00:43:11*Heartmender is now known as Guest37450
00:50:47*endou___________ joined #nim
00:51:18*jackkv joined #nim
00:51:43*biscarch joined #nim
00:54:38*Guest85144 is now known as taotetek
00:55:15*profan quit (Remote host closed the connection)
00:55:16*endou__________ quit (Ping timeout: 943 seconds)
00:55:17*dalarmmst quit (Ping timeout: 943 seconds)
00:55:17*jackv quit (Ping timeout: 943 seconds)
00:55:18*minus quit (Ping timeout: 943 seconds)
00:58:28*minus joined #nim
01:01:49*gyeates quit (Ping timeout: 276 seconds)
01:02:20*gyeates joined #nim
01:14:28*dalarmmst joined #nim
01:29:58reactormonkdom96, imo do that contributing part yourself, I think you know yourself better what you want to communicate.
01:31:56*Uint2048 quit (Quit: Page closed)
01:46:09*Demon_Fox joined #nim
01:58:09reactormonkAraq, lib/impure/rdstdin.nim(103, 10) Error: cannot open 'readline'
01:58:17reactormonkyou broke booting. Booh.
02:11:23*strcmp2 quit (Quit: Leaving)
02:25:53*dddddd quit (Ping timeout: 246 seconds)
03:01:21*jackkv is now known as jackv
03:03:01*shevy quit (Remote host closed the connection)
03:06:23*BitPuffin|osx quit (Ping timeout: 252 seconds)
03:08:08*darkf joined #nim
03:49:57*shevy joined #nim
04:09:40*gyeates quit (Ping timeout: 276 seconds)
04:29:03*yglukhov joined #nim
04:33:16*yglukhov quit (Ping timeout: 246 seconds)
04:39:49*Kingsquee joined #nim
04:48:31*gyeates joined #nim
05:05:10*pipeep joined #nim
05:05:33*mnemonikk_ is now known as mnemonikk
05:05:33*mnemonikk quit (Changing host)
05:05:33*mnemonikk joined #nim
05:14:13*jj2baile_ quit (Ping timeout: 264 seconds)
05:14:39*jj2baile joined #nim
05:25:15*n3vtelen joined #nim
05:25:28*n3vtelen left #nim ("Leaving")
05:27:01*gyeates quit (Ping timeout: 256 seconds)
06:59:05*Amun-Ra is now known as Amun_Ra
06:59:35*Amun_Ra is now known as Guest54567
07:12:27*jubalh joined #nim
07:25:58*jszymanski joined #nim
07:56:13*xcombelle joined #nim
07:58:22*strcmp1 joined #nim
08:00:38*xificurC joined #nim
08:00:45*jubalh quit (Quit: Leaving)
08:20:51*Matthias247 joined #nim
08:36:10*ChrisMAN_ quit (Ping timeout: 276 seconds)
08:37:36*milosn quit (Quit: leaving)
08:39:25*key_ quit (Ping timeout: 276 seconds)
09:05:28*filcuc joined #nim
09:18:53*apense joined #nim
09:20:05*xcombelle quit (Remote host closed the connection)
09:24:10OnOgood morning and thanks for the mess :)
09:26:34*apense quit (Ping timeout: 265 seconds)
09:30:50*jubalh joined #nim
09:32:14*jubalh quit (Remote host closed the connection)
09:35:15*OnO is now known as ono
09:41:40*shevy left #nim ("I'll be back ... maybe")
09:53:32*ono is now known as OnO
10:03:40AraqOnO: hey. bbl
10:07:47*yglukhov joined #nim
10:25:55*gokr joined #nim
10:27:18*charmander is now known as squirtle
10:28:12*polde quit (Quit: q)
10:32:12*polde joined #nim
10:45:30*jaco60 joined #nim
10:46:48*polde quit (Quit: q)
10:47:23*polde joined #nim
10:50:23*BitPuffin|osx joined #nim
10:57:13*betawaffle quit (Ping timeout: 276 seconds)
10:58:22*gokr1 joined #nim
10:58:23*gokr quit (Read error: Connection reset by peer)
10:59:03AraqOnO: so ... calmed down a bit? ;-)
10:59:29OnOyeah, definitely, took my pills ;P
11:00:13*Kingsquee quit (Quit: Konversation terminated!)
11:02:29*betawaffle joined #nim
11:07:26AraqOnO: btw c2nim produces CR-LF on windows, when I edit the file the editor keeps line endings consistent, git diff on linux shows ^M. who is to blame?
11:10:45*squirtle is now known as dtscode
11:10:50*dddddd joined #nim
11:16:56OnOjust set your Git autocrlf
11:17:01OnOhttps://help.github.com/articles/dealing-with-line-endings/
11:18:36Araqyeah I know of this solution
11:19:16OnObtw. did the PR for Git commit rules https://github.com/nim-lang/Nim/pull/2966
11:19:18*leru joined #nim
11:19:24Araqand I guess I will do it. nevertheless it's wrong too, because as I said, a few files are CR-LF for testing purposes, at least they used to be.
11:20:49OnOI guess you may set these file in .gitattribtues to be treated differently
11:27:13OnObbl
11:30:54Araqdom96: can I add "nimble publish"?
11:32:07dom96Araq: If you want to implement it, go ahead.
11:33:37Araqfor me it's a showstopper missing feature
11:34:10Araqpackages.json makes me type stuff all over that's already in the Nimble file
11:34:49Araqit's also wrong btw
11:35:14Araqit asks about the license but this can depend on the git hash / version
11:41:35dom96It's the license that the project is currently on.
11:41:44dom96That is why this is also specified in the .nimble file.
11:41:57Araqit's not a big deal
11:41:58dom96Is it really that difficult to copy and paste?
11:42:32Araqwe really want this list to be used
11:42:57Araqso it has to be as simple as possible and then even simpler
11:46:22Araqalso JSON is annoying with all these commas and brackets and shit :P
11:47:37*filcuc quit (Ping timeout: 265 seconds)
12:01:47*tymat joined #nim
12:01:53tymathello
12:02:09tymatwhat is required to get FreeBSD/*BSD support?
12:02:13pigmejhey everyone ;)
12:02:32*milosn joined #nim
12:02:34Araqtymat: Nim does support FreeBSD/*BSD afaict
12:03:17*wuehlmaus joined #nim
12:03:48tymatoh I didn't see it on the list
12:03:55tymatis there an updates ports for it?
12:05:57AraqI don't know. but it's in the "ports" list, whatever that means.
12:30:44*Demon_Fox quit (Quit: Leaving)
12:41:17*jszymanski quit (Quit: computer sleeps...)
12:41:59pigmejreactormonk: the biggest problem is taht after some time, I have like 50 nimsuggest processes
12:42:21pigmejprobably find-or-create-epc is broken somehow
12:44:50*Ven joined #nim
12:45:51Araqdom96: https://github.com/nim-lang/packages/pull/195
12:47:46*Ven quit (Read error: No route to host)
12:48:08*Ven joined #nim
13:00:41*darkf_ joined #nim
13:01:30*xificurC_ joined #nim
13:02:44*Matthias247_ joined #nim
13:03:11*tmku_ joined #nim
13:03:45*jj2baile_ joined #nim
13:06:03*biscarch_ joined #nim
13:07:49*Heartmender joined #nim
13:08:02*Matthias247 quit (*.net *.split)
13:08:02*xificurC quit (*.net *.split)
13:08:02*strcmp1 quit (*.net *.split)
13:08:03*jj2baile quit (*.net *.split)
13:08:04*darkf quit (*.net *.split)
13:08:05*dalarmmst quit (*.net *.split)
13:08:05*biscarch quit (*.net *.split)
13:08:05*endou___________ quit (*.net *.split)
13:08:08*Guest37450 quit (*.net *.split)
13:08:08*tmku quit (*.net *.split)
13:08:11*OnO quit (*.net *.split)
13:08:12*Heartmender is now known as Guest49681
13:08:43*shevy joined #nim
13:09:01*endou___________ joined #nim
13:09:38*jj2baile_ quit (Ping timeout: 276 seconds)
13:09:47*OnO joined #nim
13:09:55*jj2baile joined #nim
13:10:25*biscarch_ is now known as biscarch
13:12:01*strcmp1 joined #nim
13:15:54*dalarmmst joined #nim
13:18:35*Matthias247 joined #nim
13:19:32*S_Walker quit (Ping timeout: 265 seconds)
13:20:30*themagician quit (Ping timeout: 265 seconds)
13:20:31*r-ku quit (Ping timeout: 265 seconds)
13:20:59*yglukhov quit (Ping timeout: 265 seconds)
13:21:01*fold quit (Ping timeout: 265 seconds)
13:21:28*Matthias247_ quit (Ping timeout: 265 seconds)
13:24:33*jubalh joined #nim
13:25:29*themagician joined #nim
13:26:14*S_Walker joined #nim
13:26:27*r-ku joined #nim
13:27:45*darkf_ is now known as darkf
13:28:37*milosn quit (Ping timeout: 276 seconds)
13:29:43*milosn joined #nim
13:35:28*fold joined #nim
13:46:10*jubalh quit (Quit: Leaving)
14:00:05*trafcio joined #nim
14:03:52*trafcio quit (Client Quit)
14:04:28*trafcio joined #nim
14:12:20*trafcio quit (Quit: Textual IRC Client: www.textualapp.com)
14:12:47*trafcio joined #nim
14:27:28*aziz joined #nim
14:35:10*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:37:16*trafcio quit (Quit: Textual IRC Client: www.textualapp.com)
14:37:42*trafcio joined #nim
14:44:50*jszymanski joined #nim
14:49:10dom96Anybody bored and want a project?
14:49:21*dalarmmst quit (Remote host closed the connection)
14:50:49*dalarmmst joined #nim
15:01:21federico2dom96: what project?
15:02:56*Guest49681 quit (Changing host)
15:02:56*Guest49681 joined #nim
15:02:56*Guest49681 quit (Changing host)
15:02:56*Guest49681 joined #nim
15:02:59*Guest49681 is now known as Quora
15:06:48Araqfederico2: I think he means creating a wrapper for github's API
15:08:58*tmku_ is now known as tmku
15:09:01*fowl quit (Read error: Connection reset by peer)
15:11:38*fowl joined #nim
15:16:49*strcmp1 quit (Remote host closed the connection)
15:17:02*gyeates joined #nim
15:18:13*trafcio quit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:30:49*aziz quit (Remote host closed the connection)
15:36:37*shevy left #nim ("I'll be back ... maybe")
15:39:29dom96federico2: yep, what Araq said
15:50:58*xificurC_ quit (Quit: WeeChat 1.2)
15:51:13*xificurC joined #nim
15:55:18*Matthias247 quit (Read error: Connection reset by peer)
16:24:12*trafcio joined #nim
16:25:00*boopsiesisaway is now known as boopsies
16:30:47*jszymanski1 joined #nim
16:33:13*jszymanski quit (Ping timeout: 250 seconds)
16:33:21*Ven joined #nim
16:38:22*trafcio quit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:42:49*zahary joined #nim
16:45:35*yeye123 joined #nim
16:54:06*jszymanski1 is now known as jszymanski
16:57:02*darkf quit (Quit: Leaving)
17:02:42reactormonkpigmej, pkill nimsuggest - any find the bug :-)
17:03:51reactormonkcan you toss me a screen recording for reproduction?
17:05:58*vikaton joined #nim
17:09:11*yglukhov joined #nim
17:10:39*federico2 is now known as federico3
17:14:24*yeye123 quit (Quit: Leaving)
17:17:00*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:18:54reactormonkAraq, bootstrapping still broken. Error: unhandled exception: invalid integer: -1 [ValueError]
17:20:42*aziz joined #nim
17:25:56pigmejreactormonk: yeah sure I will try to investigate
17:26:21pigmejfor now it seems that when nimsuggest crashes, it's not properly discarded/closed by epc
17:37:17*trafcio joined #nim
17:39:41reactormonkmaybe check for an active buffer? Or make nimsuggest more resilient to crashes
17:40:02pigmejreactormonk: that's a good question though what happens there
17:40:19pigmejalso what I noticed, nimsuggest errors are colored when spawned by epc
17:40:41pigmejso it seems that tty is not working correctly or something, because the colors appears just as escape sequences
17:40:47pigmejand not like real colors
17:55:30*Matthias247 joined #nim
17:56:32*Amrykid quit (Ping timeout: 246 seconds)
17:56:59*Amrykid joined #nim
17:57:17*trafcio quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:58:23reactormonkprobably tty detection gone wrong
17:58:55yglukhovnim resets tty attributes incorreclty.
17:59:23yglukhovafter nim invocation the bash prompt is corrupted a bit
18:00:26*profan joined #nim
18:07:54*skyfex joined #nim
18:14:59*yglukhov quit (Quit: Be back later ...)
18:18:17reactormonkwell, fuck
18:30:02*vendethiel- quit (Ping timeout: 264 seconds)
18:31:20*vendethiel joined #nim
18:54:58*cyraxjoe_ is now known as cyraxjoe
19:03:53*Trustable joined #nim
19:04:36*allan0 quit (Quit: WeeChat 1.2)
19:10:53pigmejreactormonk: any ideas how we can implement 'syntax check' /
19:10:54pigmej?
19:13:31reactormonkpigmej, what exactly what should it do?
19:13:57pigmejgood question
19:14:06pigmejbut genreally nimsuggest is useless when three is an error
19:14:38pigmejthe thing is we could know it only when debug mode is turned on
19:15:29*BitPuffin|osx quit (Ping timeout: 252 seconds)
19:16:03*Trustable quit (Read error: Connection reset by peer)
19:16:26*Trustable joined #nim
19:16:26reactormonkyou could count errors
19:16:34reactormonkor grab the errors from msg
19:16:43pigmejonly first one is usefull
19:16:49pigmejthe rest are garbage
19:17:22pigmejAraq said so
19:18:54reactormonk:-(
19:19:10pigmejyeah
19:19:21reactormonkAny way to mess with the parser such that it will produce better results?
19:21:11reactormonkAka rerun the parse with some modifications to make it run
19:32:22*Mat4 joined #nim
19:41:12*Guest54567 is now known as Amun_Ra
19:45:39*jubalh joined #nim
19:51:34*irezvov joined #nim
19:51:41irezvovhi there
19:52:28Araqhi irezvov
19:52:37irezvovcould anybody tell me how call one macro from another and pass variable with NimNode to it?
19:52:42Araqreactormonk: hrm. booting works for me
19:53:05reactormonkAraq, confirmed, fixed.
19:53:15irezvovi wonna decouple one big macro in small submacros
19:53:30irezvovi can provide some code for example
19:53:38reactormonkirezvov, the second one can just be a proc, you can call procs from macros
19:54:12Araqirezvov: usually macros use .compileTime procs
19:55:00irezvovbut i use quoute
19:55:09irezvovand got this error: Error: 'mExpandToAst' can only be used in compile-time context
19:55:28irezvovso i've decided it is wrong way
19:56:05irezvovi have got this message when tried use pure proc
19:56:51irezvovhttps://gist.github.com/SPY/67ee9b7ba12edcec3212
19:56:56irezvovthis is example
19:57:50fowlMark the proc compiletime
19:58:09*vendethiel quit (Ping timeout: 244 seconds)
19:59:08irezvovshame on my head, i have to be more careful
19:59:10irezvovthx :)
19:59:34irezvovfowl: this is working
20:00:57reactormonkAraq, any reason why the compiletime part is necessary?
20:01:11reactormonkno way to just duplicate the proc with {.compileTime.} added if it's called from a macro?
20:04:13*vendethiel joined #nim
20:08:16Araqreactormonk: usually .compileTime procs use NimNode which isn't available at runtime.
20:08:43Araqthere is no code duplication cause you can indeed just use the stuff that's neutral on the runtime vs compiletime issue
20:08:45reactormonkso you could automatically mark procs which use NimNode as compiletime?
20:08:55Araqyeah, we could do that
20:09:32reactormonkbut that would require a meaningful error incase you're trying to call it from runtime
20:10:39Araqwell right now you get nice C compiler errors
20:10:53Araqso ... it's not like it's fine the way it is now
20:11:14reactormonk:-(
20:13:02*Trustable quit (Remote host closed the connection)
20:18:50*wu-lee_ quit (Remote host closed the connection)
20:24:23irezvovi have written macro which helps to define network structures, but it looks awful :) https://gist.github.com/SPY/9393f9e5cb11ca4ae8b7#file-netdef-nim-L159-L168
20:25:01irezvovnetwork structure means fields have big-endian bytes order
20:25:31irezvovcode like that make me crazy: fieldType = i[1][0][0][1]
20:26:40irezvovhow can i improve readability?
20:27:15Araqi.first.zeroth.zeroth.first
20:27:32Araq(we don't know really)
20:27:55irezvovi think i should rename i to field. it will change everything :)
20:28:18Araqyup
20:30:11irezvovso is it regular practice to have such code in templates?
20:30:42avsejirezvov, wow, you are working on couchbase driver?
20:30:53avsejor memcache?
20:31:04irezvovavsej: no, on memcache driver now
20:31:51irezvovjust like study project. i wonna feel Nim better
20:31:56fowlirezvov: normally we can use quote: to have nice looking macros but you are filling in the fields on a type def and its very nested, the only alternative is to build the ast inside out
20:31:59avsejinteresting. I have plans to write couchbase one. so memcache parser (or macro for packet definition) would be great
20:32:59fowlirezvov: inside out would be building the nnkRecList, adding it to nnkObjectTy, adding it to nnkTypeDef, then nnkTypeSection
20:33:11irezvovavsej: you are welcome :) i will be glad if it will be usefull for somebody
20:34:39*skyfex quit (Read error: Connection reset by peer)
20:34:54*skyfex joined #nim
20:35:07Araqirezvov: it's common but you can use accessors like 'x.condition.thenbranch'.
20:35:20Araqexcept macros.nim doesn't define these :P
20:35:40Araqwe tried to keep the API small
20:35:51irezvovfowl: yeah, i think i will separate iteration with data extraction and call procedure for each task inside loop step
20:40:56irezvovbtw, this is my memcached driver(but it is on very early state now) - https://github.com/SPY/nim-memcached/blob/master/memcache.nim
20:41:20*jszymanski quit (Quit: computer sleeps...)
20:41:37irezvovnonetheless it has been working already
20:42:35fowlirezvov: suggest you use {.pure.} Enums when you have short identifiers like Get/Set
20:42:53irezvovyeah, good point
20:48:59*skyfex_ joined #nim
20:51:40*skyfex quit (Ping timeout: 256 seconds)
20:58:08*NimBot joined #nim
21:00:05*brson joined #nim
21:04:24*dalarmmst quit (Ping timeout: 252 seconds)
21:06:19*wu-lee joined #nim
21:09:59*wan joined #nim
21:10:08*aziz quit (Remote host closed the connection)
21:11:37*NimBot joined #nim
21:14:49*jubalh quit (Quit: Leaving)
21:16:22*dalarmmst joined #nim
21:16:23pigmejhmm how should I use marshal.to ?
21:23:42Araqmarshal.to[destType](x)
21:24:43pigmejah right
21:24:47pigmejthx
21:26:01reactormonkpigmej, nimsuggest stuff debugging?
21:26:20pigmejreactormonk: ?
21:26:32reactormonkpigmej, or why the marshall stuf
21:27:04pigmejplaying with nim and testing nim-mode in something realistic
21:27:22*Demon_Fox joined #nim
21:27:27reactormonkneat
21:38:02fowlirezvov: in waitForResponse you don't need new(), instead put the struct on the stack and pass its address
21:48:20*Demos joined #nim
21:52:20*Mat4 quit (Quit: Verlassend)
21:56:14*brson quit (Quit: leaving)
22:06:00*zeroDivisible joined #nim
22:08:37*dnoq joined #nim
22:09:09*zeroDivisible left #nim ("WeeChat 1.2")
22:09:55*leru quit (Quit: Nettalk6 - www.ntalk.de)
22:11:27DemosAraq, https://twitter.com/velartrill/status/612701472430686208
22:15:16*dnoq left #nim (#nim)
22:15:30*Pisuke joined #nim
22:16:15*yglukhov joined #nim
22:17:46*MyMind quit (Ping timeout: 276 seconds)
22:19:05AraqDemos: twitter to her to join IRC? ;-)
22:19:27DemosI twittered her that it's a bug
22:20:28*yglukhov quit (Ping timeout: 252 seconds)
22:20:48Araqwhy?
22:20:54*Pisuke quit (Max SendQ exceeded)
22:20:59Araqwhy is it a bug?
22:21:12Araqthe compiler can mangle the name as it wishes?
22:21:47Demosright, but it should not randomly conflict with something in a different module
22:22:04*Jev joined #nim
22:22:06*Pisuke joined #nim
22:22:12Araqit doesn't. there is an ID attached to it
22:22:17reactormonkDemos, it should mangle it with an underscore... that's what it usually does.
22:22:25Jevis there a way to define multiple return types for a proc
22:22:54reactormonkJev, cosum style?
22:22:57AraqJev: overloading by return type is not supported if that's what you mean
22:23:14Jevi mean returning perhaps either a int or bool
22:23:21vikatonNim is sexist :O
22:23:30Demosright, well this woman had a conflict. I guess the same thing can happen in C++. We could emit names that are not valid C symbol names
22:23:32reactormonkJev, https://github.com/nim-lang/Nim/issues/1070
22:23:37Demosassuming linker support
22:24:10reactormonkvikaton, yeah, those people always pull out the hardest terms directly. That's also why I didn't want def- to fix that stuff :-/
22:25:03AraqJev: return a tuple (int, bool) or perhaps Option[int] or just 'int' and document that sometimes it only returns 0 and 1
22:25:36Jevooo alright. that works for me
22:25:47reactormonkJev, or look for en Either implementation :-)
22:25:52DemosAnyway apperently sometimes the compiler's name mangling does conflict with stuff in C libraries
22:25:58reactormonkJev, or return a case object
22:26:15Jevill take a look at it!
22:26:28AraqDemos: ah perhaps with the 'init' procs we generate
22:26:43Demosmaybe
22:26:47Araqbut not with her 'init' proc, that one should get an ID attached to it
22:27:02Demosright, but she could have had both her init proc and ours
22:27:07Demosno way to really tell the difference
22:27:10Araqyup
22:27:28Araqthat should be really easy to fix
22:30:16reactormonkAraq, http://hastebin.com/kaboduqita
22:31:10Araqreactormonk: bug report? fix? hrm?
22:32:05reactormonkAraq, that's just what I got back.
22:34:45reactormonkAraq, the problem is that the glfwInit() for init of the module needs to be mangled a bit more
22:37:23wu-leeall: making some slow progress getting Nim working on Arduino
22:37:44wu-leeis this entirely virgin territory, or (as I suspect) has this been done before?
22:37:58reactormonkwu-lee, Tried it, lemme give you my code
22:38:14wu-leeexcellent, that would be fantastic
22:40:22reactormonkwu-lee, https://github.com/reactormonk/nim/commit/f9a5cd43c160995316377b1f1af94b18781d1f23
22:40:29wu-leeI've had problems with global vars, don't seem to be usable, in nim or C
22:40:32reactormonkwu-lee, https://github.com/reactormonk/nim/commit/3b555cbc4d8d06a2494c05ec4f2a78e411c683e7
22:40:34wu-leedoes that sound right?
22:40:38reactormonknope
22:41:01reactormonkHow much RAM does your arduino have?
22:41:35wu-leeit's a diecimila with an atmega168
22:42:05reactormonkneed a number ^^
22:42:50wu-leeso.... (looking up) 16Kbytes flash ram
22:43:46reactormonkyeah, so you'll need to remove heap stuff I'd say... because you can't alloc()
22:44:07reactormonkthat's what I tried to do, with limited success
22:44:23reactormonkbut I haven't followed the standalone part, someone else might have done something meanwhile
22:44:33wu-leeI see you needed to patch the Nim source
22:45:10reactormonkWell, yeah. string and seq assume you have a heap
22:45:15reactormonk... which you don't
22:46:04wu-leeI have a nim program which doesn't work, unless I compile the emitted C with the stdlib_* files #included
22:46:06reactormonkyou can try just not using them but the last time I checked it didn't work, might just now
22:46:22reactormonkdon't forget to add --gc:none
22:46:36reactormonkhuh? got me some code?
22:46:53renesacreactormonk: arduino uno has 2.5kb of RAM and 32kb of program memory in flash
22:47:07reactormonkrenesac, yeah, so no heap
22:47:23wu-leethanks, --gc:none wasn't included. however, doesn't seem to help
22:47:42renesac--gc:none is implied by --os:standalone
22:47:45renesacIIRC
22:47:52reactormonkrenesac, I don't think so
22:47:55reactormonklemme check
22:48:48wu-leehold on, I'll create a gist.
22:49:01reactormonkrenesac, pretty sure it isn't
22:49:26renesacthe command line for avr that I found here was:
22:49:28renesacnim c --cpu:avr --os:standalone --deadCodeElim:on --genScript x.nim
22:50:26reactormonksounds about right
22:51:10renesachow will the gcc malloc/mmap memory w/o an OS?
22:51:44reactormonkyeah, that's why seq/string won't work
22:52:15renesacstrings on the stack should work though
22:52:38renesacbut yeah, you want static allocation
22:53:10reactormonkthat's the PSTR in the commit I linked
22:53:43renesacoh, didn't read the entire dicusssion
22:55:04wu-leereactormonk: ok, current mess committed here: https://github.com/wu-lee/nim-test/tree/arduino
22:55:09reactormonkeven if you did, you would have missed the commit, didn't mention it explicitly
22:56:13reactormonkoh, not master branch O.o
22:56:15wu-lee"make upload" for nim, "make -f c.makefile upload" for the C version (currently blink5.c)
22:57:04wu-leeblink5.c has had the #includes of stdlib_* commented out, if I uncomment them it seems to work
22:57:30wu-leeotherwise, it's a copy of the generated blink.c file in nimcache
22:57:31reactormonklib/nimbase.h:393:13: error: size of array ‘assert_numbits’ is negative
22:58:17reactormonk/* Test to see if Nim and the C compiler agree on the size of a pointer.
22:58:20reactormonk On disagreement, your C compiler will say something like:
22:58:22reactormonk "error: 'assert_numbits' declared as an array with a negative size" */
22:58:23wu-lee(actually, with nimFrame and popFrame also commented)
22:58:42reactormonkwu-lee, there we go :-)
22:59:08wu-leeyes, was getting that recently when attempting to build and link stdlib_* stuff separately
22:59:35wu-leeoh, wait, i have a nim.cfg I've not committed
23:00:03reactormonkwu-lee, platform.CPU[targetCPU].intSize.rope
23:00:15reactormonk^ that one produces an incorrect result on your platform
23:00:25reactormonkor wait, the gcc invocation sucks
23:00:41reactormonkhow do you actually compile your C?
23:00:49wu-leeok, pushed that .cfg
23:01:09wu-leesee the c.makefile
23:01:36reactormonkrenesac, somehow genScript fails horribly
23:02:04AraqgenScript has been broken for quite some time now I think
23:02:15reactormonkwu-lee, ah, that's better with the .cfg
23:02:17Araqbut at least the script gives a starting point
23:02:31wu-leethe c.makefile includes a "-DNIM_INTBITS=16" hack you might ignore currently, as I said, it's very much work in progress
23:02:51reactormonkwu-lee, trim the config file a bit
23:02:52wu-leebut the compilation would be: avr-gcc -I ~/i/installs/Nim/lib -g -mmcu=atmega168 -c -o blink5.o blink5.c
23:03:44reactormonkwu-lee, --passC:-mmcu=atmega168
23:04:08wu-leereactormonk: it's a cargo-cult copy, but all I changed were the lines setting avr-gcc
23:04:24reactormonkwu-lee, yeah, delete all the lines you didn't change
23:04:27wu-leeto avoid the ‘assert_numbits’ is negative
23:04:31wu-leeerror
23:05:20reactormonkwu-lee, yeah, that error indicates that you configured gcc incorrectly - with the passC that shouldn't be a problem anymore
23:05:41wu-leereactormonk, done, pushed
23:06:16reactormonkwu-lee, can't pull
23:06:37reactormonkaka nothing new
23:07:46wu-leeok, try again
23:09:50reactormonkthat's better
23:10:20reactormonkwu-lee, add passC = -mmcu=atmega168
23:10:42reactormonkthe -I should be generated by nim
23:10:59wu-leein nim.cfg?
23:11:12reactormonkyup
23:12:23*Matthias247 quit (Read error: Connection reset by peer)
23:13:09wu-leeok, done, pushed
23:13:19wu-leeno obvious change in behaviour however
23:13:26reactormonkHm.
23:13:37wu-lee(i.e. no flashing)
23:14:19reactormonkyou can also add everything else, such as gc = none\nos= standalone\n etc.
23:15:09*strcmp1 joined #nim
23:15:37reactormonkwu-lee, /usr/bin/avr-ld: cannot find -lm
23:16:10reactormonkI'll just install the arduino sdk
23:16:50wu-leereactormonk, just push a version of blink5.c and c.makefile which seem to work for me
23:17:58wu-leei.e. with #included stdlib_*, compiles with 'make -f c.makefile upload'
23:18:38wu-leescuse grammar, fat fingers.
23:19:15reactormonkwu-lee, lemme install arduino here real quick
23:19:41wu-leeok, np. I expect you'll need that.
23:22:21wu-leea couple of odd things about the blink.nim implementation....
23:22:40reactormonkgo on
23:22:45wu-leea) I can't call the proc 'blink', I get an odd compiler error
23:23:09wu-leeseems to be the result of simply naming a proc the same as the file it is in
23:23:43reactormonkeh yup, we had an issue like that before
23:24:02wu-lee(just trying to dig up the actual error)
23:25:10wu-lee"Error: internal error: expr(nkClosedSymChoice); unknown node kind"
23:25:20reactormonkyeah, try another name
23:25:28wu-leeyep, that's all I did
23:26:01reactormonkcommand to compile it?
23:26:07wu-leeb) global vars seem not to work as expected. If I don't put the actual code in a proc, nothing works
23:26:10reactormonknim c --cpu:avr --os:standalone --deadCodeElim:on --gc:none --parallelBuild:1 blink.nim
23:26:37reactormonkI get /usr/bin/avr-ld: cannot find -lm - which libs are that?
23:26:57wu-lee...by comparing with modifications of the generated c, seems global vars don't work in C either.
23:27:19wu-leelibm is the floating point maths lib iirc
23:28:13reactormonkthen why the fuck isn't it found?
23:28:21wu-leenot sure why it would need that at all.
23:28:23reactormonkI mean it's in /usr/lib/libm
23:29:18wu-leejust checking what I have installed.
23:30:37wu-leelibm appears to be part of the libc6 packages (on ubuntu)
23:31:30wu-leeI don't seem to have any specific avr libc6 installed
23:31:36reactormonkah thanks
23:31:55reactormonkyes, you were correct
23:32:02wu-leehowever I do have arduino arduino-core arduino-mk
23:32:14reactormonkyeah, arch has just arduino in the AUR
23:32:28reactormonkyeah, it compiles. But you said it doesn't run?
23:32:58wu-leethe nim version compiles, uploads, and the arduino does nothing visible
23:33:02wu-leeno blinking
23:33:18wu-leethe C version makes it blink however
23:33:37reactormonktry -d:release just because
23:33:53reactormonkalso, which one is the c version?
23:34:24wu-leeok, tried, same result: no blinking
23:34:33wu-leethe c version is blink5.c
23:34:58wu-leethe only difference I can see is that the stdlib_* files are inlined.
23:35:35*chdsbd joined #nim
23:36:29reactormonkah, you manually added the includes
23:36:37wu-lee(because laziness, plus I had trouble getting the stdlib_* files to compile without the negative nimbits errror)
23:36:43reactormonkas mentioned, try -d:release
23:36:55reactormonkand btw, now it compiles without any hackery
23:36:57wu-leeI did, doesn't seem to fly
23:37:05reactormonknim c -d:release --cpu:avr --os:standalone --deadCodeElim:on --gc:none
23:37:07reactormonk^ this line?
23:37:34wu-leenim c --cpu:avr --os:standalone --deadCodeElim:on --parallelBuild:1 --gc:none -d:release -o:blink.bin blink.nim
23:38:41reactormonkhow to upload stuff to the arduino? Then I can go blow some dust off mine
23:38:49*pregressive joined #nim
23:39:30reactormonkand does it blink a built-in LED or something externally which I'd have to connect?
23:40:23fowl9o999999999oo999o9o9o9ooo99o9oo999o99o99o99o9o9999999oo9oo9o9999999o99oo9o9999o9o9 p
23:40:47wu-leeif you run this it should work as it does for me: make f c.makefile upload
23:40:55wu-lees/f/-f/
23:41:00fowlOops
23:41:24wu-leeit blinks the built-in LED
23:42:40*gyeates quit (Ping timeout: 246 seconds)
23:42:46reactormonkwu-lee, let's see
23:42:50wu-leethis is the working compilation output: https://gist.github.com/wu-lee/2c456572ea4a13b716dc
23:43:28wu-leeone other observation...
23:43:50wu-leewhen I attemtpt to compile blink4.c without inlining the stdlib_* files,
23:44:15reactormonkwhich arduino? I've got an arduino uno here
23:44:24wu-leeoh, wait I see.
23:44:46wu-leewhich arduino: diecimila
23:45:07reactormonklet's find out what avrdude tells me about uno
23:45:09wu-leeI don't expect there'll be much difference
23:45:43*boopsies is now known as boopsiesisaway
23:46:26wu-leeyou may need to alter MMCU and/or DUDE_MCU in c.makefile
23:48:56reactormonkavrdude: stk500_recv(): programmer is not responding
23:49:46wu-leemy observation was that the stdlib_ files seem to hardwire NIM_INTBITS to 64, but something fixed that.
23:50:03wu-leereactormonk: that error sounds like the baud may be wrong.
23:50:11reactormonkwu-lee, possible
23:50:34reactormonkhttp://www.arduino.cc/en/Main/ArduinoBoardUno
23:50:41wu-leethis is how I got my params: run arduino IDE, check everything works normally, then
23:51:19wu-leeedit ~/.arduino/preferences.txt, add 'upload.verbose=true'
23:51:32wu-leethen re-upload, check the output to see what was used
23:52:40reactormonkI just didn't specify -b. worked
23:52:51*pregressive quit (Remote host closed the connection)
23:54:15reactormonknot sure if I have something to blink on the uno. Lemme load some code.
23:55:24wu-leethere's an example, 'blink' in the arduino menu
23:57:02*pregressive joined #nim
23:57:07wu-leethat's an arduino sketch, for raw C see blink.c, and minus CPP varnish, see blink2.c (omit the inlines at the end)
23:58:36*gyeates joined #nim
23:58:36reactormonkwu-lee, ... building ...
23:59:22wu-leeI've just pushed an edited version of blink2.c, works better for me.