<< 09-05-2014 >>

00:00:17*brson quit (Ping timeout: 264 seconds)
00:00:39*brson joined #nimrod
00:08:29fowlboom. 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:09VarriountAraq: 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:51reactormonkVarriount, only the first character is case-sensitive, and nope, it's not default
01:20:51*springbok joined #nimrod
01:21:59VarriountHi springbok
01:25:17*flaviu joined #nimrod
01:26:48springbokevening.
01:27:08reactormonkspringbok, 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:23VarriountHm. 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:06AraqVarriount: 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:07Araqit 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:29milosnAraq: morning
07:47:37*boydgreenfield quit (Quit: boydgreenfield)
07:47:52Araqmilosn: servus
07:48:18milosnive discovered another obstacle in my ORM project ... in short ... take int vars for example, ints can not contain nil value
07:48:22milosn:)
07:48:46milosnwhich makes it veru hard to map DB rows directly to nimrod objects :P
07:49:35*milosn at work
07:49:41milosncame into office early
07:51:54*kunev quit (Ping timeout: 240 seconds)
07:52:21superfuncperhaps you could just wrap the ints in a Maybe type
07:54:19Araqah yeah
07:54:25Araqthat's in fact rather obvious :P
07:54:57superfuncbeen doing too much haskell lately haha
07:54:57*Araq is a fan of misusing low(int) for None/Null
07:55:16Araqsuperfunc: hey, we also have a Maybe ... somewhere ;-)
07:57:02superfuncI'm excited to start using nimrod fulltime this summer when my semester ends
07:59:50milosnAraq: 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:17milosnand could also be the initial value when you create new record representing the future row in DB
08:00:29milosnbut its all null now, since int cant store nil :P
08:00:41milosnso i need 2 low(int)-s :P
08:01:01milosn:D
08:01:47milosnhmm high(int) and low(int) ... :P
08:02:25milosnbut thats fscken ugly man :)
08:11:52milosnhmm actually that could be the way out
08:12:13milosnis there an equivalent for float? low(float) dont do much
08:16:00Araqthere is +-INF for floats
08:16:41AraqI hate low(int), it's some really shitty value cause it doesn't work with 'abs'
08:17:25AraqIMO integers as the CPU implements them are wrong
08:17:58milosnhmm 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:15Araqsuperfunc: interesting. what will you use Nimrod for?
08:21:47superfunctwo 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:00superfuncAraq: 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:43Varriount|MobileAraq: ping
08:50:12*DAddYE joined #nimrod
08:53:24AraqVarriount|Mobile: pong
08:54:18*DAddYE quit (Ping timeout: 240 seconds)
08:55:48Varriount|MobileAraq: 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:46Varriount|MobileSince 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:02Varriount|MobileThats what Micklat said
08:58:09Araqwell what is the idea?
08:58:22Araq"The idea is this: "
08:58:35Varriount|MobileEr sorry, client cut the message off
08:58:44Varriount|MobileLet me just gist it instead
09:00:33Varriount|MobileAraq: Here's the message -> https://gist.github.com/Varriount/bb65ae029daba5c12a66
09:05:49Araqhmm a cross language GC
09:05:57Araqwill have to think about it
09:07:14*Me___ joined #nimrod
09:07:24Araqhi Me___ welcome
09:08:13Varriount|MobileAraq: For what its worth, I don't feel seamless integration would be worth it. Regular integration is fine
09:09:39Varriount|MobileOr 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:09Araqyeah but I just got an idea
09:15:31*kunev quit (Quit: leaving)
09:16:16Varriount|MobileCould you put it to the side until you've finished implementing your current idea?
09:17:08Araqno, it's related with what I'm currently doing
09:17:25Araq:-)
09:19:33*kunev joined #nimrod
09:21:48Skrylarcross language gc isn't inherently hard (iv've talked about it should be an OS service)
09:21:52Varriount|MobileHuh. Apparently Windows assigns both thread ID's and process ID's out of the same pool, so they never overlap.
09:22:14Skrylarthe problem is making an API that isn't lacking, and then getting people to use it
09:22:48AraqSkrylar: no the problem is making it perform well
09:23:40Skrylari would cover that under api :\ 'cause languages would have to register their object type definitions with it too
09:24:26AraqVarriount|Mobile: all modern OSes use 1-1 thread models where a thread is scheduled like a process
09:25:59Varriount|MobileAraq: 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:14Araqfyi: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.141.4610&rep=rep1&type=pdf
11:14:44Skrylarwhitepapers
11:14:53Skrylarmore of these bastards
11:16:16*Johz joined #nimrod
11:19:41JohzHello, 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:21JohzI 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:35JohzHowever that function isn't public.
11:21:14JohzIs 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:23Araqhi Johz make it public and do a PR
11:47:06Araqbut that shouldn't be necessary, there are very low level APIs available
11:47:29Araqdesigned to not construct the whole XML tree
11:50:06JohzFrom 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:54JohzHowever, 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:50Araqthere is also parsexml that doesn't construct a tree and is what xmlparser uses (the names suck, I know)
12:04:29JohzYeah, 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:48Araqwell make a PR and describe why you need it
12:09:00Araqadding 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:06t4nk737Hello. 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:36t4nk737As far as I can tell, there's no way in the Nimrod standard lib to do this without calling a C library.
15:13:42dom96t4nk737: What about this? http://build.nimrod-lang.org/docs/parseutils.html#parseHex,string,int,int
15:19:59t4nk737dom96: 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:27t4nk737did I miss something on that page?
15:23:01dom96I 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:15t4nk737bigints 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:39t4nk737anyway, it's easy to write these things, but it would be nice to have them built-in.
15:26:24dom96I recall hearing somebody was working on an implementation but I can't remember exactly who that was or when I heard this.
15:26:26t4nk737writing "".encode('hex') in Python instead of yet another byteToHex function is very nice.
15:27:32dom96In 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:06dom96Alternatively you can create a repo on github with the code and create a babel package out it.
15:28:09dom96*out of it
15:28:10t4nk737Do you think Araq wants a native Nimrod bigint implementation or do you think binding to GMP would be preferred.
15:28:18t4nk737dom96: thanks, I'll do that.
15:28:35t4nk737I just wanted to run it by you all first to see if it would be useful.
15:28:42dom96t4nk737: I think he would love both heh.
15:29:44dom96It'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:03t4nk737I'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:21dom96But I don't know much about big ints are implemented so that's just really my general opinion.
15:30:25t4nk737I'm sure I have it bookmarked.
15:30:39dom96*about how
15:32:16t4nk737I'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:45t4nk737Anyway, I really, really like Nimrod.
15:33:02t4nk737I'm very glad I found out about it
15:34:09t4nk737I'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:26t4nk737I should be able to do it all in one language, and Nimrod provides it.
15:34:51dom96That's good to hear :)
15:35:10dom96Out of curiosity why are you not happy with Go?
15:35:34EXetoCobviously we'll steal some code so as to make our implementation almost as fast
15:35:46t4nk737Well, it's banal to say it, but I really miss generics. Some of the workarounds are quite awkward.
15:36:05t4nk737Also, things like no tuples
15:36:13t4nk737why not tuples? argh!
15:36:45t4nk737I do really like the Go standard library, however. They've done an excellent job.
15:36:56EXetoCsome people call others narrow-minded for dismissing the language on such grounds
15:37:53t4nk737EXetoC: 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:23EXetoCno, I mean those who call others narrow-minded for complaining about lack of generics
15:38:35t4nk737Oh, my bad.
15:38:47t4nk737I misunderstood. My apologies.
15:39:15EXetoCyou end up writing generic interfaces in C, but with complete lack of type safety
15:39:38t4nk737Yes, and you can do the same in golang but you lose type safety.
15:40:50EXetoCthen 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:09t4nk737But Nimrod has really achieved a nice balance between high-level convenience and low-level performance.
15:41:31dom96I've been using Nimrod since before Go was released so I've never actually gave it a try.
15:41:40EXetoCyou can definitely have both, and I don't think everyone realizes that
15:42:05t4nk737Exactly, we've always been told that it's a choice.
15:42:09dom96But 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:46t4nk737You write Ruby, Lua, Python for convnenience and developer speed, and then you go to C for performance.
15:43:23t4nk737I've been happily surprised by the new wave of languages like D, Go, Nimrod, and Rust.
15:44:22t4nk737All 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:51t4nk737three -> four
15:46:48t4nk737That'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:35t4nk737anyway, I'm procrastinating now. Got to go. I'll write some tests and submit a PR later today, dom96 Thanks again.
15:48:58dom96t4nk737: No problem. See ya!
15:49:15t4nk737later!
15:49:18*t4nk737 quit ()
15:52:48EXetoCalright, let's see if I can make it so that echo actually prints embedded null's. it's a really annoying issue
15:53:28dom96oh 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:49fowlEXetoC, each $ has to handle nil
16:27:16*DAddYE joined #nimrod
16:40:13EXetoCfowl: so basically this? "proc `$`(x: T): string not nil"
16:40:29EXetoCnot that "not nil" works very well now, but it'd be by convention for now
16:44:24EXetoCAraq: so how will "not nil" work? if it can't be proven, will the user have to perform a check first?
16:45:00EXetoC"assert false", "if x == nil", ...
16:48:42EXetoCbut will the difference between "not nil" and a corresponding contract be more than just syntactial?
16:50:29fowlEXetoC, no, $ should return "" or "nil" or something like that
16:51:09EXetoCthat's what I implied
16:51:49fowli think changing it to 'not nil' will make it incompatible with other $s, not sure
16:54:35EXetoC"(nil)" or "(nil T)" seems good, and the input can be asserted to be not nil in cases where that is unacceptable
16:54:57EXetoCyeah well you'd have to make a transition at some point
16:56:45fowlAraq, 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:35fowlAraq, be nice to be able to do when is_void(expression): expression else: return expression
16:57:48fowlor type(..) is void
16:58:02EXetoCyou might be able to hack something together
17:01:27fowlEXetoC, thanks
17:01:36fowlheres my solution
17:01:41fowlproc takes_anything [T: not void] (some: T): void = discard
17:01:42fowltemplate voidExpr (x): expr =
17:01:42fowl when compiles(takes_anything(x)):
17:01:42fowl false
17:01:42fowl else:
17:01:42fowl true
17:02:03*guest12345678 joined #nimrod
17:02:34*guest12345678 quit (Client Quit)
17:06:00EXetoCok. you can return bool though, and just do "not compiles"
17:06:08EXetoCthat's the first time I've seen 'not' used like that
17:06:53*springbok quit (Ping timeout: 264 seconds)
17:07:07fowlEXetoC, it doesnt seem to work for void
17:07:08VarriountHm. Could you use a typeclass rather than compiles()? I heard that using compiles() is bad for your health.
17:07:37fowli tried it but echo() doesnt have a type to compare against
17:08:46EXetoCenter hack #2 I guess
17:10:23EXetoCwhen not compiles(takes_anything(a)): not compiles(takes_anything(b))
17:10:36*Jehan_ joined #nimrod
17:11:49EXetoCfowl: is that what you mean?
17:11:52fowlEXetoC, ? just `not compiles(takes_anything(x))` works
17:12:03dom96EXetoC: I thought you were talking about \0 inside strings.
17:13:03*Matthias247 joined #nimrod
17:13:28EXetoCfowl: I thought you also wanted to compare the type of two expressions, where one or both might be void
17:13:36Jehan_The sign of the devil is actually \0\0\0, not 666. The latter was a transcription error. :)
17:14:41EXetoCdom96: I did, but fowl wanted something to be done about nil inputs too
17:14:55Jehan_Someone was asking about GMP earlier?
17:15:00fowlEXetoC, nah
17:15:46EXetoCthen I don't know what you were referring to in your last statement
17:17:20*BitPuffin quit (Ping timeout: 255 seconds)
17:23:33dom96Jehan_: 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:02Jehan_It's just that I've been working on GMP bindings myself.
17:24:11dom96ahh cool
17:24:32Jehan_They're still in their early stages, but I can do basic arithmetic, printing and parsing already.
17:24:39EXetoCgmp is that complex?
17:24:55Jehan_GMP has a ton of functionality to bind.
17:25:05Jehan_There's also the matter of efficiency.
17:25:24VarriountAnd, if I recall looking at the headers correctly, a huge number of macros
17:25:36Jehan_Yeah.
17:25:43EXetoCobviously
17:25:47EXetoCgotta have those macros
17:26:28Jehan_At the moment I'm using {.passl.} to link, {.dynlib.} isn't a real option.
17:26:58VarriountWhy not?
17:27:18Jehan_Because you can't have both a {.header.} and a {.dynlib.} option.
17:27:32Jehan_Which I learned the other day.
17:28:07*Demos joined #nimrod
17:28:23Jehan_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:51VarriountJehan_: Just how much free time do you have on your hands?
17:28:52EXetoCwhy were you using .header again?
17:29:06Jehan_Because of the aforementioned macros in gmp.h?
17:29:20Jehan_Varriount: Too little?
17:29:59Demosany thoughts on removing the SSLv2 stuff from sockets and our openssl wrapper?
17:30:12EXetoCI 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:15Jehan_Oh, c2nim also seems to get indigestion from gmp.h, but that's really GMP's fault.
17:30:45dom96Demos: Why?
17:30:47Demosc2nim will almost never be able to deal with the headers without modification
17:30:48Jehan_EXetoC: Whenever I use the C++ target, it breaks, anyway. :)
17:30:51EXetoCwhat doesn't it handle in macros? ##, \, what else?
17:31:04Jehan_EXetoC: Dunno, I tried, then I gave up.
17:31:06Demosand dom96 because a lot of systems build openssl without sslv2 support, and sslv2 is not secure
17:31:28dom96Demos: dead code elimination should remove it
17:31:31Jehan_The GMP API is pretty clean, I just copied from the docs for the most part.
17:31:51Demosright, but not if you want to override nimrod's dlopen and dlsym stuff and link yourself
17:32:06EXetoCJehan_: but it's compatible with the C++ target I think
17:32:11EXetoCbut yes the target itself is buggy
17:32:14Jehan_Yup.
17:32:28Demosit came up on openBSD, but honestly the real problem is something with CRYPTO_set_mem_functions
17:33:07Jehan_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:13Jehan_Eh, using it so much.
17:33:32dom96I 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:39Demosyeah, same. But on the other hand it makes linking less compiler dependent
17:33:42Jehan_Dlopen support as such is great.
17:33:42dom96The last time this issue came up he just said to use dead code elimination
17:33:50Demosyeah
17:33:54VarriountJehan_: It's really fun when I'm using process monitor, I can instantly spot where nimrod is trying to load dll's
17:34:00dom96If you're linking yourself aren't you choosing the stuff you import anyway?
17:34:19Jehan_dom96: Que?
17:34:23Demosnot really, since stuff is loaded from all the importc'd procedures
17:35:02dom96oh, I thought you meant using the dlsym module manually yourself?
17:35:10Jehan_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:30Jehan_And I suspect that you can have lots of fun with that and rpath on Linux.
17:39:21Jehan_But there's --dynlibOverride, so I don't really care.
17:39:36Jehan_Since contrary to what the option says, you can also use it for dynamic libraries.
17:45:54fowlJehan_, you should make a babel file so we can install it by url
17:46:47Jehan_Umm, I did say that I was keeping it intentionally out of Babel, right? :)
17:47:16Jehan_It's not portable, it uses {.emit.}. It's for people who know what they are doing and need the functionality.
17:48:01dom96what if those people want to install it using babel? :P
17:48:15fowlJehan_, it would be out of the babel list, but easily installable
17:48:16*enurlyx joined #nimrod
17:48:34Jehan_Hmm. I'll have a look at that.
17:51:14enurlyxfowl: What is this message thing you are writing? Some kind of Eventsystem?
17:51:52fowlenurlyx, its an entity component system
17:55:49VarriountLike Artemis?
17:59:09AraqJehan_: python ctypes has the same problem and yet nobody complains
17:59:43Araq"otool -L" is fundamentally broken thanks to dlopen... that's what you get for providing runtime reflection so I don't care
18:00:17fowlVarriount, artemis is more of a bundle than entitty, looks like it comes with system management and stuff
18:01:11fowlVarriount, entitty has to do manual memory management (vs having a list<component> to pull from)
18:01:42VarriountAraq: What's wrong with runtime reflection?
18:01:55Araqand 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:03AraqVarriount: runtime reflection is a PITA for optimizations and verifications
18:03:09Jehan_Araq: That's fine with me, as long as --dynlibOverride exists. :)
18:04:43Jehan_And most people use reflection because languages lack metaprogramming facilities.
18:05:04Jehan_In fairness, there ARE some real good use cases for reflection.
18:05:10Araq(btw there is no difference between optimization and verification)
18:05:26Jehan_But they're not what most people use reflection for.
18:05:40Araqyup.
18:06:00Jehan_Not counting using reflection to hack around limitations in the JVM.
18:06:11Araqof course it can be useful but then don't complain your tools can't help you anymore ;-)
18:07:05Jehan_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:39Araq--verbosity:2 or higher lists dynlib dependencies btw
18:08:23AraqJehan_: 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:30Jehan_Speaking of which, would it be possible for the compilation process to be less noisy by default when -r is used?
18:09:01Araq--hint[Processing]:off ?
18:09:03Jehan_Araq: You can accomplish that on OS X, too, if you want ti.
18:09:06Jehan_it*
18:09:23Jehan_I.e. just specify that the DLL path is relative to the executable.
18:09:47Jehan_Araq: I have a script that turns off hints and sets verbosity to 0.
18:10:03Araqoh and how do I do that? export some LD_FOO environment variable in some .sh script before loading stuff?
18:10:14Jehan_It's not a feature request, I can live fine with that. I was simply wondering if it was intentional.
18:10:48Araqwell surely the compiler produces the amount of output that I consider useful... :-)
18:11:16Jehan_Araq: Start the library path with @executable_path.
18:11:18EXetoC-q|--quiet?
18:11:42Jehan_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:54enurlyxfowl: This is for games, right? Do you think this could be useful for a GUI(not game gui)?
18:12:40Jehan_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:00Jehan_I used that for the longest time to fix loading of the LLVM module on Mono.
18:13:20AraqJehan_: yeah but it's rarely really about what one *can* do
18:13:35*Demos_ joined #nimrod
18:13:36Araqit's about how the OS works by default
18:14:11Araqand how much one has to learn to workaround all the design issues
18:14:22Jehan_The problem is more that every OS does it differently.
18:14:28EXetoCdom96: it seems like "babel build" might not look in the babel path
18:14:49dom96EXetoC: babel path?
18:15:02EXetoCdom96: the babel package path
18:15:21dom96EXetoC: what are you trying to do?
18:15:42EXetoCopengl and glfw can't be find when I do "babel build", but it works when I invoke nimrod manually
18:15:47EXetoCdom96: build the example
18:16:10dom96do you have them listed as a dependency in your .babel file?
18:16:14Demos_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:07Jehan_Well, Linux doesn't want its bin directories to be polluted with libraries.
18:17:17renesacdom96, Jehan_ : it was me who started writting a bigint libray in nimrod
18:17:19Jehan_Which is a pretty reasonable stance in the UNIX world.
18:17:41Jehan_renesac: From scratch? That would be impressive.
18:17:44dom96renesac: oh. What's the status on it?
18:17:49EXetoCdom96: ok so it's required. that seems entirely reasonable actually
18:17:51renesacbut it is on hold now, and I would like a gmp binding to easily test the correctness of it
18:18:02dom96EXetoC: Yes, that is the point of 'babel build'
18:18:08renesacI stopped after implementing addition, subtraction and multiplication...
18:18:08Jehan_My office mate is one of the MPIR authors, so I have a pretty good idea what goes into one.
18:18:13Demos_ooooh when did we get babel build?
18:18:16renesacdivision was a bit hairy, and then I stopped
18:18:28dom96Demos_: Since forever lol
18:18:58EXetoCdom96: well, it also simplifies batch-compliation, but I guess it's a secondary feature
18:19:23Demos_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:25EXetoCdom96: 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:33EXetoCI mean for the package that uses opengl
18:19:46*BitPuffin joined #nimrod
18:19:50renesacI just wanted to use the nimrod 'distinct' and operator overloading habilities to write a very clean bignum library
18:19:51Demos_actually openGL requireing X11 could be a bug, it downloads the x11 wrapper even on windows
18:19:52renesacand it was working
18:20:36EXetoCI think the lack of platform parameters is the actual bug
18:20:38renesacbut I was not planning to implement a dozen different multiplication algorithms for performance, for example, like GMP
18:21:03Jehan_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:18renesacmuch less lots of assembly for each base function, again, like GMP
18:21:23Demos_I thought there was a {.require.} pragma of some kind
18:22:16EXetoCthat's slightly worse
18:22:32Demos_hm?
18:22:42Demos_oh I think I get it
18:24:24renesachttp://www.bytereef.org/mpdecimal/ <-- this bignum library is very nice too
18:24:41renesacvery clean c implementation in a few files
18:24:50dom96EXetoC: if you depend on opengl and it depends on x11 then your package will depend on x11
18:25:16dom96Demos_: Doesn't openssl work on linux already?
18:25:29renesacnot 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:48renesachttps://bitbucket.org/python_mirrors/features-cdecimal/src/48e9fb0a7217 <-- here the code base
18:26:12*PortableEXetoC joined #nimrod
18:26:17renesacnot sure where is the original repository
18:26:35PortableEXetoCAt, the jim!
18:26:46renesacops, wrong link
18:26:53Demos_dom96: I am not on linux, I am on OpenBSD
18:27:07renesachttps://bitbucket.org/python_mirrors/cpython/src/750f44e621aa/Modules/_decimal/libmpdec/
18:27:10renesac<-- here
18:27:33dom96Demos_: You said 'linux' in your question though.
18:28:05*tdc quit (Quit: ChatZilla 0.9.90.1 [Firefox 29.0/20140421221237])
18:28:14Demos_dom96: yeah, looks like a did, oops
18:28:17PortableEXetoCSame thing, kinda
18:28:19Demos_well I am on BSD
18:28:26renesacit has 100% test coverage, and formal proofs for some of the algorithms
18:28:50PortableEXetoCDemos: you prefer it for desktops?
18:29:29Demos_PortableEXetoC: it works OK (the manpages are AWESOME!) but it uses a ton of power and boots slowly
18:29:36Demos_also it does not issue TRIM commands
18:29:56Demos_but reguardless Nimrod and Babel should work on OBSD
18:30:44PortableEXetoC:s
18:34:10Demos_is there a way to pass extra flags with the dnylib pragma?
18:35:19PortableEXetoCNo trim ? how come
18:35:49Demos_not supported by openBSD
18:35:56Demos_*shrug*
18:36:16Demos_I think you may be able to manually send it
18:36:42PortableEXetoCCool voice typing
18:36:43Demos_and modern SSDs have more advanced garbage collectors
18:37:11*Demos_ is waiting for his phone to get "Cortana"
18:37:12PortableEXetoCIts automatic?
18:37:21Demos_what the gc?
18:37:28Jehan_I think it's time to figure out who has the copyright on int main(char *argc, char **argv);
18:39:20PortableEXetoCWut
18:42:41PortableEXetoCStallman?
18:42:49PortableEXetoCWild guess
18:43:49Jehan_That was a sarcastic reference to the 9th Circuit ruling in Oracle v. Google.
18:47:00*tdc joined #nimrod
18:49:38PortableEXetoCReading about it now. Wth
18:49:55Jehan_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:19fowlenurlyx, sure you could use it for a gui
18:52:15fowlenurlyx, its already available as fowltek/entitty
18:52:34PortableEXetoCJehan in nimrod? Just write a generix interface for it
18:52:46PortableEXetoCGeneric
18:52:48fowlJehan_, there is a parallel for `||` but im not sure how to use it
18:53:27Araqfowl: that's something entirely different
18:53:34Jehan_PortableEXetoC: That's not just a thing about interfaces, it'd be about language semantics.
18:54:03fowlo
18:54:10AraqJehan_: you can do that with first class iterators
18:54:26Jehan_You can? Neat. :)
18:54:57Araqwell it's ugly but should work
18:55:04Jehan_Heh. :)
18:55:30Araqyou need an explicit while loop that calls 'next' and 'finished' except that there is no 'next'
18:57:31Jehan_Well, it's not a pressing issue. I was mostly wondering if it could be done at all.
18:58:32Araqno, it's possible, you have to do let f = iter; and then f() is the 'next'
18:58:56Jehan_I see.
18:59:06Araqpeople argued it's a strange way of doing it ..
18:59:20Jehan_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:26Jehan_What is a strange way?
18:59:30*noam_ is now known as noam
18:59:42Araqthe let f = iter; f() way
18:59:52PortableEXetoCGah i want "generic container" to work :p
19:00:06VarriountIt's probably because we're used to how python does it.
19:00:21Jehan_Define "generic container"?
19:00:44PortableEXetoCAs in the generic keyword. New type classes
19:00:49Jehan_Ah.
19:01:12VarriountSpeaking of type classes, I wonder what zahary has been doing...
19:01:47Demos_PortableEXetoC: ProTip: Define a object filled with function pointers and a converter from your generic to said object
19:01:48PortableEXetoCCome to think of it, i might just be able to abuse the lenient 'let' semantics for now
19:02:00Demos_it works pretty well
19:02:01Jehan_Araq: What happens when the iterator ends and you call it that way?
19:02:14Araqit returns default(T)
19:03:19Jehan_Gotcha.
19:03:59PortableEXetoCDemos: yeah if it can be done somewhat transparently
19:04:09*Jesin joined #nimrod
19:04:17VarriountHi Jesin
19:04:21Jehan_Speaking of Sather, there's nothing like "once" arguments to iterators, right?
19:04:22Demos_Hello Jesin!
19:04:34Jehan_(Not a complaint, just trying to make sure I'm not missing anything.)
19:04:36Jesinhi
19:04:44VarriountJehan_: "Once" arguments?
19:05:33Jehan_Umm. I'd have to explain Sather for that to make sense, I think.
19:05:33AraqI'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:59Jehan_Basically, an argument that is evaluated only once during a loop as opposed to each time.
19:06:12fowlat the beginning
19:06:14Jehan_And conversely, iterator arguments that are evaluated each time through the loop.
19:06:39VarriountJehan_: Nimrod already sorta evaluates iterator arguments each loop.
19:06:41Jehan_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:56Jehan_Even while!() and until!() are technically iterators in Sather.
19:07:17Jehan_E.g.: loop while!(condition) … end;
19:07:37Jehan_The condition is evaluated each time it is encountered.
19:08:04Jehan_As opposed to a for loop style iterator, e.g.: loop i := 1.upto!(100) … end;
19:08:38enurlyxfowl thanks, i will have a look
19:08:40Jehan_And so you can have multiple while/until conditions in the same loop, or multiple for constructs.
19:09:04Jehan_Pretty neat for the fringe problem, for example.
19:09:57Jehan_http://c2.com/cgi/wiki?SameFringeProblem
19:12:47Demos_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:36VarriountHi kunev
19:14:19Jehan_Demos: Ditto.
19:15:28AraqJehan_: 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:13Jehan_Not 100% sure. I know the compiler was able to inline them, but did not have to.
19:16:23Jehan_And yeah, I know that implementing them is tricky.
19:16:28Jehan_Especially with a C backend.
19:16:51VarriountIf I recall correctly, the Lua VM captures the full stack per coroutine when using them.
19:17:26EXetoCdom96: does babel work this way because of ease of implementation, or do you think it's best to include indirect dependencies too?
19:17:27Jehan_There are ways to capture the stack. I mean, I've written code doing it. It's just not portable or clean.
19:17:53Jehan_Look up the GNU/OSSP Pth library for just one example of how it can be done.
19:18:14Jehan_There are other implementations, but Pth has a pretty nice paper explaining it.
19:18:47EXetoCwhich 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:05Varriountsetjmp/longjmp can be used for coroutines as well, as long as you know how much memory to allocate to the new stacks.
19:20:09VarriountMost implementations using setjmp/longjmp just make an overestimated guess on how much memory is needed.
19:20:43Jehan_Varriount: As I said, look at Pth. They actually have a number of different implementations, depending on what the underlying architecture offers.
19:21:17VarriountI 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:39AraqVarriount: not really
19:21:44Jehan_http://www.gnu.org/s/pth/rse-pmt.ps
19:22:04VarriountJehan_: But no Windows implementation :<
19:22:08Araqand it's not tractable in general (recursion? foreign functions? indirect calls?)
19:22:13Jehan_Varriount: Nothing outside what the various gcc __builtin() functions offer.
19:23:04Araq*shrug* stack capturing is not the problem (I'd use LuaJIT's library for it btw)
19:23:28Jehan_I hope that clang will someday implement the necessary features for C to be a fully usable compiler backend.
19:23:47Araqthe problem is that the GC needs to know about these additional stacks
19:24:12VarriountOn a side topic, are there any translate-to-assembly languages that don't use the 'stack'/'heap' memory model?
19:24:52VarriountBy translate to assembly, I mean in the same way C is sorta translated to assembly.
19:24:52AraqVarriount: some variants of ML allocate the stack frames on the heap
19:25:03Araqand produce native code
19:25:06EXetoCJehan_: why C? familiarity?
19:25:10Jehan_Define "don't use the stack/heap" memory model?
19:25:33Jehan_EXetoC: There are distinct benefits to compiling to C. Unfortunately, there are disadvantages, too.
19:26:07VarriountJehan_: The way that arguments are pushed to a stack of memory, general data layout, etc.
19:26:25Jehan_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:42Jehan_Varriount: Well, that's generally defined by the ABI?
19:27:05Jehan_Which tells you about procedure calling conventions so that different languages can actually interoperate.
19:27:29AraqVarriount: 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:48Jehan_Varriount: Why are you asking?
19:27:59VarriountJehan_: Curiousity.
19:28:17Jehan_In general, there has to be a reason to break with standards.
19:28:33VarriountI figure that there must be more than one way to do low-level function calls (aside from calling conventions)
19:28:41Jehan_E.g., support for continuations or lightweight threads are an example.
19:29:05*kunev quit (Ping timeout: 276 seconds)
19:29:06Jehan_But other than that, there are really not that many ways to call a function in assembly code.
19:29:18VarriountAraq: You can use fibers as coroutines on Windows.
19:29:22Jehan_And only so many ways to pass arguments to it (or recover results).
19:30:05AraqVarriount: as if I don't know ...
19:30:21Jehan_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:07VarriountJehan_: What about supply additional data with arguments? One possibility that comes to mind is supply additional data that corresponds to types
19:31:34Jehan_Types are rather language-specific.
19:32:23Jehan_That said, the one implementation that I know of that does function dispatch somewhat differently is Objective-C.
19:32:39Jehan_And it predictably creates occasional problems for debuggers and other tools. :)
19:33:15EXetoCVarriount: something other than calling conventions? I don't know why that'd be
19:33:23VarriountSomething 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:37EXetoCa binary format needs to be agreed on in order for things to work at all
19:33:48EXetoC*what
19:35:07EXetoCyou hide the fact that calling conventions are necessary only in higher level languages
19:36:46Jehan_Heh. That reminds me how we abused PUSH and POP back in the Z80 days. :)
19:37:21Jehan_And the x86 still abuses POP to generate position-independent code. :)
19:37:21EXetoCyou must be old
19:37:27EXetoCj/k
19:37:39Jehan_My first computer was a ZX 81. So, yeah. :)
19:39:41Jehan_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:22Jehan_Stuff like this would probably get you fired today, but it was a necessity back then.
19:41:16dom96EXetoC: If indirect dependencies are not working then it's a bug.
19:41:46*Varriount|Mobile joined #nimrod
19:42:11EXetoCwill report it then. I had to specify both opengl and x11
19:43:16dom96you sure opengl specifies x11 in its dependencies?
19:43:53dom96hrm, it does.
19:43:55dom96Interesting.
19:49:29AraqJehan_: so what's wrong with the C++ target? and can you fix it?
19:55:16EXetoChttps://github.com/Araq/Nimrod/issues/925 this (my report). what else?
19:55:26*kunev joined #nimrod
19:58:31Araqso 'abs' requires a header
19:58:37Araqthat should be easy to fix
20:00:29EXetoCI don't know how many symbols that applies to
20:01:21Araqthere are not many left in the codegen that don't trigger some header decl
20:05:40*Jehan_ quit (Quit: Leaving)
20:06:01Varriount|Mobileis this abs() for floats or ints?
20:07:51Araqints
20:09:25*Jehan_ joined #nimrod
20:09:50Jehan_Umm, nothing is wrong with the C++ target?
20:10:07Jehan_Unless you mean the odd bug.
20:11:03Araqwhich one? the abs bug?
20:14:01Jehan_I know that whenever I use --threads:on, there are problems with stuff not compiling. Or used to be.
20:14:22Araqhmm ok
20:15:05Jehan_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:34fowlwill -rpath make dlsym look in ./ for libraries
20:46:45EXetoCC++ interop and reduced exception overhead are the main reasons for it I guess
20:46:56EXetoCthe latter will be less relevant once we get that asm target
20:47:43AraqEXetoC: that's years away
20:47:50Jehan_Yes, doing exceptions in C can be a pretty painful process.
20:47:53EXetoCxd
20:48:29EXetoCyes if you're doing it manually. we already have an exception mechanism for it
20:48:57EXetoCJehan_: you never get C++ code errors with the C++ generator? just "import pegs" failed for me before
20:49:07Jehan_The generated code still has to deal with C's assumptions.
20:49:24Jehan_EXetoC: Umm, I said I did?
20:51:29AraqEXetoC: please replace in cccgexpr.nim this line
20:51:31Araq mAbsI: "(NI$2)abs($1)",
20:51:33Araqwith
20:51:34EXetoCyou said "odd bug", but this is a blocker which is why I'm asking
20:52:00Araq mAbsI: "($1 > 0? ($1) : -($1))",
20:52:00EXetoC"Error: unknown C compiler: 'gpp'" hm
20:54:30EXetoCok
20:56:27fowlEXetoC, i get that too
20:56:33Jehan_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:56Araqnah I asked for bug reports
20:57:03Jehan_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:21dom96It 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:17EXetoCAraq: so commandCompileToC is for multiple languages?
21:20:57Araqsure
21:29:20EXetoCgetting 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:03dom96interesting. 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:44Jehan_You can have fun with signed vs. unsigned in C, too.
21:39:03Jehan_int main() { return puts(-1 < 1U ? "ok" : "wtf"); }
21:40:17fowlthe 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:36Mat3hello
21:49:21Jehan_Hiya, Mat3!
21:49:54Mat3hello Jehan_
21:50:51EXetoCAraq: what now? where should I look? ^
21:55:20AraqEXetoC: well what produces this error?
21:56:19EXetoCAraq: "if (!(192 <= cardSet(cc, 32))) goto LA3"
22:00:23AraqEXetoC: lib/system/sets.nim
22:00:45Araqmake TNimSet use uint8
22:00:57EXetoCk
22:01:11Araqand get rid of the 'ze' in line 28
22:07:08*boydgreenfield joined #nimrod
22:10:14EXetoCtest case compiles. will try some other things now
22:13:19*enurlyx quit (Quit: Nettalk6 - www.ntalk.de)
22:19:04Mat3ciao
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:47EXetoCsuch as the compiler. getting something about conversion from volatile
22:26:58EXetoCand 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:24EXetoC"invalid conversion from ‘NimStringDesc* volatile*’ to ‘NimStringDesc**’"
22:32:24AraqEXetoC: again, where does it come from?
22:33:14EXetoCsorry 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:08boydgreenfieldCan’t tell if I’m just missing it: Is there a built-in string.reverse() function?
22:46:38EXetoCgrep says lib/pure/algorithm.nim:24, lib/pure/algorithm.nim:33
22:46:51EXetoCopenarray parameter. can't remember if it works for strings
22:46:57*flaviu quit (Quit: Leaving.)
22:47:08*flaviu joined #nimrod
22:47:53Araqhi skroll welcome
22:47:58skrollHello
22:49:02skrollHave 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:14boydgreenfieldEXetoC: No sadly. I was wondering if it’s just called something else?
22:50:24EXetoCskroll: great. what were your initial doubts?
22:50:32skrollperformance, to be honest
22:51:22EXetoCI just thought "ok, these guys seem to know their shit"
22:51:24skrollHowever, 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:12skrollI was sold.
22:52:54renesacnimrod performance is usually within 10% of good C code
22:53:55renesacwe 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:59renesacfor performance
22:54:36skrollExactly. I'm a diehard lover of uthash in C, but to be able to avoid that...
22:56:11skrollplus it's statically typed, and that's something i feel more comfortable with.
22:56:30renesacif 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:36skrollonly 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:44renesacI don't think I saw this yet
22:59:11skrolltry creating a template that takes a template, example: tuple [x: float, y: float, z: float]
22:59:20skrolloops
22:59:24skrolli mena a template that takes a tuple
22:59:40renesacwe still lack an real optimization pass
22:59:49skrollthen if you call the template such as foo((x: val1, y: val2, z: val3))
22:59:55renesacwe rely on the C compiler doing constant folding, etc
22:59:58skrollyou will have 3 structures of the tuple created
23:00:05skrollif you use x,y,z
23:00:40skrollfor example: template foo(t: tuple[x: float, y:float, z:float): float = t.x, t.y, t.z
23:00:49skrollthe compiler will generate 3 structs
23:00:57skrolloops
23:01:02skroll= t.x + t.y + t.z
23:01:06skrollis what I meant
23:01:07flaviuskroll: Its documented in http://nimrod-lang.org/tut2.html#templates, but it doesn't stand out
23:01:08EXetoCrenesac: some folding anyway
23:01:28skrollAh, I missed that
23:01:36flaviuLast sentence of that section
23:01:52flaviuIt should be mentioned in the manual too
23:02:05skrollanyways, yeah, it created 3 structs, and did struct1.x + struct2.y + struct3.z
23:02:11renesacflaviu, is it by design?
23:02:23Araqskroll: that's just how templates work by definition
23:02:25skrolli guess it makes sense to me, since its really just expanding the line
23:02:28flaviurenesac: Yes, template params are expressions, not objects
23:02:42skrollit clicked for me after an hour or so
23:02:46renesacright
23:02:47Araqrenesac: we have optimizations passes and constant folding
23:03:17renesacAraq, oh, I remember you saying you wanted to have a dedicated optimization pass
23:03:22renesacor something like that
23:03:34Araqyes but that doesn't mean we do nothing right now
23:05:07*boydgreenfield quit (Quit: boydgreenfield)
23:05:31skrollonce I realized that the templates were legitamately templates, that code geneartion made sense to me
23:05:49skrolleither way, ive drank the kool-aid
23:06:36skrolli'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:13EXetoCwhat do these OSes offer?
23:08:07skrollI 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:36skrollI don't want to use it, but all the code depends on SPARC64
23:09:04EXetoC90s. ok makes sense :>
23:09:24skrollI've spent the past 5 years porting as much as possible.
23:10:28skrollAlso the entire thing expects divide by 0 to result in 0.
23:11:40skrollHowever, 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:40Araqskroll: porting to sparc64 might be some work with its crazy sliding register sets
23:35:00Araqwe scan the stack conservatively and push the registers on the stack with setjmp
23:35:50Araqthere is a version for sparc but it has never been tested
23:36:25njoejoeI 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:57njoejoecdb as in: http://cr.yp.to/cdb.html
23:39:54Araqnjoejoe: my VM in the compiler uses uint32 too, you know
23:40:06Araqit's not like there are bugs everywhere ...
23:40:39Araqsometimes you have to use type conversions ... oooohh big deal if you don't give a fuck about correctness
23:40:49Araqbut a blessing if you do
23:41:32njoejoeAraq: 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:02AraqI don't know about that
23:42:15Araqas I said, it's a feature if you are concerned about correctness
23:42:39Araqwhich I am all the time but I get the average "let's use opengl" code doesn't like it
23:45:37EXetoCeverything? really?
23:45:54EXetoCanyway, I do like verbosity that is justified
23:47:17Araqand ofc the language is right to punish you for using unsigned arithmetic :P
23:48:37Araqx+4 >= 4 # for unsigned wraparound we don't know ...
23:48:59njoejoeEXetoC: not *everything*... i exagerrate
23:49:20Araqin this very moment I'm implementing a pass that proves array bounds correct
23:49:55Araqguess what? I give up for unsigned. It will only work for signed numbers
23:52:25Araqthere are almost no useful algebraic properties of unsigned wraparound arithmetic
23:55:48flaviuhttp://i12www.ilkd.uni-karlsruhe.de/~schlager/publications/ifm04.pdf
23:56:08njoejoethe only reason i care about it is for 32 bit disk pointers and 32 bit hash value
23:57:03reactormonknjoejoe, 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:35EXetoCAraq: what happens with len for really big containers?
23:58:57njoejoeyes, the hash is created with bitops and disk pointers calc'd like p += 8+klen+vlen
23:59:06AraqEXetoC: it simply works?
23:59:11flaviureactormonk: Hashes typically also use arithmetic as part of avalanching
23:59:41reactormonkflaviu, but that's not really relevant, is it?
23:59:55reactormonkbecause you don't care about overflows etc.