00:14:53 | * | askatasuna quit (Quit: WeeChat 0.4.3) |
00:16:57 | * | Kazimuth quit (Ping timeout: 245 seconds) |
00:18:35 | * | q66 quit (Quit: Leaving) |
00:24:26 | * | Kazimuth joined #nimrod |
00:25:54 | * | boydgreenfield quit (Quit: boydgreenfield) |
01:12:53 | * | saml_ joined #nimrod |
01:42:32 | * | New-Guy joined #nimrod |
01:42:41 | New-Guy | Hey everyone. |
01:43:02 | New-Guy | Having a problem/misunderstanding with tuples. |
01:43:07 | New-Guy | http://pastebin.com/7EVqyBLK |
01:43:40 | New-Guy | The manual says ("blah", "blah") should be compatible with tuple[field1: string, field2: string] |
01:43:48 | New-Guy | But it ain't workin' for me. |
01:45:26 | New-Guy | I'd appreciate some help if anyone has some time; I'll be right back myself. |
01:46:56 | flaviu1 | New-Guy: addSet((symbol, value))? |
01:48:37 | New-Guy | Well I feel like a damn fool. |
01:50:51 | New-Guy | flaviul: Thanks, I appreciate it. |
01:50:56 | * | New-Guy quit (Quit: Page closed) |
01:57:13 | OrionPK | anyone know how to call a static method in C++ from nimrod |
01:57:19 | OrionPK | e.g. foo::bar() |
02:11:11 | * | superfunc quit (Ping timeout: 252 seconds) |
02:27:59 | * | boydgreenfield joined #nimrod |
03:13:10 | * | xtagon joined #nimrod |
03:18:53 | * | flaviu1 quit (Ping timeout: 264 seconds) |
03:27:21 | * | Kazimuth quit (Remote host closed the connection) |
03:51:41 | * | boydgreenfield quit (Quit: boydgreenfield) |
04:13:41 | * | saml_ quit (Quit: Leaving) |
04:31:47 | * | xtagon quit (Quit: Leaving) |
04:50:08 | * | Demos_ quit (Read error: Connection reset by peer) |
05:02:58 | * | Puffin joined #nimrod |
05:05:26 | * | BitPuffin quit (Ping timeout: 252 seconds) |
05:24:59 | * | hoverbear quit () |
05:32:26 | * | OrionPK quit (Remote host closed the connection) |
05:36:34 | * | superfunc joined #nimrod |
05:49:59 | * | superfunc quit (Ping timeout: 252 seconds) |
07:04:14 | * | kunev joined #nimrod |
07:33:40 | Varriount | Hm. Do we currently use '(..)' for any particular construct? |
07:51:34 | * | kunev_ joined #nimrod |
07:54:14 | * | kunev_ quit (Client Quit) |
07:54:21 | * | kunev_ joined #nimrod |
07:54:22 | * | kunev_ quit (Client Quit) |
07:54:39 | * | kunev_ joined #nimrod |
07:54:53 | * | kunev quit (Ping timeout: 264 seconds) |
08:47:48 | * | genivf joined #nimrod |
08:57:12 | * | Puffin is now known as BitPuffin |
09:54:17 | * | BitPuffin quit (Ping timeout: 264 seconds) |
09:55:04 | * | io2 joined #nimrod |
10:07:15 | * | freezerburnv joined #nimrod |
10:20:06 | Araq | Varriount: no we don't and some people think they look like boobs |
10:21:52 | dom96 | what boobs have you been looking at? |
10:22:17 | Araq | hey it wasn't me who said that |
10:22:25 | Araq | it was ddl_smurf |
10:22:43 | dom96 | sure, blame it on the guy who isn't here :P |
10:22:46 | Araq | and yes, he said something like "maybe my former girlfriends were all ... special" |
10:24:46 | Varriount | Araq: I'm documenting the lexer, and I noticed that there's special tokens for '[.' '.]' and '(.' '.)' |
10:25:18 | Araq | the spec mentions them too, you know |
10:26:03 | Araq | my plan was to use [. .] for generics when it's otherwise ambiguous |
10:26:28 | Araq | like foo[.T.](a, b) vs foo[T](a, b) |
10:27:20 | Varriount | Araq: Any other compiler bugs that I could fix? |
10:27:22 | Araq | var x: Container[T] # still [] because it's obviously a generic instantiation here |
10:27:31 | Araq | Varriount: of course, let's see |
10:28:28 | Varriount | dom96: Why are not on the VNUG, keeping me company? |
10:28:39 | * | ehaliewicz quit (Read error: Connection reset by peer) |
10:28:46 | Araq | Varriount: bug #1216 is likely simply a wrong assertion |
10:28:50 | dom96 | Varriount: I literally just woke up |
10:29:46 | Araq | bug #1203 --> there is types.typeAllowed or somilar which needs the logic to dismiss 'ptr void' |
10:31:06 | Araq | check if bug #1162 still is open, I think we fixed it |
10:32:05 | EXetoC | dom96: yeah well get in there, stop wasting time! |
10:32:35 | Varriount | EXetoC: You're not in there either. :P |
10:33:01 | Araq | bug #1156 is no bug afaict |
10:33:50 | Araq | unknown opcode opcNGetType #1152 --> implement this opcode |
10:34:32 | Araq | bug #1149 --> should have been fixed now |
10:34:43 | Araq | so ... that should be enough for now :P |
10:34:46 | Araq | bbl |
10:34:53 | Varriount | Araq: Thanks |
10:36:08 | * | core-ix joined #nimrod |
10:36:17 | Varriount | Hello core-ix |
10:37:00 | EXetoC | is #1226 too general? |
10:37:22 | EXetoC | (C keyword issue) |
10:38:37 | Varriount | EXetoC: I think the mangle procedure in the codegen just needs to be updated. |
10:38:47 | EXetoC | 1ok |
10:39:43 | EXetoC | fowl: so, you wanted an EFL interface? it's not very portable, which greatly reduces its usefulness |
10:41:56 | EXetoC | they should do something about that. otherwise they've spent all this time developing something that only a few people will consider using |
10:42:34 | Varriount | EXetoC: What's an EFL interface? |
10:43:39 | EXetoC | Varriount: Enlightenment Foundation Libraries. it has a couple of components, including a widget toolkit |
10:44:00 | Varriount | EXetoC: Ah. |
10:46:55 | EXetoC | I don't know much about it, but it seems nice. some people don't like GTK for example |
10:47:18 | EXetoC | and something written in C would be preferable, even though we have a C++ target |
10:50:01 | EXetoC | Araq: why was the C++ target issue closed? do you want me to split it up into multiple issues? |
10:50:50 | * | BitPuffin joined #nimrod |
10:54:48 | * | core-ix quit (Remote host closed the connection) |
10:56:14 | Araq | EXetoC: I simply merged your PR and that closes it |
10:56:18 | Araq | I think |
10:56:43 | EXetoC | oh |
10:58:14 | Araq | but sure, reopen it |
10:58:27 | Araq | any idea what's still causing it to fail? |
11:26:56 | Varriount | Araq: What does 'factImplies' do? What is it for? I know it relates to 'guards', however are these compiletime guards, or runtime guards? |
11:43:08 | * | c0re-ix joined #nimrod |
11:55:34 | * | q66 joined #nimrod |
11:55:34 | * | q66 quit (Changing host) |
11:55:34 | * | q66 joined #nimrod |
11:59:15 | * | genivf quit (Quit: Leaving) |
12:08:43 | * | c0re-ix quit (Remote host closed the connection) |
12:12:09 | * | untitaker quit (Ping timeout: 252 seconds) |
12:16:26 | EXetoC | Araq: no I haven't looked into it |
12:16:42 | EXetoC | I don't have permission to modify the repository |
12:18:48 | * | untitaker joined #nimrod |
12:20:06 | EXetoC | if that's even the issue |
12:31:26 | * | rixx joined #nimrod |
12:33:01 | * | rixx left #nimrod (#nimrod) |
12:54:04 | * | noam__ joined #nimrod |
12:57:17 | * | noam_ quit (Ping timeout: 264 seconds) |
13:01:49 | BitPuffin | I wonder if nimrod deals better with differences in libc on windows and the others |
13:04:38 | BitPuffin | I guess since it's ANSI it should be alright |
13:09:02 | * | noam_ joined #nimrod |
13:11:49 | * | noam__ quit (Ping timeout: 240 seconds) |
13:25:44 | Varriount | Araq: I've found where the bug allowing casting's to ptr void is (the procedure isCastable) |
13:28:52 | Varriount | Araq: isCastable does not contain a call to typeAllowed. Should I add one, checking whether the casting type is allowed? |
13:33:17 | Varriount | Araq: The other option is to modify computedSize to return > 0 for ptr void's |
13:34:23 | * | darkf quit (Quit: Leaving) |
13:44:05 | * | q66 quit (Ping timeout: 252 seconds) |
13:56:02 | * | q66 joined #nimrod |
13:56:02 | * | q66 quit (Changing host) |
13:56:02 | * | q66 joined #nimrod |
14:01:19 | Araq | Varriount: yeah add it to isCastable please |
14:19:14 | Varriount | Who added colors to the koch output? It's quite pretty. |
14:19:24 | Varriount | Er, the koch test out. |
14:19:30 | Varriount | *output |
14:32:50 | * | boydgreenfield joined #nimrod |
14:33:31 | * | flaviu1 joined #nimrod |
14:38:16 | flaviu1 | EXetoC: I'll send a pull request fixing #1226 in a few minutes. Really embarrassing bug |
14:38:49 | Varriount | flaviu1: Try and document any internal compiler structures and procedures you've touched. |
14:39:23 | flaviu1 | Ok, I'll drop a few comments in too |
14:45:56 | flaviu1 | Varriount: https://github.com/Araq/Nimrod/pull/1230 |
14:46:44 | Varriount | flaviu1: Thanks. |
14:47:33 | Varriount | flaviu1: We might as well document the compiler as we fix and improve things. I would liken it to charting unexplored territory. |
14:55:32 | Varriount | Araq: What is opcNGetType supposed to do? Get the type of.. what? |
14:55:44 | flaviu1 | what do the with and without keywords do? They don't seem to be covered in the manual. |
14:56:10 | Varriount | flaviu1: They might be unused for now. |
14:59:39 | flaviu1 | Any idea what the eventual purpose would be? |
15:00:45 | Varriount | flaviu1: Maybe thread resource sychronization? context managers? specialized assignment? |
15:05:49 | * | boydgreenfield quit (Ping timeout: 240 seconds) |
15:07:24 | * | kunev_ quit (Quit: leaving) |
15:11:58 | BitPuffin | Varriount: cock* |
15:12:50 | * | Varriount slaps BitPuffin around a bit with a average-sized minnow. |
15:16:01 | * | EXetoC slaps Varriount with a confused roach |
15:17:47 | flaviu1 | !seen filwit |
15:17:47 | NimBot | filwit was last seen on Tue May 20 06:41:25 2014 quitting with message: Ping timeout: 276 seconds |
15:18:47 | Varriount | flaviu1: I've heard that filwit is/was sick. |
15:18:58 | Varriount | I hope he didn't get run over by a bus or something. |
15:20:05 | flaviu1 | I hope he gets better then |
15:20:53 | flaviu1 | It must be pretty serious if he's gone for so long |
15:23:13 | * | boydgreenfield joined #nimrod |
15:32:27 | * | boydgreenfield quit (Quit: boydgreenfield) |
16:01:55 | flaviu1 | Varriount: I've tested dom's bug, I can't replicate it either |
16:02:10 | Varriount | flaviu1: What OS are you on? |
16:02:15 | flaviu1 | linux x64 |
16:02:25 | flaviu1 | I've been able to reproduce it before |
16:02:40 | Varriount | flaviu1: And which bug? There are two that Araq mentioned that should already be fixed. |
16:02:54 | flaviu1 | https://github.com/Araq/Nimrod/issues/1149 |
16:03:27 | Varriount | flaviu1: Ok. I'm closing it. |
16:03:54 | flaviu1 | I can do a PR with a test, but it may be easier for you to do it, IDK |
16:04:23 | Varriount | flaviu1: Actually, I have to leave in a bit, so it would probably be easier for you. |
16:04:38 | Varriount | (Although, trying to write a unit test on my phone would be... interesting) |
16:04:39 | flaviu1 | Ok, give me a few minutes then |
16:05:01 | dom96 | Varriount: dude. I can still reproduce it |
16:05:04 | dom96 | Don't close it |
16:05:15 | Varriount | dom96: Have you updated your local repo? |
16:05:15 | flaviu1 | dom96: Pull the very latest nimrod |
16:05:24 | dom96 | I did |
16:05:48 | Varriount | dom96: Neither flaviu1 nor I can reproduce your bug. |
16:06:10 | dom96 | Ok, let me pull again and see. |
16:06:11 | flaviu1 | dom96: What commit hash is your head? Works for me on 97fa3391f2e7e8fefe247117bc2da9a848c4fd15 |
16:06:26 | dom96 | Perhaps it was fixed really recently. |
16:07:05 | flaviu1 | brb |
16:07:13 | dom96 | Yeah, I guess i'm not as up to date as I thought lol |
16:07:41 | dom96 | Must have been related to OrionPK's bug. |
16:08:31 | dom96 | Yep, works now. |
16:08:32 | dom96 | My bad. |
16:15:01 | flaviu1 | Varriount: https://github.com/Araq/Nimrod/pull/1231 |
16:15:44 | flaviu1 | Wait, no |
16:16:47 | flaviu1 | dom96: It runs without error, but shouldn't it also echo "a\ns\nd\nf\n"? |
16:17:10 | * | hoverbear joined #nimrod |
16:17:23 | dom96 | yeah, that's what it echos for me |
16:17:25 | flaviu1 | NM, that happens at compiletime |
16:17:31 | dom96 | yep |
16:17:45 | flaviu1 | ok, its good then, it shouldn't have any output |
16:25:07 | dom96 | flaviu1: The tester can verify compile-time output |
16:26:13 | flaviu1 | dom96: Which command is that? |
16:26:30 | dom96 | I'm looking that up now |
16:26:39 | * | dom96 thinks we should document that somewhere |
16:28:44 | dom96 | flaviu1: I think it's "msg" |
16:31:58 | * | flaviu1 quit (Ping timeout: 240 seconds) |
16:42:52 | * | eigenlicht quit (Ping timeout: 276 seconds) |
16:54:30 | * | freezerburnv quit (Quit: freezerburnv) |
16:54:42 | * | eigenlicht joined #nimrod |
16:58:21 | * | silven quit (Remote host closed the connection) |
16:59:42 | * | bjz joined #nimrod |
17:05:30 | * | zahary joined #nimrod |
17:07:01 | Varriount | Hi zahary |
17:13:41 | * | silven joined #nimrod |
17:14:04 | * | freezerburnv joined #nimrod |
17:15:45 | * | bjz quit (Ping timeout: 252 seconds) |
17:16:02 | * | flaviu1 joined #nimrod |
17:16:05 | * | bjz joined #nimrod |
17:17:43 | flaviu1 | dom96: Yes, `msg` |
17:20:41 | * | bjz quit (Ping timeout: 264 seconds) |
17:22:57 | Araq | we need another tag for bugs |
17:23:04 | Araq | between minor and major |
17:23:53 | Araq | any suggestions? |
17:23:56 | flaviu1 | http://www.haskell.org/haskellwiki/Package_versioning_policy#Version_numbers |
17:24:07 | flaviu1 | I like how they do version numbers |
17:25:19 | flaviu1 | Major.BackwardsIncompatible.MinorBackwardsCompatible.patch |
17:25:48 | Araq | flaviu1: that's how we do it... in theory |
17:26:16 | Araq | in practice we don't want 0.10.x ... so |
17:26:40 | Araq | it's always 0.9.x until 1.0.0 is out |
17:27:06 | flaviu1 | We're going to run out of the 9s soon |
17:27:23 | Araq | well look at our roadmap |
17:27:26 | dom96 | Araq: Let's rename minor to low, major to high and add medium |
17:27:40 | Araq | dom96: ok, sounds good |
17:27:42 | dom96 | or better yet, Low Priority etc |
17:29:01 | flaviu1 | Instead of having odd numbers be development builds, have the minor version increment as if a release build, and append '-dcommithash' |
17:29:40 | Araq | flaviu1: nah; also changing things now would be weird |
17:30:02 | Araq | the odd vs even scheme works quite nicely |
17:30:48 | Araq | I dislike adding random stuff to the version number |
17:31:19 | Araq | a version number should be good enough on its own, no 0.9.4alpha-crap |
17:32:36 | flaviu1 | Not all 0.9.5 builds are the same, appending the commit hash would reduce ambiguity. Doesn't matter much though |
17:33:28 | Araq | good point but then 0.9.5 means "doesn't exist really" |
17:34:09 | flaviu1 | Araq: I can't find a roadmap on google, just forum posts about it |
17:34:14 | dom96 | -v should output the commit hash |
17:34:17 | dom96 | bbl |
17:35:10 | Araq | flaviu1: it's a wiki page |
17:36:11 | flaviu1 | Oh, its the Feature Matrix |
17:36:38 | Araq | oh yeah lol |
17:37:07 | * | BitPuffin quit (Ping timeout: 240 seconds) |
17:37:16 | flaviu1 | What's planned for the with/without keywords? |
17:37:38 | Araq | replacement for .push |
17:43:31 | * | q66_ joined #nimrod |
17:43:49 | * | q66_ quit (Changing host) |
17:43:49 | * | q66_ joined #nimrod |
17:43:53 | * | q66 quit (Disconnected by services) |
17:43:55 | * | q66_ is now known as q66 |
18:15:04 | * | Matthias247 joined #nimrod |
18:21:12 | Araq | anything I should review? |
18:25:56 | dom96 | ye |
18:25:57 | dom96 | s |
18:26:03 | dom96 | Start with the oldest PR |
18:27:06 | flaviu1 | dom96: That PR hasn't been resolved yet, some people want the it to fail-fast |
18:27:45 | dom96 | Yeah, so Araq should resolve it. |
18:32:12 | dom96 | I'd say this PR is pretty important too. |
18:36:54 | fowl | EXetoC, i have no knowledge of EFL |
18:46:17 | * | BitPuffin joined #nimrod |
18:48:14 | EXetoC | ok |
18:51:38 | * | Skrylar joined #nimrod |
18:52:10 | Araq | well I don't know |
18:52:26 | Araq | fail fast is nice as is chaining |
18:52:56 | Araq | JSon in general is quirky though |
18:53:07 | Araq | so I guess we should prefer chaining |
18:53:11 | dom96 | so we should introduce a new operator for chaining |
18:53:37 | Skrylar | i think i missed what the problem was |
18:53:43 | Araq | foo{i} is the obvious candidate |
18:54:48 | dom96 | I think the "cool" and functional way to handle this is to use a Maybe type |
18:55:13 | flaviu1 | How about a dot operator for chaining? |
18:55:33 | Skrylar | I'm assuming by fail-fast you mean functions sanity checking their arguments before the chain is executed |
18:57:20 | flaviu1 | Ok, so in javascript `{a: "asd"}["b"] == undefined`, `{a: "asd"}["b"]["c"] == TypeError`, and `{a: "asd"}.b == undefined` `{a: "asd"}.b.c == undefined` |
18:57:52 | flaviu1 | So, `[]` should quick-fail, current behavior. The dot operator versions should chain, like in javascript |
18:58:00 | Skrylar | I'm not sure a new operator is needed for that; there are already exceptions to break control if you are writing a chainable API |
18:58:14 | flaviu1 | Then we also get consistency between indexing arrays. |
18:59:23 | dom96 | flaviu1: I don't think you can overload the dot operator in such a way. |
19:00:23 | Skrylar | I guess I'd have to see a full description of the problem to offer much help with that *shrugs* |
19:00:25 | flaviu1 | dom96: Sure you can. You know it'll return nil, but the compiler doesn't, it thinks its returning a PJsonNode |
19:00:51 | dom96 | Skrylar: http://build.nimrod-lang.org/irclogs/ |
19:01:03 | flaviu1 | Skrylar: https://github.com/Araq/Nimrod/pull/1089 |
19:01:29 | * | eigenlicht quit (Ping timeout: 264 seconds) |
19:02:20 | Araq | let foo = a[i][j]; echo foo # still fails fast enough, I think |
19:02:44 | Araq | and avoids more operators which are slightly different |
19:03:03 | Araq | so I vote for pulling it as it is |
19:04:21 | Skrylar | well [] is expected to either crash or throw an out of bounds, so consistency demands foo[a][b] crap out if a or b is not available |
19:04:51 | Araq | consistency for quirky json protocol processing is a weak argument though |
19:04:55 | Varriount | Wait, what are we talking about? |
19:05:02 | flaviu1 | I think that the dot operator corresponds better with javascript, but I'm fine either way. |
19:05:06 | Skrylar | having a distinction between foo[a][b] and foo[a,b] which actually have behavioral distances might be pushing the nuance a bit |
19:05:51 | Araq | Skrylar: well I suggested {} vs [] |
19:05:52 | Skrylar | if i were writing it for skylight, i would probably just make an openarray function so you'd say blahjson.path("foo", "bar") just because it reads as "hey, this is a special function" |
19:06:21 | Skrylar | Araq: adding {} notation just for JSON seems like unnecessary bloat though |
19:06:43 | Araq | the notation already exists, Skrylar |
19:06:51 | Araq | the compiler itself uses it even |
19:06:52 | flaviu1 | Yeah, making `[]` fail fast and adding a `passthrough()` method might be best. Its the most readable |
19:06:53 | Skrylar | i don't think i've seen it in the manual :\ |
19:07:13 | Varriount | Plus that's like, the third use for {} that we'll have. |
19:07:21 | * | superfunc joined #nimrod |
19:07:33 | Skrylar | flaviu1: i would agree to that; if nothing else because [] is already expected by programmers to either crash or throw an error if an element doesn't exist |
19:07:37 | Skrylar | principal of least surprise and all that |
19:07:48 | flaviu1 | I personally don't like {} being used for anything but value-value maps |
19:08:06 | Araq | there is also `{}=`, it is completely consistent with [] |
19:08:09 | Varriount | Araq: There's always '[. foo .]' |
19:08:17 | fowl | wow |
19:08:19 | fowl | {}= :)) |
19:08:24 | Araq | Varriount: no *that* does not exist :P |
19:08:34 | Araq | except on the token level |
19:08:50 | Skrylar | flaviu1: the passthrough(a, b, c) method seems the most intuitive to me, if nothing else because its ounds like what you're trying to solve is just grabbing elements without error checking each step |
19:09:29 | Skrylar | at that point you will also want to specify a default in case the value doesn't exist, just so you can say blah.getvaluewithdefault(thedefault, "i", "am", "a", "path") or else you're back to nil checking anyway |
19:10:14 | flaviu1 | I wonder how optional arguments interact with varargs |
19:11:20 | flaviu1 | I vote for `chain("a", "b", "c")` |
19:13:07 | Varriount | Are you guys talking about this -> http://forum.nimrod-lang.org/t/385 |
19:13:22 | flaviu1 | Varriount: https://github.com/Araq/Nimrod/pull/1089 |
19:21:23 | Araq | sorry but {} is simply to cool |
19:21:29 | Araq | "chain" doesn't cut it |
19:21:50 | Araq | also we can make it create subobjects via overloading of {}= |
19:22:13 | Araq | foo{"create", "everything", "on", "the", "path"} = value |
19:22:28 | flaviu1 | I have to eat, but I'll amend the pull request in a few minutes |
19:25:16 | * | Jehan_ joined #nimrod |
19:26:54 | fowl | Araq, how about ()=? :D |
19:27:03 | * | Varriount|Mobile joined #nimrod |
19:31:15 | Araq | fowl: I don't know if we support that, I think we don't |
19:31:24 | flaviu1 | I like () better too, I don't like overloading {} for anything but construction |
19:34:19 | Araq | er that's not really possible. Note that a[i] is very different from [i], and the same is for {} |
19:34:33 | Araq | a{i} is an accessor, not a constructor |
19:35:07 | Araq | it's perfectly consistent and you simply dislike it because Ruby didn't think of it :P |
19:35:36 | flaviu1 | Oddly enough, I've never used Ruby |
19:36:27 | Araq | was just an example |
19:36:44 | Araq | insert the language you're most familiar with |
19:36:52 | flaviu1 | I know, but I've heard a lot of stuff I've liked about ruby |
19:37:05 | * | eigenlicht joined #nimrod |
19:38:03 | * | Varriount|Mobile prepares for rash decision fallout |
19:38:38 | Araq | "rash"? what is that? |
19:39:20 | * | Demos joined #nimrod |
19:40:56 | flaviu1 | IDK what you're asking, but the word rash can mean a decision that was reached too quickly |
19:43:18 | Skrylar | flaviu1: I donno. I can't say much, I write eccentric code too =p |
19:56:57 | * | Kazimuth joined #nimrod |
19:59:34 | * | ehaliewicz joined #nimrod |
20:01:46 | flaviu1 | Araq: I'm not sure that `foo{"asd", "asd"} = value` is possible. I get errors about type mismatches, it may only be possible to do `foo{["asd", "asd"]} = value` |
20:03:06 | Jehan_ | What is a{b} supposed to mean? |
20:03:28 | * | perturbation joined #nimrod |
20:03:37 | Araq | flaviu1: hmm that should work though |
20:04:15 | Araq | Jehan_: it's an accessor, shorthand for `{}`(a, b) |
20:04:24 | flaviu1 | `got (PJsonNode, string, string, PJsonNode)`, `expected json.{}=(node: PJsonNode, names: varargs[string], value: PJsonNode)` |
20:04:44 | Araq | ah, that's a limitation of 'varargs' |
20:05:48 | * | Mat3 joined #nimrod |
20:05:52 | Mat3 | good afternoon |
20:05:56 | Araq | so make it foo{["a", "b"]} for now, flaviu1 |
20:06:14 | Araq | we'll change the compiler later to support it |
20:06:29 | Araq | hi perturbation welcome |
20:06:32 | Araq | hi Mat3 |
20:06:44 | Jehan_ | Hmm, you learn something new every day, I guess. :) |
20:07:51 | flaviu1 | Jehan_: It hasn't even been implemented yet :P |
20:08:20 | Jehan_ | Okay, that explains why I didn't know about it. :) |
20:08:45 | Mat3 | hi Araq |
20:09:24 | perturbation | hi Araq... just downloaded Nimrod a few days ago. I've been using it for some Problem Euler stuff so far to try and get used to it. |
20:11:19 | Mat3 | hello perturbation |
20:11:29 | Araq | Jehan_: the compiler itself uses it, it *has* been implemented |
20:11:44 | Araq | it's in fact quite old |
20:11:48 | Jehan_ | Okay, in this case I'm just ignorant. :) |
20:11:52 | perturbation | hi Mat3 |
20:14:33 | Jehan_ | Hmm, looking at it in ast.nim. It looks like a separate indexing operator the way it's used there. |
20:15:19 | flaviu1 | Araq: Ok, sent |
20:16:15 | Araq | yes it's an indexing operator just like '[]' |
20:19:36 | Araq | yes it doesn't match the "principle of least surprise". Which is a fancy saying for "let's copy Awk and C". |
20:21:50 | Mat3 | oO |
20:25:58 | fowl | did not know this works in gcc |
20:26:06 | fowl | int x = 2; int nums[x]; |
20:27:00 | Araq | fowl: that's C99 |
20:28:04 | fowl | ah |
20:30:24 | Jehan_ | Araq: Not sure why it'd violate the principle of least surprise. |
20:30:56 | Jehan_ | Incidentally, one of the computer algebra systems I'm working with also uses it as an indexing operator, so there's precedent (it's pretty old). |
20:32:05 | Jehan_ | Speaking of which, I'm still curious why a language with a syntax influenced by Pascal uses '=' for assignment and '==' for equality. :) |
20:32:31 | flaviu1 | Jehan_: Implementing := is trivial |
20:32:42 | Jehan_ | Not that I care that much (that ship sailed a few decades ago), it's more academic curiosity. |
20:32:54 | Araq | I wasn't serious about the principle of least surprise btw |
20:33:18 | Jehan_ | flaviu1: I know, but what would the point be when most Nimrod code doesn't? |
20:33:41 | Araq | pascal's := is ugly and not that logical |
20:33:53 | Jehan_ | "When in Rome, do as the Romans do." |
20:34:04 | Araq | const foo = bar # somehow := is not important here |
20:34:11 | flaviu1 | Jehan_: You can do do AST manipulations to process the code into something you like |
20:34:39 | Araq | even though you can't flip it, const bar = foo defines 'bar' |
20:35:13 | * | bjz joined #nimrod |
20:35:19 | * | xtagon joined #nimrod |
20:35:20 | Jehan_ | flaviu1: I really don't like it when you have to learn a dozen different coding styles to understand code. That way lies madness, and Perl scripts. |
20:36:30 | Jehan_ | Consistent style is a virtue, even if I would prefer a different style. |
20:37:03 | Jehan_ | s/would prefer/prefer/ |
20:37:04 | Araq | procedure foo(x: integer = 8) // = or := here? |
20:37:12 | Araq | procedure foo(x: integer = 8 ) // = or := here? |
20:37:29 | flaviu1 | Jehan_: You can already use macros and custom parsers to write perl in nimrod, but I agree that style should be consistent. |
20:37:40 | Jehan_ | Araq: I didn't mean to question your decision, I really was just curious. :) |
20:37:56 | Jehan_ | flaviu1: Yeah, and I hope people won't do it. :) |
20:38:35 | Araq | I hope people will use it when appropriate :P |
20:38:59 | Mat3 | Araq: true (beside ':=' is well understood because originated in Algol) |
20:39:20 | Jehan_ | Araq: I'm not so optimistic about programmer self-restraint, given the problems that Scala has had with abuse of operator overloading. :) |
20:39:44 | flaviu1 | LOL, SBT |
20:39:51 | Araq | what problems? |
20:39:54 | flaviu1 | Everything but simple |
20:40:00 | Jehan_ | flaviu1: Yeah, precisely. :) |
20:40:23 | Araq | and why is Scala's operator overloading worse than the extensive dynamic binding everywhere? |
20:40:36 | Jehan_ | Zinc was a godsend so that I didn't have to deal with sbt. :) |
20:40:57 | Araq | bashing operators is common, but doesn't make much sense |
20:41:13 | flaviu1 | Jehan_: I personally had good experiences with Gradle. I got to keep Maven :) |
20:41:13 | Jehan_ | Araq: linenoise is generally less readable than well-chosen identifiers. |
20:41:33 | * | bjz quit (Ping timeout: 252 seconds) |
20:41:38 | Jehan_ | flaviu1: Given the choice, I'd love to be able to dump Maven, I have to say. :) |
20:41:59 | Jehan_ | And I'd kill for a Scala implementation that's not tied to the JVM ecosystem. |
20:42:11 | Araq | Jehan_: no, that's a common misconception |
20:42:32 | Jehan_ | Araq: Clearly, you haven't had to deal with sbt. :) |
20:42:54 | flaviu1 | Araq: I was going to propose at some point requiring a text identifier for operators |
20:43:14 | Araq | a[i] = a[j] + b[k] # ok, formula is obvious |
20:43:48 | Araq | tables.set(a, i, tables.get(a, j).add(tables.get(b, k)) # ok, it's obvious where stuff comes from |
20:43:59 | Araq | but the formula is not recognizable |
20:44:15 | Jehan_ | My choice for my own language has been to support Smalltalk-style operators, i.e. identifiers followed by colons. |
20:45:00 | flaviu1 | `+` `-` `*` `/` I'm fine with, as long as they keep their meaning as numeric operators and don't become something else |
20:45:03 | Araq | there is an inherent tension between shortness and explictness |
20:45:13 | Jehan_ | Araq: I didn't mean to not support operators with well-understood meaning, such as indexing, but making up completely new ones. |
20:45:30 | Araq | and both are readable for different use cases |
20:45:40 | flaviu1 | Araq: https://github.com/runarorama/scala-machines/blob/master/build.sbt |
20:45:52 | flaviu1 | Let me see if I can find a longer one |
20:45:59 | Jehan_ | Even those I don't have a problem with in small amounts ("sola dosis facit venenum"), but apparently programmers have issues with self-restraint. |
20:46:33 | Jehan_ | flaviu1: That's actually one of the more readable ones. |
20:46:46 | flaviu1 | I know, but I can't find the ones that are horrible |
20:47:08 | Jehan_ | flaviu1: Writing them is still a mess. :) |
20:47:36 | Jehan_ | As I said, zinc > sbt. A classical case of less is more (because zinc is a part of sbt). |
20:48:05 | Araq | flaviu1: '+' is however not trivial |
20:48:28 | flaviu1 | hmm? |
20:48:40 | Araq | you want saturated arithmetic, arithmetic that wraps around, raising an exception or perhaps converting to bignums implicitly |
20:49:10 | Araq | so it's a family like +, +! +% +& |
20:49:23 | flaviu1 | That would depend on the types of the operands |
20:49:34 | Araq | not always |
20:49:51 | Araq | I keep wanting saturated arithmetic for ordinary ints |
20:50:45 | Jehan_ | Hmm, I haven't seen a good application for saturation arithmetic. But maybe that's because my typical use cases are different. |
20:50:51 | flaviu1 | Araq: https://github.com/non/spire/blob/3d2a41e91a1f6946fac63660f6157d4a6e4a281d/project/Build.scala |
20:51:01 | superfunc | exit |
20:51:02 | * | superfunc quit (Quit: leaving) |
20:52:31 | flaviu1 | I like raising an exception. You don't really want modular arithmetic unless you're doing something low-level or writing crypto code |
20:52:59 | flaviu1 | And then if I want saturated arithmatic, I'll convert my ints to SaturatedInt and do it that way |
20:54:52 | flaviu1 | Couldn't lambda lifting be put into its own pass, and then rerun enough times for everything to be lifted? |
20:59:32 | Araq | it is its own pass |
21:00:10 | Araq | running it in a fixpoint computation simply makes it far worse to debug though |
21:01:33 | Araq | Jehan_: IMHO saturated arithmetic is what the hardware should do per default ;-) |
21:02:42 | Jehan_ | Araq: Not seeing why? |
21:03:15 | Araq | alloc(N * sizeof(foo) + M) # fail for too big request |
21:03:19 | * | perturbation quit (Quit: Leaving) |
21:03:35 | Jehan_ | Overflow etc. is generally an error state. That high level languages don't expose the CPU flags is a different story. |
21:04:05 | Jehan_ | Araq: Hmm, I'd say that the overflow should trigger an error there. |
21:04:06 | flaviu1 | Ideally, processors should do modular arithmetic and store overflow somewhere. Backwards compatibility and maximum flexibility. |
21:04:49 | Jehan_ | Saturation arithmetic may create different problems there. |
21:04:58 | Araq | flaviu1: processors do that already but turning the flag into an exception is not free |
21:05:16 | Jehan_ | For example, if you use an int type that's not the full wordsize, then allocs quietly get capped at a much too low value. |
21:06:20 | Araq | Jehan_: how is that worse than wrap around "too early"? |
21:06:51 | Jehan_ | The alternative is not "wrap around" but "make it an error". |
21:07:21 | Araq | well you can easily raise an exception for high(int) |
21:07:41 | Araq | "make it an error" is always possible |
21:08:08 | Jehan_ | Requires you to expressly consider that case and may not do what is expected if you mix up different int sizes. |
21:08:28 | Jehan_ | Araq: I mean, make _every_ integer arithmetic overflow an error by default. |
21:08:29 | flaviu1 | Araq: Why would it be expensive? Just branch on a register's contents |
21:08:41 | Jehan_ | It's almost always not going to be what you intended. |
21:09:49 | Araq | I'm arguing that saturation is far better than wrapping around |
21:10:00 | Araq | you're arguing for something else :P |
21:10:13 | * | wan joined #nimrod |
21:10:16 | flaviu1 | I'm arguing that wrapping around is the most flexible possible solution |
21:10:26 | Jehan_ | You said that hardware should do saturation by default? |
21:11:00 | Araq | yes but I didn't mean it shouldn't provide overflow flags |
21:11:31 | flaviu1 | Wrapping around allows the code to most easily implement saturation, modular, and exceptions on wraparound |
21:11:46 | Araq | how so? |
21:12:10 | Araq | that's enabled by the overflow flags |
21:12:52 | Jehan_ | Araq: One problem with saturation arithmetic is that it would make big integer operations more difficult to implement. |
21:13:14 | Jehan_ | Speaking of which, I still need to wrap up the gmp module ... |
21:13:16 | flaviu1 | for signed operations, do the operation as usual, and branch on OF into storing MaxValue instead. Modular arithmetic is already implemented, and throwing an exception on overflow is just a branch on OF again |
21:13:19 | Araq | Jehan_: only if you don't *have* wrap around ops |
21:13:42 | Araq | yes they are useful. no they shouldn't be the default |
21:14:04 | Jehan_ | Okay, so you want different arithmethic operations supported by the CPU? |
21:14:42 | Araq | and exposed by languages like C which lack exceptions |
21:15:46 | * | boydgreenfield joined #nimrod |
21:15:54 | Jehan_ | I still consider C to be a portable assembly language. :) |
21:15:57 | Araq | Jehan_: the classic example for saturated arithmetic is pixel ops. "make it darker until it gets brighter again" is not useful |
21:16:07 | Jehan_ | (With C++ being the matching macro assembler. :) ) |
21:16:59 | Jehan_ | Araq: Saturation arithmetic isn't terribly difficult to implement in assembly if you really need it? |
21:17:55 | Mat3 | it is not |
21:18:26 | Mat3 | (only for floating-point values maybe) |
21:18:43 | flaviu1 | My whole idea is that modular arithmetic with flag registers is the most flexible format. You can convert it to any other type of arithmetic with very minimal hassle |
21:19:33 | Mat3 | hmm, as written it depend on the value type |
21:19:59 | flaviu1 | You can implement saturation arithmetic on top of modular arithmetic with all of two instructions and a probable branch mispredict |
21:20:13 | Araq | jo overflow; overflow: call overflowHandler; for every single arithmetic operation is not cheap |
21:20:54 | flaviu1 | branches are cheap if they are predicted correctly |
21:21:12 | Araq | yes, but code size still is an issue |
21:21:26 | Araq | well sometimes it is |
21:21:28 | flaviu1 | Your code size will increase by two instructions per add |
21:21:41 | Araq | that's 6-8 bytes |
21:21:56 | Araq | the call likely takes an expensive large immediate value |
21:22:46 | Mat3 | if a satured value is hold in one of the 16 possible registers, saturation can be done though a conditional cmov instruction |
21:23:36 | Mat3 | (no branch mispediction, but a possible extra cycle) |
21:23:52 | Araq | Mat3: yes saturation doesn't take a 'call' |
21:24:12 | Araq | thinking about it, the CPU should have a special exception handler register |
21:24:14 | flaviu1 | Araq: I think you're overoptimizng if you're worrying about cache lines |
21:24:15 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
21:24:48 | flaviu1 | The only real way to mess up the instruction cache is with insane levels of OOP |
21:24:58 | * | Kazimuth quit (Ping timeout: 276 seconds) |
21:25:59 | Mat3 | I know another example: static superinstructions (bytecode interpreters) |
21:26:33 | Mat3 | or static instruction replication (another interpreter related optimization) |
21:26:40 | Demos | flaviu1: and self-modifying code :D |
21:27:03 | * | boydgreenfield quit (Quit: boydgreenfield) |
21:27:32 | Mat3 | or trampolines, or branch tables |
21:28:04 | flaviu1 | Mat3: How big are your branch tables? |
21:28:43 | Mat3 | 16*16 instructions * 2 |
21:28:51 | Mat3 | (quads) |
21:29:42 | Mat3 | = 4 KiB |
21:29:52 | flaviu1 | Wow, big |
21:31:31 | Mat3 | the main problem is not the size here but 30-50% BTB mispredictions (which cost a lot of cycles) for interpreters |
21:33:21 | Mat3 | the same problem exist for all kind of code which relate on multible, conditional dispatching |
21:33:55 | Araq | like checking for overflow on every single arithemtic op, Mat3 ? ;-) |
21:34:18 | Mat3 | probably,yes |
21:35:46 | Mat3 | the common algorithm is simple prediction though assuming that the next branch equals the last occured one |
21:36:27 | * | Varriount|Mobile quit (Ping timeout: 252 seconds) |
21:36:59 | Jehan_ | I think most people worry about performance too much. |
21:37:17 | Mat3 | so if a call to a saturation-handling subroutine occurs often this is not the problem |
21:37:45 | flaviu1 | Mat3: I'd assume that saturation handling would be inline |
21:38:03 | flaviu1 | so you don't get any procedure calling |
21:39:09 | Mat3 | this is not always possible for a conventional compiler because processing values can not always be known at compile time |
21:40:57 | Mat3 | and saturation is a conditional operation which *depend* on specific values |
21:41:46 | Mat3 | however, for an interpreter that is not the problem because the whole runtime state is always be known |
21:42:59 | flaviu1 | Mat3: I might be missing something, but have a macro replace `+` with the asmebler equvilent of `a+b; if(CF ne 0) result |= 0x7FFF` |
21:46:45 | Mat3 | that's exactly what I'm written before; You must process the stauration at compile time which means, you must process all arithmetic and logic operations which are related to the value state at invocation |
21:49:25 | Mat3 | ^stauration=conditional saturation |
21:50:57 | * | Mat3 is now known as Mat3-coding |
22:02:26 | * | Mat3-coding quit (Quit: Verlassend) |
22:04:47 | flaviu1 | It doesn't look like I can get a parse tree from a PEG |
22:17:45 | dom96 | The compiler code should really use $ instead of *toString |
22:18:57 | fowl | hi dom |
22:19:01 | dom96 | I guess this style is a remnant from Pascal. |
22:19:06 | dom96 | hi fowl |
22:52:33 | NimBot | Araq/Nimrod implements_78 8eee1bf Dominik Picheta [+3 ±2 -0]: Implements #78. |
23:04:49 | dom96 | This is odd: https://github.com/Araq/Nimrod/issues/140 |
23:05:03 | dom96 | There is a commit which fixes this issue |
23:05:09 | dom96 | and it seems to have been made in the devel branch |
23:05:13 | dom96 | and yet somehow it's not? |
23:07:31 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:07:37 | * | Jehan_ quit (Quit: Leaving) |
23:13:15 | flaviu1 | dom96: Yeah, I saw that a while back too. Rebasing may have occurred or something |
23:14:10 | flaviu1 | Araq: What did you use as reference for the PEGs module? |
23:14:49 | flaviu1 | dom96: It only took you three years to fix that :P |
23:14:54 | dom96 | :D |
23:15:20 | Araq | flaviu1: read the paper from the Lua guys |
23:15:43 | Araq | I developed it entirely on my own though after reading it |
23:16:16 | Araq | in case you didn't notice, parsers are finger exercises for me ;-) |
23:17:42 | * | darkf joined #nimrod |
23:25:42 | Araq | good night |
23:25:48 | flaviu1 | night |
23:27:43 | BitPuffin | Araq: is this module obsolete? https://github.com/Araq/Nimrod/blob/devel/compiler/wordrecg.nim |
23:27:53 | BitPuffin | it says it's to work around a limitation in pascal |
23:28:05 | BitPuffin | and the compiler isn't written in pascal anymore |
23:29:37 | * | hoverbear quit () |
23:38:21 | flaviu1 | BitPuffin: Yes, `s/wordrecg,?//g` fails to compile |
23:38:35 | flaviu1 | Err, no it isn't |
23:39:03 | flaviu1 | I accidentally wrote yes when I should have written no |
23:40:44 | BitPuffin | lol |
23:44:49 | * | aboutGod joined #nimrod |
23:46:41 | dom96 | hello aboutGod! |
23:48:07 | flaviu1 | aboutGod: dom96 made pun of your name after you left :P |
23:52:42 | dom96 | ssshhh |
23:53:37 | BitPuffin | ssh |
23:53:43 | BitPuffin | secure shell |
23:54:55 | * | aboutGod left #nimrod (#nimrod) |
23:56:45 | dom96 | flaviu1: see what you did :( |