<<19-05-2013>>

00:49:31NimBotAraq/Nimrod 3615102 Araq [+1 ±3 -0]: fixes #433
00:49:31NimBotAraq/Nimrod 03127d3 Araq [+12 ±7 -1]: Merge branch 'master' of github.com:Araq/Nimrod
00:49:31NimBotAraq/Nimrod 5219600 Araq [+0 ±2 -0]: fixes #420
00:49:31NimBotAraq/Nimrod 77bcf7b Araq [+0 ±1 -0]: fixes #439
00:49:31NimBotAraq/Nimrod a25e167 Araq [+0 ±3 -0]: fixes #432, fixes #427
01:32:53NimBotAraq/Nimrod 466833e Araq [+0 ±4 -0]: updated docs
01:36:10fowlAraq: you wnt me to add to macros.nim
01:51:28*ARCADIVS quit (Quit: WeeChat 0.3.8)
02:32:15*q66 quit (Remote host closed the connection)
04:36:47*fowl quit (Ping timeout: 256 seconds)
04:41:19*Trixar_za is now known as Trix[a]r_za
04:48:38*fowl joined #nimrod
05:26:27fowli get this error now entitty.nim(237, 5) Error: expression 'result' has no type (or is ambiguous)
05:26:42fowlmacro unicast*(func): stmt =
05:50:12fowltest: https://gist.github.com/fowlmouth/5606825
06:21:59*OrionPK quit (Read error: Connection reset by peer)
07:03:09*Endy joined #nimrod
08:18:53reactormonkembedded.nim, line 45, setControlCHook uses c_signal where there are no signals - idea?
08:19:55reactormonkwhat's this hook anyway? Nimrod doesn't seem to used it
08:21:59reactormonkoh, I see why I don't really like the nimrod source code - too many lines per method :-)
08:23:58Araqreactormonk: setControlCHook is exported and used by some programs
08:24:23Araqyou can simply wrap it in an 'when not defined(noSignalHandler)' though
08:25:34Araqand just what method has too many lines? and how would splitting it up help anybody?
08:25:49reactormonkthat's the point :-/
08:26:23Araqthis is called "system software" for the reason that the code actually DOES something
08:26:44Araqas opposed to "business logic" code that endless delegates stuff until you can't debug it anymore
08:27:24Araq"Smalltalk: Everything happens elsewhere"
08:28:09reactormonk if p == nil: c_raise(SIGSEGV)
08:28:13reactormonkhow would you implement this?
08:30:17reactormonkproc chckNil(p: pointer) {.error: "can't assert without signals".} gives me lib/system/excpt.nim(365, 29) Error: pragmas are only allowed in the header of a proc
08:30:44Araqwell there is a forward declaration of 'chckNil' somewhere
08:31:06reactormonkmeh
08:31:07Araqyou should be able to replace the c_raise by a Nimrod 'raise' statement though
08:31:18Araqand it's a compilerproc anyway
08:31:27reactormonklib/system/excpt.nim(30, 26) Error: implementation of 'system.registerSignalHandler()' expected
08:31:28Araqso the 'error' can't work
08:31:36reactormonkok
08:32:02reactormonklib/system/excpt.nim(36, 12) Error: implementation of 'system.chckNil(p: pointer)' expected
08:32:06reactormonkso how do I deal with this?
08:32:20Araqproc chckNil ... =
08:32:27Araq when defined(noSignalHandler):
08:32:41Araq raise newException(EBase, "segfault")
08:32:45Araq else:
08:32:50Araq c_raise(...)
08:33:29reactormonkc_raise is defined with signal handlers
08:33:36reactormonk proc c_raise(sig: cint) {.importc: "raise", header: "<signal.h>".}
08:34:02Araqyeah but if you don't use it, it's not emitted in the C code I think
08:34:15Araqif it is, you need another 'when'
08:34:17reactormonkstill waiting for fail
08:34:43reactormonkyou can't use it without signals, that's it
08:34:48reactormonkthat's why I wanted to add the error
08:35:03Araqsure you can
08:35:15reactormonkwhat do you want to do without signal.h?
08:35:32Araqraising an exception needs setjmp, not signals
08:35:54Araqsetjmp is a CPU/OS specific function
08:35:57reactormonkok
08:36:03Araqbut it can be easily implemented without an OS
08:36:09Araqso I hope your headers support it :P
08:36:21reactormonksorry, I didn't see the missing `not`
08:36:50reactormonklib/system.nim(2072, 24) Error: implementation of 'system.setControlCHook(hook: proc (){.noconv.})' expected
08:36:54reactormonkwhat does this one do?
08:37:03Araqas I said
08:37:12Araqit is exported and some programs use it
08:37:25Araqit's not used by system.nim
08:37:25reactormonkyes, but what the method do?
08:37:38Araqsets a signal handler
08:37:50Araqthat's called when somebody presses CTRL-C
08:38:03reactormonk... there are hardware interrupts, but that's about it
08:38:04Araqyour board likely doesn't support it :P
08:38:11reactormonkyep.
08:38:16reactormonkbut system wants it.
08:38:22reactormonkwait, macro.
08:38:26Araq'when' ftw
08:38:29reactormonkyep
08:38:48Araqyou should really use when hostOS == "standalone"
08:38:50Araqinstead of
08:38:55Araqwhen defined(noSignalHandler)
08:39:08AraqnoSignalHandler doesn't really mean your OS has no signals ...
08:39:21Araqit means Nimrod shouldn't overwrite the default handler
08:39:52reactormonkkk
08:42:16reactormonkyou sure it's when hostOS != "standalone":
08:42:36reactormonkbecause it still complains about it not being defined even if I put it inside there
08:44:07reactormonkcan you have the compiler echo the value of hostOS?
08:44:56Araqwell you need to compile with --os:standalone
08:45:23Araqthe compiler outputs it with "nimrod dump" I think
08:46:04Araqoh and before you push I demand a code review :P
08:46:31reactormonkdon't worry
08:46:50Araqtoday is release
08:46:52reactormonkos = standalone
08:47:01reactormonksweet
08:47:13reactormonkthat's inside nimrod.cfg
08:47:58Araqthat should do
08:48:04reactormonkit doesn't
08:48:19reactormonkhttp://sprunge.us/bXcB
08:49:03Araqwell "hostOS" is no defined symbol
08:49:21Araqok, nimrod dump doesn't list it
08:49:27reactormonkdoes work when I specify it
08:49:36reactormonkhttp://sprunge.us/IRFW
08:49:54Araq--define is not the same as --os
08:50:05reactormonk➜ arduino-sample nimrod dump --os:standalone
08:50:12Araqinteresting
08:50:27Araqah yeah and gone is "Linux" then
08:50:39Araqmaybe you edited the wrong configuration file :P
08:51:18Araqor maybe 'os' doesn't work in a .cfg ... :-/
08:51:29reactormonkhttp://sprunge.us/IJeP
08:51:50Araqyeah doesn't work
08:52:07Araqit should be 'arm' instead of 'amd64'
08:52:16reactormonkit is?
08:52:44*zahary joined #nimrod
08:52:48Araqno it's not: http://sprunge.us/IRFW
08:53:04Araqit processes the .cfg
08:53:10reactormonkwtf
08:53:11Araqand yet doesn't set OS and CPU properly
08:55:11reactormonkbug?
08:55:19AraqI dunno
08:55:35Araqthe compiler explicitly only supports in the command line
08:55:51AraqI'm sure I had a reason for it
08:56:37reactormonkhmm
08:56:51reactormonkI'd prefer it in the command line here
08:56:55reactormonkehh config file
09:01:46reactormonkin my current project, I'd have to specify each time, so I'm for changing that.
09:02:12Araqwell fix it
09:02:35Araqcommands.nim:427 and 435
09:03:02Araq--> if pass in {passCmd1, passPP}
09:03:26AraqI had my reasons for not supporting it via the config system but hey, if you test it again ...
09:04:03Araqin the worst case it should be an error to use it in a config file
09:04:09Araqnot silently ignored
09:09:48reactormonknope, works as expected
09:09:51reactormonkError: system module needs 'addChar'
09:09:53reactormonkO.o
09:10:46Araqoh not that again ...
09:12:24Araqsystem.nim:934
09:12:40Araqperhaps get rid of the test 'hostOS != "standalone"'
09:13:19Araqor rather move the addChar and setStackBottom out of system/cgprocs.nim
09:13:28Araqthese are not OS dependent
09:13:33reactormonklib/system/embedded.nim(85, 22) Error: undeclared identifier: 'c_raise'
09:13:36reactormonkhmmm
09:15:07Araqthe standalone target is a mess :p
09:15:35reactormonklib/system/alloc.nim(85, 10) Error: Port memory manager to your platform
09:15:38reactormonkaww
09:15:53Araqyeah that's actually do-able without an OS :P
09:16:01AraqI should patch it
09:16:36Araqhow much RAM do you have?
09:17:25reactormonkdepends
09:17:44reactormonkFlash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader
09:17:47reactormonkSRAM 2 KB (ATmega328)
09:17:49reactormonkEEPROM 1 KB (ATmega328)
09:18:03reactormonkwhen you use the progmem macro, it goes to the flash. But iirc the flash is RO
09:19:43*Endy quit (Ping timeout: 264 seconds)
09:21:44Araqthat's too little memory for a heap really
09:21:51reactormonkyeah.
09:22:03reactormonkit should store most literals in the flash memory
09:28:28reactormonkAraq, pushed the stuff I did onto my repo, need sleep.
09:28:46reactormonkcya in about... 10h
09:29:45Araqalright
09:58:44*zahary quit (Quit: Leaving.)
10:06:54*q66 joined #nimrod
10:09:16*xcombelle joined #nimrod
10:21:56*zahary joined #nimrod
11:09:00*zahary quit (Quit: Leaving.)
11:38:30*zahary joined #nimrod
11:48:13*Endy joined #nimrod
11:49:18*zahary quit (Quit: Leaving.)
11:54:37*zahary joined #nimrod
12:03:30Araqfowl: I know, working on it
14:05:12*OrionPK joined #nimrod
15:04:11*[1]Endy joined #nimrod
15:05:08*xcombelle quit (Remote host closed the connection)
15:06:34NimBotAraq/Nimrod 8ee185c Araq [+0 ±1 -0]: --os and --cpu work in configuration files
15:06:34NimBotAraq/Nimrod 4b57e2e Araq [+0 ±6 -0]: made some tests green
15:06:43*Endy quit (Ping timeout: 260 seconds)
15:06:44*[1]Endy is now known as Endy
15:21:55*zahary quit (Quit: Leaving.)
16:04:14*Endy quit (Ping timeout: 245 seconds)
16:07:34dom96Araq: it seems the mem profiler is broken.
16:08:04Araqdom96: we have a mem profiler?
16:08:24dom96Araq: Yeah?
16:08:41dom96http://build.nimrod-code.org/docs/estp.html#memory-profiler
16:10:14Araqwell? how is it broken?
16:11:11dom96lib/system.nim(891, 17) Error: implementation of 'system.nimProfile()' expected
16:31:38*Endy joined #nimrod
16:44:09Araqdom96: about issue #443
16:44:36AraqI guess the 'fields' iterator shouldn't iterate over private fields
16:44:51Araqor maybe it should be granted special access
16:45:42dom96perhaps
16:46:38Araqwell I dunno
16:46:55Araqit seems worse to ignore private fields
16:47:13Araq'fields' is for efficient serialization etc.
16:47:22Araqit can't ignore fields
16:48:37Araqon the other hand the current error message is not bad
17:05:40*[1]Endy joined #nimrod
17:07:40*Endy quit (Ping timeout: 246 seconds)
17:07:41*[1]Endy is now known as Endy
17:21:35Araqping zahary_
17:34:30NimBotAraq/Nimrod fa174d0 Dominik Picheta [+0 ±4 -0]: Improved the performance of the SCGI module when dealing with multiple... 2 more lines
17:52:22reactormonkAraq, re.
17:53:02dom96Araq: So what about the memory profiler?
17:54:43Araqdom96: working on it
18:06:42reactormonkAraq, sooo what about the Port memory manager to your platform ? Simply don't implement one? There's not enough RAM anyway
18:09:13Araqyeah
18:11:01reactormonkand how do IU write that in nimrod?=
18:29:16Araqone possibility is to implement mmap et al as 'assert false'
18:50:30*Endy quit (Ping timeout: 264 seconds)
18:50:37Araqhttp://build.nimrod-code.org/docs/documentation.html
18:50:51Araqalready is in the new design ... ;-)
18:51:52dom96:D
18:52:28dom96Moving the style and image files in with the output during generation proved to be a wise choice ;)
18:52:53fowloo looks nice
18:53:21Araqfowl: make a pull request for your macro stuff please, add it to macros.nim
18:53:30Araqnobody wants a 2nd import for that anyway
18:53:54fowlok
18:55:31*Trix[a]r_za is now known as Trixar_za
19:10:18*fowl quit (Ping timeout: 256 seconds)
19:23:27*fowl joined #nimrod
19:58:54*Trixar_za is now known as Trix[a]r_za
20:20:39*Trix[a]r_za is now known as Trixar_za
20:45:10NimBotAraq/Nimrod 7faaf67 Dominik Picheta [+0 ±1 -0]: Added news about the new website.
20:48:41reactormonklib/system/alloc.nim(87, 10) Error: undeclared identifier: 'assert'
20:48:43reactormonkhmmm
20:49:11fowlwhat is "libmongoc.so" i installed mongo but dont have this ._.
20:49:24reactormonklooks like a C api to me
20:50:12dom96^
20:50:37Araqfowl: maybe a typo? is it libmongo.so ?
20:51:01Araqbut hrm no the 'c' stands for client I think
20:51:07fowli have libmongo-client.so
20:51:13AraqI compiled mongo from source I think
20:51:18dom96yeah, libmongoc is the C mongo Driver.
20:51:41fowlah thats not in my repos
20:51:56Araqwell I did test the wrapper for some project I can't remember
20:52:12Araqso it should work
20:52:37*q66_ joined #nimrod
20:53:27*zahary__ joined #nimrod
20:55:05*q66 quit (Ping timeout: 240 seconds)
20:56:15*zahary_ quit (Ping timeout: 260 seconds)
20:57:20fowlmaybe it should be noted that it requires the c driver https://github.com/mongodb/mongo-c-driver
20:58:54reactormonkError: system module needs 'copyStringRC1'
20:58:56reactormonkargh
20:59:37Araqreactormonk: I checked if I can improve that error message
20:59:45Araqunfortunately I can't easily
21:01:54fowl*** stack smashing detected ***: /tmp/aporia/a15 terminated
21:02:11fowlon the db_mongo example
21:03:26reactormonkhmm
21:06:11reactormonkAraq, well, copying strings around is not that useful
21:06:27Araqyeah indeed
21:06:35Araqso you need to disable the code that does that
21:10:16fowlWARNING: mongo_connect() is deprecated, please use mongo_client()
21:16:35reactormonkAraq, where do I define my own symbols, like noDynmaicAlloc?
21:18:02Araqyou don't
21:18:15Araqyou check with 'defined' and pass it on the command line
21:18:16reactormonkhm
21:18:29Araqthat means it doesn't notice your typos :P
21:18:29reactormonklib/system/alloc.nim(84, 19) Error: undeclared identifier: 'noDynamicAlloc'
21:18:50Araqwhen defined(noDynamicAlloc)
21:19:39reactormonkoh.
21:20:15reactormonkgotta say, I don't know where to disable the copyStringRC1, I'd have to mess with the compiler and add something in there.
21:20:19reactormonkcompiler/ccgexprs.nim: linefmt(p, cpsStmts, "$3 = $1; $1 = #copyStringRC1($2);$n",
21:21:32Araqjust add some Warning(e.info, warnUser, "copystring used from here")
21:21:40Araqand bootstrap
21:38:46Araqfowl: sorry, I made some comments for your macro changes
21:42:11NimBotAraq/Nimrod cd96412 Araq [+1 ±13 -2]: made some tests green; implemented 'from module import nil'
21:42:11NimBotAraq/Nimrod 3366925 Araq [+0 ±4 -0]: Merge branch 'master' of github.com:Araq/Nimrod
21:42:11NimBotAraq/Nimrod 3f2486f Araq [+0 ±4 -0]: 'from' statement documented
21:42:47*q66_ is now known as q66
21:47:20NimBotnimrod-code/nimbuild c3715b1 Dominik Picheta [+0 ±1 -0]: Some fixes for the builder.
21:47:20NimBotnimrod-code/nimbuild 969cbd6 Dominik Picheta [+0 ±1 -0]: Merge branch 'master' of github.com:nimrod-code/nimbuild
21:51:18reactormonkAraq, well, I assume the compiler needs that
21:53:33reactormonkand warning() doesn't work inside the compiler, oh well
21:53:39Araqreactormonk: yeah you get meaningless warning during bootstrapping
21:53:47fowlthere should be a suggestion to use --depth 1 when cloning nimrod, it make git only pull the minimum needed and not the whole (huge) repos and history
21:54:10Araqthere is a --depth 1 command? o.O
21:54:17Araqlol I didn't know that
21:54:33fowlyea you can use it with clone or pull and it speeds it up quite a bit
21:56:33reactormonkAraq, compiler/ccgexprs.nim(280, 15) Error: undeclared identifier: 'Warning'
21:56:36reactormonkFAILURE
21:57:35Araqs/Warning/Message
21:57:35fowlAraq: i didnt like !! either, just used it since ! was already for string->ident
21:57:43fowlstring -> tident
21:58:20Araqyeah we should deprecate '!' instead I think
22:01:35reactormonkcompiler/ccgexprs.nim(280, 18) Error: undeclared field: 'info'
22:02:00Araqthat's where you need to use your brain
22:02:14Araqthe node is likely called 'n' or 'e'
22:02:19Araqso it's n.info or e.info
22:07:12reactormonkproc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) =
22:07:19reactormonkdoesn't work on `p` either
22:07:34fowlAraq: changing the sets into procs isRoutine/isAtomic is annoying, i use them in `of` branches
22:07:50NimBotnimrod-code/nimbuild 4ba6618 Dominik Picheta [+0 ±1 -0]: Another fix for the build process.
22:07:53Araqfowl: aye make them sets then but not templates
22:08:04fowlok
22:08:49fowl"RoutineNodes"/"AtomicNodes" good?
22:10:02Araqyeah
22:10:10Araqwe also desparately need CallNodes
22:10:41Araq= {nnkCall, nnkInfix, nnkPrefix, nnkPostfix,
22:10:43Araq nnkCommand, nnkCallStrLit, nnkHiddenCallConv}
22:11:34*Trixar_za is now known as Trix[a]r_za
22:11:44Araqbtw AtomicNodes = {nnkNone..nnkNilLit}
22:11:47fowlisnt there one for macro calls too
22:13:25AraqI think zahary__ removed it as it's now translated into a 'do'
22:13:56fowlwhat's a postfix call
22:14:14Araqa*
22:14:40fowlthats allowed?
22:14:46Araqit's not part of the concrete syntax for now ;-)
22:14:59Araqbut it may be one day
22:15:20fowlo
22:17:02reactormonkAraq, there is no node in that scope
22:17:25Araqreactormonk: use p.prc.info then
22:18:33reactormonkhttp://sprunge.us/IPjO
22:19:46Araqjezz only do it if p.prc != nil then
22:19:59fowlproc ident*(n: PNimrodNode): TNimrodIdent {.magic: "NIdent".}
22:20:36fowlwait no thats not causing problems
22:20:53reactormonkwhat's `prc`?
22:21:29reactormonkraise newException(EBase, "dynamic memory allocation not supported.") <- uses copyStringRC1
22:21:46Araqquite ironic, hmm?
22:21:51AraqXD
22:22:00reactormonk.... :-(
22:22:05Araqbut yeah you shouldn't use exceptions if you have no heap ...
22:22:15reactormonkfigured so
22:22:25reactormonkany idea how to do exception handling? Go-style with return codes?
22:22:41reactormonkor an either type?
22:22:43Araqjust make sure you have some 'quit'
22:22:54Araqand some display to display an error code
22:26:47reactormonkthere is no display.
22:26:55reactormonkwell, serial port
22:27:44Araqwell you better teach system.nim how to output *something* and quit
22:28:01Araqotherwise you may as well start proving all your array bounds correct etc.
22:28:09reactormonk:-)
22:31:52reactormonklet's see
22:32:06reactormonkAraq, any way I can do that without hacking system.nim?
22:32:20Araqno, sorry
22:32:30AraqI figured system.nim ain't change friendly
22:32:43Araqfor embedded stuff
22:32:58Araqbut it's hard to improve the situation
22:34:17Araqon the other hand you almost always get nice compile time errors
22:36:15Araqfowl: do you use widestrs.nim?
22:36:54reactormonkcan I at least fuck with in in embedded.nim?
22:37:11Araqreactormonk: I think so
22:38:37*q66 quit (Remote host closed the connection)
22:41:32reactormonkoh god...
22:42:19reactormonkAraq, so no exceptions without dynamic allocation?
22:42:57Araqwhat would you do with them anyway?
22:44:13reactormonkhmm, either a quit or link them statically somewhere... I assume an Either type would be useful here
22:44:59reactormonkcan you check at compile time if you can have exceptions? Wait, OOM n stuff can occur basically everywhere
22:45:23reactormonkexcept there's no OOM without dynamic allocation, is there?
22:45:54Araqof course there is
22:46:01Araqyou can always run out of stack space
22:46:08reactormonkright
22:46:34reactormonkso what to do with exceptions? Don't use them and instead just quit?
22:46:45reactormonkoh, and according to the people in #arduino, there is no quit
22:47:02Araqhow do you tell the CPU to stop then?
22:47:15reactormonkyou can sleep it
22:47:19Araqwhile true: then?
22:48:03reactormonk reactormonk | how do you stop the processor? aka an assertion failed or similar.
22:48:11reactormonkYotson | reactormonk: ehm, you don't.
22:48:29reactormonkYotson | reactormonk: yup, as last resort you could reset the controller.
22:48:34reactormonkYotson | reactormonk: you have programming experience on/under operating systems? forget most of that. lol
22:49:32Araqwell I suppose getting some error message out of the device is all you really need
22:49:48Araqthen you can reset it manually
22:51:14Araqmy mindstorm can output things like E42 on its 4 char display :P
22:51:24Araqand make some beep
22:52:18reactormonkhttp://sprunge.us/jSca
22:53:03Araqgreat then use Serial.println()
22:54:26Araqyou should get a mindstorm instead; it has a display :P
22:55:01reactormonk^^
22:55:16reactormonkdoes it have 10 pins each as well?
22:55:39Araqeven better: It has Lego pins
22:56:32Araqyou can use it to control your Lego motors
22:56:54reactormonkyeah yeah ^^
22:57:25reactormonkso to integrate it into system.nim, I have to put it somewhere into arduino.nim in lib/system/ ?
22:58:03Araqyeah why not
23:03:17reactormonkdon't like that, but ok
23:03:36Araqyou can also rewrite system.nim and put it to some different dir
23:04:33Araqand use the --lib:DIR option to override the default dir
23:10:26reactormonkand reimplement the whole system.nim?
23:10:38Araqyeah
23:10:45Araqmaybe you like that better :P
23:11:02reactormonkno way to hook into system.nim procs and overwrite them? ;-)
23:11:12Araqthe headers should be categorized and put into separate includes
23:11:29Araqthen we can have multple system.nim that cherrypick what's available
23:11:31reactormonkshould. Oh well, fuck it, let's write that arduino.nim
23:11:58Araqbut not now, release is overdue
23:14:02reactormonksure, I'll not merge it
23:16:14fowlAraq: no
23:16:20fowlirt widestrs
23:17:37fowli didnt know it existed
23:25:44Araqgood cause I'm changing the interface
23:27:59fowli updated the pr
23:28:45fowloh i didnt mean to deprecate `!`
23:28:59fowli dont know what to replace it with
23:29:30Araqproc ident*(...)
23:29:42Araqbut this needs your judgement
23:29:55Araqis !"abc" common?
23:29:59fowlthought you wanted ident*(s: string): PNimrodNode to replace !!"foo"
23:30:20Araqwell I dunno
23:30:30Araqthat would work too ...
23:30:49Araqyou really should use 'bindSym' in macros anyway
23:31:03Araqthis identifier stuff is fragile
23:31:26fowli think it should be ~"foo" for newidentnode("foo")
23:31:49fowli meant to change it to ~ hellas ago but never got around to it
23:34:39NimBotAraq/Nimrod eda8a96 Dominik Picheta [+0 ±1 -0]: Updated news.