<< 01-06-2013 >>

00:15:24*JStoker quit (Ping timeout: 252 seconds)
00:24:09*JStoker joined #nimrod
01:30:35*erlnoob joined #nimrod
02:10:16*q66 quit (Remote host closed the connection)
03:03:15*Trix[a]r_za is now known as Trixar_za
03:46:03*OrionPK quit (Quit: Leaving)
04:42:50*Trixar_za is now known as Trix[a]r_za
05:02:07*fowl quit (Ping timeout: 256 seconds)
08:13:21reactormonkhow do I merge
08:13:23reactormonkhttp://sprunge.us/diRJ
08:49:38*gradha joined #nimrod
09:18:27Araqhi gradha, module.TEnum.value might work now
09:22:12Araqreactormonk: A & B &B -> A & B
09:23:00Araqin other words you can remove the inner 'when not defined(nimrodVM)' as the outer check already implies it's not defined
09:31:55gradhaAraq: I was tweaking it myself this week, will compare outputs, which begs the question: what is the expected output? were do I write documentation for this and a testcase?
09:33:34Araqhmm I dunno, zahary_ prepared tests for idetools
09:34:37Araqthe expected output is module.tenum.value, in other words I don't understand your question
09:34:48gradhaIIRC the only mention of idetools in the docs are the output of the commandline nimrod help, which is pretty lame, do I start a new doc or add it somewhere in the manual?
09:35:55gradhayes, that's what I have now, but I saw dom96's support answer and thought: what will be displayed if my module is called foo, which imports a bar through babelpath, which also imports a local foo?
09:36:14gradhanot sure if that's possible, was going to test that today
09:36:26Araqwell that doesn't work for now anyway
09:36:53Araqand if it will idetool's output will be ambiguous
09:37:15Araqthe module name is the module name, file information is separate and also emitted
09:41:55gradhaI was thinking maybe isMainModule could be used as special symbol for the main module, since it's already used in code
09:44:40gradhaI was also thinking of doing tests with module aliasing, and how a module filesystem case does reflect in code
09:45:32gradhazahary_'s tests were more of playing with the server mode, which I still have to check because server mode does weird things in my vim
09:51:36Araqwell then come up with new tests and add it to the tester
09:51:36*gradha quit (Read error: Connection reset by peer)
09:52:05*gradha joined #nimrod
09:56:23Araqgradha: for the "sharing of module names" to work the C code generator needs to add some unique suffix to the C file
09:57:07Araqthis makes interop with C worse IMO
09:57:21Araqso I don't know what to do about it
09:58:17gradhadefault to tell people use objc namespacing convention: every developer adds a two/three character prefix to every symbol to minimize collisions
09:59:06Araqwe could use package_module.c but then the compiler doesn't know anything about packages
10:00:24gradhamost of the world is quite used to prefixing stuff with reversed dns notation for anything requiring pseudo unique names, tell people to import com_mygrandiose_domain_bar instead of bar from their foo module
10:02:42Araqno way
10:03:05Araqinstead people already start their projects with "utils" and "types" modules
10:03:42Araqso the compiler better can deal with 5 different utils modules in the same project
10:20:01Araqmaybe it should use dirpart_module where 'dirpart' is the direct parent dir name unless that is 'source', 'lib' or 'src'
10:25:53gradhahow/where do I pass -d:useGnuReadline, add it to config/nimrod.cfg?
10:26:37Araqcompiler/nimrod.cfg
10:26:46gradhaalso maybe pass to build.sh since it accepts extraBuildARgs?
10:27:00Araqor simply add it to "koch boot"
10:27:13Araqkoch boot -d:release -d:useGnuReadline
10:28:29AraqI don't like it in compiler/nimrod.cfg as then that ends up in the bare bones C sources that are the first step for bootstrapping
10:29:13Araqand dependencies are bad for bootstrapping
10:36:17dom96Araq: Read the logs?
10:38:50Araqdom96: need a gist for the find vs findAll
10:39:13*q66 joined #nimrod
10:41:02Araqbut looking at the code it seems buggy ...
10:41:36dom96Araq: what about find/match not working with seqs?
10:43:05Araqwhat do you mean?
10:44:00dom96it fails with EInvalidIndex when given a sequence, i'm guessing it tries to do [0] = ... instead of adding.
10:45:30Araqah yeah
10:45:34Araqthat's not a bug :P
10:45:58Araqyou need to do: newSeq(s, maxSubPatterns)
10:46:09Araqand at that point you may as well simply use an array instead
10:46:52dom96why is it that way?
10:47:05dom96more importantly, why isn't this documented?
10:47:19Araqwell "openarray" works this way
10:48:21Araqbbl
11:05:24*Endy joined #nimrod
11:05:36tangentstormhrmm.. i'm unable to build nimrod on ubuntu
11:05:44tangentstormeverything seems to compile until it's time to link the final executable
11:05:56dom96let me guess 'lrint'
11:05:56tangentstormthen i get: semfold.c:(.text+0x23b7): undefined reference to `lrint'
11:05:59tangentstorm:)
11:06:35tangentstormi was hoping it was a common thing... i'm used to things building oddly on kubuntu :)bunt
11:06:50tangentstormis there an easy fix?
11:07:17dom96give me a sec, looking through the logs.
11:07:53tangentstormthanks :)
11:09:18dom96There we go:
11:09:19dom9621:32:26 Araq you can edit line 195 of nimbase.h
11:09:19dom9621:32:51 Araq so that HAVE_LRINT are not defined anymore and then it should work
11:09:27dom96Try that
11:11:12tangentstormthanks.. trying now :)
11:16:43tangentstormSUCCESS, it says :)
11:17:59dom96great :)
11:31:22Araqtangentstorm: which version of GCC do you use?
11:36:44gradhaAraq: nice, a preliminary diff output for idetools shows both our patches produce the same output so I will discard mine
11:36:48tangentstormAraq: gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)
11:46:40Araqwell I use 4.7.2
11:46:55*zahary joined #nimrod
11:47:02AraqI'm not sure whether it's the GCC version or an ubuntu specific problem
11:47:05dom96I use 4.8.0 and it works fine.
11:47:22Araqoh alright then it's ubuntu's fault
11:47:30Araqso report a bug there :P
11:47:40AraqI'm sure they are keen on fixing it
11:47:47gradhasay I make a webserver which accepts random user input and tries to compile it with nimrod, ignoring possible bugs in the compiler or DOSing, is that safe or are there any other security implications, like the compilation removing files, or accessing non visible files?
11:48:38dom96It's definitely a security risk. You can read files at compile time.
11:48:48AraqI don't think the compiler removes anything but dom96 is right
11:50:32Araqon the other hand, sandboxing by using a separate user should work, right?
11:51:05dom96You should chroot it.
11:51:11Araqafter all linux is a server OS ...
11:51:15dom96Even with that, I wouldn't feel safe.
11:51:15gradhamaybe a compile-service would run as an unpriviledged user and would communicate with the webserver
11:51:40gradhaheh, not trusting your OS today?
11:52:28*zahary1 joined #nimrod
11:52:31*zahary quit (Read error: Connection reset by peer)
11:53:10dom96You should use SELinux or AppArmor.
11:53:11*gradha quit (Read error: Connection reset by peer)
11:54:04*gradha joined #nimrod
11:54:13gradhaI know, spawn mini vms like http://qubes-os.org/trac for each compilation
11:54:46dom96http://stackoverflow.com/a/4249228/492186
11:55:36dom96A trynim website ala tryhaskell would be awesome btw
11:55:48gradhadidn't we already have one?
11:55:50dom96As soon as a proper REPL arrives I am making it :P
11:56:03dom96hrm, no?
11:57:13gradhaI remember some of you talking about a website which allows compiling multiple languages for testing and it had nimrod, it seemd to have 8.x but upgraded to 9.x
11:57:30dom96oh yeah, compileonline and ideone have nimrod.
11:57:46dom96but that's not exactly what trynimrod would be in my mind.
11:58:04dom96it would be an interactive tutorial
11:58:10dom96just like tryhaskell is.
11:59:02gradhaor like http://railsforzombies.org ?
11:59:31dom96more like http://tryruby.org :P
12:04:36gradhahmm... so what would you think of implementing a cidetools? Which would be like the current idetools, but instead of jumping to the nimrod code you would go straight to the generated C code for debugging?
12:06:42gradhait's something I don't think I'd ever use, but I suck for christmas present lists so maybe I should start now
12:06:53AraqI almost never look at the generated C code
12:07:11Araqand if I have to it's a failure of Nimrod
12:07:45Araqso no cidetools
12:08:38gradhabesides you could probably patch this behaviour with the switch which outputs line/file information in the C code and use grep on that
12:33:58gradhayay, enum hyperlinks work
13:03:09*OrionPK joined #nimrod
13:14:16*erlnoob quit (Quit: erlnoob)
13:18:35gradhais there any standarized way to access the linux clipboard or is it the same mess as the recycle bin?
13:18:59dom96the latter :P
13:20:41gradhaah, I'm remembering now that in console you used... gpm? to copy/paste, and X had its own
13:22:42gradhaand the joys of both having to compete for the hardware resource
13:23:12gradhahopefully it's better with wayland or whatever replaces X
14:02:33*OrionPK quit (Read error: Connection reset by peer)
14:04:40*erlnoob joined #nimrod
14:23:23*[1]Endy joined #nimrod
14:25:42*Endy quit (Ping timeout: 252 seconds)
14:36:34*zahary joined #nimrod
14:39:03*zahary1 quit (Ping timeout: 260 seconds)
14:39:22*erlnoob quit (Quit: erlnoob)
14:45:27*zahary1 joined #nimrod
14:47:13*zahary quit (Ping timeout: 245 seconds)
14:56:46*SirSkidmore joined #nimrod
14:56:59SirSkidmoreNimrod's procs aren't first class are they?
14:57:28dom96they are
14:57:29gradhathey should be
14:59:03gradhaif they weren't it would not be possible to implement procs like map or foldr/foldl
14:59:36gradhamaybe you are getting some warning?
15:02:00*ARCADIVS quit (Quit: WeeChat 0.3.8)
15:04:17SirSkidmoreOH
15:04:22SirSkidmoreduh
15:04:36SirSkidmoreI always do this. Ask a question in IRC then find my stupid typo :)
15:10:55*gradha quit (Quit: bbl, have youtube videos to watch)
15:45:12*zahary1 quit (Quit: Leaving.)
16:06:25NimBotnimrod-code/babel master 5e01fa0 Dominik Picheta [+0 ±3 -0]: Many new features: `build` command and dependency resolution implemented.
16:41:56*burntsushi quit (Read error: Connection reset by peer)
16:42:14*burntsushi joined #nimrod
17:15:08reactormonkAraq, so no way to add a PROGMEM to declaration only?
17:17:50*fowl joined #nimrod
18:07:02reactormonkoh, the whole thing is slightly more complicated. strcpy_P(buffer, (char*)pgm_read_word(&(string_table[i]))); // Necessary casts and dereferencing, just copy.
18:12:10reactormonkI think the cleanest API would be its own type for PROGMEM stored stuff and then converters to read
18:15:32reactormonkor explicit procs, whatever
18:15:53reactormonkAraq, any thoughts on that matter?
18:29:50reactormonkfowl, btw, the macro you sent is is good old c-style with text replacement - any "sweeter" way?
18:30:35fowlu mean other than using strutils.format()?
18:30:46reactormonkyup
18:32:00fowlsure you could write it to be result = newStmtList(); result.add var_stmt; result.add template; etc but why bother
18:32:23fowlyou dont have to process the args, so the macro is as simple as it can be
18:39:13reactormonkfowl, the problem isn't a simple sadly, you also have to copy the data from the PROGMEM
20:00:52*[1]Endy quit (Ping timeout: 256 seconds)
21:08:55tangentstormhey SirSkidmore ... whatcha working on ? :)
21:11:22fowlreactormonk, well you have to know what code you want to result from the macro before you can write it, so if you need more give me an example
21:33:15reactormonkfowl, good
21:41:47reactormonkfowl, F(int|string) (literals or known at compile-time) should give a new value of type PROGMEM_int or PROGMEM_string (there's 6 types, char, uchar, int16, uint16, int32, uint32). For reading strings, the length must be known and allocated on the stack (cstring of the same length)
21:50:54reactormonkAraq, you can't have a macro converter, can you? ^^
22:03:38fowlreactormonk, need a code example
22:04:00reactormonkfowl, creating
22:04:07fowlok ill be back later tonight
22:04:25fowlgoing to panhandle for a bus pass
22:06:52reactormonkfowl, http://sprunge.us/JccX
22:14:13reactormonkhttp://sprunge.us/NSCg possible apparently
22:14:19reactormonksee http://arduino.cc/de/Reference/PROGMEM
22:16:53Araqwhat's a macro converter? and when will you stop thinking about converters? and what's wrong with the solution I already gave you?
22:36:25*fowl quit (Ping timeout: 276 seconds)
22:48:46*fowl joined #nimrod
23:01:13reactormonkAraq, I think I'll go for explicit loading
23:06:01Araqok
23:10:32reactormonkAraq, new thingy I didn't mention before - you have to explicitly copy the stuff into the RAM
23:20:57reactormonkany better way of doing template PSTR(str: expr) = {.emit: "PSTR(" + str ")".}
23:21:15reactormonk... not sure if it even works
23:21:42Araqif you fix the syntax errors, it might
23:22:09reactormonktemplate PSTR(str: expr) = {.emit: "PSTR(" & str & ")".}
23:22:33reactormonk prog_char {.importc:"PROGMEM prog_char".} # a signed char (1 byte) -127 to 128
23:22:37reactormonkgives me arduino.nim(2, 11) Error: implementation of 'prog_char' expected
23:26:26Araqdo you think the compiler parses your importc declarations to see it's some weird "char" type?
23:47:11*OrionPK joined #nimrod