<< 13-08-2013 >>

00:31:49*jbe_ quit (Quit: Leaving)
01:33:15*XAMPP-8 joined #nimrod
01:37:19*q66 quit (Quit: Leaving)
01:37:57*XAMPP-8 quit (Ping timeout: 276 seconds)
04:22:11*OrionPK quit (Quit: Leaving)
04:57:01*XAMPP-8 joined #nimrod
05:05:50*zahary joined #nimrod
06:00:14*XAMPP-8 quit (Ping timeout: 240 seconds)
07:10:41vegainow does nimrod do unicode? Are strings utf8?
07:11:39vegaihttps://github.com/Araq/Nimrod/issues/400
07:11:49vegailooks like it's more or less like it's in go
07:17:52Araqvegai: it's utf-8 except for inputs where we don't guarantee anything
07:17:55Araqhowever!
07:18:16Araqyou can use --taintMode:on and then you're forced to do input validation on your own
07:27:23vegairoger
07:36:46*Associat0r joined #nimrod
07:36:46*Associat0r quit (Changing host)
07:36:46*Associat0r joined #nimrod
07:44:25*EXetoC joined #nimrod
08:57:54*Associat0r quit (Quit: Associat0r)
09:21:23NimBotAraq/Nimrod master c542aa7 Araq [+1 ±6 -0]: implemented computed goto support
10:10:47*q66 joined #nimrod
10:23:38*BitPuffin joined #nimrod
11:43:57*Associat0r joined #nimrod
11:44:01*Associat0r quit (Changing host)
11:44:01*Associat0r joined #nimrod
12:11:02dom96hello
12:17:29NimBotnimrod-code/packages master b04b95a Simon Hafner [+0 ±1 -0]: + kwin
12:17:29NimBotnimrod-code/packages master ae5c916 Dominik Picheta [+0 ±1 -0]: Merge pull request #23 from reactormonk/patch-2... 2 more lines
12:40:21*noam_ quit (Ping timeout: 264 seconds)
13:28:51*noam joined #nimrod
13:38:10BitPuffinHmm
13:38:24BitPuffinHow is the progress on passing values to generic parameters?
13:38:43BitPuffincc @zahary @zahary__
13:57:58*noam_ joined #nimrod
13:59:53*noam quit (Read error: Operation timed out)
14:05:38zahary__this particular problem is actually very simple, but my branch is blocked on some other harder issues
14:06:01Araqwhat issues, zahary__ ?
14:07:03zahary__ah, they are not that harder - I started the reform for compiling the generics in their defining module. this is required to fix the .globals. issue that fowl posted a long time ago
14:07:36Araqwell I dunno
14:07:54Araqwhen .globals are to be assigned to is not well defined
14:08:01AraqI mean, it's in the spec
14:08:23Araqbut what kind of behavior you need depends on the use case
14:10:15Araqperhaps the behavior should simply be "append at module's body" so that you have some control over it
14:10:20zahary__I have couple of ideas how it should work. there will be an explicit initGlobals() magic giving you precise control when they should be initialized and before this I'll even improve the spec further by giving guarantees that the .global. vars will see the vars before them in the module and are visible from top-level code after their defining proc
14:11:05zahary__this spec should be the least surprising imo
14:20:46*noam joined #nimrod
14:22:09Araqwhat's wrong with the current way again?
14:22:38*noam_ quit (Ping timeout: 246 seconds)
14:23:12zahary__well, the current way is pretty random, because the globals will initialize in the first module that happened to reference their originating proc
14:23:52zahary__and this ordering is changed in recompiles in unexpected ways
14:23:52Araqhmm I thought they are generated in the BModule they belong to
14:24:15zahary__this information is lost, because the generic proc gets a new owner
14:24:38Araqthat sounds easy to fix though
14:25:14Araq.global vars should get the current module as owner and the instantiation process shouldn't overwrite it
14:25:40zahary__well, compiling generics in their first user is broken for other reasons too
14:26:22Araqarguably it's broken too if you compile them in the original module
14:27:08AraqinstantiateHash(someNewHashFunction) # and now the original module gets all the stuff so that it can see someNewHashFunction ?
14:27:22zahary__the breakage I'm referring to comes from symbol files and cass - if you stop using the generic funtion from the module it happened to be compiled to, this can break other modules
14:27:35zahary__that's because the compiler doesn't attempt to "ref count" the usages of the generic
14:28:26Araqwell symbol files do not even serialize your new generics stuff so I dunno
14:28:49Araqyou simply never updated the serializers :P
14:29:11zahary__yes, but they can be fixed with the new scheme (it would be harder with the old)
14:29:23zahary__otherwise, I understand your point, but my long-term proposal is to compile them in a separate satellite module if you remember
14:29:55zahary__that buys you predictable module sizes foo.part1.c / foo.part2.c and less recompilation
14:31:20Araqhmm, we should make it foo.1.c and foo.2.c instead
14:31:41zahary__sure, I was using just illustative names
14:31:47Araqthis also solves the "2 modules of the same name problem" then
14:31:47zahary__illustrative
14:32:03Araqwhich we need to support for Babel
14:32:39Araqas everybody names his modules "utils" and "types"
14:33:55Araqbut gah, this doesn't work anyway
14:34:29AraqI thought we can simply check if nimcache/utils.c already exists but then nimcache will grow for every recompilation
14:48:34*noam_ joined #nimrod
14:51:45*noam quit (Ping timeout: 264 seconds)
14:58:12reactormonkdom96, now how do I use babel in my project?
14:58:33dom96well, sadly, currently you can't hah
14:58:50dom96I need to implement the ability for you specify the compilation backend I guess
14:59:03dom96I'll do that just for you :)
15:00:52zahary__Sorry, was afk for a while. the same module name problem can be solved by appending the module numeric ID to the generated file name if there is a name collision. The module IDs are persisted in caas mode and are easy to persist with symbol files too
15:02:39Araqthey already are persisted in symbol files iirc
15:03:06*noam__ joined #nimrod
15:03:11zahary__no, I wanted to do it in order to avoid some string lookup during reading of rodfiles, but never got to it
15:03:58zahary__all mentions of other modules are encoded as integers in the bulk of the data, but there is a map of int to path at the begining of the rod file
15:04:26Araqah yeah
15:04:30zahary__it's easy to move to global per-project map
15:04:50zahary__sharing rod files from libraries interferes with this a little bit
15:05:03Araqthat was the plan
15:05:15Araqbut currently it's in project/nimcache anyway
15:05:26Araqso you can't share rod files easily
15:05:40*noam joined #nimrod
15:06:24zahary__we've discussed the external interface of the libraries and how they should define "I depend on these definitions during compilation" in order to improve the potential sharing
15:06:38Araqdid we?
15:06:45*noam_ quit (Ping timeout: 264 seconds)
15:07:12Araqall I remember is symbol obfuscation
15:07:54*noam__ quit (Ping timeout: 264 seconds)
15:08:21zahary__yes, long time ago - didn't remember the specific reasons back then. but I'm mentioning it here, because it's related. if you use all the compilation settings of a project as a cache invalidation key for the shared rodfiles, you won't get much sharing anyway, because complex projects are likely to have minor differences in configs most of the time
15:08:51BitPuffinzahary__: so it's already finished or is it just that you haven't done it yet but it's simple?
15:10:08zahary__the problem is that there are commits that follow it - I have to extract just this particular feature from the rest of the commits
15:10:33zahary__also, haven't really done it yet :P
15:10:50BitPuffinzahary__: looking forward to it! So I can refactor my lib to be less stupid :P
15:11:12zahary__what are you working on?
15:11:17BitPuffinzahary__: math library
15:11:35BitPuffinhttps://bitbucket.org/TheLonelyByte/linagl
15:12:14BitPuffinzahary__: right now I have to use ranges where I don't really want to have ranges
15:12:46BitPuffinbrb
15:13:03zahary__nice, I thought that is the case too.
15:14:40zahary__for swizzle, we have another planned feature too - you'll be able to implement something like ruby's method_missing at compile-time
15:15:08Araqyeah I told him about it
15:23:40*Associat0r quit (Quit: Associat0r)
15:25:53*Associat0r joined #nimrod
15:25:53*Associat0r quit (Changing host)
15:25:53*Associat0r joined #nimrod
15:47:29reactormonkpry has more commits than nimrod. Hmm. ^^
16:00:48*Mat2 joined #nimrod
16:00:51Mat2hi @ all
16:06:40reactormonkMat2, morning
16:07:48Mat2hi reactormonk
16:14:28*BitPuffin quit (Read error: Operation timed out)
16:31:44Mat2Araq: POSIX do not define the MAP_ANONYMOUS flag so using mmap for virtual-address space allocation is OS dependent (Linux for example support this behaviour only up kernel > 2.4)
16:33:11Mat2valloc on the other side is supported from all xNIX variants since V7 and BSD 4.2
16:34:42Mat2hmm, first problem. I need to write a wrapper for valloc (don't included in there mmap library)
16:57:17Araqreactormonk: what's "pry"? and why should we care?
17:05:02Mat2hi Araq
17:07:35Araqhi Mat2 I've implemented computed goto support
17:07:48Araqbut it's not tested very well :P
17:08:07Mat2great :D
17:08:53Araquse it like this:
17:08:58Araqwhile true:
17:09:10*darithorn_ joined #nimrod
17:09:19Araq {.computedGoto.}
17:09:24Araq case opcode
17:09:27Araq of ...
17:09:29dom96hello darithorn_
17:09:39darithorn_hello
17:09:43*darithorn_ is now known as darithorn
17:09:55Mat2hi darithorn
17:10:22Mat2Araq: That's all ? nice syntax compared to C
17:12:52Araqwell it's much less flexible ...
17:13:22Araqbut as I said, this way of doing it is convenient and doesn't screw up the control flow analysers
17:14:11Mat2I think the folk at LLVM would be interested in it (there have some problems supporting these GNU extension)
17:16:27Araqit doesn't help the LLVM guys, they want to support GNU C, so they need to do support it like GNU C does
17:17:27Mat2hmm ok
17:25:46*BitPuffin joined #nimrod
17:28:56AraqMat2: I can make the compiler emit NIM_COMPUTED_GOTO(JumpTable[i]) instead of goto *JumpTable[i] and then you can do some voodoo to make GCC generate some assembler labels that you can patch
17:29:42Araqso that 'call eax' instead of 'jmp eax' is produced
17:30:09Araqbut I dunno how the 'ret's need to be inserted
17:53:50*Sergio965 joined #nimrod
17:57:22Mat2ok, that would be nice
17:57:59*Mat2 struggling with yet another mmap bug
18:02:37*Araq is struggling with incomprehensible LaTeX error messages ...
18:03:03dom96hrm, maybe #latex can help?
18:03:36Mat2sadly, I only use AsciiDoc
18:19:50*Mat2 problem solved (though undocumented flag setting)
18:31:38*BitPuffin quit (Ping timeout: 268 seconds)
18:37:44dom96gah, github killed the /languages page
18:42:26Araq"First of all: beamer does not provide any automatic scaling of text or diagrams like MS Power Point, because its author thinks that it leads to bad presentations. If the material doesn't fit on one slide unscaled simply make two or more slides out of it."
18:42:30Araq-.-
18:42:48Mat2*argh*
18:43:12Araqmaybe I should use power point instead ...
18:43:46Araqyeah, remain unhelpful and call it a feature instead
18:45:09Mat2Araq: probably that's of use: http://www.methods.co.nz/asciidoc/slidy.html#%281%29
18:46:12Araqwell I'd prefer a PDF instead of a website
18:46:28*BitPuffin joined #nimrod
18:46:54Mat2that's also possible (though docbook convertion)
18:47:20Araqmeh, fullscreen via browser is good enough I guess
18:51:12Araqhmm this looks excellent, I can make nimrod's documentation generator generate HTML slides
18:53:14Mat2better as struggling with SMaTex I think
18:54:14Araqlatex is a never ending pita, unhelpful error messages, overflow hbox crap, packages are all incompatible with each other in various ways
18:54:31Araqinsane quoting rules
18:54:40Araqbroken macro system
18:54:55Araqetc. etc. how anybody can use it productively escapes me
18:55:00dom96Araq: hah, after you left someone agreed with you.
18:55:39Mat2*lol*
18:55:45BitPuffinzahary__: I guess this is encourages making a branch for every task you ever do for easy merging later on :)
18:56:08Araqdom96: in #latex?
18:56:14dom96yes
18:56:18Araqlol
18:56:45Mat2well, that's xNix tradition
19:11:01*Sergio965 quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
19:14:03reactormonkAraq, repl for ruby. And it's awesome.
19:15:23Araqof course it's Ruby after all
19:21:08*Sergio965 joined #nimrod
19:25:23BitPuffinAraq: you like ruby?
19:27:42AraqBitPuffin: never used it, but I dislike dynamic typing enough so that I'll never try it
19:28:26BitPuffinAraq: ah, well you don't seem to love OO all that much either
19:28:50Araqwell you know these things are related ...
19:29:08BitPuffinAraq: dynamic typing and OO?
19:29:21Araqwhy would I do all the painful work if there was something out there that I particularly like?
19:29:58BitPuffinAraq: because designing a programming language is an interesting challenge. But I guess out of spite is a good reason too :)
19:35:24dom96BitPuffin: Do you like Ruby?
19:35:47BitPuffindom96: yes, it's mighty fine, but it is too slow for most of my work
19:36:08BitPuffindom96: I do too lean towards liking static typing more, and functional programming
19:36:24BitPuffinat least I am starting to
19:46:57BitPuffinIs it a good idea to convert ptr to ref? When binding to C
19:48:23Araqit's a good idea if you have control over the allocation
19:48:34Araqmany C libraries do this:
19:48:47Araqproc createStuff(): ptr Stuff
19:48:56Araqproc freeStuff(s: ptr Stuff)
19:49:06Araqand then you CANNOT change ptr to ref
19:58:51BitPuffinah
19:59:04BitPuffinwhat's the equivalent of size_t in nimrod?
20:00:08Araqint
20:00:14BitPuffinoh
20:02:46BitPuffinHmm
20:02:50BitPuffinFILE
20:03:16BitPuffinTFile?
20:03:23AraqFILE* is TFile (I know, I know ...)
20:03:49BitPuffinso they are indeed equivalent, good
20:04:00BitPuffinshouldn't c2nim catch that?
20:05:23Araqsure
20:08:55BitPuffinSo how does one deal with linking to static C libs with nimrod
20:09:06BitPuffindom96: is there a babel option for this?
20:09:29dom96nope
20:10:03BitPuffindom96: hm, kind of need it probably
20:10:21BitPuffindom96: I'm writing a binding to scrypt and a wrapper for using it for password hashing
20:10:51dom96k, submit an issue. I'll do it ASAP.
20:11:23dom96but hrm, wait.
20:11:35dom96Shouldn't the .nimrod.cfg handle it?
20:12:55BitPuffinI dunno
20:13:01BitPuffindon't no jack about nimrod.cfg
20:17:59BitPuffinwait brb, we'll have a look soon
20:19:56*gradha joined #nimrod
20:21:34Araqhi gradha
20:21:47Mat2hi gradha
20:21:47gradhahi Araq
20:21:49Araqyour library doesn't export anything :P
20:21:53Araqso I can't use it
20:21:55gradhalibrary?
20:22:04Araqthe resource stuff
20:22:50gradhait's not meant to be used as a library yet
20:22:50gradhayou are meant to compile, run it, then run the generated binary
20:22:57*BitPuffin quit (Ping timeout: 264 seconds)
20:23:06gradhait just tests if binaries with appended data have problems under other platforms than mine
20:23:21gradhaI wouldn't expect this to be a problem, but since you mentioned having problems in the past I went the safer route
20:23:32Araqwell I need a proc getResource(file: string): string
20:24:08AraqMat2: using HTML for the slides works incredibly well :-)
20:24:58gradhaAraq: sure, I was meaning to write that and make a pull request against Aporia using it
20:25:08Araqwhy aporia btw?
20:25:41gradhadom96 seemed to have problems with some resources used by Aporia not being available in the binary directory, IIRC for babel binary installation or something
20:26:00gradhait looked like a real world problem rather than my own imaginary problems
20:26:09gradhaunless I dreamed all this Aporia resources stuff
20:26:25Araqlet's ask dom96 ... dom96?
20:26:40gradhahi EvilAww
20:26:53EvilAwwHello
20:26:58dom96If you're talking about the stuff that the gtksourceview depends on then I don't think gradha's solution can help.
20:27:20dom96Unless I dunno, you embed it in the executable and then when aporia starts write it to the hard drive
20:28:04Araqthat sounds aweful
20:28:09gradhaurgh, so gtksourceview reads these resources and you can't control that?
20:28:16dom96indeed
20:28:29dom96You can set a search path for it.
20:28:32dom96But that's about it.
20:29:19gradhathen I'll make up my own imaginary problems
20:29:41Araqwell nimrod needs it for system.nim
20:29:58gradhahow does it need it?
20:30:16Araqso that "nimrod i" can be a single exe
20:30:43gradhaah, yes, I thought you wouldn't want to use it before "correct" use, meaning, not writing appended data to $TMP
20:33:18Araqif you can write to $TMP you can also return the contents in a string?
20:33:52gradhayes, why would you want a string though?
20:34:16*Araq always misuses strings as byte buffers
20:35:49gradhaI guess you could export to nimrod the mmaped binary as a read only array
20:36:41Araqwhat's wrong with getResource("system.nim") ?
20:37:04Araqyou need to add some indexing structure I guess
20:37:38gradhait's either building my own file format structure or reusing the zip module
20:39:17Mat2Araq: good to know :D
20:39:53Araqyou should have told me earlier, Mat2 ;-)
20:56:27gradhameh, I guess I'll leave the zip route for later, it's too tedious
20:58:23gradhagetResource will also be case sensitive, rather than implement case insensitive matching it seems easier to lowercase all filenames when preparing the appended data
20:58:51*BitPuffin joined #nimrod
20:59:54Araqgradha: meh ... I'll patch it then ;-)
21:00:22BitPuffinokay so how do I link to a static C library in .nimrod.cfg
21:00:43BitPuffindom96: should .nimrod.cfg be in src/ or in the same dir as foo.babel
21:00:50gradhaAraq: I was thinking of using TTable, you may want to add a TCaseTable
21:01:06dom96BitPuffin: src/ I think
21:01:12BitPuffindom96: okay
21:01:22Araqgradha: there is newStringTable(modeCaseInsensitive) in strtabs.nim
21:01:43gradhaalso just saw hashes.hashIgnoreCase
21:02:43AraqI read about a guy who uses a.png for the thumbnail and A.png for the real image
21:02:57Araqand he complained this doesn't work on windows
21:03:23gradhawouldn't strtabs require two lookups? it maps to a string... so I first match the user input to the stored filename, then look up the filename?
21:04:01gradhaI was expecting a hierarchy of TTables per directory, with filename mapping to an internal structure holding byte offset and length of the data
21:04:46Araqjust map the full path/filename to some byte offset
21:05:11BitPuffinis it `l=ltarsnap` in .nimrod.cfg?
21:05:25gradhafull path/filename looks scary given crossplatform path separators
21:05:46Araqwhy? '/' is the universal path separator anyway
21:06:51gradhamaybe users will want to use os procs to build the filepath
21:07:38BitPuffindom96: any idea? :(
21:08:22gradhausing os.joinPath on windows would break then as input for getResource
21:08:30dom96BitPuffin: huh? what are you trying to do?
21:08:40BitPuffindom96: link to a static library in .nimrod.cfg
21:08:46Araqgradha: so do a x.nomalize.replace('\\', '/') on the path 'x' and call it a day
21:09:15dom96BitPuffin: The stuff you put in the .cfg file is similar to what you would use as an argument on the cmd line.
21:09:43dom96BitPuffin: I guess --passL:-ltarsnap is what you want?
21:09:56BitPuffindom96: I hope so
21:10:16gradhaAraq: so using strtabs, do you suggest storing the offset and length of each file as a string?
21:11:33AraqI suggest you normalize the path and then use a TTable[string, tuple[offset, length: int]]
21:15:37gradhanow that you mention normalize maybe I could use UnixToNativePath when reading the index from disk
21:17:53Mat2get some sleep, ciao
21:18:06*Mat2 quit (Quit: Verlassend)
21:19:27BitPuffinulong would be uint64 right?
21:24:42*Sergio965 quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:25:17BitPuffinwhat's the proper way to convert between string and ptr uint
21:25:22BitPuffinuint8*
21:25:25BitPuffinptr unit8
21:25:30BitPuffinand back
21:30:21BitPuffin"PPPPyObject" lol
21:39:41*q66 quit (Quit: Leaving)
21:40:01*q66 joined #nimrod
21:57:08*zahary__ is now known as zahary_
22:16:55*EXetoC quit (Quit: WeeChat 0.4.1)
22:18:37*OrionPK joined #nimrod
22:44:59*Trix[a]r_za quit (Ping timeout: 240 seconds)
22:45:15*Trixar_zb joined #nimrod
23:19:07gradhagood night
23:19:11*gradha quit (Quit: bbl, need to watch http://www.youtube.com/watch?v=OzrkmcBMPYo again)
23:27:14OrionPKhttps://github.com/google/gumbo-parser
23:28:25OrionPKgood candidate for wrappage
23:35:39*BitPuffin quit (Ping timeout: 268 seconds)
23:48:46*Associat0r quit (Quit: Associat0r)
23:50:01*Associat0r joined #nimrod
23:50:01*Associat0r quit (Changing host)
23:50:01*Associat0r joined #nimrod