<< 17-01-2014 >>

00:00:23reactormonkPStringTable doesn't have a $?
00:01:29AraqI think it has, but you need to import stringtabs explicitly
00:02:04reactormonkhow do I say I want to do a put request instead of a post request?
00:02:33dom96use ``request`` with httpMethod = httpPUT
00:04:04reactormonkError: unhandled exception: Connection reset by peer [EOS]
00:04:06reactormonk-.-
00:04:08reactormonkdom96, works.
00:04:54dom96I never tested httpPUT :P
00:05:13reactormonkis it any different from post?
00:05:56dom96Except for the name? I would assume so.
00:09:02reactormonkdom96, well, I still get a connection reset by peer :-/
00:09:29reactormonkand it doesn't even show up in the server log
00:10:09dom96Create an issue on github then please.
00:12:38*io2 quit ()
00:13:38reactormonkdom96, yup, post works. request doesn't.
00:15:13*dmac quit (Quit: Leaving.)
00:15:28reactormonkooooh, forgot a \c\L after the content length header
00:19:14reactormonksomehow my decompress doesn't work reliably :-/
00:20:10reactormonkdidn't we have something to use zlib?
00:21:15reactormonkgrabbed it.
00:21:25Araqgood night guys
00:22:15NimBotAraq/Nimrod devel e1accd9 Araq [+1 ±9 -0]: better html generator for the tester; fixes some VM bugs
00:22:15NimBotAraq/Nimrod devel 1aa0b8c Araq [+2 ±11 -0]: Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
00:47:47fowlmerge devel into master plz
00:50:25*Demos joined #nimrod
00:50:39Demoscan I forward declare a proc and then define it in a different file
00:51:26reactormonkhow do I clear a seq from all elements? setLen to 0?
00:56:38reactormonkbtw, what's the join called again?
00:56:59reactormonkohhh, strutils.
01:03:11reactormonkdom96, can I make post async?
01:07:56*dymk joined #nimrod
01:12:21dom96reactormonk: no
01:12:32dom96reactormonk: To clear just set to @[]
01:17:43dom96Demos: I don't think so
01:17:49dom96Demos: What did you want to ask about babel btw?
01:23:42reactormonkBuilding babel/babel using c backend...
01:23:44reactormonkcommand line(1, 1) Error: invalid command line option: '--noBabelPath'
01:23:50*Demos quit (Ping timeout: 272 seconds)
01:24:10reactormonksounds like a chicken-egg problem to me
01:25:28dom96you need master not devel
01:27:37reactormonkduh
01:28:33dom96'night
01:33:38reactormonkwasn't there a switch to create a package?
01:33:47*brson quit (Quit: Lost terminal)
01:34:11*brson joined #nimrod
01:35:51*DAddYE quit (Remote host closed the connection)
01:36:24*DAddYE joined #nimrod
01:40:50*DAddYE quit (Ping timeout: 245 seconds)
01:58:36*vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
02:17:26*dymk quit (Quit: This computer has gone to sleep)
02:46:58*DAddYE joined #nimrod
02:48:02*Xuehas joined #nimrod
02:48:30*Xuehas quit (Quit: Xuehas)
02:49:17*Xuehas joined #nimrod
02:50:55*Xuehas left #nimrod (#nimrod)
02:52:06*DAddYE quit (Ping timeout: 276 seconds)
03:05:58*DAddYE joined #nimrod
03:08:08*Demos joined #nimrod
03:17:53*Demos quit (Ping timeout: 252 seconds)
03:22:45*BitPuffin quit (Quit: WeeChat 0.4.2)
03:30:24*ehaliewicz quit (Remote host closed the connection)
03:33:18*dymk joined #nimrod
03:53:38*dymk quit (Quit: This computer has gone to sleep)
04:05:49*Demos joined #nimrod
04:12:21*dymk joined #nimrod
04:29:08*dymk quit (Quit: This computer has gone to sleep)
04:42:18*dymk joined #nimrod
04:43:27*dymk quit (Client Quit)
04:46:22*dymk joined #nimrod
04:55:25*dymk quit (Quit: This computer has gone to sleep)
04:56:21*dymk joined #nimrod
04:58:16*foxcub joined #nimrod
04:59:37*Demos quit (Read error: Operation timed out)
05:01:02*brson quit (Read error: Operation timed out)
05:01:22*DAddYE quit (Remote host closed the connection)
05:01:26*dymk quit (Quit: This computer has gone to sleep)
05:03:48*brson joined #nimrod
05:11:54*DAddYE joined #nimrod
05:12:05*DAddYE quit (Remote host closed the connection)
05:12:11*DAddYE joined #nimrod
05:13:51foxcubIs it possible to create a generic type with not only a type, but also, say, an integer parameter?
05:14:03foxcubSo something like Vector[T,D], where D is an integer dimension?
05:15:36*DAddYE quit (Remote host closed the connection)
05:16:03*DAddYE joined #nimrod
05:16:33*dymk joined #nimrod
05:18:12*dymk quit (Client Quit)
05:18:21*dymk joined #nimrod
05:19:59*LordAndrew joined #nimrod
05:20:08fowlfoxcub, you can use a range
05:20:18fowlfoxcub, https://github.com/BitPuffin/linagl/blob/master/src/linagl/vector.nim
05:20:35LordAndrewHowdy there.
05:20:37*DAddYE quit (Ping timeout: 248 seconds)
05:20:42fowlhey
05:20:51foxcubAh, I see
05:21:16foxcubSo it's a workaround, but there is hope (according to the comment) that it can be done directly with an integer in the future?
05:22:03fowlthat is planned
05:22:25foxcubGreat. Thanks.
05:22:55*brson quit (Ping timeout: 245 seconds)
05:24:49*brson joined #nimrod
05:41:19*vbtt joined #nimrod
05:44:55*vbtt quit (Client Quit)
05:57:45*XAMPP joined #nimrod
05:57:56*XAMPP quit (Changing host)
05:57:56*XAMPP joined #nimrod
06:08:08*LordAndrew quit (Quit: Page closed)
06:09:12*dymk quit (Quit: This computer has gone to sleep)
06:21:31*foxcub quit (Quit: foxcub)
06:25:24*Demos joined #nimrod
06:27:49*dymk joined #nimrod
06:50:03*brson quit (Quit: leaving)
06:57:09*Demos quit (Ping timeout: 248 seconds)
07:01:49*DAddYE joined #nimrod
07:02:17*DAddYE quit (Remote host closed the connection)
07:02:23*DAddYE_ joined #nimrod
07:05:22*DAddYE_ quit (Client Quit)
07:14:16*dymk quit (Quit: This computer has gone to sleep)
07:14:32*dymk joined #nimrod
07:15:09*dymk quit (Client Quit)
07:24:09*dymk joined #nimrod
08:27:49*Araq_ joined #nimrod
08:28:42*odc joined #nimrod
09:38:53*CarpNet joined #nimrod
09:39:35*joebobjoe joined #nimrod
09:39:42joebobjoeHey guys
09:39:50joebobjoeHow does Nimrod compare in safety to Rust?
09:40:00joebobjoeI see you guys are adding dependent types?
09:43:04fowlwhat do you mean by safety?
09:44:25*Mordecai joined #nimrod
09:44:48*psquid quit (Ping timeout: 252 seconds)
09:44:57joebobjoefowl: Data races, deadlocks, region analysis, buffer overflows, null pointers...
10:08:21fowlnull pointers are possible, race conditions, deadlocks are always possible as a result of bad programming
10:09:09fowlnimrod has compile-time and runtime bounds checking to prevent buffer overflow, but you cant really stop someone whos determined to do this
10:11:17joebobjoefowl: Hm. Does library code use something like Option?
10:11:31joebobjoeOr are there no forced null checks of any kind
10:12:53*Ycros joined #nimrod
10:26:44fowljoebobjoe, theres no option[t] in the std lib
10:47:10*joebobjoe quit (Read error: Connection reset by peer)
10:50:06*XAMPP quit (Ping timeout: 265 seconds)
10:50:46*noam quit (Read error: Connection reset by peer)
10:53:30*noam joined #nimrod
11:03:03Araq_fowl: no, the new concurrency model I'm working on prevents deadlocks and data races ...
11:03:31Araq_also you can annotate a pointer as "not nil" and then the compiler checks at compile time it can't be nil
11:08:12Araq_but in general Nimrod focusses on expressivity, Rust on safety
12:39:02*isenmann quit (Quit: Leaving.)
12:40:49*XAMPP joined #nimrod
13:40:20*[1]Endy joined #nimrod
14:11:30*darkf quit (Quit: Leaving)
14:15:52*Mordecai quit (Quit: work)
14:20:19*Araq_ quit (Quit: ChatZilla 0.9.90.1 [Firefox 26.0/20131205075310])
14:50:36*aftersha_ joined #nimrod
14:53:21*[2]Endy joined #nimrod
14:57:23*[1]Endy quit (Ping timeout: 272 seconds)
14:57:39*wan quit (Quit: leaving)
15:01:27*Fernandos joined #nimrod
15:01:32Fernandoshii
15:02:47FernandosJust curious, I never understood why you need to cast in the first place. I'm not talking about php-like hidden-casts, but about an API for safe value extraction, conversion etc.
15:03:23FernandosSo, why do does Nimrod still rely on casts?
15:07:57dom96My guess would be because inheritance kinda requires it.
15:08:36dom96The unsafe cast on the other hand is required because of C's void pointer type.
15:11:50FernandosUnderstandable, but a jquery like chained (a union struct in C) procedure (or is it called function in nimrod?) that allows gch.stackBottom.int.safe would be more useufl
15:12:05FernandosDo you understand what I mean?
15:12:40dom96Nimrod allows you to type cast like that.
15:12:54Fernandoshuh?? really?
15:13:10dom96var x = 5; x.float # for example
15:13:22Fernandosoh, that's cool!
15:13:24dom96if that's what you mean
15:14:30OrionPKx.float == float(x)
15:14:31Fernandosindeed, but why is var a = cast [int](gch.stackBottom) even required then?
15:15:44dom96That's the unsafe cast. With a safe cast the compiler ensures that you can cast that way, but with an unsafe one you are basically just forcing it to cast to whatever you tell it which could lead to problems.
15:16:13dom96From the manual: "Type casts are a crude mechanism to interpret the bit pattern of an expression as if it would be of another type. Type casts are only needed for low-level programming and are inherently unsafe."
15:16:13*foxcub joined #nimrod
15:16:32*Fernandos quit (Disconnected by services)
15:16:32*Fernandos1 joined #nimrod
15:16:44dom96hello foxcub
15:16:57foxcubhello dom96
15:17:03*Fernandos1 is now known as Fernandos
15:17:05*Fernandos quit (Changing host)
15:17:05*Fernandos joined #nimrod
15:17:12dom96In fact, i'm using an incorrect term for "safe cast". The manual calls them "type conversions".
15:17:32FernandosSo, why not a.int.unsafe instead of cast [int]?
15:18:01dom96Because unsafe operations should be difficult to perform to discourage their use.
15:18:20dom96So it's better to make them verbose as a deterrent against their usage
15:18:32FernandosWhy not just remove it then? I mean it's not called unsafe without a reason
15:18:56Fernandos.unsafe is more verbose, but shorter than cast [int]
15:19:18FernandosI mean .int.unsafe
15:19:38dom96Because sometimes you have to type cast, there is no way around it.
15:19:40EXetoChow can it be made safe if all you have is an untyped buffer? Nimrod is both a high and a low level wrapper
15:19:57EXetoCand casts are commonly performed in code that wraps C libs
15:19:59Fernandosyou could remove the complicated cast [int] synthax and add a "use strict" attribute that talks to the compiler
15:20:35EXetoCs/wrapper/language
15:20:40foxcubIs there any kind of graph library for nimrod?
15:20:41EXetoC:E
15:20:49Fernandosfoxcub: what do you mean?
15:20:49*aftersha_ quit (Quit: Computer has gone to sleep.)
15:20:59foxcubGraph processing.
15:21:01Fernandosgraphdb or graph viewer?
15:21:01dom96foxcub: Don't think so. I'm sure you could wrap some C lib though
15:21:20dom96Fernandos: What's the point?
15:21:38foxcubdom96: are there good docs somewhere on writing wrappers?
15:21:44Fernandosdom96: curiosity and simpler logic
15:22:20Fernandosdom96: I have been eyeing nimrod for a while and didn't write in it yet, but am just watching this talk http://www.infoq.com/presentations/nimrod
15:22:36Fernandosand the cast was always something that annoyed me, because it's an ugly quirk
15:23:09*aftersha_ joined #nimrod
15:23:25Fernandosusually it's a sign of using the wrong datastructure
15:23:44dom96foxcub: Not yet I don't think. Somebody should write some heh. But writing wrappers is easy, and you can use c2nim to help you.
15:23:59Fernandosand I like the recursive .function.function synthax
15:24:13dom96foxcub: Take a look at some already made wrappers, best way to learn is from examples.
15:24:17foxcubdom96: what's the simplest example I could read to get started?
15:24:44Fernandosfoxcub: I'm just watching this http://www.infoq.com/presentations/nimrod maybe could help you too
15:24:56foxcubFernandos: thanks
15:26:08dom96foxcub: Most wrappers are unfortunately quite big.
15:26:29FernandosIs nimrod runtimeless??
15:27:15dom96foxcub: First thing that comes to mind is my opencv wrapper: https://github.com/dom96/nim-opencv
15:27:31foxcubdom96: thanks, although OpenCV is a monster.
15:27:46Fernandosccv is smaller
15:28:07dom96The basic idea is you use the dynlib, importc and cdecl pragmas
15:28:30dom96But try running the .h files through c2nim: http://build.nimrod-lang.org/docs/c2nim.html
15:28:49dom96May need to edit them a bit to get c2nim to understand them but it should make the process much easier.
15:29:15foxcubI guess the types are matched up in the obvious way?
15:29:18foxcubstring to char*?
15:29:26dom96char* is cstring
15:29:33EXetoCFernandos: where does that cast appear?
15:29:53foxcubAh, Ok, I need to do some reading.
15:29:55foxcubThanks for the pointers.
15:30:09FernandosEXetoC: in minute 1.0 on http://www.infoq.com/presentations/nimrod
15:30:36foxcubOne more question. What about C++? Especially, if I have something header-only, using templates. Is there a good way to make it play nice with nimrod?
15:31:03dom96Fernandos: Minute 1.0?
15:31:10Fernandosyes, of the video
15:31:27Fernandosthe video and slides are synced
15:31:45dom96You mean 1:00?
15:31:53Fernandoslol yeah
15:31:59dom96There is no code at that time.
15:32:09fowlFernandos, the nimrod runtime is just the GC
15:32:12Fernandosdid 1.0 cause a floating pointer exception? :D
15:32:53Fernandosdom96: 1:10 then
15:32:54EXetoC"stackBottom: pointer". GC stuff is naturally very low level
15:32:54dom96foxcub: c2nim supports C++ too, it's a bit harder to wrap C++ code though. Araq wants someone to try wrapping Qt though as he recently added C++ support to c2nim.
15:33:10EXetoCcast to int and you get the numerical value of the pointer
15:33:26foxcubdom96: got you, thanks. I'll take a look at c2nim
15:34:12dom96Fernandos: It's a very low-level features which is why it's under the "systems programming language" bullet point in the slide.
15:34:17dom96*feature
15:35:55Fernandosdom96: yup, I got that.. Just thought, hey why use cast [int] in the first place, when .int.unsafe could do the same and would me more expressive.
15:36:21dom96Because making it expressive encourages it's use.
15:36:29dom96Which is something we don't want to do.
15:36:31EXetoCaren't you special-casing the syntax then?
15:36:43FernandosI can't judge that without stats.
15:36:54dom96And that syntax would require making 'unsafe' a keyword
15:37:11Fernandosdom96: however I don't ask you to change the language, just question the use of casts like that in general.
15:39:13EXetoCdom96: I don't know if that's the reason, but I'm not sure if x.int.unsafe follows a logical structure
15:39:40Fernandosme neither, was just a pulled out of void :)
15:39:54Fernandosx.unsafe.int could also work
15:40:36dom96Yeah, I agree with EXetoC
15:40:58FernandosI don't know enough details about the implementation, but theoretically you coud also say. "use strict" which would enforse safe everywhere removing the need for unsafe
15:41:38Fernandosdom96: yeah you can name to something more logical, I am sure you know nimrod 100x better than me =)
15:41:58Fernandosdo you know what I mean by use strict?
15:42:24Fernandossimilar to javascript and html, where they use transitional ans strict to switch between standards and quirks mode.
15:42:52*aftersha_ quit (Quit: Computer has gone to sleep.)
15:44:31dom96Yeah, isn't that a VB.NET thing?
15:47:47*TylerE quit (Ping timeout: 272 seconds)
15:48:18foxcubIs there a way to issue a compile-time error if a certain (generic) version of a procedure were to get called?
15:48:41foxcubSo something like 'quit "override"' in the tutorial, but at compile time?
15:49:55fowlFernandos, x.castTo(int) (implementation follows)
15:50:13fowlproc castTo* [B] (obj: B; A: typedesc): A = cast[A](obj)
15:51:06Varriountfoxcub: by generic, you mean an actual generic, right? with the [] ?
15:51:17foxcubVarriount: yes
15:51:34foxcubRoughly, I want to have a generic procedure, but allow only its specializations to get called.
15:51:51Varriountfoxcub: I think you might be able to try to compare the generic type with something in a static block. One moment
15:52:12dom96I think there is an {.error: "msg here".} pragma
15:52:16Varriountfoxcub: By the way, what version of nimrod are you using? 9.2, master, or devel?
15:52:22foxcub0.9.2
15:52:36Varriountfoxcub: You should probably grab either master or devel.
15:53:30Varriountfoxcub: The nimrod compile is pretty easily compiled, and even if you don't have the time, someone in here probably has a binary on-hand
15:53:36foxcubdom96: 0.9.2 tells me Error: invalid pragma: error: "override"
15:53:46foxcubVarriount: Ok
15:53:49Varriount(FYI, I host the Win32 and Win64 build bots)
15:53:55fowlfoxcub, you could `when T is string: {.error: ..}`
15:54:12Varriountfowl: He would have to put it in a static block, right?
15:54:18dom96no
15:54:23foxcubVarriount: actually, I have master handy
15:54:28VarriountOh right, 'when'
15:54:49foxcubI don't want to be checking T at all
15:55:03foxcubI want it to fail for all T, except for the one where the procedure is already specialized
15:55:12foxcubSo
15:55:27foxcubproc f[T](x: T): void = always fail at compile time
15:55:34Varriountfoxcub: Maybe you want a typeclass? It also might help if we could see you code.
15:55:34foxcubproc f(x: string): void = do something
15:55:41foxcubproc f(x: int): void = do something else
15:55:54fowlfoxcub, the simple answer is dont use a generic there..
15:56:12dom96foxcub: Why not just rely on the compile-time error the compiler will give you anyway?
15:56:19dom96foxcub: Also, you don't need the ': void'
15:56:54Varriountfoxcub: Again, it might help if we saw your code, or even psuedo-code of what you are trying to achieve.
15:56:54foxcubdom96: I wanted to provide a more elaborate error message, I guess.
15:58:01foxcubHow would I provide a chunk of code here?
15:58:35dom96https://gist.github.com/dom96/75825cdca7256291f5ed
15:59:03dom96Something like that?
15:59:25Varriountfoxcub: gist is your friend. :)
15:59:59foxcubdom96: that gives me: Error: invalid pragma: error: "My error"
16:00:22foxcubI've switched to master, I think.
16:00:32foxcubnimrod -v
16:00:33foxcubNimrod Compiler Version 0.9.3 (2014-01-16) [MacOSX: amd64]
16:00:34foxcubCopyright (c) 2004-2013 by Andreas Rumpf
16:01:40dom96hrm, guess I should've tested it heh
16:01:52Varriountfoxcub: http://nimrod-lang.org/manual.html#error-pragma
16:02:55dom96Odd that it doesn't work.
16:03:22foxcubOk, putting just {.error.} as an annotation works.
16:03:23dom96Although your error does get printed at runtime ;)
16:03:44foxcubBut that doesn't give me a way to give an error message
16:04:17foxcubPerhaps, I shouldn't push it, and just stick to the compiler errors.
16:04:24foxcubThanks for your help, everybody.
16:04:45dom96{.error: "msg".} only seems to work at the top-level.
16:05:51*TylerE joined #nimrod
16:06:29dom96Definitely something to ask Araq about.
16:08:09Fernandosfowl: is that already possible?
16:08:48fowlFernandos, what?
16:09:15fowlfoxcub, you can use static: quit "my error" in the meantime
16:09:18Fernandosthe code you wrote to me
16:09:27Fernandosfor casting
16:09:27fowlFernandos, yes
16:09:32Fernandoscool
16:10:23foxcubfowl: is quit "my error" static?
16:10:31foxcubI thought it would only be triggered at run-time.
16:10:45fowlfoxcub, it is inside a static: block
16:12:30*TylerE quit (Ping timeout: 245 seconds)
16:13:22VarriountHrm. Anyone know if the vm supports importing already-compiled dynamic libraries?
16:13:43foxcubfowl: this is most strange to me, but I'll try it
16:13:54Varriountfoxcub: btw, what editor are you using?
16:14:10foxcubVarriount: vim
16:14:35VarriountMkay. I assume you have to vim plugin for nimrod?
16:15:03foxcubVarriount: I do
16:16:04dom96Varriount: I think so. But you have to compile with -d:useFFI
16:18:28dom96bbl
16:20:28foxcubHere's another question
16:20:32foxcubNow about importing from modules.
16:20:56foxcubHere's some simple code: https://gist.github.com/mrzv/8476229
16:21:15foxcubIn order for it to run I have to uncomment import archive in serialize.nim
16:21:32foxcubBut I'd like it to work with any user-defined save(), load() operations anywhere down the line.
16:21:52foxcubWhy do specific save() and load() have to imported into serialize.nim for them to work, and is there a way to avoid that?
16:22:14Varriountfoxcub: What is 'archive'? Where is it located?
16:22:26foxcubThere are three files in that gist.
16:22:40foxcubarchive.nim starts at line 32.
16:23:26VarriountAh. I see. Just so you know, gist allows you to paste multiple 'files' into separate boxes.
16:24:08foxcubThanks, it's the first time I use gist.
16:24:54discolodahmm, c2nim needs to be able to take stdin and emit to stdout so i can use it within vim
16:25:52Varriountfoxcub: One moment, let me download and run this
16:26:12foxcubThere was a mistake in the comment.
16:26:19foxcubimport archive needs to be present for the code to run.
16:26:21foxcubIt's fixed now.
16:27:06fowlfoxcub, http://build.nimrod-lang.org/docs/manual.html#symbol-lookup-in-generics
16:27:08Varriountfoxcub: So you want user pluggable functions?
16:27:15foxcubyeah
16:28:01foxcubI want the user to be able to provide save[TA,TMyType](a: TA, x: TMyType), and I want it to just work.
16:28:32foxcubI also want the user to be able to provide her own Archive implementations, by defining save/load for simple types, and I want the rest to just work.
16:28:51Varriountfoxcub: All they should have to do then is to define the save/load proc for their type.
16:29:03VarriountAnd import your module.
16:29:25VarriountThe only reason that wouldn't work is because of the generics.
16:29:36VarriountYou want a fallback implementation, I assume?
16:29:53fowlor just read the section i linked to
16:30:05fowlif you want something to skim for: "mixin"
16:30:30foxcubI don't want a fallback implementation.
16:30:42foxcubI want errors when things aren't implemented.
16:30:59foxcubBut there seems to be a limitation with modules.
16:31:07fowlno there doesnt
16:31:17foxcubOh, sorry
16:31:18fowlor if there is, it isnt what youre describing
16:31:20foxcubI missed your comment.
16:32:36foxcubfowl: brilliant, I see what you mean. Thanks.
16:32:40foxcubLet me try it.
16:33:10foxcubAnd it works! Thanks, fowl
16:33:46foxcubSooner or later I'll wrap my head around the subtleties of this language.
16:34:18fowlor just read through the manual
16:34:21fowlwink
16:34:52foxcubYeah, that's the plan. I only stumbled on nimrod yesterday, so for now just wanted to play with it a little to get a feel for things. Manual is the next on the list.
16:35:00fowlthere's cool stuff in it, like user-defined type classes http://build.nimrod-lang.org/docs/manual.html#user-defined-type-classes
16:35:08*Fernandos left #nimrod ("PRIVMSG #concrete5 :Not found a c5 dev yet?")
16:35:48foxcubWell, I'm in general finding the blend of C++ and Python irresistible.
16:36:20foxcubBut yeah it seems there is a treasure trove of stuff there. I still need to figure out what it has for concurrency, but so far it's looking great.
16:39:08Varriountfoxcub: I'm glad you like nimrod. Personally, I find it worthwhile, helping to promote a language that many would say is an underdog.
16:40:06foxcubVarriount: I'm sure it's just a matter of time. I suspect publicity is the issue. I'd never heard of it until yesterday.
16:54:42dom96I think we reached a saturation point with people who frequent HN/Reddit.
16:55:15dom96I was hoping for more people to arrive here while that talk was on the front page.
17:02:57Varriountdom96: I don't suppose you would happen to know if the new FFI interface somehow generates files? I'm getting a compiler error about an undefined symbol "STDCALL" in evalffi.nim
17:03:15VarriountWhen I try to bootstrap nimrod (devel branch_
17:03:17Varriount*)
17:03:30*zahary_ quit (Read error: Connection reset by peer)
17:03:48discolodaNimrod is interesting, where its basicly the language i wanted to make, with two exceptions: loose identifiers and uses '.' for the alternate function call syntax (mine used space)
17:09:43*wan joined #nimrod
17:10:27dom96Varriount: I don't think so.
17:20:32*aftershave quit (Quit: Textual IRC Client: www.textualapp.com)
17:21:40*aftershave joined #nimrod
17:21:51*[2]Endy quit (Ping timeout: 252 seconds)
17:29:34Araqdiscoloda: what are "loose identifiers"?
17:30:22Araqhi foxcub welcome
17:30:40foxcubhi Araq thanks
17:31:07*vvbitt joined #nimrod
17:31:35Araqdom96: there is 'error' as a proc annotation which currently can't take a message, and then there is the error statement pragma
17:31:56AraqI'm sure it's documented and that you asked 10 times about it
17:32:03Araq:P
17:32:44OrionPKim guessing he means LoOosE vs loose vs loo_se
17:33:26Araqoh I see
17:34:08vvbittHello. There are a couple of unanswered questions on reddit.
17:34:25Araqhi vvbitt
17:34:26dom96Araq: Is the error statement pragma documented separately from the 'error' as a proc annotation pragma?
17:34:33*vvbitt is now known as vbtt
17:34:44foxcubvbtt: where is the reddit discussion?
17:35:01Araqdom96: dunno, I think so
17:35:31vbtthttp://www.reddit.com/r/programming/comments/1vdo3l/nimrod_a_new_approach_to_metaprogramming/
17:35:35discolodaThIs == t_h_i_s
17:35:54dom96Araq: Next time i'll be sure to tell new users that you should not be disturbed with questions, would that be better?
17:36:02foxcubvbtt: thanks
17:36:13Araqdom96: what?
17:36:58dom96Araq: Never mind :P
17:38:12dom96There is nothing in the docs which says "The error statement pragma can only be used at the top-level"
17:39:04dom96But I just found macros.error which should work.
17:40:07Araqno idea
17:42:26*DAddYE joined #nimrod
17:44:27OrionPKdiscoloda one of the nice things about allowing that is interop w/ C libraries
17:45:10OrionPKi.e. my_function_name == myFunctionName
17:46:43*DAddYE quit (Client Quit)
17:51:16discolodaOrionPK: i understand how it is convenient, it just feels a little wrong. you can 'rename' symbols of imported/exported functions with importc and exportc pragmas.
18:05:08*brson joined #nimrod
18:05:20*DAddYE joined #nimrod
18:07:41Araqvbtt: I replied
18:08:25*Demos joined #nimrod
18:08:25*brson quit (Client Quit)
18:08:39*brson joined #nimrod
18:08:42Demosoh dear macros are hard...
18:08:53*CarpNet quit (Quit: Leaving)
18:09:07*vbtt quit (Ping timeout: 246 seconds)
18:09:29Demosalso I was reading the logs and aperently c2nim supports C++... how good is that support, I find that with plain C most headers do not translate
18:10:11Araqoh really? that's news to me
18:10:11dom96Demos: What did you want to ask me about babel?
18:10:37AraqI thought c2nim can read the programmer's mind ...
18:10:52Araqseriously what's so hard to understand that yes, you need to touch the header
18:11:06Araqbut no, that's not big deal and saves TONS of work
18:11:20DemosAraq: I understand that, but I mean I get no nimrod output at all. And sometimes the errors are cryptic at best
18:11:53Demosand dom96 I was going to ask how bable communicates its paths to the compiler
18:12:07dom96Demos: --path
18:12:10AraqDemos: discoloda is using c2nim to translate quake 2 ...
18:12:26Araqand not its header files, but all of it
18:12:44DemosI used c2nim to translate libalpm, but I am pretty sure it would die in a fire if directed at d3d11.h
18:13:18discolodawell, all but a few things. like CPP funkyness. and it needs a lot of work on the Nimrod it emits
18:13:21Demosspeaking of which, how does c2nim translate C++ virtual functions and such
18:13:51Demosdom96: so the compiler does not really "know" about babel
18:14:18AraqDemos: it translates C++ into nimrod code that uses "importcpp"
18:14:26Demoseeeeeewwwww
18:14:55*dymk quit (Quit: This computer has gone to sleep)
18:14:59Araqso "virtual" is not relevant
18:15:33Araqdiscoloda: please don't ruin my argument. c2nim kicks ass
18:15:56Demosright, I prefer to have nimrod headers that do not depend on having a cpp compiler handy on the path. But ofc you need a stable ABI, so real translation would only work with stuff like COM
18:16:22discolodaoh, yes. it does
18:16:36Araqthe idea is to generate a dirty nimrod->c++ brigde which you can then build as a DLL
18:16:50Araqand then you can use a proper wrapper module in nimrod using dynlib
18:17:26Araqbut that has not been tried for now since I lack the time
18:18:11Demosright, I guess that works, and it is probably best for stuff like Qt but COM has a defined binary interface
18:18:25dom96Demos: Indeed. There is a thing called --babelPaths though. So it puts the latest version of any packages installed in ~/.babel/pkgs into your PATH.
18:18:29*dymk joined #nimrod
18:18:30AraqCOM is windows only though
18:19:04AraqI wanted to support COM via disphelper but according to Varriount that's tough
18:19:38DemosI think the "proper" way would perhaps be to have a tool like c2nim that read idl files and generated nimrod
18:20:04Araqbbl
18:20:27Demosbut for indivudial libraries (in particular stuff like D3D) that use COM "lite" just knowing the layout of the interfaces and vtables is probably fine
18:21:38Demosdom96: anyway I wrapped libalpm (the pacman library) and I will submit a pr "soon(tm)"
18:22:30dom96cool
18:23:08Demosit would be super cool for bable to use it, but that is a lot of work
18:31:52*brson quit (Quit: leaving)
18:32:09*brson joined #nimrod
18:32:21*brson quit (Changing host)
18:32:21*brson joined #nimrod
18:33:53dom96Demos: Yes, what advantages would that bring though?
18:34:47Demoswell uninstallation for a start, rock solid dependencies, people using arch or possibly msys2 could just add the repo and get communication between their system package database and babel
18:36:17dom96The only reason babel doesn't support uninstallation currently is because I haven't implemented it yet
18:36:57Demosfair. using libalpm would slightly complicate builds on OSX and windows
18:37:11dom96yes
18:38:19Demosalthough not too much. the only stated dependency is libarchive and you may be able to avoid that if you just don't use the archive manipulation functions
18:40:55Demosalso, for com I don't think disphelper is the way to go. Seems to me that for something like nimrod you really want to use the direct "call through function pointer" style for COM
18:41:22dom96A dependency on libalpm is too a dependency.
18:41:51Demostrue, could be static though, or something
18:42:31DemosI don't really think it is a good idea for babel, I just think it would be neat. I kinda wrote the binding at 2AM for no good reason....
18:42:59*Eruquen joined #nimrod
18:46:31OrionPKdemos, go back to visual studio :P
18:46:41Demoshehe
18:47:11Demosthere are a few issues I am working on there, I want to get nimrod to generate the project file, like cmake does
18:48:27*DAddYE_ joined #nimrod
18:48:46discolodahmm, can you add languages to cmake? like adding nimrod to it
18:49:15DemosI mean I could, but I dont really want to. Better to write some nimrod that generates the project and then just use nake or whatever to call it
18:49:52Demosnimrod does not really need a full on build system, we have the compiler
18:50:41*DAddYE_ quit (Remote host closed the connection)
18:51:13*DAddYE_ joined #nimrod
18:51:52*DAddYE quit (Read error: Connection reset by peer)
18:57:08*Demos quit (Read error: Operation timed out)
18:58:35*vbit joined #nimrod
18:58:59*vbit quit (Client Quit)
18:59:27*vbtt joined #nimrod
19:03:11*dymk quit (Quit: This computer has gone to sleep)
19:10:52*xtagon joined #nimrod
19:11:57Araqhi xtagon welcome
19:14:47xtagonHey :)
19:15:29foxcubIs there any support for atomics in nimrod? For example, compare-and-swap?
19:21:16Araqlook at lib/system/atomics.nim
19:28:29foxcubSo atomicCompareExchangeN is what I'm after?
19:31:34*ddl_smurf quit (Quit: ddl_smurf)
19:34:11Araqnot sure, ask MFLamer when he's around
19:38:06xtagonSince Nimrod compiles to C, is it safe to say you can theoretically use it anywhere you can use C, even embedded systems?
19:38:38Araqyes, we have a special --os:standalone mode for embedded systems
19:38:45xtagonNeat!
19:38:58Araqno gc then and no stdlib, but still runtime array bounds checking
19:39:08Araqand a much better syntax and type system
19:39:14Araqso still a win over C :P
19:40:17xtagonI like that you support many different C compilers
19:41:32*dymk joined #nimrod
19:46:03*dymk quit (Ping timeout: 252 seconds)
19:51:49*foxcub quit (Quit: foxcub)
19:52:26*dymk joined #nimrod
20:02:36*stollero joined #nimrod
20:02:56stolleroGood evening
20:03:30xtagonHello
20:04:38Araqhi stollero welcome
20:05:15stolleroQuick question: Is it possible to map a sequence to variables like: var a, b, c, d = @[1, 2, 3, 4]
20:08:28Araqstollero: for now only with a macro
20:08:49Araqgradha had an implementation but he's not here right now
20:10:12stolleroAlright, maybe there is another way. I'll explain what I want to do. I have a command line application with an input of 4 numbers seperated by space.
20:10:19stolleroReading is really easy with stdin.readLine.split.map(parseInt)
20:10:41stolleroThen I have my sequence that led to my question
20:12:07xtagonI'm trying to build 0.9.2 on Linux AMD64 and get a build error during linking. Here's the last part of the output https://gist.github.com/anonymous/6a41fa5cacf7f8fea337
20:13:12stolleroxtagon: just build on Ubuntu 12.04 x64 without any issues
20:13:25stolleroAraq: Thanks for your help, will take a look at the macros
20:25:24xtagonAraq, any idea why it won't compile for me? It's on Ubuntu 13.04 x86_64
20:27:25Araqxtagon: use git head instead, ubuntu got rid of ansi c's lrint
20:28:21xtagonAraq, thanks
20:29:38*icebattle joined #nimrod
20:29:58Araqstollero: I'll put that macro into the stdlib, this question comes up quite often
20:31:07stolleroAraq: Good idea :)
20:43:34dom96Araq: Could you merge master into the devel branch?
20:44:04Araqdom96: will do it later, fixing unittest module for master
20:44:20dom96ok
20:44:23Araqinterestingly it turned out to be yet another stress test for vm2 ...
20:45:29*io2 joined #nimrod
20:49:25*dymk quit (Quit: This computer has gone to sleep)
20:50:58*Eruquen quit (Ping timeout: 245 seconds)
20:54:17*Eruquen joined #nimrod
20:57:48*Demos joined #nimrod
21:00:39VarriountOrionPK: Did you manage to get 'nimrod serve' to work with multiple files?
21:02:33Demosis there a way to dpecify a document type in any of the XML modules?
21:02:37Demos*specify
21:02:52*[1]Endy joined #nimrod
21:03:30OrionPKiirc i couldnt get nimrod serve to work at all
21:04:08VarriountOrionPK: Ok, then I must be running into the same thing you ran into
21:04:22VarriountI don't get any output. :/
21:04:23OrionPKmm that stinks
21:04:35OrionPKI have some code in the plugin for nimrod serve, but it's disabled
21:04:42OrionPKbecause I couldnt get it to work
21:04:45VarriountYeah, I saw
21:09:15DemosYeah I could not get serve to do anything
21:09:21Araqyou know ... we have like 4 people working with "idetools" but nobody working *on* idetools
21:09:31Araqthat's the problem
21:09:39Demosspawning a process on every keystroke is "Not A Good Idea"
21:10:35VarriountAraq: Fine. I'll go get my machete and shotgun. But if I get eaten by wild procedures, I blame you.
21:11:14stolleroPNimRode to String?
21:11:31stolleroPNimRodeNode to String?
21:11:44Varriountstollero: AstToString, I think
21:12:01VarriountIt's either in the system module, or the macros module
21:12:20AraqI think it's "repr"
21:14:17*DAddYE_ quit (Read error: Connection reset by peer)
21:14:21stollerorepr did the trick
21:14:59Demoshaving idetools exposed vai a nimrod API would be pretty neat as well. Could run all that stuff in the same process as the editor
21:15:10*DAddYE joined #nimrod
21:16:18xtagon"Indentation is done with spaces only, tabulators are not allowed." - is there a good reason for this? I prefer tabs for indentation and spaces for formatting
21:18:58AraqDemos: only if your editor supports DLLs
21:19:05stolleroConvert sequence to array?
21:19:19Varriountxtagon: I think the short answer is, because the width your editor defines for a 'tab' and the width other editors define for 'tabs' is going to be different
21:19:35VarriountThus, any hope of formatting is lost
21:19:40Demosxtagon, alignment matters, not indentation. So if you were to accedently mix spaces and tabs code that looks valid would not be
21:19:42Araqstollero: not possible in general, as array must have a known size at compiletime
21:19:44Varriountxtagon: However, there is a workaround
21:20:01stolleroxtagon: http://c2.com/cgi/wiki?TabsVersusSpaces
21:20:27stolleroCan a string split return an array?
21:20:35Demosand yes, only if you can call dlls, but the idetools text interface can be implemented in terms of the nimrod API
21:20:40stolleroAraq: Can a string split return an array?
21:21:11Demosstollero, not really... I mean how big should it be?
21:21:31stolleroDemos: size of 4
21:22:06Varriountxtagon: If you *really* want tabs, add this at the top of your file (no quotes) : "#! replace("\t", " ")"
21:22:36Demoswhat happens if you pass in a string with more than 4 parts?
21:22:41VarriountEr, I mean, ignore the outer quotes.
21:22:48*pafmaf left #nimrod (#nimrod)
21:23:10xtagonVarriount, thanks. I think I'll conform to the standard
21:23:30xtagonEvery so often I get flak for using tabs in Ruby instead of two spaces :|
21:24:09Araqstollero: I think I can do it now, but I won't show it :P
21:24:27stolleroDemos: I am using stdin.readLine.split - assume that is never greater than 4
21:24:30Varriountxtagon: FYI, the snippet I posted is a source code filter that the nimrod compiler will evaluate, which replaces tabs with two spaces.
21:24:51Araqas it relies on a small hole in the macro evaluation system
21:24:55VarriountSee: http://nimrod-lang.org/filters.html#replace-filter
21:24:57xtagonVarriount, but it has to be in every source file which uses tabs, correct?
21:24:58stolleroAraq: Did you just implement it :)?
21:25:04Varriountxtagon: Yes.
21:25:54Varriountxtagon: Plus, if you plan to submit something like that to Araq, he'll get into a fit, and no-one wants to have that happen again.
21:26:16VarriountWe still haven't gotten rid of the teddy bears from last time.
21:26:19xtagonSo how many spaces should I use for indentation?
21:26:24Varriountxtagon: Two
21:26:37stollero(4)
21:26:39stollero:)
21:26:58AraqVarriount: "get into a fit"? what does that mean?
21:27:37VarriountAraq: To throw a tantrum. (and I was joking, just so you know)
21:28:31Demosare we talking about tabs or fixed length string processing here?
21:28:39Araqbah that never happens
21:28:57AraqI'm always in a good mood
21:29:13VarriountAraq: However, at least in the US, 'tantrum' is associated more with children and/or juvenile behavior, while 'fit' implies a less severe, adult version
21:29:50Araqnow that's offensive :P
21:29:55AraqI'm still like a child
21:30:33VarriountDemos: Are you using idetools/serve as well?
21:30:52Demoswell I would be, but I can't get serve to work
21:31:10DemosI wrote the code to invoke it and redirect output, but I can not do so vecause there /is/ no output
21:31:12AraqDemos: the trick is to use suggest etc. and not "serve"
21:31:24VarriountDemos: Maybe, between the two of us, we can get it back into some semblence of working
21:31:49DemosAraq, true, but then you end up starting a new process for EVERY suggestion
21:32:03Demosand Varriount I could not even find the actual code for idetools, just the code leading there
21:32:16Demosalthough I only looked for a little while
21:32:52VarriountDemos: I don't know about idetools, but the 'serve' code is enmeshed into the main program procedures
21:32:59Demosoh dear god
21:33:37DemosI really can not work on it this weekend, but maybe next week/weekend
21:34:34AraqDemos: yeah but that's still workable
21:35:28DemosAraq, sure. But getting it out of the main program flow is a good goal once we have it working
21:35:49Demosoh dear I think my mouse is dieing
21:36:34OrionPKgive it a viking funeral
21:37:09Demosit is like 2 years old and cost a good amount of money
21:37:17*LordAndrew joined #nimrod
21:37:20DemosI should really stop buying razor products
21:37:24OrionPK:\
21:37:31Araqhi LordAndrew welcome
21:37:31OrionPKyeah razor isnt known for quality
21:37:51LordAndrewHowdy!
21:39:50*[1]Endy quit (Ping timeout: 272 seconds)
21:44:15*vendethiel joined #nimrod
21:44:41Demosit could also be possible that my 30 year old mousepad is disintegrateing
21:45:30Demoswell ok, actually only 19 years old
21:46:35VarriountDemos: I was mistaken. Only *bits* of the serve code is enmeshed in the main procedures. A large part of the processing is in compiler/service.nim
21:47:06OrionPKVarriount u gonna fix nimrod serve?
21:47:21VarriountOrionPK: Possibly. I promise nothing.
21:47:53OrionPKswear to me!
21:48:20VarriountOnly if you can promise me A's in all my classes this semester.
21:48:27Varriount:3
21:48:29OrionPKi promise
21:48:59OrionPKnot promising i'll be able to keep that promise though
21:50:20*stollero quit (Quit: Verlassend)
21:54:40*dymk joined #nimrod
21:56:51Araqping zahary
22:04:24Araqdamn ... anybody still on master?
22:04:53VarriountAraq: I can switch to master.
22:05:05VarriountWhy do you ask?
22:05:21Araqok please check if tests\run\tunittest runs on master
22:12:14VarriountAraq: I'm not able to get nimrod to bootstrap back on to master. I get a gcc error
22:12:41Araquh oh
22:12:55Araqso only devel can compile devel?
22:13:19VarriountAraq: No. Only master can compile master
22:14:27VarriountI was able to get master to compile devel today, about 3 hours ago
22:14:39Araqwhat's the error message?
22:14:55Varriountc:\64\nimrod\compiler\nimcache\compiler_ropes.c: In function 'compilerropesInit':
22:14:55Varriountc:\64\nimrod\compiler\nimcache\compiler_ropes.c:1622:50: error: 'r_393449' undeclared (first use in this function)
22:14:55Varriount asgnRefNoCycle((void**) &r_393458, ropef_125079(r_393449, LOC100001, 0));
22:16:22Araqstrange
22:16:48VarriountThere's a faint possibility that it might be my build setup.
22:17:13VarriountLet me take down the builders, and see if that does anything
22:18:37Araqwe really need versioning of the exes for koch/nimbuild
22:19:37Araqfucking unittest module makes my head explode
22:19:56VarriountHowso?
22:20:54Araq3 nested templates with lazy lookup and override mechanisms should be forbidden
22:21:51VarriountAraq: Yeah. I can't bootstrap master using devel. I keep getting that rope error
22:22:27VarriountWith parallelBuild set to 1, I get:
22:22:30Varriountc:\64\nimrod\compiler\ropes.nim: In function 'compilerropesInit':
22:22:30Varriountc:\64\nimrod\compiler\ropes.nim:289:123: error: 'r_393449' undeclared (first use in this function)
22:22:30Varriount var r {.global.} = r.ropef
22:22:30Varriount ^
22:22:30Varriountc:\64\nimrod\compiler\ropes.nim:289:123: note: each undeclared identifier is reported only once for each function it appears
22:23:08VarriountAraq: I'll use a built version of master from the build farm archives
22:23:26dom96omg. Why is git such a fail at line endings?
22:24:11VarriountBecause stupid people using windows feel the need to change the default git line ending option?
22:25:23AraqVarriount: this makes no sense that code section is not even active
22:25:28Araqlook at compiler/ropes.nim
22:25:38Araqthere is a "when true" section
22:26:24dom96Well I tried...
22:26:31dom96Git is being too much of a bitch.
22:27:37Varriountdom96: How many versions of nimrod is the build farm archiving at the moment?
22:27:50dom96Varriount: Probably quite a lot.
22:27:51vbttcan nimrod overload on the return type?
22:27:59Araqvbtt: no
22:28:55xtagonSilly noob question: why does echo($some_int) work but $some_int.echo does not? But stdin.readLine acts the same as readLine(stdin)
22:29:24Demosdarn I crashed the compiler!
22:29:29AraqVarriount: I guess it's the static[string] that changed its semantics
22:29:46DemosI crashed GCC
22:29:51Araqxtagon: $a.b is parsed as $(a.b) and not as ($a).b
22:30:06xtagonAraq, ah, thanks!
22:30:26Araqyou don't need the $ for echo
22:30:32VarriountAraq: Huh?
22:30:42xtagonThe tutorial uses it
22:31:44VarriountAraq: Should I try wiping my local nimrod build, and bootstrapping it from csources?
22:32:02AraqVarriount: nah, it's fine
22:32:33VarriountAraq: So.. why isn't it working? What changed?
22:33:03Araqnot sure but static[X] changed its meaning
22:33:25Araqer ... never mind
22:33:34Varriount?
22:33:36AraqI am still looking at the devel version
22:37:13AraqVarriount: ah, master has a different version of ~
22:37:29Varriount~?
22:37:38Araqand it still uses 'expr[string]' which changed its semantics
22:37:56Araq ~ is the compile-time rope constructor, obviously
22:38:06Araqbecause it looks like a rope
22:39:03VarriountAraq: And you aren't afraid someone might miss that completely obvious and totally reasonable operator?
22:39:32Araqit's in the compiler not in the stdlib
22:39:37VarriountOh.
22:40:38Araqand it's not my code but zahary's
22:41:25vbttso ~"hello" is a rope?
22:41:32Araqand it starts to make some sense when you have 4K of rope handling code
22:41:46Araqvbtt: yes
22:44:37vbttwhat do you mean *compile-time* rope operator? could this not have been a type TRope("hello")
22:45:00vbttIs it used a lot in metaprogramming?
22:48:30Araqit's used in the compiler, it's not used "a lot", it's not in the stdlib
22:51:52Araqand "compile-time" means it triggers a compile-time context so the compiler must be able to evaluate the argument at compile time
22:52:37vbttok thanks.
22:54:11vbttreading about the interfaces discussion and type classes. i think nimrod has made good design choices here.
22:55:42Demosyeah, I think most people miss the fact that "program to an interface" is a) impossible and b) does not mean "use OO style interfaces everywhere"
22:56:11VarriountDemos: It's not always their fault, Java is largely to blame.
22:56:13vbttI just wish that function calls within typeclasses don't automatically treat values as types, rather require a ':'
22:56:26vbtte.g. write(s, :string) instead of write(s, string)
22:56:45DemosVarriount, I blame the java/c++/simula style OOP (single dispatch)
22:57:12VarriountHey Araq, want to hear of another python let-down?
22:58:34DemosI want to hear it :D
22:58:50Araqvbtt: the type/value unification is however quite advanced
22:59:09Araqin other words I'm not sure what a leading ':' would destroy when it comes to metaprogramming
22:59:15Araqperhaps nothing
23:00:28VarriountWell, a python enhancement proposal was accepted withing the last year for dynamic dispatch. The downside? The dispatch is based only on the type of the first argument in a procedure, whether the procedure be part of a class/object definition or not
23:00:49vbttSince types often follow ':', I think a leading ':' greatly helps readability.
23:00:58DemosVarriount, python must have had single dispatch for a while right?
23:01:10Demoslike regular OOP style virtual calls
23:01:21VarriountAnd due to python's explicit 'self' in object/class methods, this essentially makes the single dispatch useless when working with object methods
23:01:36vbttPython has had single dispatch since almost forever.
23:01:43VarriountDemos: It's a registration dispatch mechanism
23:01:44Demosso how is this new thing different?
23:02:08VarriountIt's meant to help things like the pickle module, where certain mechanisms have to be registered.
23:02:13vbttwhich pep are you talking about?
23:02:33DemosI actually gotta go, see yall later
23:02:41*Demos quit (Quit: Leaving)
23:02:41Varriountvbtt: http://www.python.org/dev/peps/pep-0443/
23:03:23*foxcub joined #nimrod
23:03:31VarriountHello again foxcub
23:03:36foxcubHi
23:03:49foxcubI have a very strange question.
23:04:00foxcubHow can I convert a pointer to a ref?
23:04:23Araqyou don't, you either start with a 'ref' or you use 'var' or 'ptr'
23:04:30foxcub(I realize this is a heresy.)
23:04:43Araq(nope, it's a common question)
23:04:51vbttVarriount: yeah that makes sense - explicitly states 'single dispatch generic functions'
23:04:56foxcubWhat if I want to make an ugliest, unholiest cast? (That would also increment a reference count for the object.)
23:05:35Varriountfoxcub: Have you looked at the gc inc ref and dec ref procs?
23:05:37Araqensure that you have 2 words to fake the GC header then and it might work, foxcub
23:05:57foxcubBut the mechanics of it?
23:06:02foxcubSay I have a pointer.
23:06:22foxcubNow I want a reference, or are you suggesting that I do a bit copy into the reference, but skip first two words?
23:06:24Varriountvbtt: I still dislike the fact that there are no allowances made for OO style programming
23:07:08vbttVarriount: not sure what you mean? Python is very OO style.
23:07:28*psquid joined #nimrod
23:07:28*psquid quit (Changing host)
23:07:28*psquid joined #nimrod
23:07:30Varriountvbtt: That you can't use the single-dispatch generic function mechanisms with methods
23:07:48VarriountWithout going around the restrictions set it place.
23:08:26foxcubAraq, alternatively, is there some kind of a void* type reference? Something I could store, and then extract, but assign to a reference to some higher level type?
23:08:33Varriount(Yes, I realize that you can simply delegate a method to an outside function)
23:08:53Araqfoxcub: there is pointer but that's a untyped "ptr"
23:09:27foxcubWell, that's why I'm storing addresses as pointers, but now how to convert them back to refs?
23:09:44Araqyou can use "ref tuple[]" for an "untyped ref". this requires casts but is memory safe ... I think
23:10:03foxcubAha, can you give me a brief example?
23:10:10Varriountfoxcub: What are you working on, exactly?
23:10:18foxcubVarriount: serialization
23:10:30foxcubThe kind that tracks references correctly.
23:10:59Varriountfoxcub: Has the marshal module been of any use at all?
23:11:06foxcubI don't need json.
23:11:46Araqfoxcub: not sure what the example should contain
23:12:02Araqtold you already everything i know
23:12:18foxcubAraq: I seriously doubt that. :-)
23:12:59Varriountfoxcub: Maybe, but have you looked at the marshal source code?
23:13:16VarriountActually, does the marshal module even handle reference tracking?
23:13:41foxcubVarriount: I have not. It's a good suggestion, I'll check it out. I'm not sure if it tracks references. I saw json, and I skipped it.
23:14:19Araqfoxcub: ever heard of the Second Futamura Projection?
23:14:55foxcubNo, what's that?
23:15:53Araqok, so I didn't tell you everything I know :P
23:16:27foxcub;-)
23:16:48foxcubHm, when I say type TRef = ref tuple[]
23:16:56foxcubAnd then try to make a TTable[int, TRef]
23:17:08foxcubIt complains.
23:17:39Araqok, so it give it a dummy: int field
23:17:54foxcubIt complains.
23:17:57foxcubSorry
23:18:01foxcubIgnore the last comment.
23:20:13foxcubAraq: amazing! It works.
23:20:32foxcubSo casts between references work fine?
23:20:44foxcubWhat does it do to reference counting?
23:21:14Araqnothing but the assignment still does the RC updates so it ends up being fine
23:21:52foxcubSo it's safe, and I don't need to think about GC? That's excellent.
23:21:57Araqif it doesn't work come back and complain, some parts of the GC might not have been written with this in mind *cough*
23:22:09foxcubAraq: ;-) got you
23:23:08Araqin fact, you should add it to the testsuite please
23:23:24foxcubActually, just casting to PObject and back works, so that's all I need.
23:23:46Araqyeah any "ref object" works I guess
23:23:58foxcubgreat
23:30:03VarriountHm. I wonder if flexible declarative command line option parsing is possible
23:30:54*odc quit (Ping timeout: 252 seconds)
23:40:09dom96Araq: What is ole2?
23:40:44Araqsome COM stuff
23:41:02Araqfixed windows.nim already, but need to push it
23:41:03dom96It's currently broken.
23:41:45dom96oh, did you fix it?
23:41:52dom96Did you change TGUID into a tuple?
23:42:47*foxcub quit (Quit: WeeChat 0.4.2)
23:48:04Araqno, should I?
23:48:10AraqI fixed windows.nim on devel
23:48:15dom96Not necessarily.
23:48:34dom96I just used the object constructor syntax for my use case.
23:49:10dom96every single GUID in ole2 will need to be changed as it uses tuple construction syntax
23:49:20Araqhuh? what?
23:49:22*dom96 isn't sure how it ever worked
23:49:35*Araq is not either
23:49:44AraqVarriount: did you change the windows stuff?
23:49:51Araqso ... I've got good news
23:50:01Araqunittest module works on devel again
23:50:34VarriountAraq: The only changed windows stuff is in my most recent pull request, that adds greater symlink support to os.nim
23:50:48Araqmake that PR against devel please
23:50:50VarriountThe pull request is on the devel branch
23:50:57Araqdamn :P
23:50:59Araqyou're quick
23:51:38Araqcan you please start to work on something important? :P
23:51:45Araqlike fixing idetools
23:51:59Araqthat might even be easier than closure iterators
23:52:17*darkf joined #nimrod
23:52:20VarriountAraq: How is idetools broken?
23:52:31Araqthe "serve" mode
23:52:39Araqaccording to everybody who tries it
23:53:02VarriountFunny thing about that, I think I found a workaround for the moment
23:53:50VarriountAraq: There's a 'reset' command when in serve mode. I don't know exactly what it does, but if used after every command sent to the serving compiler, things work.
23:54:42dom96Perhaps that is how zahary intended it to be used from the beginning.
23:54:43VarriountYou are right, of course. Fixing 'serve' is much easier than closure iterators.
23:55:01dom96Varriount: Could you document 'serve'?
23:55:23Varriountdom96: http://build.nimrod-lang.org/docs/idetools.html#compiler-as-a-service-caas
23:55:43dom96oh TIL
23:56:02VarriountAlthough, the fact that you have to specify a single source file offends me somewhat.
23:56:25VarriountSince most programmers tend to have multiple files open at any given time.
23:56:44dom96It doesn't seem 'reset' is documented.
23:56:53VarriountNope.
23:57:29Araqwhy has this been written by britney spears?
23:57:39Araqalso wow I never read it ...
23:58:27dom96because gradha
23:59:25Araqhe should get some credit for his work
23:59:44VarriountAm I missing something?
23:59:54dom96Also we should be professional :P