<< 19-06-2013 >>

00:06:47*EXetoC quit (Quit: WeeChat 0.4.1)
00:59:37*Trixar_za is now known as Trix[a]r_za
01:11:18*Boscop quit (Disconnected by services)
01:11:21*Boscop joined #nimrod
01:23:36*DAddYE quit (Remote host closed the connection)
02:03:22*fowl is now known as zz_fowl
02:28:21*zz_fowl is now known as fowl
03:50:46*silven quit (*.net *.split)
03:50:48*Raynes quit (*.net *.split)
03:52:42*silven joined #nimrod
03:52:42*Raynes joined #nimrod
03:53:59*silven quit (*.net *.split)
03:53:59*Raynes quit (*.net *.split)
03:55:39*silven joined #nimrod
03:55:39*Raynes joined #nimrod
04:22:38*OrionPK quit (Read error: Connection reset by peer)
06:06:50*q66 joined #nimrod
06:09:56*Amrykid quit (Read error: Operation timed out)
06:13:06*Amrykid joined #nimrod
06:38:45*comex quit (Quit: Coyote finally caught me)
07:14:50*comex joined #nimrod
07:43:26*comex quit (Quit: Coyote finally caught me)
08:30:53*comex joined #nimrod
09:11:36*Araq_ joined #nimrod
10:08:52*EXetoC joined #nimrod
10:21:25Araq_ping zahary_
10:21:33zahary_hi
10:22:55Araq_I'm planning a pure reference counting GC for the shared memory heap
10:23:13Araq_so that no stack walkings whatsoever are necessary
10:23:25Araq_this means it never needs to stop any thread
10:23:31zahary_throwing out deferred counting?
10:23:40Araq_yeah
10:24:01zahary_if the papers are to be trusted this should work very well
10:24:07Araq_so I've been thinking how to optimize/detect not owning pointers
10:24:26Araq_but it's quite hard
10:24:30zahary_this shouldn;t
10:24:33Araq_for now the rule is:
10:25:08Araq_if the variable v is local and the proc doesn't perform write access to a location that may alias what v points to
10:25:25Araq_for instance:
10:25:36Araq_var it = head; while it != nil:
10:25:56Araq_ it.prev = it.next # deletes node 'it'
10:26:00Araq_ use(it)
10:26:04Araq_ it = it.next
10:26:22Araq_'it' then keeps the node alive
10:26:33zahary_why are you trying to invent the rules. there was a paper analyzing the problem
10:26:36Araq_so you need to perform RC ops for it
10:27:08Araq_yeah but I lost the paper :P
10:27:19Araq_and it's always more fun to think for yourself
10:27:49zahary_it seemed complicated and we'll probably get it wrong as fun as it is :)
10:28:55Araq_my rule may be overly conservative
10:29:01Araq_but I'm pretty sure it's correct
10:31:03zahary_so, where are the increments/decrements in your example?
10:32:52Araq_for the it.prev = it.next the usual ops
10:33:33Araq_for 'it' we do the same but in addition need an try: ... finally: if it != nil: decRef(it)
10:34:02Araq_which is expensive
10:36:52zahary_maybe this was the paper? http://www.hpl.hp.com/personal/Pramod_Joisha/Publications/ismm06.pdf
10:37:30zahary_you should still remember that the refcount updates require some form of locking (atomic ops are not sufficient)
10:39:03Araq_it there are no write operations to the heap that may influence 'it' (unlike the example) you can avoid the RC ops for 'it'
10:39:30Araq_(unless 'it' points to newly allocated memory ...)
10:39:34zahary_the most touted algorithm in the literature (the one using the alternative write barriers) doesn't require locking and has a cheaper write barrier in the common case
10:40:57Araq_however for "shared ref" the cost should be acceptable
10:42:35zahary_I'm not that convinced that shared ref should be rarely used. maybe serial types (unique smart pointers) will prove to be most widely used type
10:51:57Araq_yeah well ... thanks to aliasing everything is hard
10:52:33Araq_and I haven't found any good papers about linear types for now
10:53:16*Araq_ quit (Read error: Connection timed out)
10:53:33zahary_linear types are a simple concept in my opinion. the implementation in otherwise immutable languages is what creates the need for complicated papers
10:53:57zahary_a linear type is just a value that can have a single reference in the program at any point
10:54:07zahary_C++'s unique_ptr would be an example
10:54:53zahary_they can be implemented easily as user types once value semantics are in place
10:54:55*Araq_ joined #nimrod
10:55:14zahary_linear types are a simple concept in my opinion. the implementation in otherwise immutable languages is what creates the need for complicated papers
10:55:19zahary_linear type is just a value that can have a single reference in the program at any point
10:55:23zahary_C++'s unique_ptr would be an example
10:55:26zahary_they can be implemented easily as user types once value semantics are in place
10:57:29Araq_I dunno; "a nonlinear data structure must not contain any linear components" is a common restriction
10:58:09zahary_this follows naturally in C++ due to the lack of copy constructor of unique_ptr
10:58:36zahary_any type that has a unique_ptr member will get only a default move constructor implicitly
10:59:49Araq_how does that help? C++ doesn't prevent arbitrary nesting of types
11:00:22Araq_alright I see
11:00:25zahary_but it's transitive with regard to nesting. if you don't get a default copy ...
11:14:28Araq_"the most touted algorithm in the literature ..." can you find that paper again please?
11:15:56*Araq_ quit (Read error: Connection timed out)
11:16:55*Araq_ joined #nimrod
11:16:57zahary_there is a stand-alone paper, but what was easier to find is the complete master thesis of one of the authors
11:17:01zahary_http://www.cs.technion.ac.il/users/wwwb/cgi-bin/tr-get.cgi/2006/PHD/PHD-2006-10.pdf
11:17:29zahary_3. An On-the-Fly Mark-and-Sweep Garbage Collector Based on Sliding Views
11:17:38zahary_the write barrier and the general algorithm is explained here
11:19:37zahary_note that the same barrier is used in another GC, which claims to be faster, but requires precise stack marking
11:19:37zahary_http://grothoff.org/christian/teaching/2007/4705/urc-oopsla-2003.pdf
11:20:37zahary_it uses bump-pointer heap for new objects (nursery) that are moved to a regular heap if they survice
11:20:43zahary_survive
11:21:37zahary_but it's also true that nimrod challenges the generational hypothesis with our stack allocated objects. maybe these nurseries won't help us much
11:35:18*Amrykid quit (Changing host)
11:35:18*Amrykid joined #nimrod
11:40:17Araq_and what's worse ... it complicates the write barrier even further
11:41:15zahary_complicates as in "more core"?
11:42:45*Trix[a]r_za is now known as Trixar_za
11:44:09Araq_yeah
11:44:25Araq_and the generational write barrier requires the object owner
11:44:38zahary_I've implemented that part in the codegen
11:44:43Araq_which the codegen doesn't emit and which may not be available for 'var ref'
11:45:25zahary_what is special about var ref?
11:47:34Araq_the traditional write barrier injects obj.field = x
11:47:54Araq_with 'var ref' the obj.field access can be split up in arbitrary ways
11:48:14zahary_ah, sure. I've thought about this too
11:48:43zahary_it's not implemented yet, but it's possible to pass the owner as well in call-sites.
11:49:08zahary_the var ptr param will just get "fatter"
11:51:07*Araq_ quit (Read error: Connection timed out)
11:51:51*Araq_ joined #nimrod
12:01:47Araq_that's one way of doing it, the other being to call interiorPointer(...) to get the owner's address
12:02:22zahary_yep, forgot about this one
12:02:27Araq_it's expensive but currently we already have an unsureAsgnRef
12:07:52Araq_well I can't see me implementing "An On-the-Fly Mark-and-Sweep Garbage Collector Based on Sliding Views"; I'll go for the pure RC GC
12:08:23Araq_and yeah it'll use atomicInc/Dec + locks in the GC
12:11:43zahary_I had an idea to make the --gc:... switch just point to a file containing a bunch of required constants (besides the implementation) that tell the codegen to use certain kind of write barriers or certain kinds of stack marking
12:12:04zahary_do you welcome such change? then we'll be able to have a plethora of GCs
12:15:42zahary_then I'll go to the GC mailing list to explain how much easier to use Nimrod is compared to Jikes VM (the current golden standard for GC experimentation)
12:19:18Araq_the idea is not bad, but perhaps we should make that --gcImpl switch and keep --gc as it is
12:20:13Araq_or we make the codegen check for the existance of some symbols via the compilerproc mechanism
12:21:20Araq_and compilerproc needs to be renamed to cgsym or something anyway
12:21:30zahary_how does that work? these implementation details were the reason I didn't go ahead with it
12:27:53Araq_type RequiresRCWriteBarrier {.compilerproc.} = object # in gc.nim
12:28:11Araq_in the codegen: if getCompilerProc("RequiresRCWriteBarrier") != nil: ...
12:28:47Araq_it's uglier than necessary because {.define.} has been deprecated
12:29:05zahary_I thought it woudn't be too hard to get a value of a named constant in cgen
12:29:37zahary_const WriteBarrierType = wbOwner
12:29:58zahary_the value
12:31:43Araq_I don't think there are compilerproc consts
12:32:04Araq_and without the compilerproc the symbol is not guaranteed to be kept
12:32:09zahary_but the value is in the symbol table (the ast field of the const symbol)
12:32:55zahary_heck, even a magic would be simple to implement. WriteBarrierType wbOwner
12:39:34Araq_the symbol table is not persistent ... well it used to not be
12:45:18*Araq_ quit (Read error: Connection timed out)
12:46:56*Araq_ joined #nimrod
13:00:41EXetoCis it possible to get the root AST node? I couldn't find anything relevant
13:04:56Araq_EXetoC: within a macro you can use callsite()
13:05:20Araq_you can't get up further by design
13:20:03EXetoCok. that's barely an inconvenience
13:43:01*Araq_ quit (Quit: ChatZilla 0.9.90 [Firefox 21.0/20130511120803])
13:47:27EXetoCsome changelog mentioned getting closer to unifying of expression and statements. is that statements as expressions or something else?
13:48:55EXetoCwhich is a very convenient feature
14:07:41*Trixar_za is now known as Trix[a]r_za
14:18:30EXetoCthis often throws because it cannot always find "name": (it.kind == nnkProcDef or it.kind == nnkMethodDef) and it.name.baseName.ident == !"inv")
14:19:00EXetoCthis looks similar to classimpl's approach, so what's going on? is short circuiting working like in other languages?
14:19:40EXetoCI'll try to divide it into several if statements and see if it works then
14:21:15EXetoCactually, it might be failing on the next line
14:32:55EXetoCuh yeah, callsite() doesn't really give me anything new. is it possible to check if a certain node will compile?
14:35:49EXetoCotherwise I'll just have to blindly insert new nodes and hope for the best
14:36:01zahary_there is system.compiles, but it's currently not possible to directly check AST values against it. we should fix that, but currently it's only possible to return a block from the macro that uses system.compiles in a when statement
14:36:07zahary_https://github.com/Araq/Nimrod/blob/master/lib/pure/unittest.nim#L117
14:36:49zahary_this is an example from the unittest module, you should see how these templates are used with getAst
14:41:35EXetoCyeah, so it's just a matter of converting to a string first
14:42:24zahary_er, no. it's just that the purpose of the check in the unittest module is to determine whether the type is convertible to string
14:42:48zahary_the goal is to print intermediate values (if that's possible)
14:43:26zahary_you could have an arbitrary expression as an argument to compiles(...)
14:45:33EXetoCuh yeah
16:21:08*Endy joined #nimrod
16:31:21fowlEXetoC, what are you having trouble with
16:44:24reactormonkproc makeDocList*(numFiles: cint): ptr ptr ptr wordEntry =
16:44:26reactormonkO.o
16:44:26*DAddYE joined #nimrod
16:45:27fowllol
16:45:49fowlim going through this, see what it takes to do stuff in nimrod http://developer.ubuntu.com/get-started/
16:46:48reactormonkQT-based?
16:47:30fowlyea
16:47:34fowlqt5
16:48:30fowlis that going to be a problem
16:51:21fowllooks like little code has to be written
17:05:56EXetoCfowl: checking if a call compiles
17:10:16EXetoCin AST form
17:15:07EXetoCzahary_: so an AST can't be converted to an expr then?
17:20:48fowli got it working..
17:21:14fowlhttps://gist.github.com/fowlmouth/baf4772bac7a38bf8161
17:21:32fowlo nm
17:21:35fowlgetAsp >_>
17:22:02fowlwith getast i got a segfault :D
17:40:13Araqnice ... -.-
17:55:55*fowl- joined #nimrod
18:00:08*DAddYE quit (*.net *.split)
18:00:09*fowl quit (*.net *.split)
18:02:36*DAddYE joined #nimrod
18:02:38fowl-Araq, should i file an issue
18:07:35EXetoCoh ok
18:08:28Araqfowl-: yes please
18:09:38fowl-ok
18:10:35fowl-so that should work
18:10:40fowl-compiles(getAst(exp)) ?
18:11:02AraqI dunno but it mustn't crash the compiler
18:11:21fowl-aye
18:12:08EXetoCAraq: cmon, don't take away all the challenges
18:13:21*Trix[a]r_za is now known as Trixar_za
18:25:07*Endy quit (Ping timeout: 268 seconds)
18:32:44*fowl- is now known as fowl
18:32:48*fowl quit (Changing host)
18:32:48*fowl joined #nimrod
18:51:22*sbenitez joined #nimrod
18:51:56*sbenitez is now known as whoknows
18:52:14*whoknows is now known as nooneknows
18:52:33nooneknowsHi all. I'm having a problem compiling with the standalone os target.
18:52:53nooneknowsSpecifically: Error: system module needs 'addChar'.
18:55:37nooneknowsI see system.nim:934 should not include "system/cgprocs" when hostOs == standalone. Is this a bug, then?
18:56:10fowlnooneknows, someone will be along who knows more about it
19:00:33nooneknowsGreat, thanks. :)
19:01:58reactormonknooneknows, where do you want to run it on?
19:04:14Araqhi nooneknows , welcome
19:04:29Araqyeah I know --os:standalone doesn't work anymore
19:05:01reactormonkAraq, can't wrap my head around that progmem stuff :-(
19:05:29Araqyou need to wrap some 'add' definition in a 'when hostOs != "standalone"' section
19:06:23AraqI think it's the one in line 1746 in system.nim
19:07:22Araqreactormonk: just ignore the progmem crap then? and as I said, it's not important that 'raise' works properly when you've got 16K of RAM ...
19:08:07reactormonkAraq, just kick the exception? I don't like that either
19:08:27reactormonkand I need to figure out how to store structs in the progmem anyway
19:13:07Araqlooks like we need another pragma
19:13:27Araqsomething like "annotation" that allows for more flexibility how things are declared
19:13:55reactormonksadly, yep
19:14:05Araqvar x {.annotation: "$# progmem $#".}: int ?
19:14:11reactormonkactually having my new pointer type would be sweet
19:14:58reactormonkwhy not. But you can't capture certain stuff with that, such as that you cannot dereference with * there
19:15:04reactormonkyou need pgm_read_word
19:15:17Araqgah that sounds nasty
19:15:58reactormonkyup
19:16:20reactormonkbecause PROGMEM has its own address space, you need *_P functions for that, or pgm_read_* stuff
19:19:00reactormonkI could work with different types here, but I think that annotation pragma would help
19:20:13reactormonkThe best way would be to have a {.progmem.} that takes care of the annotation and changes the type of the variable so I can add converters that read the stuff from progmem if needed and if not, pass the correct types on to C functions
19:20:36Araqwell if you need accessors anyway what's wrong with a "distinct ptr"?
19:20:53reactormonk prog_pointer = distinct pointer
19:21:01Araqnah
19:23:57Araqtype TX {.extern: "int* progmem".} = distinct ptr int16
19:24:42Araqproc `[]`(x: TX): int16 = pgm_read_int(x)
19:25:05reactormonkah
19:25:26reactormonkdoes the compiler call [] automatically?
19:25:34Araqno
19:25:55reactormonkLet's give converters some love
19:50:48EXetoCare there functions that specifically give everything before FormalParams? 'name' is one of them, and stmt[0] is just ProcDef so that's easy to remember, but there's Empty x2 just before FormalParams
19:52:44nooneknowsAraq: Thanks. That fixed the addChar. Now I see "system module need 'copyString'.
19:52:57fowlno EXetoC
19:53:21fowlformalparams is like this: [resultType, identDef(arg1name, arg1type, arg1default), ...]
19:53:50fowlpaste and ill check it out
19:54:22nooneknowsThe only reference I see to sysstr is on system.nim:2129
19:55:27reactormonknooneknows, which processor do you want it to run on?
19:56:10fowlnooneknows, are you using nimgrep to search
19:56:15nooneknowsi586
19:56:34fowlnooneknows, standalone is for embedded devices
19:56:46nooneknowsOn bare metal...
19:57:38reactormonkoh.
19:57:52nooneknowsI'm just using grep to search.
19:58:55fowlits probably not used with different case/styles but its best to search for an identifier with nimgrep --ignorestyle
19:59:18fowlthat way you can find s_y_S_s_t_R if its typed like that
20:02:31nooneknowsNo further matches with nimgrep.
20:08:25nooneknowsAh, I see system.nim:1079. I believe that's the culprint.
20:08:30nooneknowsculprit*
20:08:49EXetoCfowl: I was just looking for a convenience function. the layout is static so adding it manually should be easy
20:09:33fowlEXetoC, oh you were asking about the layout of a proc node?
20:09:45fowlEXetoC, do this in a new file: import macros
20:09:48fowldumptree:
20:10:08fowl proc foo [A] (some: A): B {.foo.} =
20:10:13fowl nil
20:10:50fowlthat should have most of the fields filled out
20:11:10fowlthere are helper funcs like name() for that reason though
20:12:07nooneknowsNope.
20:13:59nooneknowsreactormonk: I see you were having similar issues a while ago. Did you ever get it sorted out?
20:15:46reactormonknooneknows, still on it, should run on arduino afterwards
20:16:14nooneknowsIs it compiling with --os:standalone?
20:37:00reactormonknope
20:37:43reactormonkAraq, can I somehow query the size of a type?
20:38:14fowlsizeof()
20:40:43reactormonknow the interesting part is that I can only read in word/dword sizes... which is different form platform to platform :-/
20:41:21reactormonkAraq, any way I can fuck with the assignment copy? :-)
20:43:23reactormonkscrew it, don't need that
20:44:05fowlnooneknows, are you trying to write a kernel or somethign
20:44:12nooneknowsYes.
20:44:21fowlcool
20:44:36EXetoCfowl: nah I was using treeRepr for that
20:44:41Araqdom96 used to have a kernel written in nimrod
20:44:53fowlyea but he never published it
20:44:57fowl=(
20:45:19fowli wrote an oracle in nimrod once
20:45:52fowlit was capable of solving 1000 what-is-the-meaning-of-life's per second
20:45:52fowlbut i didnt upload it anywhere
20:45:53dom96I wouldn't call it a kernel, but I still have it somewhere.
20:46:01dom96I'm guessing it won't work anymore.
20:46:02reactormonkAraq, is it reasonable to have a memcpy that copies stuff from progmem to RAM?
20:46:08reactormonk... without typecheck.
20:46:17reactormonkbecause I wouldn't know how to do that.
20:46:52reactormonkwait, maybe generics
20:47:54reactormonkany way to attach a generic to a distinct pointer? So I can have prog_ptr[char] afterwards?
20:48:25fowltype prog_ptr [X] = distinct ptr X ?
20:48:56reactormonkbasically
20:51:49reactormonkseems to compile
20:55:37Araqreactormonk: I don't think memcpy can deal with it
20:56:26Araqand I'm beginning to wonder if you can be of more help to us :P
20:56:34Araqwhy not play with the JS backend again?
20:57:31reactormonkAraq, because that's my current project ;-)
20:57:52Araqnooneknows: if you write a kernel, it might be easier to not do that via --os:standalone but instead make the GC/memory manager work with your kernel
20:58:46Araqbasically you need to provide a simple osAllocPages()
20:58:56Araqyou can use a static array and provide the memory from that
20:59:27nooneknowsWhat is system.c?
20:59:38reactormonknooneknows, the nimrod stdlib
20:59:49fowlthe result of system.nim
21:01:07nooneknowsAraq, so you're saying I should include the runtime with the kernel? Doesn't the runtime make use of a lot of system funtions?
21:03:05nooneknowsDoing --gc:none -d:useMalloc gives me: Error: undeclared indentifer: 'TCellSet'
21:04:13AraqI know
21:04:19Araqdon't use that
21:04:27Araqmake it work with your kernel instead of disabling it
21:05:33nooneknowssystem.c uses errno, mman, stdio, and signal from libc. Writing this code would take a substantial amount of time.
21:14:55Araqwell I know a guy who managed to massage system.nim and got it to work
21:15:43nooneknowsSure, but "massaging" it, or eliminating it, is what the --os:standalone flag should do, isn't it?
21:16:09AraqI'm not sure
21:16:31Araq--os:standalone may also mean "embedded"
21:16:41fowlmy oracle is saying that hope in anything is illogical, and that the only sane course of action is to dance around naked
21:17:35dom96from what I remember, I specified my own custom system.nim, if that helps. I'm on Windows currently so I can't check my code.
21:21:28*EXetoC quit (Ping timeout: 246 seconds)
21:22:18dom96I'll dig up the code and try to get it running again tomorrow, that is if I don't end up playing Kerbal Space Program all day.
21:23:30reactormonknow I have a byte and a ptr. How do I write that byte to that specific ptr?
21:25:02Araqcast[ptr byte](p) = b
21:28:33reactormonkso basically http://sprunge.us/JcOL
21:30:13reactormonknow, how do I get the target if I want var foo = <something in progmem>
21:30:55fowlhow would you do it in c
21:34:36reactormonkin nimrod, basically var foo: T; memcpy(bar, foo)
21:35:18dom96so you want: var foo = bar?
21:35:50nooneknowsWhat is setStackBottom supposed to do?
21:36:59reactormonkdom96, yep
21:37:27reactormonkdom96, actually var foo = bar[] if possible
21:37:45reactormonkbut I'd settle with var foo = bar
21:37:47nooneknowsls
21:37:49nooneknowswoops.
21:38:08*EXetoC joined #nimrod
21:38:20dom96reactormonk: Maybe you could overload [], you can't currently overload `=`.
21:38:44reactormonkdom96, so I'll settle with the allocate, then copy
21:39:08dom96or just creat a proc which does it, now that I think about it I don't think it's possible to overload [] that way.
21:39:13dom96*create
21:39:29dom96A proc with a name like "getMem" or something.
21:45:19dom96Araq: oh cool, maybe gradha will beat you to creating a blog. :P
21:51:05fowlreactormonk, write a template for :=
21:51:48reactormonkfowl, would be an idea
21:55:05reactormonkAraq, the pragma you mentioned, could I use that one for type prog_ptr[X] = distinct ptr X in such a way that var foo: prog_ptr[TFoo] = ... generates TFoo foo PROGMEM = ... ?
21:55:38AraqI'm not sure
21:57:03EXetoCwhat goes between Pragma and StmtList? I thought maybe it was the optional comment as indicated by the grammar, but adding one changes nothing
21:57:45*nooneknows is now known as sbenitez
21:58:18*sbenitez is now known as sergio965
21:58:20*sergio965 is now known as Sergio965
21:59:57AraqEXetoC: I don't understand your question
22:00:39fowlEXetoC, like i said stop worrying about the structure of the proc node and just use the helper functions, i wrote them so you dont have to remember node[6] is the statement list
22:01:20EXetoCAraq: in the proc AST. ...FormalParams, Pragma, Empty, StmtList...
22:01:56EXetoCfowl: there's nothing for index number 6. I'm just curious
22:02:05EXetoCI am using those that are there already
22:03:07Araqthere are also empty positions for later additions
22:03:55EXetoCalright thanks
22:08:40EXetoConly return value interception left then. let's see if there are any caveats related to that
22:10:52*Trixar_za is now known as Trix[a]r_za
22:15:53Sergio965Does Nimrod allocate 1000000001 bytes for strings?
22:16:13Araqwhat do you think?
22:16:29Sergio965No, but the typedef is char[10000001].
22:16:31Sergio965Or whatever.
22:17:38EXetoCofc it does. gotta avoid those re-allocations :>
22:17:51Sergio965Eh?
22:18:07EXetoCnot quite that I think. it's just a range isn't it
22:18:16EXetoCshould be documented somewhere. let me check
22:18:33Araqdunno where that comes from but in general I prefer weird/wrong upper bounds so that bounds checking can stay turned on
22:18:52Sergio965How does that affect bounds checking?
22:19:16Sergio965Strings in Nimrod have lengths associated with them.
22:19:55Araqfor instance:
22:20:01Sergio965Strings are: struct { tseq struct { int lin; int reserved; }, char[10000001] }
22:20:08Sergio965int len*
22:20:39Araqtype a = ptr array [0..1000_000, char]
22:20:58Araqvar v = cast[a](alloc(100))
22:21:11Araqv[10] # compiles
22:21:53Araqsimulates C's unchecked arrays and there is no need for {.push checks:off.}
22:22:05Sergio965Doesn't it consume a lot of memory?
22:22:12Araqlook at my code
22:22:19Sergio965Well, not yours.
22:22:31Araqwell the other code does the same
22:22:49Sergio965Perhaps it's because I turned off bounds checking that I see this?
22:23:03Araqit's only a declaration
22:23:09Araqit lies
22:23:17Sergio965But the string is allocated statically.
22:25:06EXetoCuh oh "lib/nimrod/core/macros.nim(329, 26) Error: internal error: expr(skMacro); unknown symbol"
22:25:16EXetoCwill create a test case soon
22:25:56Araqlooks like I need to fix bugs before implementing new features ...
22:26:00Sergio965http://pastebin.com/83X38d6u
22:26:14Sergio965Won't TMP62 be really large?
22:26:34Sergio965Sorry, there's supposed to be a typedef char NIM_CHAR: at the top.
22:27:23Araqyeah but the compiler shouldn't generate that ...
22:27:30Sergio965But it did!
22:28:04Araqwhich code makes it generate that?
22:28:49EXetoCdon't worry, we'll survive a little longer even with such a tiny feature set :-)
22:29:09Sergio965http://pastebin.com/4TS5iit8
22:29:26Sergio965(It does nothing.)
22:31:07Sergio965I'm compiling with c --gc:none --noMain --stackTrace:off --lineTrace:off -c
22:34:51Araqthe compiler only uses NimStringDesc* for me ...
22:34:58Araqwhich is a pointer
22:36:07Araqthe literals come from STRING_LITERAL which uses an array of a proper size
22:38:10Sergio965The code I showed you was what I got when I ran it through the preprocessor.
22:39:55Sergio965Oh.
22:40:20*Sergio965 whistles
22:40:24Sergio965Sorry. :)
22:40:53Sergio965I converted some of the code by hand to be more readable and I misread the struct constructor.
22:41:01Sergio965Er, not converted, but rewrote for clarity.
22:42:21Sergio965:q
22:42:23Sergio965Sigh.
22:43:44*OrionPK joined #nimrod
23:02:29Sergio965How do I change the output directory to be something other than numcache?
23:02:32Sergio965nimcache*
23:02:42Araq--nimcache:path
23:05:24Sergio965Thanks. :)
23:17:50Sergio965Is there a way to make it write to a parent directory?
23:19:06Sergio965Nevermind.
23:35:57*DAddYE quit (Remote host closed the connection)
23:36:51*SirSkidmore left #nimrod ("WeeChat 0.4.0")
23:42:13Sergio965Can I not do something like: var p: ptr = ptr(0x1000)?
23:44:13OrionPKdear god
23:44:41Sergio965Indeed.
23:47:04*q66 quit (Remote host closed the connection)
23:49:30Sergio965If I could, that'd be awesome.