00:00:17 | * | brson quit (Ping timeout: 264 seconds) |
00:00:39 | * | brson joined #nimrod |
00:08:29 | fowl | boom. multicast messages done. |
00:34:20 | * | Johz quit (Quit: Leaving) |
00:40:28 | * | Demos joined #nimrod |
00:45:18 | * | Skrylar quit (Ping timeout: 240 seconds) |
01:01:04 | * | Demos quit (Quit: WeeChat 0.4.2) |
01:12:09 | Varriount | Araq: Can you explain again how the semi-case sensitive mode works? And is it on by default now? |
01:16:37 | * | q66 quit (Quit: Leaving) |
01:20:51 | reactormonk | Varriount, only the first character is case-sensitive, and nope, it's not default |
01:20:51 | * | springbok joined #nimrod |
01:21:59 | Varriount | Hi springbok |
01:25:17 | * | flaviu joined #nimrod |
01:26:48 | springbok | evening. |
01:27:08 | reactormonk | springbok, sup |
01:29:08 | * | wan quit (Ping timeout: 240 seconds) |
01:31:32 | * | brson quit (Ping timeout: 252 seconds) |
01:43:25 | * | wan joined #nimrod |
01:51:32 | * | psquid joined #nimrod |
01:51:33 | * | psquid quit (Changing host) |
01:51:33 | * | psquid joined #nimrod |
02:04:56 | * | psquid_ joined #nimrod |
02:06:05 | * | psquid quit (Ping timeout: 255 seconds) |
02:14:09 | * | brson joined #nimrod |
02:21:35 | * | brson quit (Ping timeout: 252 seconds) |
02:25:18 | * | brson joined #nimrod |
02:36:44 | * | brson quit (Ping timeout: 240 seconds) |
03:00:09 | * | brson joined #nimrod |
03:04:56 | * | flaviu quit (Remote host closed the connection) |
03:05:24 | * | psquid joined #nimrod |
03:07:08 | * | psquid_ quit (Ping timeout: 240 seconds) |
03:08:28 | * | Skrylar joined #nimrod |
03:25:36 | * | jbe joined #nimrod |
03:38:31 | * | DAddYE_ quit () |
03:38:42 | * | DAddYE joined #nimrod |
03:44:15 | * | xenagi quit (Quit: Leaving) |
03:45:52 | * | jbe quit (Remote host closed the connection) |
03:55:39 | * | BitPuffin quit (Ping timeout: 265 seconds) |
03:55:41 | * | BitPuffi1 joined #nimrod |
03:59:51 | * | jbe joined #nimrod |
04:01:23 | Varriount | Hm. Quiet night. |
04:05:40 | * | psquid_ joined #nimrod |
04:07:41 | * | jbe quit (Remote host closed the connection) |
04:08:29 | * | psquid quit (Ping timeout: 255 seconds) |
04:09:09 | * | jbe joined #nimrod |
04:24:24 | * | jbe quit (Remote host closed the connection) |
04:29:06 | * | jbe joined #nimrod |
04:34:59 | * | brson quit (Ping timeout: 250 seconds) |
04:37:06 | * | jbe quit (Remote host closed the connection) |
04:51:20 | * | brson joined #nimrod |
04:55:40 | * | DAddYE quit () |
04:56:04 | * | brson quit (Ping timeout: 265 seconds) |
05:02:15 | * | DAddYE joined #nimrod |
05:06:42 | * | brson joined #nimrod |
05:12:46 | * | nande quit (Ping timeout: 258 seconds) |
05:12:46 | * | Kelet quit (Ping timeout: 258 seconds) |
05:12:59 | * | brson quit (Ping timeout: 245 seconds) |
05:35:44 | * | Kelet joined #nimrod |
05:51:47 | * | vendethiel quit (Read error: Connection reset by peer) |
05:57:07 | * | vendethiel joined #nimrod |
06:16:18 | * | vendethiel quit (Ping timeout: 240 seconds) |
06:24:19 | * | bjz joined #nimrod |
06:24:42 | * | vendethiel joined #nimrod |
06:25:02 | * | vendethiel quit (Read error: Connection reset by peer) |
06:26:39 | * | vendethiel joined #nimrod |
06:27:04 | * | kunev joined #nimrod |
06:31:49 | * | vendethiel quit (Remote host closed the connection) |
06:32:52 | * | vendethiel joined #nimrod |
07:24:18 | * | Varriount|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )) |
07:39:32 | * | superfunc joined #nimrod |
07:41:06 | Araq | Varriount: it's off by default the compiler specific configuration files uses it though (cs:partial) |
07:41:54 | * | psquid_ quit (Ping timeout: 240 seconds) |
07:42:07 | Araq | it makes the first character sensitive and leaves the rest as it is, so Foo/foo are distinct, FooBar is still Foo_bar |
07:43:27 | * | psquid_ joined #nimrod |
07:47:01 | * | zahary quit (Quit: Leaving.) |
07:47:29 | milosn | Araq: morning |
07:47:37 | * | boydgreenfield quit (Quit: boydgreenfield) |
07:47:52 | Araq | milosn: servus |
07:48:18 | milosn | ive discovered another obstacle in my ORM project ... in short ... take int vars for example, ints can not contain nil value |
07:48:22 | milosn | :) |
07:48:46 | milosn | which makes it veru hard to map DB rows directly to nimrod objects :P |
07:49:35 | * | milosn at work |
07:49:41 | milosn | came into office early |
07:51:54 | * | kunev quit (Ping timeout: 240 seconds) |
07:52:21 | superfunc | perhaps you could just wrap the ints in a Maybe type |
07:54:19 | Araq | ah yeah |
07:54:25 | Araq | that's in fact rather obvious :P |
07:54:57 | superfunc | been doing too much haskell lately haha |
07:54:57 | * | Araq is a fan of misusing low(int) for None/Null |
07:55:16 | Araq | superfunc: hey, we also have a Maybe ... somewhere ;-) |
07:57:02 | superfunc | I'm excited to start using nimrod fulltime this summer when my semester ends |
07:59:50 | milosn | Araq: actually i had other idea for low(int) ... low(int) would be the special value when you set it to your int field on the row object, that field is ommited from SQL query |
08:00:17 | milosn | and could also be the initial value when you create new record representing the future row in DB |
08:00:29 | milosn | but its all null now, since int cant store nil :P |
08:00:41 | milosn | so i need 2 low(int)-s :P |
08:01:01 | milosn | :D |
08:01:47 | milosn | hmm high(int) and low(int) ... :P |
08:02:25 | milosn | but thats fscken ugly man :) |
08:11:52 | milosn | hmm actually that could be the way out |
08:12:13 | milosn | is there an equivalent for float? low(float) dont do much |
08:16:00 | Araq | there is +-INF for floats |
08:16:41 | Araq | I hate low(int), it's some really shitty value cause it doesn't work with 'abs' |
08:17:25 | Araq | IMO integers as the CPU implements them are wrong |
08:17:58 | milosn | hmm i am the wrong person for that discussion :) |
08:18:31 | * | milosn on 2nd coffee |
08:19:13 | * | DAddYE quit (Remote host closed the connection) |
08:19:40 | * | DAddYE joined #nimrod |
08:20:15 | Araq | superfunc: interesting. what will you use Nimrod for? |
08:21:47 | superfunc | two things, first, I'm working on a graph library(basic bfs, dfs, topsort, minimum spanning trees etc). second is a top down 2d shooter, similar to ikaruga |
08:23:54 | * | DAddYE quit (Ping timeout: 240 seconds) |
08:25:00 | superfunc | Araq: I plan to release an initial version of the library for people to use in early june |
08:38:26 | * | Varriount|Mobile joined #nimrod |
08:38:43 | Varriount|Mobile | Araq: ping |
08:50:12 | * | DAddYE joined #nimrod |
08:53:24 | Araq | Varriount|Mobile: pong |
08:54:18 | * | DAddYE quit (Ping timeout: 240 seconds) |
08:55:48 | Varriount|Mobile | Araq: I emailed Micklat, and he said that, A) He wasn't actively developing Nimborg anymore, B) That there were certain callbacks and stuff that needed to be finished, and C) That in order to have truly seamless integration with python, some special GC thing would be needed |
08:56:43 | * | kunev joined #nimrod |
08:56:46 | Varriount|Mobile | Since Nimrod is an ambitious language, perhaps its developers would be interested in the difficult task of cross-language GC. This is a bit harder than anything I've done with NimBorg so far, but it could interest someone who likes greater challenges. The idea is this: |
08:57:02 | Varriount|Mobile | Thats what Micklat said |
08:58:09 | Araq | well what is the idea? |
08:58:22 | Araq | "The idea is this: " |
08:58:35 | Varriount|Mobile | Er sorry, client cut the message off |
08:58:44 | Varriount|Mobile | Let me just gist it instead |
09:00:33 | Varriount|Mobile | Araq: Here's the message -> https://gist.github.com/Varriount/bb65ae029daba5c12a66 |
09:05:49 | Araq | hmm a cross language GC |
09:05:57 | Araq | will have to think about it |
09:07:14 | * | Me___ joined #nimrod |
09:07:24 | Araq | hi Me___ welcome |
09:08:13 | Varriount|Mobile | Araq: For what its worth, I don't feel seamless integration would be worth it. Regular integration is fine |
09:09:39 | Varriount|Mobile | Or rather, seamless integration would not be worth excessive code changing and effort within the compiler, when decent integration exists already. |
09:09:51 | * | Me___ quit (Client Quit) |
09:15:09 | Araq | yeah but I just got an idea |
09:15:31 | * | kunev quit (Quit: leaving) |
09:16:16 | Varriount|Mobile | Could you put it to the side until you've finished implementing your current idea? |
09:17:08 | Araq | no, it's related with what I'm currently doing |
09:17:25 | Araq | :-) |
09:19:33 | * | kunev joined #nimrod |
09:21:48 | Skrylar | cross language gc isn't inherently hard (iv've talked about it should be an OS service) |
09:21:52 | Varriount|Mobile | Huh. Apparently Windows assigns both thread ID's and process ID's out of the same pool, so they never overlap. |
09:22:14 | Skrylar | the problem is making an API that isn't lacking, and then getting people to use it |
09:22:48 | Araq | Skrylar: no the problem is making it perform well |
09:23:40 | Skrylar | i would cover that under api :\ 'cause languages would have to register their object type definitions with it too |
09:24:26 | Araq | Varriount|Mobile: all modern OSes use 1-1 thread models where a thread is scheduled like a process |
09:25:59 | Varriount|Mobile | Araq: My ignorance on such subjects is why I'm reading "Windows Internals" |
09:42:53 | * | springbok quit (Ping timeout: 264 seconds) |
09:50:56 | * | DAddYE joined #nimrod |
09:55:06 | * | DAddYE quit (Ping timeout: 240 seconds) |
10:06:20 | * | Skrylar quit (Ping timeout: 240 seconds) |
10:28:24 | * | Skrylar joined #nimrod |
10:38:11 | * | BitPuffi1 quit (Ping timeout: 255 seconds) |
10:51:43 | * | DAddYE joined #nimrod |
10:54:50 | * | io2 joined #nimrod |
10:56:14 | * | DAddYE quit (Ping timeout: 258 seconds) |
11:01:08 | * | springbok joined #nimrod |
11:02:33 | * | springbok quit (Changing host) |
11:02:33 | * | springbok joined #nimrod |
11:08:14 | Araq | fyi: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.141.4610&rep=rep1&type=pdf |
11:14:44 | Skrylar | whitepapers |
11:14:53 | Skrylar | more of these bastards |
11:16:16 | * | Johz joined #nimrod |
11:19:41 | Johz | Hello, I'm trying to read an xml document by essentially iterating over a set of tags at a certain depth, as opposed to reading the whole thing into memory and trying to access the full tree. |
11:20:21 | Johz | I have something that will work, but it isn't very good. In the standard library, however, there is the xmlparser module which contains a function which would be absolutely perfect. |
11:20:35 | Johz | However that function isn't public. |
11:21:14 | Johz | Is there a way to get around that, or should I just C&P it into my own code and feel horrendously guilty? :P |
11:30:33 | * | BitPuffi1 joined #nimrod |
11:46:23 | Araq | hi Johz make it public and do a PR |
11:47:06 | Araq | but that shouldn't be necessary, there are very low level APIs available |
11:47:29 | Araq | designed to not construct the whole XML tree |
11:50:06 | Johz | From what I can tell, there's xmltree, which gives me all of the pieces of tree that I can stick together, and xmlparser, which gives me a function that will build the full tree. |
11:50:54 | Johz | However, to build the full tree, there's also a function that builds part of the tree given an initial point in the parsing, which is really just a utility function, but it turns out is exactly the utility function that I want to write. |
11:52:26 | * | DAddYE joined #nimrod |
11:56:42 | * | DAddYE quit (Ping timeout: 240 seconds) |
11:56:50 | Araq | there is also parsexml that doesn't construct a tree and is what xmlparser uses (the names suck, I know) |
12:04:29 | Johz | Yeah, parsexml had been what I'd been using to get all the "tag" events, but really badly (child nodes were simply added to a sequence, no searching mechanism etc) |
12:08:48 | Araq | well make a PR and describe why you need it |
12:09:00 | Araq | adding a * is not that hard for us |
12:17:37 | * | BitPuffi1 is now known as BitPuffin |
12:24:37 | * | Johz quit (Quit: Leaving) |
12:28:09 | * | isenmann quit (Quit: Leaving.) |
12:37:10 | * | darkf quit (Quit: Leaving) |
12:53:11 | * | DAddYE joined #nimrod |
12:57:30 | * | DAddYE quit (Ping timeout: 240 seconds) |
13:00:12 | * | kunev_ joined #nimrod |
13:01:25 | * | kunev quit (Disconnected by services) |
13:01:31 | * | kunev_ quit (Client Quit) |
13:02:07 | * | kunev joined #nimrod |
13:34:14 | * | Skrylar quit (Ping timeout: 252 seconds) |
13:38:49 | * | Skrylar joined #nimrod |
13:54:05 | * | DAddYE joined #nimrod |
13:58:18 | * | DAddYE quit (Ping timeout: 240 seconds) |
14:33:05 | * | io2 quit (Quit: ...take irc away, what are you? genius, billionaire, playboy, philanthropist) |
14:55:00 | * | DAddYE joined #nimrod |
14:57:40 | * | t4nk737 joined #nimrod |
14:58:33 | * | Varriount|Mobile quit (Ping timeout: 250 seconds) |
14:59:41 | * | DAddYE quit (Ping timeout: 264 seconds) |
15:00:06 | t4nk737 | Hello. Does anyone think there would be interest in a hex module for the standard library? I couldn't find any way to convert hex strings to and from byte strings/arrays. I wrote one, and if there's interest I'll polish it up and write tests for it before submitting a PR. |
15:01:57 | * | kunev quit (Quit: leaving) |
15:02:36 | t4nk737 | As far as I can tell, there's no way in the Nimrod standard lib to do this without calling a C library. |
15:13:42 | dom96 | t4nk737: What about this? http://build.nimrod-lang.org/docs/parseutils.html#parseHex,string,int,int |
15:19:59 | t4nk737 | dom96: thanks. I should have specified: I'm talking about arbitrarily large hex strings, larger than can fit in an integer. Kind of like golang's hex package, or Python "".encode('hex') "".decode('hex') |
15:20:27 | t4nk737 | did I miss something on that page? |
15:23:01 | dom96 | I see. I think that may be accepted into the standard library (Araq ultimately decides), but it would be nice if your module produced BigInts I think, however we currently lack a bigint implementation in the stdlib. |
15:25:15 | t4nk737 | bigints would be nice, but also byte strings and/or byte arrays are quite useful, particularly for crypto routines. But bigints would be extremely useful for crypto and other areas, too. Has anyone written a bigint imple in Nimrod? |
15:25:39 | t4nk737 | anyway, it's easy to write these things, but it would be nice to have them built-in. |
15:26:24 | dom96 | I recall hearing somebody was working on an implementation but I can't remember exactly who that was or when I heard this. |
15:26:26 | t4nk737 | writing "".encode('hex') in Python instead of yet another byteToHex function is very nice. |
15:27:32 | dom96 | In any case, you can submit a PR (if you don't mind the possibility that it will be rejected) or wait for Araq to show up so that he can tell you if he wants it in the stdlib. |
15:28:06 | dom96 | Alternatively you can create a repo on github with the code and create a babel package out it. |
15:28:09 | dom96 | *out of it |
15:28:10 | t4nk737 | Do you think Araq wants a native Nimrod bigint implementation or do you think binding to GMP would be preferred. |
15:28:18 | t4nk737 | dom96: thanks, I'll do that. |
15:28:35 | t4nk737 | I just wanted to run it by you all first to see if it would be useful. |
15:28:42 | dom96 | t4nk737: I think he would love both heh. |
15:29:44 | dom96 | It's nice to have as little dependencies as possible though so a native implementation would be nice, with the possibility of switching to GMP for higher performance. |
15:30:03 | t4nk737 | I'll go ahead and submit a PR for this hex module and then start working on bigint in Nimrod. There's a really good blog post somewhere that someone wrote about writing bigint library. |
15:30:21 | dom96 | But I don't know much about big ints are implemented so that's just really my general opinion. |
15:30:25 | t4nk737 | I'm sure I have it bookmarked. |
15:30:39 | dom96 | *about how |
15:32:16 | t4nk737 | I've done some work adapting a bigint routine in JavaScript, but just working on someone else's implementation. But I have friends who are strong in numerics who could probably help out if needed. |
15:32:45 | t4nk737 | Anyway, I really, really like Nimrod. |
15:33:02 | t4nk737 | I'm very glad I found out about it |
15:34:09 | t4nk737 | I'm glad to have a reasonable alternative to Go, which I've not been terribly happy with. But I've been looking for an alternative to Python for a while for performance issues. Tired of writing C libraries to call from Python. |
15:34:26 | t4nk737 | I should be able to do it all in one language, and Nimrod provides it. |
15:34:51 | dom96 | That's good to hear :) |
15:35:10 | dom96 | Out of curiosity why are you not happy with Go? |
15:35:34 | EXetoC | obviously we'll steal some code so as to make our implementation almost as fast |
15:35:46 | t4nk737 | Well, it's banal to say it, but I really miss generics. Some of the workarounds are quite awkward. |
15:36:05 | t4nk737 | Also, things like no tuples |
15:36:13 | t4nk737 | why not tuples? argh! |
15:36:45 | t4nk737 | I do really like the Go standard library, however. They've done an excellent job. |
15:36:56 | EXetoC | some people call others narrow-minded for dismissing the language on such grounds |
15:37:53 | t4nk737 | EXetoC: those are just a few reasons, sinec dom96 asked me. Anyway, not looking for conflict. Didn't think I'd offend anyone on #nimrod complaining about golang. |
15:38:23 | EXetoC | no, I mean those who call others narrow-minded for complaining about lack of generics |
15:38:35 | t4nk737 | Oh, my bad. |
15:38:47 | t4nk737 | I misunderstood. My apologies. |
15:39:15 | EXetoC | you end up writing generic interfaces in C, but with complete lack of type safety |
15:39:38 | t4nk737 | Yes, and you can do the same in golang but you lose type safety. |
15:40:50 | EXetoC | then you have things like run-time safety, but I want as much as possible to be at compile-time |
15:41:01 | * | bjz quit (Ping timeout: 252 seconds) |
15:41:09 | t4nk737 | But Nimrod has really achieved a nice balance between high-level convenience and low-level performance. |
15:41:31 | dom96 | I've been using Nimrod since before Go was released so I've never actually gave it a try. |
15:41:40 | EXetoC | you can definitely have both, and I don't think everyone realizes that |
15:42:05 | t4nk737 | Exactly, we've always been told that it's a choice. |
15:42:09 | dom96 | But from what I saw reading about it, the lack of generics, exceptions and the C-like syntax didn't exactly encourage me to try it. |
15:42:46 | t4nk737 | You write Ruby, Lua, Python for convnenience and developer speed, and then you go to C for performance. |
15:43:23 | t4nk737 | I've been happily surprised by the new wave of languages like D, Go, Nimrod, and Rust. |
15:44:22 | t4nk737 | All of which offer both convenience and speed. Nimrod, however, is the only one of those three that you can easily call from Python, Lua, Ruby, etc (actually, not 100% sure about D). |
15:44:51 | t4nk737 | three -> four |
15:46:48 | t4nk737 | That's actually why I tried out Nimrod. I was pretty disappointed Go didn't have shared library support to call from Python. I tried out Nimrod and was amazed how easy it was to write a fast shared library and call it from Python. |
15:47:08 | * | tdc joined #nimrod |
15:48:35 | t4nk737 | anyway, I'm procrastinating now. Got to go. I'll write some tests and submit a PR later today, dom96 Thanks again. |
15:48:58 | dom96 | t4nk737: No problem. See ya! |
15:49:15 | t4nk737 | later! |
15:49:18 | * | t4nk737 quit () |
15:52:48 | EXetoC | alright, let's see if I can make it so that echo actually prints embedded null's. it's a really annoying issue |
15:53:28 | dom96 | oh yeah, i've been bitten by that a couple of times |
15:55:27 | * | DAddYE joined #nimrod |
15:59:50 | * | DAddYE quit (Ping timeout: 258 seconds) |
16:01:48 | * | superfunc quit (Ping timeout: 240 seconds) |
16:04:20 | * | untitaker quit (Ping timeout: 276 seconds) |
16:09:02 | * | untitaker joined #nimrod |
16:23:49 | fowl | EXetoC, each $ has to handle nil |
16:27:16 | * | DAddYE joined #nimrod |
16:40:13 | EXetoC | fowl: so basically this? "proc `$`(x: T): string not nil" |
16:40:29 | EXetoC | not that "not nil" works very well now, but it'd be by convention for now |
16:44:24 | EXetoC | Araq: so how will "not nil" work? if it can't be proven, will the user have to perform a check first? |
16:45:00 | EXetoC | "assert false", "if x == nil", ... |
16:48:42 | EXetoC | but will the difference between "not nil" and a corresponding contract be more than just syntactial? |
16:50:29 | fowl | EXetoC, no, $ should return "" or "nil" or something like that |
16:51:09 | EXetoC | that's what I implied |
16:51:49 | fowl | i think changing it to 'not nil' will make it incompatible with other $s, not sure |
16:54:35 | EXetoC | "(nil)" or "(nil T)" seems good, and the input can be asserted to be not nil in cases where that is unacceptable |
16:54:57 | EXetoC | yeah well you'd have to make a transition at some point |
16:56:45 | fowl | Araq, i would love to have an expression to get check if an expression is void, type(echo "x") makes this happen Error: expression 'echo "Hi"' has no type (or is ambiguous) |
16:57:35 | fowl | Araq, be nice to be able to do when is_void(expression): expression else: return expression |
16:57:48 | fowl | or type(..) is void |
16:58:02 | EXetoC | you might be able to hack something together |
17:01:27 | fowl | EXetoC, thanks |
17:01:36 | fowl | heres my solution |
17:01:41 | fowl | proc takes_anything [T: not void] (some: T): void = discard |
17:01:42 | fowl | template voidExpr (x): expr = |
17:01:42 | fowl | when compiles(takes_anything(x)): |
17:01:42 | fowl | false |
17:01:42 | fowl | else: |
17:01:42 | fowl | true |
17:02:03 | * | guest12345678 joined #nimrod |
17:02:34 | * | guest12345678 quit (Client Quit) |
17:06:00 | EXetoC | ok. you can return bool though, and just do "not compiles" |
17:06:08 | EXetoC | that's the first time I've seen 'not' used like that |
17:06:53 | * | springbok quit (Ping timeout: 264 seconds) |
17:07:07 | fowl | EXetoC, it doesnt seem to work for void |
17:07:08 | Varriount | Hm. Could you use a typeclass rather than compiles()? I heard that using compiles() is bad for your health. |
17:07:37 | fowl | i tried it but echo() doesnt have a type to compare against |
17:08:46 | EXetoC | enter hack #2 I guess |
17:10:23 | EXetoC | when not compiles(takes_anything(a)): not compiles(takes_anything(b)) |
17:10:36 | * | Jehan_ joined #nimrod |
17:11:49 | EXetoC | fowl: is that what you mean? |
17:11:52 | fowl | EXetoC, ? just `not compiles(takes_anything(x))` works |
17:12:03 | dom96 | EXetoC: I thought you were talking about \0 inside strings. |
17:13:03 | * | Matthias247 joined #nimrod |
17:13:28 | EXetoC | fowl: I thought you also wanted to compare the type of two expressions, where one or both might be void |
17:13:36 | Jehan_ | The sign of the devil is actually \0\0\0, not 666. The latter was a transcription error. :) |
17:14:41 | EXetoC | dom96: I did, but fowl wanted something to be done about nil inputs too |
17:14:55 | Jehan_ | Someone was asking about GMP earlier? |
17:15:00 | fowl | EXetoC, nah |
17:15:46 | EXetoC | then I don't know what you were referring to in your last statement |
17:17:20 | * | BitPuffin quit (Ping timeout: 255 seconds) |
17:23:33 | dom96 | Jehan_: Sure, do you think we should make a binding for GMP and use it in Nimrod's stdlib, or make a native big int implementation or both? |
17:23:39 | * | q66 joined #nimrod |
17:23:39 | * | q66 quit (Changing host) |
17:23:40 | * | q66 joined #nimrod |
17:24:02 | Jehan_ | It's just that I've been working on GMP bindings myself. |
17:24:11 | dom96 | ahh cool |
17:24:32 | Jehan_ | They're still in their early stages, but I can do basic arithmetic, printing and parsing already. |
17:24:39 | EXetoC | gmp is that complex? |
17:24:55 | Jehan_ | GMP has a ton of functionality to bind. |
17:25:05 | Jehan_ | There's also the matter of efficiency. |
17:25:24 | Varriount | And, if I recall looking at the headers correctly, a huge number of macros |
17:25:36 | Jehan_ | Yeah. |
17:25:43 | EXetoC | obviously |
17:25:47 | EXetoC | gotta have those macros |
17:26:28 | Jehan_ | At the moment I'm using {.passl.} to link, {.dynlib.} isn't a real option. |
17:26:58 | Varriount | Why not? |
17:27:18 | Jehan_ | Because you can't have both a {.header.} and a {.dynlib.} option. |
17:27:32 | Jehan_ | Which I learned the other day. |
17:28:07 | * | Demos joined #nimrod |
17:28:23 | Jehan_ | I also have a 128-bit int library at https://bitbucket.org/behrends/nimlongint (don't tell Araq, though, I'm evil and am using {.emit.}). Also, not portable (yet), so not recommended for Babel. |
17:28:51 | Varriount | Jehan_: Just how much free time do you have on your hands? |
17:28:52 | EXetoC | why were you using .header again? |
17:29:06 | Jehan_ | Because of the aforementioned macros in gmp.h? |
17:29:20 | Jehan_ | Varriount: Too little? |
17:29:59 | Demos | any thoughts on removing the SSLv2 stuff from sockets and our openssl wrapper? |
17:30:12 | EXetoC | I think you were notified of the related limitations, but it's always nice to get something up and running quickly, and most people use the C target anyway |
17:30:15 | Jehan_ | Oh, c2nim also seems to get indigestion from gmp.h, but that's really GMP's fault. |
17:30:45 | dom96 | Demos: Why? |
17:30:47 | Demos | c2nim will almost never be able to deal with the headers without modification |
17:30:48 | Jehan_ | EXetoC: Whenever I use the C++ target, it breaks, anyway. :) |
17:30:51 | EXetoC | what doesn't it handle in macros? ##, \, what else? |
17:31:04 | Jehan_ | EXetoC: Dunno, I tried, then I gave up. |
17:31:06 | Demos | and dom96 because a lot of systems build openssl without sslv2 support, and sslv2 is not secure |
17:31:28 | dom96 | Demos: dead code elimination should remove it |
17:31:31 | Jehan_ | The GMP API is pretty clean, I just copied from the docs for the most part. |
17:31:51 | Demos | right, but not if you want to override nimrod's dlopen and dlsym stuff and link yourself |
17:32:06 | EXetoC | Jehan_: but it's compatible with the C++ target I think |
17:32:11 | EXetoC | but yes the target itself is buggy |
17:32:14 | Jehan_ | Yup. |
17:32:28 | Demos | it came up on openBSD, but honestly the real problem is something with CRYPTO_set_mem_functions |
17:33:07 | Jehan_ | I'm not really happy with Nimrod using dlopen(). Operating systems have a standard process for loading libraries that you normally don't want to circumvent. |
17:33:13 | Jehan_ | Eh, using it so much. |
17:33:32 | dom96 | I don't really mind tbh. Get rid of it in a PR if you want, but i'm leaving it up to Araq to decide. |
17:33:39 | Demos | yeah, same. But on the other hand it makes linking less compiler dependent |
17:33:42 | Jehan_ | Dlopen support as such is great. |
17:33:42 | dom96 | The last time this issue came up he just said to use dead code elimination |
17:33:50 | Demos | yeah |
17:33:54 | Varriount | Jehan_: It's really fun when I'm using process monitor, I can instantly spot where nimrod is trying to load dll's |
17:34:00 | dom96 | If you're linking yourself aren't you choosing the stuff you import anyway? |
17:34:19 | Jehan_ | dom96: Que? |
17:34:23 | Demos | not really, since stuff is loaded from all the importc'd procedures |
17:35:02 | dom96 | oh, I thought you meant using the dlsym module manually yourself? |
17:35:10 | Jehan_ | One problem, for example, is that I can't use "otool -L" (the "ldd" counterpart in OS X) to see where libraries are being loaded from. |
17:35:30 | Jehan_ | And I suspect that you can have lots of fun with that and rpath on Linux. |
17:39:21 | Jehan_ | But there's --dynlibOverride, so I don't really care. |
17:39:36 | Jehan_ | Since contrary to what the option says, you can also use it for dynamic libraries. |
17:45:54 | fowl | Jehan_, you should make a babel file so we can install it by url |
17:46:47 | Jehan_ | Umm, I did say that I was keeping it intentionally out of Babel, right? :) |
17:47:16 | Jehan_ | It's not portable, it uses {.emit.}. It's for people who know what they are doing and need the functionality. |
17:48:01 | dom96 | what if those people want to install it using babel? :P |
17:48:15 | fowl | Jehan_, it would be out of the babel list, but easily installable |
17:48:16 | * | enurlyx joined #nimrod |
17:48:34 | Jehan_ | Hmm. I'll have a look at that. |
17:51:14 | enurlyx | fowl: What is this message thing you are writing? Some kind of Eventsystem? |
17:51:52 | fowl | enurlyx, its an entity component system |
17:55:49 | Varriount | Like Artemis? |
17:59:09 | Araq | Jehan_: python ctypes has the same problem and yet nobody complains |
17:59:43 | Araq | "otool -L" is fundamentally broken thanks to dlopen... that's what you get for providing runtime reflection so I don't care |
18:00:17 | fowl | Varriount, artemis is more of a bundle than entitty, looks like it comes with system management and stuff |
18:01:11 | fowl | Varriount, entitty has to do manual memory management (vs having a list<component> to pull from) |
18:01:42 | Varriount | Araq: What's wrong with runtime reflection? |
18:01:55 | Araq | and very the idea to link *statically* against some shitty-per-default-not-installed devel package so that the *runtime* loading can be tracked is absurd too |
18:03:03 | Araq | Varriount: runtime reflection is a PITA for optimizations and verifications |
18:03:09 | Jehan_ | Araq: That's fine with me, as long as --dynlibOverride exists. :) |
18:04:43 | Jehan_ | And most people use reflection because languages lack metaprogramming facilities. |
18:05:04 | Jehan_ | In fairness, there ARE some real good use cases for reflection. |
18:05:10 | Araq | (btw there is no difference between optimization and verification) |
18:05:26 | Jehan_ | But they're not what most people use reflection for. |
18:05:40 | Araq | yup. |
18:06:00 | Jehan_ | Not counting using reflection to hack around limitations in the JVM. |
18:06:11 | Araq | of course it can be useful but then don't complain your tools can't help you anymore ;-) |
18:07:05 | Jehan_ | Araq: The problem with dynlibs using a hidden loading process that's not reflected in the executable is that it can be frustrating to figure out what goes wrong when something goes wrong with it. |
18:07:39 | Araq | --verbosity:2 or higher lists dynlib dependencies btw |
18:08:23 | Araq | Jehan_: IME that's only a problem with Unix. On Windows DLLs simply work, you put it in the same dir as the .exe and they will be used |
18:08:30 | Jehan_ | Speaking of which, would it be possible for the compilation process to be less noisy by default when -r is used? |
18:09:01 | Araq | --hint[Processing]:off ? |
18:09:03 | Jehan_ | Araq: You can accomplish that on OS X, too, if you want ti. |
18:09:06 | Jehan_ | it* |
18:09:23 | Jehan_ | I.e. just specify that the DLL path is relative to the executable. |
18:09:47 | Jehan_ | Araq: I have a script that turns off hints and sets verbosity to 0. |
18:10:03 | Araq | oh and how do I do that? export some LD_FOO environment variable in some .sh script before loading stuff? |
18:10:14 | Jehan_ | It's not a feature request, I can live fine with that. I was simply wondering if it was intentional. |
18:10:48 | Araq | well surely the compiler produces the amount of output that I consider useful... :-) |
18:11:16 | Jehan_ | Araq: Start the library path with @executable_path. |
18:11:18 | EXetoC | -q|--quiet? |
18:11:42 | Jehan_ | OS X has that because OS X apps are technically folders with multiple files, and that's how the system finds the libraries in there. |
18:11:54 | enurlyx | fowl: This is for games, right? Do you think this could be useful for a GUI(not game gui)? |
18:12:40 | Jehan_ | A little known fact is that you can also install_name_tool -add_rpath to make the system look for dlopen libraries in a specific place. |
18:13:00 | Jehan_ | I used that for the longest time to fix loading of the LLVM module on Mono. |
18:13:20 | Araq | Jehan_: yeah but it's rarely really about what one *can* do |
18:13:35 | * | Demos_ joined #nimrod |
18:13:36 | Araq | it's about how the OS works by default |
18:14:11 | Araq | and how much one has to learn to workaround all the design issues |
18:14:22 | Jehan_ | The problem is more that every OS does it differently. |
18:14:28 | EXetoC | dom96: it seems like "babel build" might not look in the babel path |
18:14:49 | dom96 | EXetoC: babel path? |
18:15:02 | EXetoC | dom96: the babel package path |
18:15:21 | dom96 | EXetoC: what are you trying to do? |
18:15:42 | EXetoC | opengl and glfw can't be find when I do "babel build", but it works when I invoke nimrod manually |
18:15:47 | EXetoC | dom96: build the example |
18:16:10 | dom96 | do you have them listed as a dependency in your .babel file? |
18:16:14 | Demos_ | Jehan_: you could probably do some kind of RPATH thing to on linux, but honestly I am not sure it is a good idea |
18:17:07 | Jehan_ | Well, Linux doesn't want its bin directories to be polluted with libraries. |
18:17:17 | renesac | dom96, Jehan_ : it was me who started writting a bigint libray in nimrod |
18:17:19 | Jehan_ | Which is a pretty reasonable stance in the UNIX world. |
18:17:41 | Jehan_ | renesac: From scratch? That would be impressive. |
18:17:44 | dom96 | renesac: oh. What's the status on it? |
18:17:49 | EXetoC | dom96: ok so it's required. that seems entirely reasonable actually |
18:17:51 | renesac | but it is on hold now, and I would like a gmp binding to easily test the correctness of it |
18:18:02 | dom96 | EXetoC: Yes, that is the point of 'babel build' |
18:18:08 | renesac | I stopped after implementing addition, subtraction and multiplication... |
18:18:08 | Jehan_ | My office mate is one of the MPIR authors, so I have a pretty good idea what goes into one. |
18:18:13 | Demos_ | ooooh when did we get babel build? |
18:18:16 | renesac | division was a bit hairy, and then I stopped |
18:18:28 | dom96 | Demos_: Since forever lol |
18:18:58 | EXetoC | dom96: well, it also simplifies batch-compliation, but I guess it's a secondary feature |
18:19:23 | Demos_ | question: in order for OpenSSL to work on linux you need to first load libcrypto with the RTLD_GLOBAL flag passed to dlopen. What is a good way to get this to happen? |
18:19:25 | EXetoC | dom96: but if opengl requires x11, do I have to specify both opengl and x11? might be a bug |
18:19:28 | * | brson joined #nimrod |
18:19:33 | EXetoC | I mean for the package that uses opengl |
18:19:46 | * | BitPuffin joined #nimrod |
18:19:50 | renesac | I just wanted to use the nimrod 'distinct' and operator overloading habilities to write a very clean bignum library |
18:19:51 | Demos_ | actually openGL requireing X11 could be a bug, it downloads the x11 wrapper even on windows |
18:19:52 | renesac | and it was working |
18:20:36 | EXetoC | I think the lack of platform parameters is the actual bug |
18:20:38 | renesac | but I was not planning to implement a dozen different multiplication algorithms for performance, for example, like GMP |
18:21:03 | Jehan_ | Araq: The reason for having the compiler be less verbose with -r is to enable stuff like #!/usr/local/bin/nimrun or something. |
18:21:18 | renesac | much less lots of assembly for each base function, again, like GMP |
18:21:23 | Demos_ | I thought there was a {.require.} pragma of some kind |
18:22:16 | EXetoC | that's slightly worse |
18:22:32 | Demos_ | hm? |
18:22:42 | Demos_ | oh I think I get it |
18:24:24 | renesac | http://www.bytereef.org/mpdecimal/ <-- this bignum library is very nice too |
18:24:41 | renesac | very clean c implementation in a few files |
18:24:50 | dom96 | EXetoC: if you depend on opengl and it depends on x11 then your package will depend on x11 |
18:25:16 | dom96 | Demos_: Doesn't openssl work on linux already? |
18:25:29 | renesac | not as high performance as GMP, except for printing large numbers, where the decimal base excels (you don't have to do lots of huge divisions) |
18:25:48 | renesac | https://bitbucket.org/python_mirrors/features-cdecimal/src/48e9fb0a7217 <-- here the code base |
18:26:12 | * | PortableEXetoC joined #nimrod |
18:26:17 | renesac | not sure where is the original repository |
18:26:35 | PortableEXetoC | At, the jim! |
18:26:46 | renesac | ops, wrong link |
18:26:53 | Demos_ | dom96: I am not on linux, I am on OpenBSD |
18:27:07 | renesac | https://bitbucket.org/python_mirrors/cpython/src/750f44e621aa/Modules/_decimal/libmpdec/ |
18:27:10 | renesac | <-- here |
18:27:33 | dom96 | Demos_: You said 'linux' in your question though. |
18:28:05 | * | tdc quit (Quit: ChatZilla 0.9.90.1 [Firefox 29.0/20140421221237]) |
18:28:14 | Demos_ | dom96: yeah, looks like a did, oops |
18:28:17 | PortableEXetoC | Same thing, kinda |
18:28:19 | Demos_ | well I am on BSD |
18:28:26 | renesac | it has 100% test coverage, and formal proofs for some of the algorithms |
18:28:50 | PortableEXetoC | Demos: you prefer it for desktops? |
18:29:29 | Demos_ | PortableEXetoC: it works OK (the manpages are AWESOME!) but it uses a ton of power and boots slowly |
18:29:36 | Demos_ | also it does not issue TRIM commands |
18:29:56 | Demos_ | but reguardless Nimrod and Babel should work on OBSD |
18:30:44 | PortableEXetoC | :s |
18:34:10 | Demos_ | is there a way to pass extra flags with the dnylib pragma? |
18:35:19 | PortableEXetoC | No trim ? how come |
18:35:49 | Demos_ | not supported by openBSD |
18:35:56 | Demos_ | *shrug* |
18:36:16 | Demos_ | I think you may be able to manually send it |
18:36:42 | PortableEXetoC | Cool voice typing |
18:36:43 | Demos_ | and modern SSDs have more advanced garbage collectors |
18:37:11 | * | Demos_ is waiting for his phone to get "Cortana" |
18:37:12 | PortableEXetoC | Its automatic? |
18:37:21 | Demos_ | what the gc? |
18:37:28 | Jehan_ | I think it's time to figure out who has the copyright on int main(char *argc, char **argv); |
18:39:20 | PortableEXetoC | Wut |
18:42:41 | PortableEXetoC | Stallman? |
18:42:49 | PortableEXetoC | Wild guess |
18:43:49 | Jehan_ | That was a sarcastic reference to the 9th Circuit ruling in Oracle v. Google. |
18:47:00 | * | tdc joined #nimrod |
18:49:38 | PortableEXetoC | Reading about it now. Wth |
18:49:55 | Jehan_ | I don't think there's a way to have two iterators side-by-side in the same loop, the way that Sather allowed? |
18:50:19 | fowl | enurlyx, sure you could use it for a gui |
18:52:15 | fowl | enurlyx, its already available as fowltek/entitty |
18:52:34 | PortableEXetoC | Jehan in nimrod? Just write a generix interface for it |
18:52:46 | PortableEXetoC | Generic |
18:52:48 | fowl | Jehan_, there is a parallel for `||` but im not sure how to use it |
18:53:27 | Araq | fowl: that's something entirely different |
18:53:34 | Jehan_ | PortableEXetoC: That's not just a thing about interfaces, it'd be about language semantics. |
18:54:03 | fowl | o |
18:54:10 | Araq | Jehan_: you can do that with first class iterators |
18:54:26 | Jehan_ | You can? Neat. :) |
18:54:57 | Araq | well it's ugly but should work |
18:55:04 | Jehan_ | Heh. :) |
18:55:30 | Araq | you need an explicit while loop that calls 'next' and 'finished' except that there is no 'next' |
18:57:31 | Jehan_ | Well, it's not a pressing issue. I was mostly wondering if it could be done at all. |
18:58:32 | Araq | no, it's possible, you have to do let f = iter; and then f() is the 'next' |
18:58:56 | Jehan_ | I see. |
18:59:06 | Araq | people argued it's a strange way of doing it .. |
18:59:20 | Jehan_ | Maybe I'll have a look to see if it can be wrapped in a macro with a pretty bow and all. |
18:59:21 | * | Jesin quit (Quit: Leaving) |
18:59:26 | Jehan_ | What is a strange way? |
18:59:30 | * | noam_ is now known as noam |
18:59:42 | Araq | the let f = iter; f() way |
18:59:52 | PortableEXetoC | Gah i want "generic container" to work :p |
19:00:06 | Varriount | It's probably because we're used to how python does it. |
19:00:21 | Jehan_ | Define "generic container"? |
19:00:44 | PortableEXetoC | As in the generic keyword. New type classes |
19:00:49 | Jehan_ | Ah. |
19:01:12 | Varriount | Speaking of type classes, I wonder what zahary has been doing... |
19:01:47 | Demos_ | PortableEXetoC: ProTip: Define a object filled with function pointers and a converter from your generic to said object |
19:01:48 | PortableEXetoC | Come to think of it, i might just be able to abuse the lenient 'let' semantics for now |
19:02:00 | Demos_ | it works pretty well |
19:02:01 | Jehan_ | Araq: What happens when the iterator ends and you call it that way? |
19:02:14 | Araq | it returns default(T) |
19:03:19 | Jehan_ | Gotcha. |
19:03:59 | PortableEXetoC | Demos: yeah if it can be done somewhat transparently |
19:04:09 | * | Jesin joined #nimrod |
19:04:17 | Varriount | Hi Jesin |
19:04:21 | Jehan_ | Speaking of Sather, there's nothing like "once" arguments to iterators, right? |
19:04:22 | Demos_ | Hello Jesin! |
19:04:34 | Jehan_ | (Not a complaint, just trying to make sure I'm not missing anything.) |
19:04:36 | Jesin | hi |
19:04:44 | Varriount | Jehan_: "Once" arguments? |
19:05:33 | Jehan_ | Umm. I'd have to explain Sather for that to make sense, I think. |
19:05:33 | Araq | I'm not familiar with Sather, but usually you make the closure iterator an inner iterator and capture what you don't want to pass all the time |
19:05:59 | Jehan_ | Basically, an argument that is evaluated only once during a loop as opposed to each time. |
19:06:12 | fowl | at the beginning |
19:06:14 | Jehan_ | And conversely, iterator arguments that are evaluated each time through the loop. |
19:06:39 | Varriount | Jehan_: Nimrod already sorta evaluates iterator arguments each loop. |
19:06:41 | Jehan_ | In Sather, iterators are not limited to a for construct. They're general ways to control loop execution. |
19:06:43 | * | wan quit (Ping timeout: 252 seconds) |
19:06:56 | Jehan_ | Even while!() and until!() are technically iterators in Sather. |
19:07:17 | Jehan_ | E.g.: loop while!(condition) … end; |
19:07:37 | Jehan_ | The condition is evaluated each time it is encountered. |
19:08:04 | Jehan_ | As opposed to a for loop style iterator, e.g.: loop i := 1.upto!(100) … end; |
19:08:38 | enurlyx | fowl thanks, i will have a look |
19:08:40 | Jehan_ | And so you can have multiple while/until conditions in the same loop, or multiple for constructs. |
19:09:04 | Jehan_ | Pretty neat for the fringe problem, for example. |
19:09:57 | Jehan_ | http://c2.com/cgi/wiki?SameFringeProblem |
19:12:47 | Demos_ | it looks like closure iterators would do the trick there, but I have only read about them in the manual, not actually used them in a substantial way |
19:13:27 | * | kunev joined #nimrod |
19:13:36 | Varriount | Hi kunev |
19:14:19 | Jehan_ | Demos: Ditto. |
19:15:28 | Araq | Jehan_: how are they implemented in Sather? do they capture the full stack? |
19:15:34 | * | PortableEXetoC quit (Quit: cake) |
19:15:47 | * | Demos_ quit (Quit: WeeChat 0.4.2) |
19:16:13 | Jehan_ | Not 100% sure. I know the compiler was able to inline them, but did not have to. |
19:16:23 | Jehan_ | And yeah, I know that implementing them is tricky. |
19:16:28 | Jehan_ | Especially with a C backend. |
19:16:51 | Varriount | If I recall correctly, the Lua VM captures the full stack per coroutine when using them. |
19:17:26 | EXetoC | dom96: does babel work this way because of ease of implementation, or do you think it's best to include indirect dependencies too? |
19:17:27 | Jehan_ | There are ways to capture the stack. I mean, I've written code doing it. It's just not portable or clean. |
19:17:53 | Jehan_ | Look up the GNU/OSSP Pth library for just one example of how it can be done. |
19:18:14 | Jehan_ | There are other implementations, but Pth has a pretty nice paper explaining it. |
19:18:47 | EXetoC | which might add some noise. at least if you end up with a tree that is as complex as the one in the average unix system, though it's fairly unlikely :> |
19:19:05 | Varriount | setjmp/longjmp can be used for coroutines as well, as long as you know how much memory to allocate to the new stacks. |
19:20:09 | Varriount | Most implementations using setjmp/longjmp just make an overestimated guess on how much memory is needed. |
19:20:43 | Jehan_ | Varriount: As I said, look at Pth. They actually have a number of different implementations, depending on what the underlying architecture offers. |
19:21:17 | Varriount | I wonder if the Nimrod compiler could determine the memory usage of each stack frame, or at least give a much closer estimate than other libraries of the sort. |
19:21:39 | Araq | Varriount: not really |
19:21:44 | Jehan_ | http://www.gnu.org/s/pth/rse-pmt.ps |
19:22:04 | Varriount | Jehan_: But no Windows implementation :< |
19:22:08 | Araq | and it's not tractable in general (recursion? foreign functions? indirect calls?) |
19:22:13 | Jehan_ | Varriount: Nothing outside what the various gcc __builtin() functions offer. |
19:23:04 | Araq | *shrug* stack capturing is not the problem (I'd use LuaJIT's library for it btw) |
19:23:28 | Jehan_ | I hope that clang will someday implement the necessary features for C to be a fully usable compiler backend. |
19:23:47 | Araq | the problem is that the GC needs to know about these additional stacks |
19:24:12 | Varriount | On a side topic, are there any translate-to-assembly languages that don't use the 'stack'/'heap' memory model? |
19:24:52 | Varriount | By translate to assembly, I mean in the same way C is sorta translated to assembly. |
19:24:52 | Araq | Varriount: some variants of ML allocate the stack frames on the heap |
19:25:03 | Araq | and produce native code |
19:25:06 | EXetoC | Jehan_: why C? familiarity? |
19:25:10 | Jehan_ | Define "don't use the stack/heap" memory model? |
19:25:33 | Jehan_ | EXetoC: There are distinct benefits to compiling to C. Unfortunately, there are disadvantages, too. |
19:26:07 | Varriount | Jehan_: The way that arguments are pushed to a stack of memory, general data layout, etc. |
19:26:25 | Jehan_ | Let me put it this way: If Nimrod didn't have a C backend, I'd not have used it for serious work. |
19:26:42 | Jehan_ | Varriount: Well, that's generally defined by the ABI? |
19:27:05 | Jehan_ | Which tells you about procedure calling conventions so that different languages can actually interoperate. |
19:27:29 | Araq | Varriount: there is nothing you can't find really. Some variants of Scheme use the C stack as the young generation for the GC ... |
19:27:48 | Jehan_ | Varriount: Why are you asking? |
19:27:59 | Varriount | Jehan_: Curiousity. |
19:28:17 | Jehan_ | In general, there has to be a reason to break with standards. |
19:28:33 | Varriount | I figure that there must be more than one way to do low-level function calls (aside from calling conventions) |
19:28:41 | Jehan_ | E.g., support for continuations or lightweight threads are an example. |
19:29:05 | * | kunev quit (Ping timeout: 276 seconds) |
19:29:06 | Jehan_ | But other than that, there are really not that many ways to call a function in assembly code. |
19:29:18 | Varriount | Araq: You can use fibers as coroutines on Windows. |
19:29:22 | Jehan_ | And only so many ways to pass arguments to it (or recover results). |
19:30:05 | Araq | Varriount: as if I don't know ... |
19:30:21 | Jehan_ | You can mix up the order or the format, but that doesn't really give you benefits that are worth doing it different. |
19:31:07 | Varriount | Jehan_: What about supply additional data with arguments? One possibility that comes to mind is supply additional data that corresponds to types |
19:31:34 | Jehan_ | Types are rather language-specific. |
19:32:23 | Jehan_ | That said, the one implementation that I know of that does function dispatch somewhat differently is Objective-C. |
19:32:39 | Jehan_ | And it predictably creates occasional problems for debuggers and other tools. :) |
19:33:15 | EXetoC | Varriount: something other than calling conventions? I don't know why that'd be |
19:33:23 | Varriount | Something that, in C, would some something along the lines of "void foo(void* arg1, int type1)" where type1 can tell you the runtime type of a pointer |
19:33:37 | EXetoC | a binary format needs to be agreed on in order for things to work at all |
19:33:48 | EXetoC | *what |
19:35:07 | EXetoC | you hide the fact that calling conventions are necessary only in higher level languages |
19:36:46 | Jehan_ | Heh. That reminds me how we abused PUSH and POP back in the Z80 days. :) |
19:37:21 | Jehan_ | And the x86 still abuses POP to generate position-independent code. :) |
19:37:21 | EXetoC | you must be old |
19:37:27 | EXetoC | j/k |
19:37:39 | Jehan_ | My first computer was a ZX 81. So, yeah. :) |
19:39:41 | Jehan_ | One of the fastest ways to clear a ZX Spectrum's screen was to disable interrupts, zero the HL register, set the SP to the end of the screen area, and then do PUSH HL a lot (and afterwards, restore SP and interrupts). |
19:40:22 | Jehan_ | Stuff like this would probably get you fired today, but it was a necessity back then. |
19:41:16 | dom96 | EXetoC: If indirect dependencies are not working then it's a bug. |
19:41:46 | * | Varriount|Mobile joined #nimrod |
19:42:11 | EXetoC | will report it then. I had to specify both opengl and x11 |
19:43:16 | dom96 | you sure opengl specifies x11 in its dependencies? |
19:43:53 | dom96 | hrm, it does. |
19:43:55 | dom96 | Interesting. |
19:49:29 | Araq | Jehan_: so what's wrong with the C++ target? and can you fix it? |
19:55:16 | EXetoC | https://github.com/Araq/Nimrod/issues/925 this (my report). what else? |
19:55:26 | * | kunev joined #nimrod |
19:58:31 | Araq | so 'abs' requires a header |
19:58:37 | Araq | that should be easy to fix |
20:00:29 | EXetoC | I don't know how many symbols that applies to |
20:01:21 | Araq | there are not many left in the codegen that don't trigger some header decl |
20:05:40 | * | Jehan_ quit (Quit: Leaving) |
20:06:01 | Varriount|Mobile | is this abs() for floats or ints? |
20:07:51 | Araq | ints |
20:09:25 | * | Jehan_ joined #nimrod |
20:09:50 | Jehan_ | Umm, nothing is wrong with the C++ target? |
20:10:07 | Jehan_ | Unless you mean the odd bug. |
20:11:03 | Araq | which one? the abs bug? |
20:14:01 | Jehan_ | I know that whenever I use --threads:on, there are problems with stuff not compiling. Or used to be. |
20:14:22 | Araq | hmm ok |
20:15:05 | Jehan_ | I honestly don't know, since I don't have much reason to use anything other than the C target 99% of the time. |
20:46:34 | fowl | will -rpath make dlsym look in ./ for libraries |
20:46:45 | EXetoC | C++ interop and reduced exception overhead are the main reasons for it I guess |
20:46:56 | EXetoC | the latter will be less relevant once we get that asm target |
20:47:43 | Araq | EXetoC: that's years away |
20:47:50 | Jehan_ | Yes, doing exceptions in C can be a pretty painful process. |
20:47:53 | EXetoC | xd |
20:48:29 | EXetoC | yes if you're doing it manually. we already have an exception mechanism for it |
20:48:57 | EXetoC | Jehan_: you never get C++ code errors with the C++ generator? just "import pegs" failed for me before |
20:49:07 | Jehan_ | The generated code still has to deal with C's assumptions. |
20:49:24 | Jehan_ | EXetoC: Umm, I said I did? |
20:51:29 | Araq | EXetoC: please replace in cccgexpr.nim this line |
20:51:31 | Araq | mAbsI: "(NI$2)abs($1)", |
20:51:33 | Araq | with |
20:51:34 | EXetoC | you said "odd bug", but this is a blocker which is why I'm asking |
20:52:00 | Araq | mAbsI: "($1 > 0? ($1) : -($1))", |
20:52:00 | EXetoC | "Error: unknown C compiler: 'gpp'" hm |
20:54:30 | EXetoC | ok |
20:56:27 | fowl | EXetoC, i get that too |
20:56:33 | Jehan_ | EXetoC: The way Araq phrased it made it sound as though he wondered whether I had any principal objections to the C++ backend. |
20:56:56 | Araq | nah I asked for bug reports |
20:57:03 | Jehan_ | So I was trying to explain that my issues are solely with stumbling over bugs now and then. |
21:01:19 | * | nande joined #nimrod |
21:06:21 | dom96 | It would be interesting to compare the performance of the same Nimrod code between the C and C++ backends. |
21:06:34 | * | Skrylar quit (Ping timeout: 240 seconds) |
21:09:33 | * | kunev quit (Ping timeout: 252 seconds) |
21:20:17 | EXetoC | Araq: so commandCompileToC is for multiple languages? |
21:20:57 | Araq | sure |
21:29:20 | EXetoC | getting NU8* -> NI8* conversion errors now. I guess I need to include a cast somewhere since C++ is more strict |
21:36:48 | * | flaviu joined #nimrod |
21:37:03 | dom96 | interesting. Just made a `here <http://blah.com>`_ link twice in my rst and I got a "Warning: redefinition of label 'here'" |
21:38:09 | * | Demos quit (Read error: Connection reset by peer) |
21:38:44 | Jehan_ | You can have fun with signed vs. unsigned in C, too. |
21:39:03 | Jehan_ | int main() { return puts(-1 < 1U ? "ok" : "wtf"); } |
21:40:17 | fowl | the ending ); is like a frowny face of disappointment too |
21:40:35 | * | tdc quit (Ping timeout: 255 seconds) |
21:40:58 | * | flaviu quit (Ping timeout: 240 seconds) |
21:48:32 | * | Mat3 joined #nimrod |
21:48:36 | Mat3 | hello |
21:49:21 | Jehan_ | Hiya, Mat3! |
21:49:54 | Mat3 | hello Jehan_ |
21:50:51 | EXetoC | Araq: what now? where should I look? ^ |
21:55:20 | Araq | EXetoC: well what produces this error? |
21:56:19 | EXetoC | Araq: "if (!(192 <= cardSet(cc, 32))) goto LA3" |
22:00:23 | Araq | EXetoC: lib/system/sets.nim |
22:00:45 | Araq | make TNimSet use uint8 |
22:00:57 | EXetoC | k |
22:01:11 | Araq | and get rid of the 'ze' in line 28 |
22:07:08 | * | boydgreenfield joined #nimrod |
22:10:14 | EXetoC | test case compiles. will try some other things now |
22:13:19 | * | enurlyx quit (Quit: Nettalk6 - www.ntalk.de) |
22:19:04 | Mat3 | ciao |
22:19:10 | * | Mat3 quit (Quit: Verlassend) |
22:22:55 | * | Varriount-Mobile joined #nimrod |
22:23:04 | * | Varriount_ joined #nimrod |
22:23:23 | * | flaviu joined #nimrod |
22:24:39 | * | Varriount quit (Ping timeout: 245 seconds) |
22:24:43 | * | Varriount|Mobile quit (Ping timeout: 252 seconds) |
22:25:24 | * | Varriount joined #nimrod |
22:26:47 | EXetoC | such as the compiler. getting something about conversion from volatile |
22:26:58 | EXetoC | and sprintf |
22:27:53 | * | Varriount_ quit (Ping timeout: 264 seconds) |
22:27:53 | * | Varriount-Mobile quit (Ping timeout: 264 seconds) |
22:29:48 | * | Jehan_ quit (Quit: Leaving) |
22:30:24 | EXetoC | "invalid conversion from ‘NimStringDesc* volatile*’ to ‘NimStringDesc**’" |
22:32:24 | Araq | EXetoC: again, where does it come from? |
22:33:14 | EXetoC | sorry doing too much at once. will paste the whole output soon. LOC13 = readline_10487(f_167743, &res_167745) |
22:38:36 | * | boydgreenfield quit (Read error: Connection reset by peer) |
22:38:55 | * | boydgreenfield joined #nimrod |
22:42:44 | * | skroll joined #nimrod |
22:45:08 | boydgreenfield | Can’t tell if I’m just missing it: Is there a built-in string.reverse() function? |
22:46:38 | EXetoC | grep says lib/pure/algorithm.nim:24, lib/pure/algorithm.nim:33 |
22:46:51 | EXetoC | openarray parameter. can't remember if it works for strings |
22:46:57 | * | flaviu quit (Quit: Leaving.) |
22:47:08 | * | flaviu joined #nimrod |
22:47:53 | Araq | hi skroll welcome |
22:47:58 | skroll | Hello |
22:49:02 | skroll | Have to say, being a C programmer by trade, I was REALLY skeptical about nimrod. After toying with it for a few days, I'm in love. |
22:49:14 | boydgreenfield | EXetoC: No sadly. I was wondering if it’s just called something else? |
22:50:24 | EXetoC | skroll: great. what were your initial doubts? |
22:50:32 | skroll | performance, to be honest |
22:51:22 | EXetoC | I just thought "ok, these guys seem to know their shit" |
22:51:24 | skroll | However, as a quick toy, I implemented a bucket PM Quadtree in about 100 lines of code that could do a polygon intersection test between two 200,000+ vertice polygons in less than 1 second. |
22:52:12 | skroll | I was sold. |
22:52:54 | renesac | nimrod performance is usually within 10% of good C code |
22:53:55 | renesac | we avoid runtime overhead, and things like templates and generic programming can make easy do things you would need to resort to macros in C |
22:53:59 | renesac | for performance |
22:54:36 | skroll | Exactly. I'm a diehard lover of uthash in C, but to be able to avoid that... |
22:56:11 | skroll | plus it's statically typed, and that's something i feel more comfortable with. |
22:56:30 | renesac | if something is much slower in nirmod, it is probably some suboptimal algorithm choice, or something not being optimized yet (you may find some of naﶥ algorithms in the stdlib) |
22:57:36 | skroll | only thing that threw me for a loop was inline definitions of tuples being passed into a template. the compiler makes a lot of duplicates of the tuple uless you assign it to a temporary variable in the scope of the template itself. |
22:58:44 | renesac | I don't think I saw this yet |
22:59:11 | skroll | try creating a template that takes a template, example: tuple [x: float, y: float, z: float] |
22:59:20 | skroll | oops |
22:59:24 | skroll | i mena a template that takes a tuple |
22:59:40 | renesac | we still lack an real optimization pass |
22:59:49 | skroll | then if you call the template such as foo((x: val1, y: val2, z: val3)) |
22:59:55 | renesac | we rely on the C compiler doing constant folding, etc |
22:59:58 | skroll | you will have 3 structures of the tuple created |
23:00:05 | skroll | if you use x,y,z |
23:00:40 | skroll | for example: template foo(t: tuple[x: float, y:float, z:float): float = t.x, t.y, t.z |
23:00:49 | skroll | the compiler will generate 3 structs |
23:00:57 | skroll | oops |
23:01:02 | skroll | = t.x + t.y + t.z |
23:01:06 | skroll | is what I meant |
23:01:07 | flaviu | skroll: Its documented in http://nimrod-lang.org/tut2.html#templates, but it doesn't stand out |
23:01:08 | EXetoC | renesac: some folding anyway |
23:01:28 | skroll | Ah, I missed that |
23:01:36 | flaviu | Last sentence of that section |
23:01:52 | flaviu | It should be mentioned in the manual too |
23:02:05 | skroll | anyways, yeah, it created 3 structs, and did struct1.x + struct2.y + struct3.z |
23:02:11 | renesac | flaviu, is it by design? |
23:02:23 | Araq | skroll: that's just how templates work by definition |
23:02:25 | skroll | i guess it makes sense to me, since its really just expanding the line |
23:02:28 | flaviu | renesac: Yes, template params are expressions, not objects |
23:02:42 | skroll | it clicked for me after an hour or so |
23:02:46 | renesac | right |
23:02:47 | Araq | renesac: we have optimizations passes and constant folding |
23:03:17 | renesac | Araq, oh, I remember you saying you wanted to have a dedicated optimization pass |
23:03:22 | renesac | or something like that |
23:03:34 | Araq | yes but that doesn't mean we do nothing right now |
23:05:07 | * | boydgreenfield quit (Quit: boydgreenfield) |
23:05:31 | skroll | once I realized that the templates were legitamately templates, that code geneartion made sense to me |
23:05:49 | skroll | either way, ive drank the kool-aid |
23:06:36 | skroll | i'm really curious to see if code I generate will run on this stupid solaris machine we have to use for a few things at work. |
23:07:13 | EXetoC | what do these OSes offer? |
23:08:07 | skroll | I inherited a code-base from the mid-90's that depends on a big-endian CPU because the original programmers made that assumption when serializing various types |
23:08:36 | skroll | I don't want to use it, but all the code depends on SPARC64 |
23:09:04 | EXetoC | 90s. ok makes sense :> |
23:09:24 | skroll | I've spent the past 5 years porting as much as possible. |
23:10:28 | skroll | Also the entire thing expects divide by 0 to result in 0. |
23:11:40 | skroll | However, there's a lot of tools that using nimrod would make my life much easier in (such as parsing strings from a file) that I could append to the current system. If it works I may be saving myself a lot of time. |
23:28:32 | * | darkf joined #nimrod |
23:33:41 | * | boydgreenfield joined #nimrod |
23:34:40 | Araq | skroll: porting to sparc64 might be some work with its crazy sliding register sets |
23:35:00 | Araq | we scan the stack conservatively and push the registers on the stack with setjmp |
23:35:50 | Araq | there is a version for sparc but it has never been tested |
23:36:25 | njoejoe | I have been trying to implement the CDB writer/reader in nimrod and foiled left and right with uint32. so finally i implemented it in ruby. https://gist.github.com/jots/65215a6fce042b7d7857 it is slow as snot. anyone want to take a stab at translating it into nimrod? |
23:36:57 | njoejoe | cdb as in: http://cr.yp.to/cdb.html |
23:39:54 | Araq | njoejoe: my VM in the compiler uses uint32 too, you know |
23:40:06 | Araq | it's not like there are bugs everywhere ... |
23:40:39 | Araq | sometimes you have to use type conversions ... oooohh big deal if you don't give a fuck about correctness |
23:40:49 | Araq | but a blessing if you do |
23:41:32 | njoejoe | Araq: no, i'm not saying there are bugz, just my problem using them. seems like if I make one thing uint32 I end up having to type convert everything. i'm sure i'm doing it wrong. |
23:42:02 | Araq | I don't know about that |
23:42:15 | Araq | as I said, it's a feature if you are concerned about correctness |
23:42:39 | Araq | which I am all the time but I get the average "let's use opengl" code doesn't like it |
23:45:37 | EXetoC | everything? really? |
23:45:54 | EXetoC | anyway, I do like verbosity that is justified |
23:47:17 | Araq | and ofc the language is right to punish you for using unsigned arithmetic :P |
23:48:37 | Araq | x+4 >= 4 # for unsigned wraparound we don't know ... |
23:48:59 | njoejoe | EXetoC: not *everything*... i exagerrate |
23:49:20 | Araq | in this very moment I'm implementing a pass that proves array bounds correct |
23:49:55 | Araq | guess what? I give up for unsigned. It will only work for signed numbers |
23:52:25 | Araq | there are almost no useful algebraic properties of unsigned wraparound arithmetic |
23:55:48 | flaviu | http://i12www.ilkd.uni-karlsruhe.de/~schlager/publications/ifm04.pdf |
23:56:08 | njoejoe | the only reason i care about it is for 32 bit disk pointers and 32 bit hash value |
23:57:03 | reactormonk | njoejoe, on hash values you'll likely do bitops and not arithmetic. Not so sure about the disk pointers, do you do arithmetics with those? |
23:58:35 | EXetoC | Araq: what happens with len for really big containers? |
23:58:57 | njoejoe | yes, the hash is created with bitops and disk pointers calc'd like p += 8+klen+vlen |
23:59:06 | Araq | EXetoC: it simply works? |
23:59:11 | flaviu | reactormonk: Hashes typically also use arithmetic as part of avalanching |
23:59:41 | reactormonk | flaviu, but that's not really relevant, is it? |
23:59:55 | reactormonk | because you don't care about overflows etc. |