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:21 | reactormonk | how do I merge |
08:13:23 | reactormonk | http://sprunge.us/diRJ |
08:49:38 | * | gradha joined #nimrod |
09:18:27 | Araq | hi gradha, module.TEnum.value might work now |
09:22:12 | Araq | reactormonk: A & B &B -> A & B |
09:23:00 | Araq | in other words you can remove the inner 'when not defined(nimrodVM)' as the outer check already implies it's not defined |
09:31:55 | gradha | Araq: 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:34 | Araq | hmm I dunno, zahary_ prepared tests for idetools |
09:34:37 | Araq | the expected output is module.tenum.value, in other words I don't understand your question |
09:34:48 | gradha | IIRC 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:55 | gradha | yes, 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:14 | gradha | not sure if that's possible, was going to test that today |
09:36:26 | Araq | well that doesn't work for now anyway |
09:36:53 | Araq | and if it will idetool's output will be ambiguous |
09:37:15 | Araq | the module name is the module name, file information is separate and also emitted |
09:41:55 | gradha | I was thinking maybe isMainModule could be used as special symbol for the main module, since it's already used in code |
09:44:40 | gradha | I was also thinking of doing tests with module aliasing, and how a module filesystem case does reflect in code |
09:45:32 | gradha | zahary_'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:36 | Araq | well 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:23 | Araq | gradha: for the "sharing of module names" to work the C code generator needs to add some unique suffix to the C file |
09:57:07 | Araq | this makes interop with C worse IMO |
09:57:21 | Araq | so I don't know what to do about it |
09:58:17 | gradha | default to tell people use objc namespacing convention: every developer adds a two/three character prefix to every symbol to minimize collisions |
09:59:06 | Araq | we could use package_module.c but then the compiler doesn't know anything about packages |
10:00:24 | gradha | most 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:42 | Araq | no way |
10:03:05 | Araq | instead people already start their projects with "utils" and "types" modules |
10:03:42 | Araq | so the compiler better can deal with 5 different utils modules in the same project |
10:20:01 | Araq | maybe it should use dirpart_module where 'dirpart' is the direct parent dir name unless that is 'source', 'lib' or 'src' |
10:25:53 | gradha | how/where do I pass -d:useGnuReadline, add it to config/nimrod.cfg? |
10:26:37 | Araq | compiler/nimrod.cfg |
10:26:46 | gradha | also maybe pass to build.sh since it accepts extraBuildARgs? |
10:27:00 | Araq | or simply add it to "koch boot" |
10:27:13 | Araq | koch boot -d:release -d:useGnuReadline |
10:28:29 | Araq | I 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:13 | Araq | and dependencies are bad for bootstrapping |
10:36:17 | dom96 | Araq: Read the logs? |
10:38:50 | Araq | dom96: need a gist for the find vs findAll |
10:39:13 | * | q66 joined #nimrod |
10:41:02 | Araq | but looking at the code it seems buggy ... |
10:41:36 | dom96 | Araq: what about find/match not working with seqs? |
10:43:05 | Araq | what do you mean? |
10:44:00 | dom96 | it fails with EInvalidIndex when given a sequence, i'm guessing it tries to do [0] = ... instead of adding. |
10:45:30 | Araq | ah yeah |
10:45:34 | Araq | that's not a bug :P |
10:45:58 | Araq | you need to do: newSeq(s, maxSubPatterns) |
10:46:09 | Araq | and at that point you may as well simply use an array instead |
10:46:52 | dom96 | why is it that way? |
10:47:05 | dom96 | more importantly, why isn't this documented? |
10:47:19 | Araq | well "openarray" works this way |
10:48:21 | Araq | bbl |
11:05:24 | * | Endy joined #nimrod |
11:05:36 | tangentstorm | hrmm.. i'm unable to build nimrod on ubuntu |
11:05:44 | tangentstorm | everything seems to compile until it's time to link the final executable |
11:05:56 | dom96 | let me guess 'lrint' |
11:05:56 | tangentstorm | then i get: semfold.c:(.text+0x23b7): undefined reference to `lrint' |
11:05:59 | tangentstorm | :) |
11:06:35 | tangentstorm | i was hoping it was a common thing... i'm used to things building oddly on kubuntu :)bunt |
11:06:50 | tangentstorm | is there an easy fix? |
11:07:17 | dom96 | give me a sec, looking through the logs. |
11:07:53 | tangentstorm | thanks :) |
11:09:18 | dom96 | There we go: |
11:09:19 | dom96 | 21:32:26 Araq you can edit line 195 of nimbase.h |
11:09:19 | dom96 | 21:32:51 Araq so that HAVE_LRINT are not defined anymore and then it should work |
11:09:27 | dom96 | Try that |
11:11:12 | tangentstorm | thanks.. trying now :) |
11:16:43 | tangentstorm | SUCCESS, it says :) |
11:17:59 | dom96 | great :) |
11:31:22 | Araq | tangentstorm: which version of GCC do you use? |
11:36:44 | gradha | Araq: nice, a preliminary diff output for idetools shows both our patches produce the same output so I will discard mine |
11:36:48 | tangentstorm | Araq: gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) |
11:46:40 | Araq | well I use 4.7.2 |
11:46:55 | * | zahary joined #nimrod |
11:47:02 | Araq | I'm not sure whether it's the GCC version or an ubuntu specific problem |
11:47:05 | dom96 | I use 4.8.0 and it works fine. |
11:47:22 | Araq | oh alright then it's ubuntu's fault |
11:47:30 | Araq | so report a bug there :P |
11:47:40 | Araq | I'm sure they are keen on fixing it |
11:47:47 | gradha | say 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:38 | dom96 | It's definitely a security risk. You can read files at compile time. |
11:48:48 | Araq | I don't think the compiler removes anything but dom96 is right |
11:50:32 | Araq | on the other hand, sandboxing by using a separate user should work, right? |
11:51:05 | dom96 | You should chroot it. |
11:51:11 | Araq | after all linux is a server OS ... |
11:51:15 | dom96 | Even with that, I wouldn't feel safe. |
11:51:15 | gradha | maybe a compile-service would run as an unpriviledged user and would communicate with the webserver |
11:51:40 | gradha | heh, not trusting your OS today? |
11:52:28 | * | zahary1 joined #nimrod |
11:52:31 | * | zahary quit (Read error: Connection reset by peer) |
11:53:10 | dom96 | You should use SELinux or AppArmor. |
11:53:11 | * | gradha quit (Read error: Connection reset by peer) |
11:54:04 | * | gradha joined #nimrod |
11:54:13 | gradha | I know, spawn mini vms like http://qubes-os.org/trac for each compilation |
11:54:46 | dom96 | http://stackoverflow.com/a/4249228/492186 |
11:55:36 | dom96 | A trynim website ala tryhaskell would be awesome btw |
11:55:48 | gradha | didn't we already have one? |
11:55:50 | dom96 | As soon as a proper REPL arrives I am making it :P |
11:56:03 | dom96 | hrm, no? |
11:57:13 | gradha | I 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:30 | dom96 | oh yeah, compileonline and ideone have nimrod. |
11:57:46 | dom96 | but that's not exactly what trynimrod would be in my mind. |
11:58:04 | dom96 | it would be an interactive tutorial |
11:58:10 | dom96 | just like tryhaskell is. |
11:59:02 | gradha | or like http://railsforzombies.org ? |
11:59:31 | dom96 | more like http://tryruby.org :P |
12:04:36 | gradha | hmm... 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:42 | gradha | it'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:53 | Araq | I almost never look at the generated C code |
12:07:11 | Araq | and if I have to it's a failure of Nimrod |
12:07:45 | Araq | so no cidetools |
12:08:38 | gradha | besides 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:58 | gradha | yay, enum hyperlinks work |
13:03:09 | * | OrionPK joined #nimrod |
13:14:16 | * | erlnoob quit (Quit: erlnoob) |
13:18:35 | gradha | is there any standarized way to access the linux clipboard or is it the same mess as the recycle bin? |
13:18:59 | dom96 | the latter :P |
13:20:41 | gradha | ah, I'm remembering now that in console you used... gpm? to copy/paste, and X had its own |
13:22:42 | gradha | and the joys of both having to compete for the hardware resource |
13:23:12 | gradha | hopefully 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:59 | SirSkidmore | Nimrod's procs aren't first class are they? |
14:57:28 | dom96 | they are |
14:57:29 | gradha | they should be |
14:59:03 | gradha | if they weren't it would not be possible to implement procs like map or foldr/foldl |
14:59:36 | gradha | maybe you are getting some warning? |
15:02:00 | * | ARCADIVS quit (Quit: WeeChat 0.3.8) |
15:04:17 | SirSkidmore | OH |
15:04:22 | SirSkidmore | duh |
15:04:36 | SirSkidmore | I 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:25 | NimBot | nimrod-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:08 | reactormonk | Araq, so no way to add a PROGMEM to declaration only? |
17:17:50 | * | fowl joined #nimrod |
18:07:02 | reactormonk | oh, 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:10 | reactormonk | I think the cleanest API would be its own type for PROGMEM stored stuff and then converters to read |
18:15:32 | reactormonk | or explicit procs, whatever |
18:15:53 | reactormonk | Araq, any thoughts on that matter? |
18:29:50 | reactormonk | fowl, btw, the macro you sent is is good old c-style with text replacement - any "sweeter" way? |
18:30:35 | fowl | u mean other than using strutils.format()? |
18:30:46 | reactormonk | yup |
18:32:00 | fowl | sure you could write it to be result = newStmtList(); result.add var_stmt; result.add template; etc but why bother |
18:32:23 | fowl | you dont have to process the args, so the macro is as simple as it can be |
18:39:13 | reactormonk | fowl, 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:55 | tangentstorm | hey SirSkidmore ... whatcha working on ? :) |
21:11:22 | fowl | reactormonk, 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:15 | reactormonk | fowl, good |
21:41:47 | reactormonk | fowl, 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:54 | reactormonk | Araq, you can't have a macro converter, can you? ^^ |
22:03:38 | fowl | reactormonk, need a code example |
22:04:00 | reactormonk | fowl, creating |
22:04:07 | fowl | ok ill be back later tonight |
22:04:25 | fowl | going to panhandle for a bus pass |
22:06:52 | reactormonk | fowl, http://sprunge.us/JccX |
22:14:13 | reactormonk | http://sprunge.us/NSCg possible apparently |
22:14:19 | reactormonk | see http://arduino.cc/de/Reference/PROGMEM |
22:16:53 | Araq | what'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:13 | reactormonk | Araq, I think I'll go for explicit loading |
23:06:01 | Araq | ok |
23:10:32 | reactormonk | Araq, new thingy I didn't mention before - you have to explicitly copy the stuff into the RAM |
23:20:57 | reactormonk | any better way of doing template PSTR(str: expr) = {.emit: "PSTR(" + str ")".} |
23:21:15 | reactormonk | ... not sure if it even works |
23:21:42 | Araq | if you fix the syntax errors, it might |
23:22:09 | reactormonk | template PSTR(str: expr) = {.emit: "PSTR(" & str & ")".} |
23:22:33 | reactormonk | prog_char {.importc:"PROGMEM prog_char".} # a signed char (1 byte) -127 to 128 |
23:22:37 | reactormonk | gives me arduino.nim(2, 11) Error: implementation of 'prog_char' expected |
23:26:26 | Araq | do you think the compiler parses your importc declarations to see it's some weird "char" type? |
23:47:11 | * | OrionPK joined #nimrod |