<< 23-01-2014 >>

00:00:03renesaccan't I index tuples with field numbers?
00:01:18renesacI'm trying to refactor the ParticleBench code, so unnoficial compiler tweaks are out
00:01:19renesac:P
00:01:30renesacbut I will take a look
00:01:51Araqseems like you only need to weaken the check for tyTuple and then it should compile
00:02:07Araqand yes you can do tup[i] but i has to be a constant and so that doesn't help
00:02:56renesacI tried with a enum
00:03:05renesacbut not constant enought it seems...
00:03:06renesac:P
00:03:33Araqit needs to be an intege
00:03:36Araq*integer
00:04:00Araqwhat should tup[enumValue] mean? tup[enumValue.ord] ? then just say so
00:04:01renesacit is strange that it prints the field name if you call it with parenthesis
00:04:11renesachum
00:05:03renesacI get a SIGSEGV: Illegal storage access. (Attempt to read from nil?)
00:05:09renesacwith enumvalue.ord
00:05:17renesacit works with a simple integer
00:05:36Araqyay
00:09:06renesacit also gives SIGSEGV when I try an array of ints...
00:09:15renesacconst dim: array[3, int] = [0,1,2]
00:09:15renesacfor c in dim:
00:09:15renesac echo min[c]
00:09:45renesacit works with a single const int
00:09:45Araqon devel?
00:10:03renesacI tried to compile from git
00:10:18renesacthough it gives the same version number and date of the nimbuild one
00:10:40renesacor not
00:10:42renesacNimrod Compiler Version 0.9.3 (2014-01-21)
00:15:02*Smaehtin quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
00:20:33*brson joined #nimrod
00:27:54renesacI was trying to use enum as a nicer array, but it seems that the working solution is to use a simple array + enum
00:28:31Araqyeah
00:28:34Araqgood night
00:28:45renesacgood night
00:28:56dom96yeah, I'm away to sleep too
00:28:58dom96bye
00:30:09renesac*I was trying to use tuple
00:33:55*nueva quit (Quit: Bye)
00:47:25*LordAndrew joined #nimrod
01:07:34*DAddYE quit (Remote host closed the connection)
01:10:20*Varriount is back
01:41:53*vbtt_ joined #nimrod
01:42:05vbtt_hi
01:44:01VarriountHi vbtt_
01:45:04vbtt_what's the primary dev platform for nimrod?
01:46:36vbtt_also who runs the nimrod builders?
01:47:09vbtt_dom96: u here?
01:49:32LordAndrewVarriount: Do you think it'd be worth making a pull request for this function I wrote?: https://gist.github.com/Lordovos/8552530
01:55:16vbtt_LordAndrew: why not a generic one that can use float or int?
01:59:48renesacI was going to write something similar
02:00:19LordAndrewAh right, floats. Forgot about that.
02:00:26renesacbut accepting as argument a nimrod type or subrange
02:00:27*capisce_ quit (Ping timeout: 260 seconds)
02:00:43LordAndrewI'm also wondering if I would want to just have the procedure be named random() instead of randomRange.
02:01:23renesacand it would return all types of values, like uint32, floats, strings, etc
02:01:29renesacwell, that was the plan
02:01:43renesacand subranges, of course
02:02:21LordAndrew...oh. random(float) doesn't work on Windows??
02:02:35renesacnor in linux I think
02:02:49renesacthe std random is very limited
02:03:03renesacthat is why I wanted to make this super generic templated version
02:03:21vbtt_random(float) is documented. doesn't work?
02:03:30LordAndrew"This is currently not supported for windows."
02:03:31renesacis it?
02:03:34renesachum
02:03:40LordAndrewCompiler throws error as well, says expected an int.
02:04:03vbtt_http://nimrod-lang.org/math.html#135
02:04:46vbtt_yeah you could just overload random().
02:05:09vbtt_random(max) or random(min, max). nimrod can do this type of overloading, right?
02:05:21renesacright
02:05:42renesacwell, the other thing wrong with random is using global state
02:06:26renesacI haven't tried, but I suspect a call to randomize in a function will interfere in other unrelated functions called latter
02:07:06vbtt_unrelated, but what do you guys think are the top 3 distinctive features of nimrod?
02:08:20vbtt_just wondering since the language has grown a lot of features.
02:09:13*DAddYE joined #nimrod
02:09:14renesacI was thinking in something like random[range[0 .. 16].uint](seed=x).get()
02:09:53renesacthough that will only work for ranges known at compile time...
02:10:12vbtt_renesac: the global state should always be available because some functions may not care.
02:10:25renesac?
02:10:25vbtt_also why is range better than (min, max) ?
02:10:54vbtt_renesac: I mean random(max) should always be allowed (using the global random generator)
02:11:01renesacnot that it is better, but I though it would make min,max unnecessary
02:11:47vbtt_renesac: max and min, max are convenient.
02:11:54renesacvbtt_: I'm talking about the seed used by the random generator, that may be changed by unrelated functions runing at the same time
02:12:06renesacvbtt_: indeed, now I see it
02:12:41renesacbut even then, I think random should also be capable of returning ranges, even if it has optional max and min arguments
02:13:33vbtt_renesac: why return a range? randomSample(sampleSize, min, max) is more useful imo.
02:13:53*DAddYE quit (Ping timeout: 272 seconds)
02:14:26renesacwhat is sampleSize?
02:14:52vbtt_actually randomSample(sampleSize, array or seq)
02:15:00renesacand my question would be, why not return a range, if you want to return int, uint64, float, etc?
02:15:03vbtt_select random sampleSize elements from list.
02:15:30renesacoh, that would be a different function
02:15:31vbtt_renesac: let me rephrase, what does it mean to return a random 'range'?
02:16:09renesacreturn a value of type subrange that is inside that defined subrange
02:16:50renesachttp://build.nimrod-lang.org/docs/manual.html#subrange-types
02:16:57renesac<-- I'm talking about those
02:17:17vbtt_ah i see.
02:17:27vbtt_yup sure - that should work too.
02:17:44renesacbut the limitation is that they should be known at compile time
02:17:49vbtt_type Color = range[0..0xFFFFF];.... random(Color)
02:17:57renesacso the parameters max and min have their value
02:18:06vbtt_it's still useful.
02:18:37renesacI was thinking more in random[color]()
02:18:39*DAddYE joined #nimrod
02:18:41*DAddYE quit (Client Quit)
02:19:13renesacbut I guess overloading/implicit generics works too
02:19:26renesacI'm not sure you can use "when" inside the function then
02:19:41vbtt_either will work but random(Color) is more readable imo.
02:19:46renesacrigth
02:19:47vbtt_renesac: why cant you use when?
02:19:58renesacI don't know
02:20:17renesacprobably you can indeed, I'm still starting with nimrod
02:20:51renesacanyway, I wanted a 64bit random value, so I was going to write my own random funcion from scratch
02:21:25renesacas the stdlib only provides positive integers as random values
02:21:35renesac(and floats, I missed that)
02:23:13vbtt_renesac: what's sizeof(int) in nimrod?
02:23:27renesacI think it is plataform dependent
02:23:33renesaceither 32 or 64bits
02:23:43renesacint32 is aways 4 bytes
02:23:54renesacint64 aways 8bytes
02:24:14renesacvbtt_: about the global state again, you might have some test that depends on certain random pattern, and another function is called, that calls randomize, and your totally unrelated function fails.
02:24:50renesacyou should be able to seed your own random number generator
02:25:11vbtt_renesac: code shouldn't depend on random 'patterns'. it's a bug. random by definition shouldn't have patterns (but pseudo-random happens to cos it's machine generated)
02:25:21vbtt_renesac: agree on 2nd point.
02:25:25renesacto reproduce a bug
02:25:26renesacfor example
02:25:44renesacwell, global state is bad
02:25:50vbtt_renesac: the api could be. randomizer = initRandom(seed); var x = random(randomizer, min, max);
02:28:01renesacI think simply 'let random1 = Random(seed); var x = random.get(max, min=2)
02:28:11renesac*random1.get
02:28:33renesacthe case insensitivity of nimrod makes worse to work with classes
02:28:47renesacwell, maybe 'let random = TRandom(seed)
02:28:54renesacyep
02:29:26EXetoCyes that's the convention
02:30:10renesacif you just need one random value now, you could use 'TRandom(seed).get(max)'
02:30:47renesacthough you have to initialize separately to use in a loop
02:32:16renesacbut if TRandom itself supported arrays, sets, strings, etc as output, it wouldn't be as necessary
02:32:55LordAndrewHmm.
02:33:22LordAndrewFor a .gitignore file in a NImrod project, what would I want to exclude? Just /nimcache?
02:34:21renesacI'm going to post a rant in the forums soon about how I hate some C style stdlib APIs that don't use or let you use nimrods features and nicities that C don't have
02:34:52renesacI'm still preparing it, and feeling the language
02:36:08renesacrandom is among them, as is Open() and Alloc()
02:36:15renesac/spoiler
02:39:49EXetoCwrapping alloc shouldn't be difficult
02:39:58renesacyep, it is trivial
02:40:16EXetoCand what about open?
02:41:30renesacyou need to declare a variable of type TFile to feed to the function
02:41:38renesacyou loss nimrod type inference
02:42:15EXetoCthat has to do with how var works, no? also, check the other overloads
02:42:21renesacyou should be able to just 'var file = Open(filename)'
02:42:44EXetoCyou can
02:43:03renesacohh
02:43:16renesacI didn't saw the other definitions
02:43:41renesacok, that is outside my rant now
02:44:59renesacabout alloc, you see all over the place: 'cast[ptr T](alloc0(sizeof(T)))' where it would be shorter to write alloc0[ptr T](sizeof(T))
02:45:11renesacyep, that is trivial, but still a C wart in nimrod
02:45:21EXetoCeasy to fix like I say, but I'll do it tomorrow or something if you don't want to
02:45:36renesacyeah
02:45:37EXetoCassuming that sizeof works and all that
02:46:12renesacI'm just removing the cast, not changing the alloc0 arguments
02:46:28vbtt_renesac: can a template fix that?
02:46:37VarriountHey guys. What's going on?
02:46:41renesaca simple wrapper function would fix that
02:46:41vbtt_why not just allocPtr(T)
02:47:36renesacwell, most of the time is the size of the elements pointed by the pointer times the number of elements
02:47:45EXetoCor just overload it. alloc(T, n: int) or something?
02:48:02renesacyep
02:48:17renesacbut my point is that it should be like that in the stdlib the first place
02:48:49vbtt_renesac: agree.
02:49:10vbtt_the stdlib should be convenient and consistent.
02:49:34renesacI also like the jemalloc experimental API style: http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html
02:49:38EXetoCthere has always been a lack of man power, but ask if you want
02:49:43renesacinstead of binary flags, optional arguments, of course
02:50:06renesacbut that would be a more radical change
02:50:39renesacand even jemalloc people aren't certain that their experimental API should be keept
02:51:27renesacof course, instead of returning int, throw an exception and return a pointer
02:51:42xtagonHow do you trap signals like SIGTERM in nimrod?
02:52:02VarriountThere's a handler setting procedure in system.nim
02:52:33xtagonVarriount, what's the proc name?
02:52:52renesacactually, that experimental api is totally compatible with current nimrod, just adding optional arguments
02:53:00xtagonVarriount, searching for "signal" or "trap" didn't bring anything up
02:53:16EXetoChook?
02:53:39EXetoCso, only for ctrl-c I guess
02:53:48VarriountSet control hook should get sigterm
02:54:20VarriountsetControlCHook
02:54:29Varriount*Looks at implementation*
02:54:46xtagonThanks. Is there no way to hook other signals? I don't need to, but now I'm curious :)
02:55:01VarriountWhy do you think I'm looking at the source?
02:55:36VarriountAnyway, the two things I think the stdlib could use the most improvement in is unicode string handling, and asyncio
02:55:40EXetoCbecause you've watched all the cat videos
02:56:12EXetoCwhat about unicode?
02:57:12VarriountEXetoC: Most of the string related procedures in nimrod are untested with unicode strings
02:57:59VarriountAlso, the manual/tutorial needs a big warning saying that the subscript operator for strings works on the width of a char type
02:57:59renesacwell, if they affect only ASCII, they are utf-8 agnostic
02:58:21EXetoCgot an example? many procs don't care what the string is
02:58:23renesacVarriount, there is a warning
02:58:58VarriountEXetoC: That's why I said "untested"
02:59:54Varriountxtagon: See this -> https://gist.github.com/Varriount/8572100
03:00:20VarriountThat's what excpt.nim (included in system.nim) does
03:01:38VarriountThere's also some private signal handlers procs in excpt.nim, so I would make sure you're not overriding anything if you want to play around with such things
03:03:19xtagonVarriount, awesome, thanks
03:03:57xtagonVarriount, do you know if nimrod traps INT or KILL on it's own for any reason, such as for the GC?
03:04:15VarriountI'm looking
03:04:26VarriountYeah, it captures both.
03:05:16VarriountDoesn't do much with them. Just prints out stack traces (if available) and handles exiting the integrated debugger if you're debuggin
03:05:19Varriount*debugging
03:06:07Varriountxtagon: Go to ./lib/system/excpt.nim, down near the bottom
03:08:02VarriountI imagine that Araq doesn't have handler registering procedures for the other signals, because after getting most of those, a program has to tread very carefully to avoid termination by the OS
03:09:55xtagonYes, but I can see why someone would want to catch KILL in order to free up resources or something
03:10:15Varriount*shrug*
03:12:00VarriountThe code doesn't look too complicated. If you want, you could probably use sigaction to retrieve nimrod's handlers, and wrap them in your own handler. Or you could modify the handling code to allow user-set hooks.
03:12:24VarriountLooks like a good mini-project to me.
03:12:41VarriountAlthough, I'm focusing on strutils and unicode.nim right now.
03:13:33xtagonHave fun with that :)
03:14:03VarriountI'm just comparing what python has built-in to strings that nimrod lacks.
03:14:03xtagonI'm fighting a virus and not in much of a coding mood
03:14:28VarriountAw. Sorry about that.
03:15:16xtagonOh, one other thing I couldn't find in the docs: How do you return an exit status code?
03:15:32xtagonI get an error if I use return in the main code
03:19:16Varriountquit()
03:20:11Varriountxtagon: http://nimrod-lang.org/system.html#407
03:20:36xtagonHeh, I was searching for "exit" when I should have searched "quit" :)
03:21:09VarriountI really do wish that chrome had a regex or peg ctrl+find feature
03:22:00*vbtt_ quit (Ping timeout: 272 seconds)
03:23:40xtagonThere's one in the Chrome web store but it has 2/5 stars...
03:24:31xtagonVarriount, ah, here is one that looks promising https://chrome.google.com/webstore/detail/regex-search/bcdabfmndggphffkchfdcekcokmbnkjl?hl=en
03:25:22VarriountOoh, thanks!
03:25:39*vbtt_ joined #nimrod
03:25:48VarriountRegex may suck for any complicated parsing, but it does get the job done for little things.
03:26:32xtagonThe main benefit of regex is that it's everywhere
03:27:27Varriountxtagon: Did you know that sublime text (and many other IDE's) user regex for highlighting and parsing languages?
03:27:32Varriount*use
03:28:22xtagonVarriount, that sounds like it would be hard for recursive grammars
03:28:22VarriountI help develop one of the two sublime text nimrod plugins. It's very.. uncomfortable.
03:29:24Varriountxtagon: It's a mixture of json and regex. You define "match rules" in regex, and then specify other things about the rules in json.
03:29:39xtagonThe other thing about regex is that it CAN be fast, but usually isn't. Have you seen this? http://swtch.com/~rsc/regexp/regexp1.html
03:31:13Varriountxtagon: Do you happen to know which algorithm PCRE uses?
03:31:53xtagonI'm not sure
03:32:39vbtt_xtagon: in practice you dont really hit the pathological case.
03:33:40xtagonNot for small scripts, but I can see why programs like grep would get a performance boost
03:33:49Varriountxtagon: Does this article link to a usefull implementation?
03:34:28LordAndrewI really need to learn how to use regular expressions.
03:34:58VarriountLordAndrew: The first thing about learning to use regular expressions is when to not use regular expressions.
03:35:37renesacgrep compiles not very complex queries to be VERY fast
03:35:45LordAndrewWould using a regular expression to validate, say, a dice roll notation be an appropriate use?
03:36:13VarriountYes. Using it, however, to parse HTML, is not.
03:36:35xtagonVarriount, I don't remember the article mentioning any specific implementation
03:37:07xtagonVarriount, check the "History/Refernces" section, there might be something there
03:37:21renesacyep, up to two regular expressions, grep uses the Boyer-Moore algorithm
03:37:55xtagonVarriount, PCRE has two different algorithms, one is Perl-compatible and one is not (for performance) but I don't know any details on the algorithms
03:38:21vbtt_how do i look at the generated c code again?
03:38:38Varriountvbtt: Look at the nimcache directory
03:38:49renesacI'm starting to read a book about string matching, but haven't got very far
03:38:58Varriountrenesac: What is it?
03:39:10LordAndrewWhat exactly is the C code in the nimcache for? Does Nimrod itself just transcompile to C?
03:39:17VarriountLordAndrew: Yes.
03:39:33vbtt_vbtt_: can't find it. i just did 'nimrod c hallo.c' and it compiled but no nimcache direction
03:39:39vbtt_s/direction/directory
03:39:43vbtt_Varriount: ^
03:39:46renesac"algorithms on strings, trees, and sequences" by Dan gusfield
03:39:52Varriountvbtt: Are you using linux or nimrod?
03:39:55Varriount*windows
03:40:06xtagonNimrod is an OS now? nice :)
03:40:08renesacVarriount.
03:40:26Varriountrenesac: Yes?
03:40:32renesacthe name of the book
03:40:36VarriountI see it.
03:40:37vbtt_Varriount: linux x64. just bootstrapped nimrod as per the github readme.
03:41:20vbtt_there is a nimcache in Nimrod (doesn't contain hallo) and there's no nimcache in Nimrod/examples
03:41:39Varriountvbtt: Did hallo compile successfully?
03:41:46vbtt_Varriount: yes
03:41:57VarriountWhere did you compile it?
03:42:40vbtt_cd Nimrod/examples ~/src/Nimrod/bin/nimrod c hallo.c
03:43:26VarriountYou tried using nimrod to compile a c file?
03:43:34vbtt_sorry. typo.
03:43:38vbtt_nimrod c hallo.nim
03:43:48vbtt_then i have the hallo executable and it works.
03:44:24VarriountWell, the C code should be somewhere in the examples/nimcache directory.
03:44:32vbtt_there is no examples/nimcache :(
03:44:44vbtt_"no such file or directory"
03:44:50xtagonvbtt, sudo updatedb && locate nimcache
03:45:06Varriountvbtt: You're starting to scare me.
03:46:01vbtt_hmm something weird going on. locate finds it but I can't cd to it.
03:46:17vbtt_ah wait
03:46:20xtagonVarriount, I looked into a bit more just now. Thompson's algorithm was patented (which explains why it's hard to find an implementation)
03:46:21vbtt_examples/examples/nimcache :)
03:46:32*Lordovos joined #nimrod
03:46:48Varriountxtagon: I will never understand why people are allowed to patent an *algorithm*
03:47:02xtagonVarriount, or a UI pattern. Good grief.
03:47:06VarriountThat's like patenting a recipe
03:47:18vbtt_yo dawg - there's an examples directory inside the examples directory
03:47:38Varriount:3
03:47:55Varriountxtagon: Any idea when the patent expires?
03:48:42VarriountOr who has to die to get the patent into public domain?
03:48:53*LordAndrew quit (Ping timeout: 272 seconds)
03:49:10xtagonVarriount, http://www.freepatentsonline.com/3568156.pdf
03:49:25Lordovosdamnit
03:49:27*Lordovos is now known as LordAndrew
03:50:06VarriountGood grief, it was patented about 47 years ago.
03:50:36VarriountOr rather, filed 47 years ago, patented 44 years ago.
03:52:13VarriountIs it still valid?
03:52:55xtagonVarriount, IIRC design patents only last 14 years
03:53:33renesac"only
03:53:34renesac"
03:53:36xtagonVarriount, I just found this library which was made by the article author https://code.google.com/p/re2/
03:53:36Varriountxtagon: Maybe we could use this algorithm to implement a native nimrod regex engine.
03:54:14VarriountOoh, and it has a BSD license.
03:54:56xtagonI don't see anywhere saying it's the same algorithm, just that it's written by the same author
03:55:55xtagonVarriount, ah, here we go: http://swtch.com/~rsc/regexp/regexp3.html
03:58:21xtagonIt's still only shaving a few microseconds of PCRE, probably not worth implementing in nimrod
04:00:53VarriountYeah. Best to follow the principle of NIH
04:02:16VarriountIt's a shame that google discontinued code search, it was a helpful service.
04:02:46xtagonYeah it was
04:03:05xtagonI wouldn't reimplement re2, but a wrapper might be cool
04:03:21*Varriount holds out c2nim
04:04:33xtagonDoes c2nim work on C++?
04:04:46VarriountI think it has limited support.
04:05:05VarriountOnly one way to find out!
04:09:36renesacbummer, if I have a function 'proc func(x: array[2, int]) = foo' I can't call it like 'func([1,2])'
04:11:23Varriountrenesac: Really? what error do you get?
04:11:44renesacok, maybe it is because it isn't doing implicit type conversion
04:11:53renesacI'm trying to fix here
04:13:17xtagonrenesac, it works for me if I specify the proc's return type
04:14:17renesacok, it was my fault
04:14:53renesacwasn't supplying the right number type inside the array
04:15:17LordAndrewBleh, I am way too paranoid about software licenses.
04:15:50renesacthe first thing I saw in the error message was 'got (Array constructor[' instead of 'array['
04:16:20renesacso I wrongly assumed a nimrod limitation :/
04:18:20Varriountrenesac: How do you mean? What was the correct code?
04:18:51renesacthe function was asking a array of floats, and I gave it an array of ints
04:19:06renesacjust putting .0 on the numbers solved the issue
04:19:17vbtt_is there a quick way to call new(TMyObject) and initialize it with values at the same time?
04:19:35*ddl_smurf joined #nimrod
04:19:41Varriountvbtt: define 'quick'
04:20:11VarriountI'm assuming that TMyObject is a ref
04:20:31vbtt_Varriount: easy. instaead of var x = new(TMyObject); x.foo = 1; x.bar=2;..
04:20:40renesacvar obj = TMyObject(x: bla) ?
04:20:50vbtt_if I don't use new, I can do var x = TMyObject(foo: 1, bar: 2)
04:21:05Varriountvbtt: Then don't use new.
04:21:48vbtt_Varriount: but then I make a TMyObject instead of a ref TMyObject, no?
04:21:56vbtt_is it still created on the heap?
04:22:22renesactype RTmyobject = ref Tmyobject
04:22:36renesacvar obj = RTMyObject(x: bla)
04:22:50renesacI haven't tried, but I guess it works
04:23:22renesac(I think the standard is to use a P instead of a R)
04:23:39renesac(not sure)
04:23:51VarriountActually, the standard is to not use type prefixes, although personally, I like them.
04:24:20renesacwell, w/o case sensitivity, type prefixes help separate types from values
04:24:47VarriountWhich is what I said to Araq, and he just grumbled that too many people complained about the prefixes.
04:25:06VarriountIt also helps to seperate types and values from procedures.
04:25:08renesacthe first time I saw the language I thought they were very ugly, but I'm growing to like them
04:25:16vbtt_yeah I dont like type prefixes. did you say the nimrod standar is to *not* use them?
04:25:21renesacgiven the style insensitivity
04:25:29Varriountvbtt: Yes.. sorta
04:26:53xtagonBut all the standard libraries use them
04:27:30Varriountxtagon: Araq means to change the names in the future
04:27:52vbtt_interesting.
04:27:58xtagonGood to know
04:28:03VarriountIt's too bad we don't have a larger community to draw upon, to get a general consensus.
04:28:30renesacthe forum don't have pooling functionality right?
04:28:36xtagonIf the prefix isn't going to be standard, then I say there should be at least first-character case sensitivity
04:28:50xtagonso that "version" can be a variable and "Version" can be a type
04:29:22renesacmy vote would be: either keep the style insensitivity AND type prefixes or have full/partial style sensitiviy by default and remove the prefixes
04:29:38xtagonrenesac, I agree
04:30:51LordAndrewStyle insensitivity?
04:31:07xtagons/style/case
04:31:13renesacDS_f_D == dffd
04:31:17renesac*dsfd
04:31:38renesacenglobing case and _ insensitivity
04:31:48renesacbut the main issue here is indeed the case of the first letter
04:32:02LordAndrewerr
04:32:13renesacthat is useful for OO style programing
04:32:15VarriountI bequeth to you all these three links: https://github.com/Araq/Nimrod/blob/devel/doc/apis.txt , http://forum.nimrod-lang.org/t/191/3 ,
04:32:26VarriountThird one coming up as soon as I can find it
04:33:17LordAndrewvar my_var == myVar?
04:33:27VarriountLordAndrew: Yes
04:33:38VarriountCurrently, though possibly not in the future
04:33:41LordAndrewwhy would that be a thing
04:34:22VarriountLordAndrew: So that everyone can have their own style for their own projects
04:34:33LordAndrewDoes this extend to say:
04:34:36LordAndrewvar t = "whatever"
04:34:37LordAndrewecho(T)
04:35:16VarriountYes.
04:35:39VarriountAgain, there are currently options for nimrod's compiler regarding case-sensitivity
04:35:40renesacbut consistency is encouraged
04:35:46Varriountrenesac: Yes
04:36:02xtagonVarriount, I just found another implementation: https://github.com/laurikari/tre/
04:36:11xtagonVarriount, this one is in C
04:36:31VarriountOoh, much easier to wrap than C++
04:37:26VarriountDId I tell you guys about a mailing post on the cairo (2d graphics library) mailing list involving someone working for one of the standards groups?
04:37:57xtagonVarriount, do tell
04:38:03LordAndrewHow does Nimrod's compiler create executables based on the code we compile?
04:38:24VarriountHe said that cairo would be a perfect model for the standard.. except that the standard should have a C++ object oriented interface
04:39:31VarriountLordAndrew: The "Nimrod Compiler" is actually a transpiler. It translates nimrod code into C (or C++, or objective C, or javascript) and then tells the local compiler to compile those generated files into a binary.
04:40:27xtagonWhoa, I did not know C++ and Objective C were supported too
04:40:49xtagonAre you saying we could compile native apps for iOS/Android?
04:40:52VarriountWell, those backends are not quite as stable as the C backend, or so I've been lead to believe.
04:41:13vbtt_there's also js :)
04:41:25LordAndrewI see. But since the default local compiler is GCC, wouldn't the binaries depend on libgcc and glibc?
04:41:54VarriountLordAndrew: Yes, if the compiler is configured that way.
04:42:08VarriountYou can pass arguments to the backend compiler if need be.
04:42:30Varriountxtagon: Yes, theoretically.
04:44:01xtagonThat's awesome
04:44:43VarriountI think there's an example that's supposed to work on android. I don't know if it's still functional though.
04:46:21xtagonI'm guessing it has to be wrapped in something Java-like anyway, though
04:46:27Varriountxtagon: Look at the cross_calculator example.
04:47:50xtagonVarriount, cool
04:48:03LordAndrewVarriount: I see. I ask because I try to avoid accidentally using GPL licensed stuff that would in turn make my code and/or executables GPL. I'm probably worrying far too much about it though.
04:48:25VarriountLordAndrew: You're worrying far too much about such things.
04:50:43xtagonLordAndrew, libc is LGPL which lets you link it in proprietary code (in contrast to GPL)
04:52:09VarriountHeh, your worrying reminds me of the time I called atlassian ( the company behind bitbucket) in order to get my code removed from a repository.
04:52:52LordAndrewI'm totally fine with open sourcing my stuff but I prefer the MIT/BSD licenses (and not having the GPL forced upon me over hidden goblins I didn't see coming).
04:52:52xtagonVarriount, from your repository or someone elses?
04:53:07VarriountI had written a modification tracker for a minecraft server written in python, and I had placed a very specific license in it that specified that I was to be given credit
04:53:17Varriount(minecraft classic)
04:53:52VarriountThe head of the dev team for that particular piece of server software took my code and incorperated it into his server, and called it his own.
04:54:05vbtt_can nimrod pragmas be used to tag the license onto modules and then programmers can compile with 'no-gpl' if they want?
04:54:06VarriountSince I was also on the dev team, I saw this.
04:54:15Varriountvbtt: Theoretically.
04:54:31vbtt_that would be nice
04:55:19VarriountWhen the lead dev wouldn't confess to what he had done, I found atlassian's phone number, and called them up one day. The person who answered the phone must have been surprised to hear a 15 year asking that a repository owner be given a warning
04:55:38Varriountfor violating a software license.
04:56:17VarriountAlthough he took me seriously, he explained that I had to have proof, and that without proof, they couldn't / wouldn't do much
04:56:37xtagonWhat constitute's proof? Git logs?
04:57:09VarriountAnd/or an email sent with an attachment to yourself. That way you have time logs stored by a third party
04:57:16Varriount*That, and/or
04:57:31VarriountAnd we were using svn at the time.
04:57:58xtagonI wonder if that would be a useful software-as-a-service.
04:58:09VarriountIn the end, I actually got my code removed without resorting to such drastic action.
04:58:38VarriountBy getting the rest of the team to gang up on the leader (He was younger than I, and a lot more pig-headed)
05:00:51VarriountIt's kinda laughable when I think about it. The modification tracker I wrote wasn't very well written, not always tracking modifications in the correct order, causing the server to freeze when loading from the sqlite database...
05:01:31VarriountBut I was quite proud of it at the time. It was one of my first pieces of somewhat complex code.
05:01:37LordAndrewHmm. Dependency Walker only show that my executables link Kernel32.dll and MSVRCT.dll.
05:02:21VarriountLordAndrew: Well yeah. Those are both essential libraries.
05:09:49Varriountxtagon: Are you able to compile that tre regex lib you linked?
05:10:08xtagonVarriount, I didn't try
05:10:17xtagonVarriount, it's on my todo list (which is long...)
05:10:45VarriountOdd. the configure command isn't showing in my mingw shell
05:11:54*filwit quit (Quit: Leaving)
05:12:12xtagonVarriount, you have to use autoconf on configure.ac to produce a configure script (although I'm not familiar with how)
05:12:40VarriountThere's a configure.ac file, I don't know how to process it though.
05:12:45xtagonVarriount, I just say https://github.com/laurikari/tre/blob/master/configure.ac#L1
05:12:48xtagonsaw*
05:13:12VarriountI'm not terribly experience on the intricacies of linux build systems.
05:13:27xtagonVarriount, try just running "autoconf" in that directory with no arguments
05:13:57VarriountApparently I don't have autoconf
05:14:04xtagonVarriount, what distro?
05:14:09VarriountWindows.
05:14:24xtagonOh right, you mentioned Mingw
05:14:30VarriountI have msys installed. I could have sworn that I installed autotools as well.
05:15:55*brson quit (Ping timeout: 272 seconds)
05:21:24Varriountxtagon: I've tried linux, I just can't kick the habit of using windows. I'm used to it.
05:22:59xtagonVarriount, nothing wrong with that. I use both regularly.
05:23:44VarriountAlthough, I do seem to find a constant between the two : No matter what OS I use, building things with autotools and the like will always be a pain for me.
05:24:01xtagonI hear you on that one
05:24:29VarriountWhich is why I like nimrod. No more do I have to endure the masochistic build systems!
05:25:32Varriountxtagon: Have you ever managed to get GTK compiled as a 64 bit library/dll on windows?
05:25:41xtagonI use Windows for two reasons: 1. my job involves Windows-specific software, 2. there is better audio production software on Windows
05:25:51xtagonVarriount, no, that sounds like "fun"
05:26:30Varriountxtagon: Did you know, not only are the instructions on the GTK website nicely non-specific, GTK has circular dependancies.
05:26:50xtagonVarriount, my most recent "adventure" was getting LLVM compiled on 64-bit windows. It was fairly easy (in comparison to other things) and still drove me mad
05:27:10Varriountxtagon: I tried that. Never managed to be successful though.
05:27:29VarriountI can get 32 bit things compiled, 64 bit is another matter.
05:27:39xtagonVarriount, I was trying to get Crystal (another in-development lang) to compile on Windows. I didn't get far.
05:28:00VarriountHopefully nimrod is far superior.
05:28:05xtagonIt is
05:30:17renesacquestion: can I define a new implicit conversion?
05:30:29Varriountrenesac: Yes. See: Converters
05:30:49renesacoh, cool
05:31:09VarriountThey're a bit limited, in the fact that they operate on a global level.
05:31:34VarriountIt would be nice to be able to apply them to only certain procedure scopes, but w/e
05:32:09renesacright, but they will only change the output where the compiler would give an type mismatch error anyway, right?
05:32:17VarriountYeah
05:32:29renesacthen it is ok for my usage now
05:35:41LordAndrewHuh, so it does look like the executables staticly link libgcc_s_dw2-1.dll internally.
05:37:21*brson joined #nimrod
05:39:22VarriountRats. The tre regex library has only been built under windows using visual studio
05:41:23xtagonBummer.
05:41:50VarriountIt's not too bad. I have the SDK downloaded. I just need to remember how to invoke MSBuild correctly.
05:43:07VarriountFew people realize that you can download the compiler behind visual studio, without Visual Studio itself (and all the crud that comes with it)
05:43:34LordAndrewYou can?
05:43:39VarriountYep
05:43:54VarriountYou just install the windows sdk downloads.
05:46:13*delian66 quit (Ping timeout: 248 seconds)
05:48:13*brson quit (Ping timeout: 272 seconds)
05:54:44*brson joined #nimrod
05:56:02Varriountxtagon: If you manage to build that library as a 64 bit, please tell me. MSBuild complains that I don't have the right Toolset, and after that, complains that I'm trying to build a 32 bit library on a 64 bit platform.
05:56:10VarriountI have to get to bed.
05:56:58xtagonVarriount, I'll let you know. I was only planning on building on Linux though
06:02:27*LordAndrew quit (Quit: Out.)
06:05:13*xtagon quit (Ping timeout: 252 seconds)
06:38:09vbtt_having both variants and inheritance is a bit confusing imo.
06:40:32vbtt_really variants can be modelled by abstract base types so not sure what the two ways of expression get us.
06:40:39vbtt_this should be in the faq.
07:05:17*aruniiird joined #nimrod
07:32:20*bbodi joined #nimrod
07:34:54vbtt_hm, how do i search github issues?
07:36:23vbtt_so I can't use typeclasses to parameterize other types? e.g. seq[MyTypeClass]
07:36:30vbtt_zahary^
07:47:56bbodiI think it siuld work. what is the full code and the error?
07:55:57vbtt_bbodi: Error: internal error: GetUniqueType
08:00:44bbodihttps://github.com/Araq/Nimrod/search?q=GetUniqueType&ref=cmdform&type=Issues there are some issues about it
08:06:18vbtt_bbodi: thanks.
08:06:25vbtt_none of them are related to typeclasses though.
08:13:25*bbodi quit (Ping timeout: 248 seconds)
08:14:41*bbodi joined #nimrod
08:31:15*aruniiird quit (Ping timeout: 272 seconds)
08:32:33*odc joined #nimrod
08:34:02*odc left #nimrod (#nimrod)
08:57:08*brson quit (Quit: leaving)
08:57:55*betawaffle quit (Ping timeout: 245 seconds)
09:05:10*olahol_ left #nimrod (#nimrod)
09:16:37*darkf_ joined #nimrod
09:19:33*darkf quit (Disconnected by services)
09:19:34*darkf_ is now known as darkf
09:22:54*aruniiird joined #nimrod
09:37:01*CarpNet joined #nimrod
09:54:56vbtt_a bunch of basic type class functionaly seems broken. e.g. 'is' doesn't really test anything.
10:11:00*nueva joined #nimrod
10:18:02bbodiI got compilation errors related to C sources. But yesterday everything worked fine, and didn't occur any modifications since it. I think the problem is that nimrod doesn't use the gcc that was packaged with it.
10:26:10*bbodi quit ()
10:32:18*bbodi joined #nimrod
10:42:19vbtt_hello
10:43:06bbodihi
10:43:21vbtt_http://vocalbit.com/posts/exploring-type-classes-in-nimrod.html
10:46:29bbodiit seems cool!
10:56:18*vbtt_ quit (Quit: Page closed)
11:27:08NimBotAraq/Nimrod devel cfa31d1 Araq [+16 ±12 -15]: next steps for closure iterators
11:27:08NimBotAraq/Nimrod devel 25f1426 Araq [+0 ±2 -0]: closure iterators almost work
11:27:08NimBotAraq/Nimrod devel 513f5ed Araq [+0 ±4 -0]: closure iterators work
11:27:08NimBotAraq/Nimrod devel fc8fa0d Araq [+0 ±3 -0]: small code cleanups
11:27:08NimBot1 more commits.
11:27:43AraqVarriount: closure iterators are now complete afaict
11:28:06Araqand with that I'm entering bugfixing mode ;-)
11:28:14bbodiHi Araq!
11:28:21Araqhi bbodi
11:29:32Araqbbl
11:37:28bbodiI can't compile my sources since yesterday
11:37:51bbodiI get error from the GCC
11:37:53bbodilike
11:37:54bbodic:\projects2\whitestageditor\nimcache\nimrod_system.c:11597:25: error: dereferencing pointer to incomplete
11:37:54bboditype
11:37:54bbodi for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
12:01:15bbodiI think I found some huge bug
12:01:50Araqbbodi: will look at it tonirght
12:01:53Araq*tonight
12:02:34bbodiok, I try to reproduce it in a simple way, then I will create an isse for that
12:05:31*easy_muffin joined #nimrod
12:09:16nuevalooks like type classes syntax could be used also as some kind of unit tests for type
12:10:01nuevai mean, it's already working in this role
12:11:49bbodihttps://github.com/Araq/Nimrod/issues/836
12:29:51Araqbbodi: that is not supposed to work, @[] has a gerneric seq type
12:30:14Araqit doesn't perform that form of type inference that you're after there
12:30:31Araqtype the @[] and it should work
12:30:39Araqand yes, the compiler should complain about it
12:34:43*aruniiird quit (Ping timeout: 260 seconds)
12:41:48bbodiYes, some compiling error messages could save a lot of time for the developers, thanks
12:43:58*Mordecai joined #nimrod
12:45:25*psquid quit (Ping timeout: 248 seconds)
12:48:55EXetoCsure. if the error comes from a C compiler then it's a bug
13:13:29*easy_muffin quit (Ping timeout: 252 seconds)
13:18:58*BitPuffin joined #nimrod
13:19:14BitPuffinping Araq
13:36:13EXetoClots of issues resolved
13:36:48*darkf quit (Quit: Leaving)
13:36:49EXetoCBitPuffin: including this https://github.com/Araq/Nimrod/issues/517
13:37:58EXetoCdid you work around it?
13:48:57renesacthe math.mean function requires an openarray, so that means I can't call it with slices?
13:49:50renesacnevermind
13:49:54BitPuffinEXetoC: don't remember lol
13:50:10BitPuffinMy mind is not very organized atm
14:33:09Varriountvbtt: Just saw you blog post. Nice!
14:36:03bbodican I invoke a method of the super type?
14:36:19*Mordecai is now known as psquid
14:38:10Araqbbodi: no, you have to make the method a proc of some unique name to invoke it, there is a feature request for foo(Base(x)) to resolve 'foo' statically but I don't think that's a good idea
14:38:50bbodiAraq: ok, thanks
14:39:12Araqhi BitPuffin
14:39:28BitPuffinhey Araq. Sorry I got home a bit too late yesterday in order to deal with it
14:39:32Araqbbodi: if you have a good idea how to do this, I'm all ears
14:39:48BitPuffinI'll be home much earlier today though so I'll give it a shot then :) will you be in here later?
14:40:11*faassen joined #nimrod
14:40:18*dirkk0 joined #nimrod
14:41:00AraqBitPuffin: what shot?
14:41:20BitPuffinAraq: the error I came across yesterday
14:41:26BitPuffinyou told me to fix something in ropes
14:42:22Araqmeh, I can do it later too
14:42:40AraqI'm doing a feature freeze for 0.9.4 now anyway
14:42:43*dirkk_ joined #nimrod
14:42:55Araqso, I have some time to fix bugs
14:45:33*dirkk0 quit (Ping timeout: 245 seconds)
14:49:00*dirkk__ joined #nimrod
14:50:20BitPuffinAraq: ah neat!
14:50:43AraqBitPuffin: means no improvements to the concurrency model though :P
14:50:47BitPuffinAraq: guess updated concurrency and vm is the main things on the roadmap for 0.9.6 ?
14:51:04Araqvm is in 0.9.4
14:51:10BitPuffinoh?
14:51:13BitPuffincompletely done?
14:51:15*dirkk_ quit (Ping timeout: 245 seconds)
14:51:18BitPuffinwell you know what I mean
14:51:23Araqwell "completely"
14:51:25Araqyes
14:51:32BitPuffinsoftware is never completely done
14:51:47BitPuffinwell that's nice
14:52:05BitPuffinWe desperately need 0.9.4 to release so no complaints here honestly :)
14:53:06Araqwell fixing the most important bugs will take 2 weeks
14:53:14Araqthat's my estimate
14:53:57Araqbased on my feelings :P
14:54:43BitPuffin#emonimrod
14:54:51BitPuffincoding with feelings
14:58:58Araqbbl
14:59:19nueva#entomonimrod: dissecting bugs with feelings
14:59:42*AndChat|206976 joined #nimrod
15:03:43AndChat|206976Varriount: thanks. Any feedback on the blog post?
15:04:06BitPuffinwhat blog post
15:04:17*AndChat|206976 is now known as vbtt_
15:05:54vbtt_http://vocalbit.com/posts/exploring-type-classes-in-nimrod.html
15:06:01vbtt_Bbl
15:07:21BitPuffinvbtt_: cool! will definitely read it later!
15:11:45*dirkk0 joined #nimrod
15:12:55*dirkk__ quit (Ping timeout: 252 seconds)
15:14:11renesachttps://gist.github.com/ReneSac/95c224ab5aab29529315 <-- how do I properly initialize a TRunningStat?
15:14:36renesacI must explicitly zero all fields
15:14:39renesac?
15:20:26BitPuffinlol
15:23:03BitPuffinthat doesn't look right
15:23:34BitPuffinrenesac: is the result the same each time?
15:24:22renesacactually yes
15:24:32renesacbut it is probably because unitialized memory
15:24:46renesacoh, it is not
15:25:00renesac(big numbers all look the same)
15:25:09BitPuffinrenesac: yeah floats seem too have issues initializing to 0
15:25:14BitPuffinat least completely 0
15:25:20BitPuffinit's usually something very close to 0
15:25:21renesacacc.n is an int
15:25:47BitPuffinyup
15:26:03BitPuffinoh right yeah wtf
15:29:37vbtt_Can anyone give feedback on correctness of the blog post?
15:29:40vbtt_http://vocalbit.com/posts/exploring-type-classes-in-nimrod.html
15:30:01discolodatype classes look usefull
15:31:12discolodai cant tell you how accurate the post is, but i think its written well
15:33:16vbtt_Thanks discoloda
15:35:51*[1]Endy joined #nimrod
15:38:55*dirkk_ joined #nimrod
15:39:13EXetoCBitPuffin: that bug wasn't reported?
15:39:47*dirkk0 quit (Read error: Connection reset by peer)
15:42:53BitPuffinEXetoC: which bug
15:44:20*Varriount|Mobile joined #nimrod
15:45:20Varriount|MobileSo, my email got assaulted this morning by quite a few GitHub notifications
15:45:46BitPuffinlol
15:45:48BitPuffin:D
15:47:05EXetoCBitPuffin: the float init bug
16:07:37*Varriount|Mobile quit (Remote host closed the connection)
16:11:47*bbodi_ joined #nimrod
16:15:23*[2]Endy joined #nimrod
16:18:23*[1]Endy quit (Ping timeout: 272 seconds)
16:22:27BitPuffinEXetoC: The way I worked around it was to just loop through my vector or matrix or wtf it was and initialize it to 0
16:22:30BitPuffinwasted cpu cycles ftw
16:22:33BitPuffinbut it's ze workaround
16:26:15vbtt_System.reset
16:26:35EXetoCso no
16:27:07EXetoCvbtt_: yes?
16:27:39renesacshould I open a bug on my issue with TRunningStat?
16:29:44EXetoCBitPuffin: noInit first then?
16:29:44*wan quit (Quit: leaving)
16:32:11EXetoCvbtt_: nvm
16:32:36EXetoCI accidentaly called system.reset instead of the proc I had define. it's very hard to figure out what's going on in that case
16:36:56*LordAndrew joined #nimrod
16:37:15*BitPuffin quit (Ping timeout: 252 seconds)
16:39:57*XAMPP quit (Ping timeout: 265 seconds)
16:41:12*ddl_smurf quit (Quit: ddl_smurf)
16:42:40*ddl_smurf joined #nimrod
16:43:10*ddl_smurf quit (Client Quit)
17:08:43*dirkk_ quit (Quit: This computer has gone to sleep)
17:17:01*BitPuffin joined #nimrod
17:36:50*io2 joined #nimrod
17:48:45*vbtt_ quit (Ping timeout: 252 seconds)
17:48:46Araqrenesac: the compiler intializes everything to binary 0 for you ...
17:49:39renesacthen "n" should have been initialized too...
17:50:01VarriountAraq, zahary, dom96 : I'm going through issues older than one month, and testing any examples I find to see if they still exist. I've commented on the ones that I think should be closed.
17:52:39AraqVarriount: excellent, but do you test with devel or master?
17:52:51Varriountdevel
17:52:57Araqok
17:53:45Araqnot sure if thats correct but merge with master is not far away anyway *cough*
17:58:53*xtagon joined #nimrod
17:59:20nuevaAraq: 'nimrod --path:/tmp/example c a' doesn't found given module, though '/tmp/example/a.nim' certainly exists. bug?
18:01:23*BitPuffin quit (Ping timeout: 245 seconds)
18:01:26Araq--path is for imports
18:01:43Araqnot if you're too lazy to give your main file properly
18:07:50*CarpNet quit (Quit: Leaving)
18:11:38*brson joined #nimrod
18:13:34renesacAraq: using values passed as parameters is faster than using module-global values? When used in a tight loop, for example.
18:15:16Araqrenesac: usually, yes
18:15:41renesacwhat I do if this value is a state that the caller should not care about?
18:15:56renesacmake a block inside the module to declare it and the function?
18:16:34Araqthen the function is in the block too and can't be exported
18:16:45renesacoh
18:16:49Araquse a .global variable instead, which is quite like C's static
18:16:59renesachumm
18:17:07renesacI forgot this pragma
18:17:31renesacthanks
18:18:42renesacwhy did you name it "global" and not "static"? (I know, "global like lifetime", but it is a bit confusing ^^')
18:19:40*vbtt_ joined #nimrod
18:24:03NimBotAraq/Nimrod devel 179bfad Araq [+0 ±2 -0]: typeClasses now documented in grammar.txt
18:24:03NimBotAraq/Nimrod devel 581d138 Araq [+0 ±1 -0]: renderer knows about nkStaticTy and nkTypeClassTy
18:24:53Araqvbtt_: many thanks for your blog post, will read it tonight
18:25:24NimBotAraq/Nimrod master b4645a0 Araq [+0 ±1 -0]: master compiler compiles with devel
18:26:15vbtt_Araq: sure thing.
18:26:45vbtt_I'll probably continue doing minor tweaks to the post.
18:27:10vbtt_ I've wanted something like nimrod's type classes and haven't seen it in another language. I wrote about it because I like the overall design.
18:27:15Araqrenesac: "static" now means "at compile time"
18:27:21*io2 quit (Remote host closed the connection)
18:27:22vbtt_I'll try to do more posts over time.
18:27:27*DAddYE joined #nimrod
18:27:31Araqhi DAddYE
18:27:44DAddYEHi Araq!!!!!! How are you!?
18:28:15renesacAraq: right, I thought it was "const" for compile time stuff
18:28:16Araqdunno, I never sleep more than 5 hours
18:28:33DAddYEAraq: kids or work?
18:28:36Araqrenesac: we have "const", "static" and ".compileTime", ... it's a bit of a mess
18:28:46AraqDAddYE: kids...
18:29:07DAddYEheheheh
18:29:16vbtt_Araq: plural? I thought your only kid was nimrod?
18:29:50Araqvbtt_: no I have also a real life
18:30:17vbtt_Araq: excellent!
18:30:37AraqI guess ...
18:31:11*aftershave quit (Quit: Textual IRC Client: www.textualapp.com)
18:31:39vbtt_I'm always amazed by how much nimrod has, in terms of features *and* stdlib (very important) given that it's a hobby project.
18:31:40Araqrenesac: in fact, I don't think .global has been designed. It grew into existance
18:31:46*aftershave joined #nimrod
18:32:55Araqrenesac: 'sfGlobal' was a flag to mark global variables in the compiler, the step to .global was obvious then for a compiler writer
18:33:08renesachum
18:33:32Araqlater we discovered it's incredibly useful for metaprogramming
18:33:51vbtt_hmm I think I used master ti test type class features. perhaps thats why they didn't all work complete.
18:35:00*vbtt_ quit (Quit: Page closed)
18:35:07nuevawtf? 'nimrod c random/a.nim' puts cached file as 'nimcache/random_a.cpp', but 'nimrod c src/a.nim' puts cached file as 'nimcache/parent_a.cpp', where 'parent' is a name of parent dir of 'src'
18:35:19*vbtt_ joined #nimrod
18:35:28Araqnueva: that's the feature I was talking about
18:35:39Araqthe compiler guesses the package name
18:35:52Araqas we have no notion of a package in the language
18:36:45AraqIMHO it should be documented how the algorithm works and then it's perfectly fine, in your opinion it's a feature from hell, I guess
18:37:38*io2 joined #nimrod
18:40:44reactormonkAraq, could we change that name generation? Or somehow control it?
18:41:23Araqwhy?
18:41:30nuevabut why to do it for main module? so if i have my example project in '/home/user/Projects/ExampleProject/src/main.nim', but then move it to 'home/user/Projects/CoolProject/src/main.nim'. it will regenrerate *_main.cpp?
18:42:04nueva"Main module" is what I pass to compiler to build whole project
18:43:13Araqnueva: the use case was that every babel package has such nice module names as "utils" or "types" and so we need a way to distinguish modules of the same name
18:44:54Araqso yeah, it recompiles when you rename your project dir. wooohoo big deal
18:45:26Araqhappens like once in a year so I already spent more time talking about it
18:48:43reactormonkAraq, does the compiler do that for everything or just the included libs?
18:49:14Araqfor every module you use
18:49:18nuevaare there so many babel packages with different intenral hierarchy?
18:49:47nuevai've found list of ecxceptions. "lib", "src", "source", "package", "pckg", "library", "private"
18:49:56Araqyup
18:50:39nuevaso, if package writer will use something different for his internal directory name it will be his fault?
18:51:13AraqI can't follow you, sorry
18:51:37AraqpackageA/src/utils.nim is common and should become packageA_utils
18:51:53Araqnot src_utils as that wouldn't avoid collisions
18:52:26nuevaAraq: it will not only recompile, it will leave unexpected garbage. it also makes reasoning about generator a bit harder.
18:53:04vbtt_really the top level package direcotry should be tagged. e.g. package.nimpkg/srcl/blah/whatever
18:53:22nuevapackageA/myprivatedir/utils.nim and packageB/myprivatedir/utils.nim
18:53:34vbtt_then it's unabiguous what the package name is.
18:54:21nuevawho should then change his 'privatedir' packager A or packager B?
18:54:59reactormonknueva, so you want the compiler to be aware of packages?
18:55:04vbtt_and yeah, special directories should not be ignore (if you want you can create src/mypackage.nimpkg/x.nim)
18:55:09nuevaok, it's not my question really. my question was: should packagers just use 'src' by convention as a name of private package dir?
18:55:09zaharyvbtt: there is a minor error in one of your examples
18:55:22zaharyfor item in f:
18:55:22zahary line is String
18:55:22zaharyyou meant to say "for line in f"
18:55:29vbtt_zahary: thanks for reviewing!
18:55:34vbtt_ah right - that's the one I didn't compile :)
18:55:59vbtt_zahary: feedback on accuracy also appreciated. also, did I miss anything important?
18:56:09zaharyyou may also mention that you could even write param types such as seq[FileLike] and Nimrod will just do the right thing
18:56:25*vbtt quit (Quit: Page closed)
18:57:18vbtt_zahary: yeah I tried that and didn't get it work. perhaps I should use devel and not master? I also found minor issues with 'is' testing in type classes.
18:57:55zaharyhmm, I think this one should work already, but I might be wrong
18:57:55nuevareactormonk: I'd like to shorten this list of exceptions to just '__some_ugly_rare_name_rer34234d' and make a rule for packages to use this name only (not 'src' or something). because this list couldn't be infinite
18:58:23Araqnueva: well the convention is indeed a "private" directory
18:59:21vbtt_zahary: the compiler reported Error: internal error: GetUniqueType. when I used it as a parameter to seq[MyTypeClass]. trivial example reproduces it.
19:00:45zaharyalright, I'll work on that soon
19:01:12reactormonknueva, I suggest make a forum post and/or a github issue for that and state your point in full
19:01:16nuevaAraq: still there is a list of conventions used by compiler. I suppose it's for legacy packages?
19:03:19Araqnueva: actually it's to allow for more flexibility but legacy is a reason too of course
19:03:30Araqas I said, I think we should document this list and then it's fine
19:03:38*Mordecai joined #nimrod
19:04:02Araqbut I'm open for suggestions
19:04:14Araqit's not too late to change it again
19:04:33vbtt_zahary: also a simple 'is' test didn't work. i.e. `f(x) is Int` in the typeclass. and then define f(x:MyType): Bool. but `MyType is MyTypeClass` still returns true.
19:04:43*psquid quit (Ping timeout: 245 seconds)
19:04:58AraqI guess I'm too blame for the 'is' bugs
19:05:12vbtt_Araq: what do you think of my suggestion? only .nim files and sub-folders in a top level package directory that has an .npk extension.
19:05:21vbtt_every folder is part of the package.
19:05:37vbtt_i.e. no specially ignored cases (src or whatver).
19:05:48Araqvbtt_: so essentially we go up the tree until we find a .babel file?
19:06:11vbtt_that might work too.
19:06:29vbtt_Araq: I was suggestion you call the folder mysqllib.npk
19:06:37vbtt_or collections.npk
19:06:45vbtt_within that the folders dont have extensions.
19:07:00vbtt_yes you go up till you know you've found the top level folder for that package.
19:07:06nuevaAraq: shorten list to just "private". and maybe to not so obvious name ("__private__"?)
19:07:11Araqfolders shouldn't have extensions, that's uncommon
19:07:19vbtt_easy to find from the outside too (unike python where I have to see if it contains __init__
19:07:30vbtt_Araq: ok then just a special file in the top level folder is fine.
19:08:02vbtt_Araq: btw, it may be uncommon but i think it's a great idea :) and cross platform too.
19:08:51vbtt_my basic proposal is get rid of ignored special cases. and have an easy way to locate a source file, given an import statement.
19:08:53reactormonkvbtt_, .app ?
19:09:15vbtt_reactormonk: true! not that uncommon, haha.
19:10:20vbtt_i think organizational only directories like 'src' should be outside your package source top level folder, not inside.
19:12:37Araqvbtt_: just to be clear packageA/src/packA/module.nim produces packA_module, no need to adhere to any convention, it simply works unless you dream up unrealistic example names like "foo"
19:13:58Araqand what do we do with the stdlib? that has no .babel file, though perhaps it could fake one
19:14:16nuevabtw, babel path outside of project directory by default isn't nice. it's better to follow Node.js (npm), Python (virtualenv, pip), Haskell (cabal sandbox). but I guess, it was already discussed before making a desicion...
19:14:21vbtt_Araq: yeah, .babel or whatever special file should be in *every* top level pkg. including stdlib.
19:14:27reactormonkAraq, just hardcode it to `stdlib`
19:15:10vbtt_Araq: how does nimrod know where to search for nim files?
19:15:24reactormonkvbtt_, config/nimrod.cfg
19:15:26Araqvbtt_: via --path and --babelPath
19:16:36Araqnueva: again, what do you mean? "outside of project dir"?
19:17:54vbtt_Araq: i'm proposing that given '--path A,B,C' is given, nimrod do only a one-level DFS for folders under A or B or C that contain the special .babel file.
19:18:18vbtt_no complicated search for nim files and magic package names.
19:19:03vbtt_s/is given//
19:19:57Araqnah, I leave everything as it is
19:20:20Araqit works quite well afaict
19:20:32Araqand it's telling I got not a single bug report about it
19:20:41nuevaAraq: I mean, "config/nimrod.cfg(37, 2) Hint: added path: '/home/user/.babel/pkgs/'" by default, while it could be '/home/Projects/CoolProject/.babel/pkgs'
19:20:45reactormonkAraq, maybe no one is using it ^^
19:21:06Araqreactormonk: why do we get so many other bug reports then? :P
19:21:49*Mordecai is now known as psquid
19:21:51reactormonkright, I still need to create something like repr in JS
19:21:58vbtt_Araq: you'll get more colissions as the community grows.
19:22:07*EXetoC quit (Ping timeout: 260 seconds)
19:22:47reactormonkAraq, does the compiler recognize collisions?
19:22:55vbtt_does nimrod have a locate command? `nimrod locate foopkg`
19:23:04nuevaAraq: bug report about what? about directory exceptions used for generated file naming? about flat scheme of naming of generated files?
19:23:10vbtt_in the current state of affairs, the locate command would be much appreciated.
19:23:26reactormonkvbtt_, I think idetools --def might help a bit
19:25:14VarriountAraq: For testing purposes, either we should close issues that are fixed on devel, or at least make a note that the issues are fixed on devel, and close them when devel next merges into master
19:25:16vbtt_fwiw, this could be fixed down the line too.
19:25:20KoodaIs the devel branch expected to build right now?
19:25:33VarriountKooda: Yes.
19:25:36vbtt_ppl will just have to move their files around to match their exported hierarchy.
19:25:44VarriountAlso, nice to see you again kooda
19:26:01KoodaI saw your comment on my PR, I want to test it :)
19:26:16KoodaDo I need to use koch to build devel too?
19:27:22VarriountKooda: Of course.
19:27:43KoodaHm, so I might have a problem.
19:27:53Koodalib/pure/os.nim(1589, 22) Error: undeclared identifier: 'ParamStr'
19:28:15VarriountKooda: Your not mergin devel into master on your local repo, are you?
19:28:31Varriount*merging
19:28:34nuevaI guess, no one is using Nimrod with an external build system. but if Nimrod declares interoperability with C/C++/JS on source level, somebody will use it with external build system (like Grunt for JS or Cmake for C++)
19:28:59KoodaVarriount: hm… not if I didn’t mess up with my repo
19:29:26VarriountKooda: It should build. I built nimrod using the devel repo this morning.
19:29:38nuevaas all (except me) are using Nimrad as a build system, there are no bug reports about file names and stuff
19:29:45nueva*Nimrod, sorry
19:29:56vbtt_btw, where does the build farm run? what tool does it use? and can I add a builder?
19:30:14vbtt_iow, I didn't find an about page on build.nimrod...
19:30:20Varriountvbtt_: The build farm is run by different people, using nimbuild (search on github)
19:30:31VarriountI run the Win32 and Win64 builders
19:30:43KoodaOh
19:30:51Varriountdom96 runs the 32 and 64 bit linux builders.
19:30:51KoodaCould I add NetBSD i386 and amd64?
19:31:01Araqvbtt_: nimbuild is currently broken and I'm having fun to get it back to work ... it's a nice multithreading issue
19:31:34VarriountKooda: Yeah. You just have to get dom96 to accept the new OS config and have him set it in the hub
19:32:02KoodaI have a machine for it if needed
19:32:04VarriountAraq, vbtt_ : Well, nimbuild isn't entirely broken. It's just that it crashes when it tries to bootstrap nimrod the second time in a row.
19:32:20Araqnueva: ok, fair enough, but the .babel thing is an algorithm just like it currently implements an algorithm. so how exactly does it change anything?
19:32:31VarriountWhich I bypass by running the builder in a shell loop.
19:34:16vbtt_some algorithms have fewer surprises.
19:34:34vbtt_the current violates the principle of least surprise, perhaps.
19:35:08nuevaAraq: .babel wasn't my suggestion (though I'm not objecting it). I was suggessting shorten list of exceptions to one non-obvious, rare name and make it conventional.
19:35:08vbtt_anyway, i'm going to stop arguing about it cos it still sort of works.
19:35:49AraqKooda: which OS are you on?
19:35:54KoodaNetBSD
19:36:26*EXetoC joined #nimrod
19:40:12EXetoCnueva: lib/src is common in quite a few languages aren't they? which is why I adhere to those. lib would be for libs and src for apps
19:40:20EXetoCI guess we just need some conventions
19:44:24NimBotAraq/Nimrod devel c9cdbbe Araq [+0 ±3 -0]: should compile on netbsd
19:44:29AraqKooda: try again
19:44:42nuevaEXetoC: I was speaking about predictability of generated files' names. yeah, 'src' name for source directory is common, so I'm using it in project (not in package). and I'm using external build system. so I want to know what files will be generated by Nimrod. i was suprised.
19:47:04Araqnueva: I'm looking at my .babel directory now
19:47:34Araqthe opencv.babel file is in opencv-0.1.0/
19:47:36KoodaAraq: fixed the issue :)
19:48:13nuevaso it's a clash between my expectations and allowing to use 'src'/'lib' in packages. right now, I'm the only who is using external build system, so I think I will not win :)
19:48:37Araqno on the contrary
19:48:45Araqyou fought long enough with me
19:48:46vbtt_nueva: for what you're doing, nimrod should just emit the list of generated files. you shouldn't have to reproduce it's algorithm.
19:49:01Araqvbtt_: that's what nimrod already supports
19:49:11vbtt_nueva: why not use that?
19:49:27vbtt_nueva: that isolates you from nimrod internals and possible changes.
19:49:56vbtt_hmm, maybe the build system doesn't support it.
19:50:05vbtt_so you have to recode the logic in the other build systems
19:50:14Araqnueva: we also have plans to split the larger generated .c file into mutliple files
19:50:28Araqthen there is no 1-1 mapping between modules and .c files
19:51:42nuevavbtt_: yeah, bu Nimrod now can output this list only when it compiles files and only to fixed file path. I need to know about generated files' paths without compilation (i.e. without producing any files).
19:52:07*aftersha_ joined #nimrod
19:52:41vbtt_that's a feature request then! bbl.
19:52:42nuevait was discussed earlier, PR is awaited from my side, but I want to avoid it :)
19:52:54*aftersha_ quit (Client Quit)
19:53:10*aftersha_ joined #nimrod
19:53:39VarriountAnyone know if the semantics for 'creating' a new closure iterator variable changed?
19:54:38*aftersha_ quit (Client Quit)
19:54:51AraqVarriount: I hope not
19:54:59Araqall the tests I have for them are green
19:55:13VarriountAraq: I'm running a test from an old issue
19:55:34VarriountOr rather, a code snippet provided in the issue. It concerns recursive iterators.
19:55:49VarriountAraq: https://github.com/Araq/Nimrod/issues/555
19:55:54Araqrecursive iterators are not supported
19:56:33VarriountAraq: Are they supposed to throw an error?
19:57:18*aftersha_ joined #nimrod
19:57:31Araqyes
19:57:56Araqit's a nice tricky test case
19:58:05Araqadded it to the suite, no idea why it was missing
19:58:39VarriountAraq: Well in the code snippet in that issue, they don't.
19:58:50AraqI know
19:59:00Araqit's an indirect recursion, I didn't check against that
19:59:55VarriountAlthough, at least it doesn't crash the compiler. ;P
20:00:00EXetoCwhat about sets in strutils for control chars, lowercase etc?
20:00:39AraqEXetoC: constants are usually in Uppercase except when they are not
20:01:45nuevaAraq: splitting of .c isn't really interferes with my current approach. naming of splitted files will still be deterministic. but of course I always will be relying on unstable/fragile compiler internals in this case.
20:02:08EXetoCAraq: no I mean character sets for those, because I have a hard time remembering ASCII ranges such as 0-0x1F for example
20:02:40*vbtt_ quit (Ping timeout: 272 seconds)
20:03:14AraqEXetoC: we'll only get bug reports that those are not unicode aware, so please don't add it
20:03:37EXetoC-.-
20:03:55nuevaand it's better to use specialized public interface
20:03:59renesachttps://gist.github.com/ReneSac/3b56d3b3836761093436 <-- how I can get this object working like a sequence?
20:04:51Araqin fact ... I don't think I'll write another stdlib module anytime soon for reasons like this
20:05:29Araqwhen you do nothing you can't do anything wrong
20:06:12dom96When you do things right, people won't be sure you've done anything at all.
20:06:30*dom96 wonders who gets the reference
20:06:34dom96Hi btw
20:07:57EXetoCI haven't heard of any alternatives. I'll keep referring to asciitable.com then
20:08:44Araqrenesac: I think you need a single `[]` that returns a 'var TPt' for this to work
20:09:41Araqhi dom96, there were discussions about babel and how the compiler generates C filenames
20:09:48dom96Holy wow at the amount of notifications on Github.
20:09:55dom96I'm glad I disabled the emails.
20:10:00AraqI would like to know your opinion
20:10:11Araqwhat? the emails can be disabled? lol
20:10:20VarriountI like the emails.
20:10:22dom96Yep. In the settings.
20:10:38Varriountdom96: I think I've commented on one or two issues posted by you.
20:10:41dom96Although you still get some. Like ones which you created or were a part of I think.
20:10:56dom96Yeah, that's probably why I got those emails heh.
20:11:57dom96Araq: Yeah, I read everything. The idea to use the .babel file to determine the top-level directory isn't a bad one.
20:12:10*bbodi_ quit (Ping timeout: 272 seconds)
20:12:22Araqthe top-level directory has that annoying version number though, dom96
20:12:37EXetoCAraq: do you know what these people want then? only unicode-aware functions perhaps
20:13:02Varriount^
20:13:06AraqEXetoC: they want C#
20:13:19Araqthey might pretend that they don't but they do
20:13:32dom96Araq: Yeah... well it's hard to keep a balance between "Nice filenames" and "unambiguous filenames"
20:13:53dom96It may be a good idea to lean towards "Unambiguous filenames" completely.
20:13:57VarriountEXetoC: Give up. Your never going to be able to convince Araq to change his mind about unicode.
20:14:06Varriount*unicode related stuff
20:14:44dom96Araq: If you're desperate you could use the .babel filename. :P
20:14:58EXetoCVarriount: I disagreed?
20:15:53VarriountIt sounded like you were trying to convince Araq of something unicode-related.
20:15:54EXetoCit sounded to me like he wouldn't mind, but other people would coplain
20:17:08EXetoCnevermind that
20:18:38dom96Kooda: I appreciate you wanting to contribute a machine but I would prefer to get these nimbuild issues fixed first. I still think that the builders need some adjustments to be more friendly to machines which are not under my control.
20:18:39EXetoCI wonder what would be more acceptable. overloads for both char and TRune?
20:19:17Araqah yeah, back to nimbuild debugging
20:20:04VarriountEXetoC: Yes.
20:20:06AraqVarriount: btw it took me 3 evenings to get the closure iterators to work, so don't worry. I had to change a lot
20:20:29VarriountAraq: I know. Believe me, your hard work is not going unappreciated.
20:21:12VarriountI've *seen* the lambda lifting code.
20:21:38Araqthe lambda lifting code is actually quite clean
20:21:57Araqthe algorithm itself drives one crazy though
20:22:13Araqand there are so many special cases to consider
20:23:00VarriountLike the one I mentioned above.
20:23:14Araqthat returns 0 now
20:23:28VarriountWhich is counted as "None" I assume?
20:24:02VarriountAnyway, I hope you don't mind me going through the issues. It's something useful that I enjoy doing.
20:24:28Araqare you crazy? I appreciate you going through the list of bugs!
20:25:29Koodadom96: please tell me when you are ready :)
20:25:49dom96Kooda: I certainly will, thanks :)
20:26:13Varriountdom96: Thank you for putting easily testable snippets in your issues. :D
20:27:22EXetoCAraq: so the biggest issue is the lack of isControlChar for TRune for example? would that *and* sets be fine then? Sets are neat
20:27:36dom96Varriount: Thank you for appreciating them! You just put a smile on my face :)
20:27:56AraqEXetoC: just add the set with a comment it's not unicode aware
20:28:00reactormonkhttps://github.com/Araq/Nimrod/issues/347 gist timed out :-/
20:28:40Araqreactormonk: I can close it as "won't fix" if that helps you
20:29:01reactormonkAraq, let's see if it's still buggy
20:29:07renesacAraq: indeed it was just the lack of 'var' on the return variable, thanks ^^"
20:30:10renesacit seems I don't even need to define `[]=`
20:30:18EXetoCAraq: well that was simple. maybe for Whitespace/NewLines as well then, because unicode has more of both I think
20:30:23reactormonkAraq, yup, it is.
20:31:07Araqreactormonk: can you pass a function(a,b,c) to a function(a,b) in JS?
20:31:43*mietek quit (Ping timeout: 272 seconds)
20:31:45reactormonkAraq, you can pass functions all the way you want
20:31:56*mietek joined #nimrod
20:33:02Araqhmm
20:33:16VarriountWhat does "object contstructor needs an object type" mean?
20:33:22Varriount*constructor
20:33:29reactormonkVarriount, code?
20:33:44AraqFoo(a: 1, b: 2) # Foo should be an object?
20:34:28VarriountAraq, reactormonk : https://gist.github.com/Varriount/8586245
20:34:36VarriountThe error is caused by the bottom file
20:34:56dom96hello mietek
20:35:05Varriount(I can't get the top file to compile, it seems that the kind of tuple conversion expected on line 4 is no longer supported)
20:35:07AraqVarriount: yes, because it's a tuple, not an object
20:35:13dom96oh, mietek is not new. Hello anyway.
20:35:29Araqand yes I know about the range in tuples problem
20:35:52Araqfirst example should compile, 2nd not
20:35:57VarriountWhich would explain why natural() fails.
20:36:56Araqit's really quite simple; if A <: B then C[A] <: C[B] doesn't hold in general
20:37:07Araqso the compiler refuses the code
20:39:11reactormonkAraq, in case of a tuple it doesn't? That's a good old product type.
20:40:11Araqif A and B are objects they could have different sizes and then the tuple can't possible adhere to a subtype relation
20:40:28*aftersha_ quit (Quit: Computer has gone to sleep.)
20:40:57reactormonkah sap
20:41:21reactormonkcan't you check for sizes?
20:42:24Araqthat's planned, yeah but it means we have 2 different subtype relations
20:42:39Araqto support and so it's a bit of work
20:42:56reactormonkand not overly urgent?
20:43:42Araqyeah
20:45:39nuevaI built compiler from devel branch 6 days ago. I've just pulled new commits and 'koch boot' now fails with "lib/system/excpt.nim(83, 17) Error: undeclared identifier: 'CString'". will cleaning help?
20:46:47*vbtt joined #nimrod
20:47:20Varriountnueva: It should
20:47:49Varriountnueva: Also make sure that all nimcache directories are deleted.
20:47:53Araqnueva: something is still not case consistent ,but I wonder why "nativeStackTraces" are enabled for you
20:48:15vbttbtw if I declare `var x = MyObject(..)` it's goes on the stack, correct?
20:49:03Araqyes
20:49:04*[2]Endy quit (Ping timeout: 252 seconds)
20:49:10*Varriount will never understand why people are worrying about stack/heap allocation in a gc'ed language
20:49:15dom96vbtt: I'm reading your article and found some spelling mistakes: "defintion", "arbirary". Other than that so far very nice article :)
20:49:25Varriount*stack-vs-heap
20:50:24nuevaAraq: because I explicitly enabled it.
20:50:26dom96vbtt: Another one: "evalutate"
20:50:26AraqVarriount: because stack allocation is 0 instructions and heap allocation is 100?
20:50:41vbttdom96:thanks for the feedback! I'll spellcheck it.
20:51:00vbtthah wow I was tired at night.
20:51:22dom96vbtt: Thank you for writing the article!
20:52:00vbttVarriount:I need to know the semantics. it's not just about the gc. it's copying, lifetime, etc.
20:52:01dom96Araq: "var written: Int = write(f, String)". See? People already want it to be 'Int' not 'int' :P
20:52:25vbttheh - not sure what it's originally, or string.
20:53:23dom96Araq wants the convention to be that for types (and some consts) the first letter is uppercase, except for built-in types like int, string etc.
20:53:32nueva'koch clean' didn't help (btw, it deleted .gitignore). there are no nimcache directory left, but it still fails with the same error. so I should just disable nativeStackTrace?
20:53:45Varriountnueva: Yes.
20:53:45vbttI like type names capitalized. And I'm used to snake_case but I tried using camelCase in the examples. if there's a style guide i'll follow it.
20:53:52dom96I'd rather just make it clear that *every* type starts with a capital letter.
20:54:00dom96everything else does not.
20:54:02dom96Like in Haskell.
20:54:04Araqnueva: sorry I didn't catch this but "koch clean" never helps with anything
20:54:10AraqI never run it fwiw
20:54:31vbttdom96: Python does what Araq wants. I lean towards every type being capitalized. but either is fine really.
20:54:35Araqyou simply need to do /CString/cstring/ and then it should compile
20:55:15Araqdom96: uppercase Int is too annoying, I tried it
20:55:52vbttwill `type lowercasename` be a syntax error?
20:56:09dom96Araq: Ok. I can live with it.
20:56:17vbttHm, I'll change the example to lowercase Int and String, then.
20:56:19Araqvbtt: I wanted to do that but people dislike the idea
20:56:41Araqapparently consistency works best when it's not enforced ....
20:56:44vbttAraq: I like the idea.
20:57:07vbttAraq: that's a constraint that can always be relaxed later with no breakage. Unlike the other way..
20:57:24Araqvbtt: doesn't help
20:57:34Araqfor instance we're still quite strict when it comes to comments
20:57:54AraqI can only guess how many people never considered nimrod because of that feature
20:57:54vbtthmm ok.
20:58:38Varriountvbtt: Or simply write in the style you prefer, and run `nimrod pretty` over everything.
20:58:43Varriount:3
20:58:50nueva## \ and then doc comments on new line is weird, IMHO
20:58:50vbttactually i originally passed on nimrod because of case/underscore insensitivity, $ and command style calls.
20:59:10vbttpossibly others, but now I realize I cant get everything I want (without doing any work ;)
20:59:12Varriountnueva: That isn't actually done anymore.
20:59:22Araqvbtt: there you go then
20:59:27EXetoCsuch minor reasons
20:59:40vbttVarriount:ah ok. i didn't know 'pretty' works.
20:59:51dom96vbtt: Perhaps in the "Using Type Classes [sic]" section you could add another example where you actually define a type which satisfies the type classes you defined and shows that they can be passed to those functions you defined (``doubleBend`` and ``copyFileData``)?
20:59:56Varriountnueva: If you look in the libs, documentation tends to be done python style, with doc-comments underneath things
21:00:21dom96er, nvm my [sic] misread heh
21:00:28vbttdom96:good idea. i was going to write more in there and also show a complie time error on mismatch.
21:00:39dom96vbtt: Yeah, great :)
21:01:11vbttEXetoC:not really minor. readability counts. specially when you have to read other developer's code.
21:01:38VarriountAraq, dom96: Well, I've gone through about 75% of all the issues (I ignored the one's that weren't clear, lacked a test, or were feature requests)
21:01:50vbtti was more happy with clay, but that language died.
21:01:59VarriountI've commented on the one's whose results have changed.
21:02:06dom96Varriount: Now fix 20% and i'll give you a hug.
21:03:05vbttthere's also other weird looking stuff like dangling '=' in proc. yes these things matter and ppl will pass on languages because of this. however, you can still have a compelling language if your ecosystem is solid. i.e. good, complete stdlib, nice community etc.
21:03:36vbtti can't use most new languages because they dont even try to implement a stdlib or common libraries. i want to build real products.
21:04:00vbttnimrod has a very good ecosystem but not compelling enough yet.
21:04:17reactormonkvbtt, what lib are you missing?
21:04:29dom96I think the reason that they don't is because the language changes too much. We try to keep backwards compatibility even though we're pre-1.0.
21:05:10EXetoCvbtt: right, subjectivism and all that :>
21:05:41dom96vbtt: Any ideas what happened to Clay? Did the author just give up/lose interest?
21:06:11EXetoCdom96: yeah, people should know what <1.0 implies
21:06:21vbttreactormonk:just compare with pytho stdlib. not that python apis are great, but there's really a lot more than nimrod.
21:07:11Araqno there isn't
21:07:14vbttdom96: the original author left it for another project. then 'joe' worked on it for a while and then got busy.
21:07:53Araqpython's internet modules are extensive and battle-tested but that's about it
21:08:08reactormonkvbtt, make a list and post it in the wiki. And those will not go to stdlib, more likely as a babel package
21:08:22Araqof course if you count stuff like Python's "enum" module as lacking for nimrod, you'll get a different picture
21:08:31nuevaVarriount: http://pastebin.com/WtDX16kE is there any other way understandabe by 'nimrod doc'?
21:09:27Araqalso python has really good 3rd party stuff like numpy
21:10:02Araqbut the stdlib is not that bigger
21:10:54vbttforget enum. it's little things like datetime and random.sample
21:11:03reactormonkI mean you could port numpy to nimrod. Just rip out the python API and make a nimrod API
21:11:28reactormonkvbtt, time is nasty.
21:11:42Varriountnueva: http://pastebin.com/9U0SLngN
21:11:53Araqvbtt: hmm ok, I miss these details as I only go over the list of modules
21:12:39reactormonkAraq, what about time? Its own babel package and kick it out of the stdlib mostly?
21:12:55Varriountvbtt: I've heard that arrow is much better than datetime
21:13:09Araqreactormonk: doesn't work, but we can trim it down
21:13:29Araqand have a "timex" module in babel
21:13:32vbttVarriount: I dont like python's datetime api, (dont know about arrow) but it's still convenient vs. nimrod where i'd have to implement it.
21:13:33nuevaVarriount: I've tried it before asking, but it didn't work. because of outdated compiler (mine was built 6 days ago)?
21:13:52Varriountnueva: Huh. Odd
21:14:19dom96no, times should be in the stdlib
21:15:19Varriountnueva: Add two spaces before the doc-comment
21:15:43vbttAraq:from a high level the list of stdlib in nimrod is impressive. however the impression i have is 1) somewhat lacking apis (however better functions can be added as they are used) and 2) not coherent or consistent (e.g. does the http lib use the parser lib? does it emit the standard datetime for dates, etc.
21:16:01vbttAraq:still for pre 1.0, there's no other language that's close.
21:16:25*zahary quit (Quit: Leaving.)
21:16:33Araqit is quite consistent and coherent afaict
21:16:48Varriount^ If a bit biased toward the compiler's needs.
21:16:51reactormonkvbtt, write up any inconsistencies you find.
21:17:10vbttok, i'll spend more time with it. perhaps i'm missing the details.
21:17:16dom96I agree that the stdlib still needs some things and that there is a lot packages which could be on babel which we do not have but python and ruby do
21:17:38dom96This sadly means that deciding to take up some project could mean that you have to recreate some library that you need.
21:17:55dom96For example, for nimbuild I had to create a CIDR module (or whatever it's called)
21:18:26AraqVarriount: the compiler tries to avoid the stdlib
21:18:46Araqmostly for historical reasons though
21:19:04VarriountAraq: Ok then, biased towards other parts of nimrod's codebase.
21:19:05Araqthere was no stdlib when I wrote the compiler ...
21:19:16dom96Anyone on Ubuntu or any other linux for that matter here have a minute to test something?
21:20:48nuevaVarriount: pretty unintuitive. but it works now, thanks.
21:22:18nuevadom96: I'm on Debian. what exactly do you need to test?
21:23:01VarriountHm. Which is preferable: Implementing reversed string operations from strutils as separate procs, or as a flag that can be passed to each proc?
21:23:15vbtteg. theres asyncio *and* libuv.
21:23:29Varriountvbtt: Asyncio is a pure lib, libuv is a wrapper.
21:23:38Araqvbtt: if anything the stdlib is too consistent for its own good. people stumble upon TTable being value based types
21:23:59vbttVarriount:my point is that perhaps one of those does not belong in the stdlib.
21:24:00VarriountAlso, iirc, wrappers are being moved out of the stdlib (with some exceptions)
21:24:16Araqvbtt: libuv will become a babel package
21:24:19vbtteither pick libuv and then use it as the one and only event loop.
21:24:24vbttAraq: ah ok.
21:24:37vbttAraq:too consistent is a good thing imo.
21:24:45Araqquite a lot things already moved to babel
21:25:00Araqso now the tester needs to learn about babel ...
21:25:18VarriountWhy?
21:25:34Araqso that we can test that babel packages still compile?
21:26:05VarriountAh. So that was why you needed a new dir name?
21:26:35Araqno, I just like "testament" as a pun
21:26:39vbttthe parsers are all called 'parseXXX' *except* json which is just json.
21:27:51Araqjson it not only a parser ...
21:29:54VarriountBy the way, how much of the xml and json specs do the xml and json parsers implement? Is it enough that users should be concerned about xml and json exploits?
21:30:41Araqnot sure what exploits you mean, but no
21:30:56Araqthe xml parser ignores xml as much as it parses it
21:31:31vbttheh
21:31:41Araqit's a braindead standard and when it dies I'll rejoice
21:32:40vbttbraindead perhaps but very commonplace.
21:33:00vbttyou want at least one strict xml parser.
21:33:11Araqwe have some wrapper for that
21:33:13vbtt(for other people, not for me)
21:33:32Araqusually we have wrappers for the "proper" way and a cool module for my way
21:33:46Araqmy way always wins in practice
21:33:51dom96nueva: https://github.com/dom96/ParticleBench
21:34:26Araqturns out nobody gives a shit about xml's namespacing feature etc. nobody uses it, nobody knows it exists
21:34:48Araqyou should read these standards one day, it's crazy
21:35:27dom96oh yeah, the xmldom module seems like a waste of my time nowadays heh
21:36:22Araqbtw nobody actually produces valid xml either, so a "strict" module doesn't help
21:36:55vbttAraq:not true, there's a lot of valid xml out there. specially in-house.
21:37:11Araqthere is more invalid xml though
21:37:17vbtton the web json is fast replacing xml.
21:37:27Araqand it helps when you can parse that too
21:37:28dom96nueva: Run 'babel build' if you can with Nimrod @ master.
21:37:29vbtttake atom feeds e.g. or google apis
21:38:02vbttAraq:sure but a switch (strict/lenient) would be nice.
21:39:08Araq*shrug*
21:39:36vbttthe peg module looks pretty slick.
21:41:17nuevadom96: strictly @ master? would @ devel be ok?
21:41:53dom96nueva: Would prefer @ master. But sure go ahead.
21:42:09Araqoh btw
21:42:30*dirkk0 joined #nimrod
21:42:38AraqI am *very* open for suggestions of how we should do the TParser -> Parser transition
21:42:39*dirkk0 quit (Client Quit)
21:43:50vbttare you talking about renaming all types to remove the 'T' prefix?
21:44:04Araqyes
21:45:08Araqtechnically it's easy, "nimrod pretty --noTP myproject.nim" will do the job
21:45:25nuevababel failed to find libssl.so. library is installed. does nimrod program use predefined paths for searching libraries to use for FFI?
21:45:53dom96nueva: Maybe the .so has a different name
21:46:18nueva/usr/lib/i386-linux-gnu/libssl.so
21:46:35nuevaah. ok, it's my fault
21:46:51nuevasorry
21:47:03vbttI have an elaborate idea.
21:47:51dom96well that suggests that something is wrong with 'devel'
21:48:00nuevaI compiled Nimrod as an amd64 program but didn't install libssl:amd64
21:48:13nueva*compiled babel
21:48:16vbttnimrod rename module1.TMyType MyType -o fixups.log
21:48:31dom96because xtagon cannot build ParticleBench on devel
21:48:34vbttnimrod fixup module2,module3,module4 -i fixups.log
21:48:50dom96Guess I should test devel then
21:48:51vbtt-o is output, -i is input file
21:49:17Araqvbtt: no need, "nimrod pretty" can do that
21:49:18xtagondom96, actually what I meant was I cannot build nimrod on devel
21:49:23nuevadom96: wait, I didn't proceed to testing ParticleBench yet
21:49:28xtagondom96, on master I mean
21:49:34xtagondom96, sorry, misread what you said.
21:49:49Araqmaster can build devel, devel can build master
21:49:59Araqbut only since today
21:50:13dom96nueva: Yeah, sorry. xtagon tested it for me too.
21:50:17dom96I was referring to that.
21:50:57vbttoh, pretty can save explicit renames specified by the user?
21:51:16vbttand then apply those renames to other dependent modules later?
21:51:58nueva'babel install' failed with "command line(1, 1) Error: invalid command line option: '--noBabelPath'"
21:51:59Araqnah it works differently, you pass --pretty.overwrite and then pretty modifies the files directly
21:52:27nuevaI mean, I'm installing the babel itself
21:52:37Araqwelcome in the year 2014 where git tells you about the changes it made
21:52:51EXetoCthe one and only babel
21:53:11Araqno need for a rename/fixup sing and dance
21:53:28vbttAraq: what i'm suggesting allows piecemeal renames and also arbitrary renames ('Foo' -> 'Bar')
21:53:34vbttbut yeah, i said 'elaborate' :)
21:53:54vbttit will be useful for software refactoring in general. not just for stdlib and not just for a one time conversion.
21:54:09Araqit will allow for arbitrary rename yes
21:54:24Araqbut can we focus on the social aspect instead?
21:54:38vbttwhat social aspect?
21:54:46dom96nueva: Sounds like you're running 0.9.2
21:54:47Araqdo we release 0.9.4 and then say, for 0.9.6 run "nimrod pretty" over your entire code base?
21:55:12dom96Well in any case it's pretty much confirmed now that devel is faulty.
21:55:22dom96Araq: Your VM crashes on ParticleBench
21:55:25vbttAraq: that's why i proposed fixup.log file. you just distribute this file with each release and when people upgrade they run 'nimrod fixup mymodules -i fixup.log'
21:56:04Araqvbtt: that's disgusting
21:56:36nuevadom96: Nimrod Compiler Version 0.9.3 (2014-01-17) [Linux: amd64]
21:56:44Araqa deprecation path is much more polite
21:57:00dom96nueva: babel uses the nimrod that's in your PATH. Is 0.9.2 in your PATH?
21:57:17dom96oh wait
21:57:22nuevadom96: output is from 'nimrod -v'
21:57:35dom96I guess Araq never merged master into devel?
21:57:43AraqI did
21:58:18dom96nueva: Git pull then
21:58:37vbttwhy? it'll work when you make other changes to the stdlib as well. it doesn't preclude a deprecation path. it's just that you use a generic tool rather than manual or specific one.
21:58:54vbttbut i understand it needs extra effort cos the tool doesn't exist.
21:59:09Araqthe tool does exist
21:59:21AraqI made 100K LOC case consistent with it
21:59:40nuevadom96: ok, but I'm right now fixing case sensitivity problems on current devel head to boot with rare options
21:59:56vbttpretty is different tool from what I'm describing. lets say you decide to go through the stdlib and rename a few functions for consistency. now what? how do you get everybody to fix that up? pretty?
22:00:07dom96nueva: No worries. xtagon already tested it for me so it's fine.
22:00:37Araqvbtt: ah I see
22:01:05xtagonvbtt, I like your fixup idea
22:01:12Araqbut yes, pretty will learn how to do it
22:01:51*brson quit (Ping timeout: 252 seconds)
22:01:53vbttAraq:pretty will learn specail renames? such as 'pipe' -> 'socket' ?
22:02:05vbttor 'parsecsv' -> 'csv' ?
22:02:07Araqthat's easy to do
22:02:32Araqthe problem is that it needs to be done in a batch
22:02:52Araqyou can't rename it in the stdlib and then later in your project
22:03:19vbttof course you can. i only need to rename it in my project when i upgrade to the new version of the stdlib.
22:03:40*brson joined #nimrod
22:03:46Araqbecause it's not clear if foo in your project refers to stdlib.foo
22:04:16vbttwhat? it can be statically resolved. i'm not talking about textual replace.
22:04:17nuevashould I rename globalError to GlobalError or vice versa?
22:04:37Araqbut you can compile against the old stdlib and then it's obvious
22:04:40vbtti'm talking about parsing the files, resolving symbols and semantic rename.
22:04:49AraqI know
22:05:38Araqyou can't do a semantic rename when your code doesn't compile anymore
22:05:49Araqthat's the problem
22:06:08Araqso you need to compile against the old stdlib so all names can be resolved
22:06:12Araqand then you can rename
22:06:49vbttcan you instead lookup the 'fixups.log' file to find the old symbols?
22:07:03Araqnueva: globalError but where do you see GlobalError?
22:07:14nuevaGo has a similar tool http://golang.org/cmd/fix/
22:08:11Araqoh really? how come you think I don't know?
22:08:23nuevaAraq: http://pastebin.com/VshmpEcV
22:08:33vbttAraq:another idea. a deprecated statement. you rename TType to Type and then write depreated TType = Type. so the compiler can resolve it to the new symbol and emit a warning.
22:09:08Araqnueva: almost all of that is dead code
22:09:32Araqvbtt: we have a deprecated pragma and it also works for types
22:09:56nuevaAraq: I don't promote Go or my extensive knowledge. just making a sidenote.
22:10:33vbttactually deprecated is the wrong word. i'm suggesting obsolete but auto linked to the new version.
22:10:46vbttobsolete TType = Type
22:11:01Araqwhat's the difference between obsolete and deprecated?
22:11:05vbttnow when you compile a dependent module, it looks up TType, find it, emits a warning, but links to Type instead.
22:11:22vbttAraq:minor difference, deprecated still work.
22:11:27AraqI mean in english
22:11:32nuevaAraq: not so dead. it prevents 'koch boot -d:release -d:tinyc -d:useGnuReadline -d:useFFI -d:nativeStacktrace'
22:11:57vbttdeprecated = going away soon. obsolete = gone already.
22:12:11Araqah
22:12:25vbtti think. english is not my absolute 1st language. more like 1.5th.
22:13:18EXetoCyes
22:13:21vbttin english, actually, deprecated means discouraged.
22:13:25Araqnueva: are you on devel?
22:13:37vbttbut in programming it means what i said.
22:13:46EXetoCwell that too, and some things stay deprecated forever
22:15:10nuevaAraq: yes
22:16:39Araqnueva: you can also simply get rid of --cs:partial in nimrod.nimrod.cfg
22:20:00nuevainternalAssert or InternalAssert? I think I got pattern and it should be internalAssert (because it's a proc)
22:20:48nuevaor it's not a proc?
22:21:37Araqit's internalAssert
22:21:52nuevait's template. so it's still internalAssert
22:21:57Araqjust run nimrod pretty over it with all your -d stuff
22:22:19Araqand use --pretty.overwrite
22:25:16Araqbtw does -d:tinyc still work?
22:25:28Araqworked for me years ago
22:26:09Araqand then the gnu headers kept getting stranger
22:27:07nuevaI don't use it, just compilng with it enabled :)
22:27:37*vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
22:27:45Araqbtw the idea to *share* builtin header files between compilers is ... bizzare
22:29:10nuevaoh, well... error: no such file or directory: 'compiler/nimcache/libtcc.o'. is it tinyc related?
22:32:48nuevayeah, it's tinyc-related
22:52:07*BitPuffin joined #nimrod
23:04:16Araqgood night
23:12:25*darkf joined #nimrod
23:17:12nuevadom96: ParicleBench building on devel: "SIGSEGV: Illegal storage access. (Attempt to read from nil?)"
23:17:24dom96nueva: Yeah, same results here.
23:17:30dom96Appreciate you testing though
23:19:42nuevadom96: full log http://pastebin.com/YYHykB17 (ust for the record)
23:22:13*vbtt joined #nimrod
23:30:57*ddl_smurf joined #nimrod
23:30:59dom96Good night
23:35:01*io2 quit (Ping timeout: 272 seconds)
23:43:22VarriountMeep
23:44:26vbttbeep
23:44:41renesacError: execution of an external program failed; rerun with --parallelBuild:1 to see the error message
23:44:42renesacFAILURE: Execution failed with exit code 256
23:44:56renesac<-- this is running with --parallelBuild:1
23:46:01vbtttry parallelBuild:0
23:46:17renesacsame failure
23:48:37renesacI'm trying to compile ParticleBench with the latest nimrod master
23:51:57renesacok, changed a var to a const and now it compiles
23:51:58renesac\o/
23:52:26renesac(well, uncomented a line too