<<09-12-2012>>

00:04:46*shevy left #nimrod ("I'll be back ... maybe")
00:06:54Araqdom96: I don't think I have any project to register to babel ;-)
00:07:09Araqmaybe if I wouldn't put everything in the stdlib ... :D
00:07:18dom96yeah... :P
01:14:40*fowl quit (*.net *.split)
01:15:17*fowl joined #nimrod
02:05:08*Trixar_za is now known as Trix[a]r_za
02:05:29*q66 quit (Quit: Quit)
04:18:03*XAMPP quit (Ping timeout: 245 seconds)
04:20:35*XAMPP joined #nimrod
04:20:35*XAMPP quit (Changing host)
04:20:35*XAMPP joined #nimrod
08:53:50*FreeArtMan joined #nimrod
11:54:01*q66 joined #nimrod
12:45:36Araqdom96: I think babel should be part of the compiler's distribution
12:45:50dom96sure
12:46:38ZorAraq: hey
12:46:47Araqhi Zor
12:48:40Araqbut then babel would need to be able to update the compiler ... and that needs to be special cased
12:49:12dom96I don't think so...
12:50:22Araqwhat do you mean?
12:50:45Araqthat it is not babel's business? or that it doesn't require a special case?
12:51:19dom96hrm, well the former. But hrm.
12:51:48dom96I suppose it does make sense.
12:53:24Araqbut 'koch' can already update
12:53:32Araqexcept on windows
12:53:53Araqbtw check it out, babel may have the same problem
12:53:55dom96hrm, why not on Windows?
12:58:15dom96But for normal apps we could have some kind of a specification as to how to build them in the .babel file. You know, for nimrod:
12:58:43dom96Commands: unzip build/csources.zip && ./build.sh && bin/nimrod c koch && ./koch boot
12:59:05dom96But then this won't work on Windows because of the dependency on unzip
13:13:11Araqyeah but that's pretty much unfixable
13:16:40AraqZor: I'm wondering about the difference between using a spin lock and a lock free implementation
13:17:18Araqseems to me that most lock free implementations simply re-invent the spin lock ... what am I missing?
13:18:26Zorimplementation of what
13:18:57Araqfor instance a typical lock free queue uses CAS in a loop
13:19:13Araqbut that's how a spin lock is implemented too
13:19:32Araqso you could simply use a spin lock to get the very same effect
13:20:17ZorI think the difference is that a spin lock is a more generalized concept that can be implemented in different ways
13:20:40Araqwell sure, but why bother with lock free then?
13:22:20Zordunno...it probably depends on your particular needs
13:22:33ZorI haven't really ever used a spin lock for anything before
13:24:52Zorbut it seems like a spin lock allows for arbitrary operations in a locked region
13:24:55Zorwhich CAS doesn't
13:25:15Araqyeah sure
13:25:38Araqbut since lock free is incredibly hard to get right a spin lock looks like a sweet cheap alternative
13:25:45*Zor nods
13:25:51Araqbut https://groups.google.com/forum/?fromgroups=#!topic/comp.programming.threads/bPAVH1OTqtI seems to contain the answer
13:26:59Araq"The collision probability scales with the square of the time taken in
13:27:00Araqone spinning loop cycle. So the basic idea is to keep this time as short
13:27:02Araqas possible. It is obvious that spinning at some spin-lock variable and
13:27:04Araqthen modifying some other memory location holds the lock longer than
13:27:06Araqreading the old value and write the new value back, which implicitly
13:27:08Araqreleases the lock. The compared exchange simply joins the memory
13:27:09Araqlocation of the mutex with the memory location of the data to protect.
13:27:11AraqThis also shows when it makes sense: only as long as you do not protect
13:27:12Araqmore than one memory place with the lock. But keep in mind that fine
13:27:14Araqgrained locking is a requirement of scalability."
13:30:57Araqhrm after reading this ... ok, it's entirely different :-)
15:12:24Zorthe build farm seems dead
15:12:30Zor502
15:13:15dom96fixed
15:13:59Zorwhat ppc64 hardware is it running?
15:15:51dom96"4x16x3.55 GHz IBM POWER7 / 64 GB RAM / IBM Power 730 Express server / Fedora ppc64"
15:16:04dom96gcc110 http://gcc.gnu.org/wiki/CompileFarm
15:16:26Zorah
15:16:36ZorI tried getting access to the gcc compile farm but they are ... less than responsive
15:16:58dom96yeah, it took a while for them to reply to my request.
15:17:39dom96pity the gcc compile farm doesn't have any windows machines.
15:35:02*XAMPP quit (Read error: No buffer space available)
15:35:27*XAMPP joined #nimrod
15:35:28*XAMPP quit (Changing host)
15:35:28*XAMPP joined #nimrod
18:46:09*FreeArtMan quit (Ping timeout: 276 seconds)
19:07:02*Vladar joined #nimrod
19:12:22Araqhi Vladar
19:12:45VladarHi
19:13:15Araqplease help to fill the babel repository ;-)
19:13:17dom96hey Vladar. You should put nimgame on babel's package list!
19:13:58VladarYeah, already thought of it
19:18:36dom96awesome. I hope my crappy readme files are good enough to get you started heh
20:09:29Vladardom96, I hope I did it right way, have a look
20:14:07dom96Vladar: You need a comma between the two JSON objects.
20:14:12dom96i.e. after the }
20:14:21dom96(Just after the first })
20:14:48Vladaroh
20:15:52Araqbabel should be able to register packages :P
20:16:09Araq./babel register
20:16:20Araqpackage name? _
20:16:22dom96Araq: You know, there is a reason the software is open source :P
20:16:33dom96Araq: You are more than welcome to contribute ;)
20:17:17Araqok, I will implement a good old DOS dialog then
20:17:23dom96Vladar: Also, I think your babel file should say "Version: 0.4.0". Since that's the current version in the latest commit on github.
20:17:51VladarI't kinda WIP version, but yes
20:18:44VladarI'll make it 0.3.1 )
20:19:11dom96Sure. That works too.
20:19:17reactormonkdom96, want to do git integration? So you can do ./babel build <version> and it looks for git tags?
20:20:39dom96reactormonk: That's actually how it's implemented :)
20:20:47reactormonkdom96, fancy
20:20:58dom96And in fact, I just realised I forgot to document the specifics of how versioning works.
20:21:23reactormonkwould help, yep
20:21:59Vladardom96, second try
20:24:02dom96Vladar: Perfect.
20:25:46Araqdom96: can I make babel use an sqlite database? :P
20:26:11Vladarhm, maybe I'll add libtcod-nim too
20:27:18dom96Araq: Not until a website is made to go along with it.
20:27:35Araqwhat has that to do with a website?
20:27:56dom96Like I said, we can't store the sqlite file on git
20:28:08Araqso what, we don't store it on git
20:28:17dom96where do we store it then?
20:28:39Araqwe will have a recipes/ folder with all the registered .babel files and babel generates an sqlite database from that
20:29:08Araqso people only need to create the .babel file
20:29:35Araqand I'll implement some user dialog to help creating a .babel file
20:30:33dom96haven't we already discussed this?
20:30:38Araqsure
20:30:46Araqbut I forgot why we decided against it :P
20:30:57dom96We decided against it because of the problem I described.
20:31:10Araqyeah but that's not a real reason
20:31:36Araqbabel can easily download the appropriate .babel and build the package according to that
20:31:48dom96IMO the best way to do this is to have people upload full packages to some website
20:32:01Araqnah
20:32:06Araqnobody wants to do that
20:32:19dom96instead of keeping their git repo @ some tag in sync with the package's repo .babel file.
20:32:23Araqpeople want to say: "here's the github URL, do something with it"
20:34:02dom96yes, and that is what we have with the current system
20:35:55dom96You're mixing up a server-side .babel file list, and a client-side sqlite database to speed things up. Please keep it simple.
20:36:10Araqnot to speed things up
20:36:26Araqso that people don't have to learn 2 different syntaxes
20:36:26dom96well then I don't understand what you wish to accomplish
20:37:03Araqjust let me hack something, if you don't like it, we can remove it again
20:37:22dom96fine.
20:37:38dom96But I would rather hear your plan instead of letting you waste time implementing it :P
20:39:00Araqwell I already told you, but I'll change the plan according to what is easy to implement ;-)
20:39:15Vladardom96, so, after installing some package user must add it to lib-path or how it works?
20:39:55dom96Well, Araq implemented a 'babelPath' option. Araq: Is it in the config file by default now?
20:41:25dom96Araq: Please explain your plan more clearly so that I can understand it.
20:42:46Araqdom96: it's not in the config file and would break bootstrapping :-/
20:43:11Araqlet me see if a workaround works
20:43:15dom96huh? so it's not implemented yet?
20:43:30Araqit is implemented
20:43:43Araqbut you can't put it in the default config
20:43:59dom96interesting, how does that affect bootstrapping?
20:44:26Araqthe old version doesn't know about --babelPath, finds it in the config file and complains
20:44:54Araq(old version = the version of the generated C code)
20:46:21dom96oh
20:46:54reactormonkAraq, so bootstrap twice?
20:47:17Araqpeople complain if I update the C sources too often ... :P
20:47:27Araqbut I already have a solution
20:47:41Araqso what should --babelpath be?
20:47:48Araq %home/babel ?
20:48:05Araq $home/babel/libs ?
20:48:41dom96the latter
20:48:53reactormonkAraq, I'd go with .babel
20:49:00dom96hah.
20:49:37dom96babel used to install to ~/.babel but Araq wanted it to be ~/babel
20:50:20reactormonkvote on it? ;-)
20:51:58reactormonkI don't like my homedir to be cluttered by non-dot files...
20:52:07Araqreactormonk: we don't believe in democracy here :P
20:52:29reactormonkAraq, good, I'll send some agents over
20:52:57AraqI don't like dot files in my homedir
20:53:12dom96lol
20:53:15Vladardom96, when I'm using --babelPath, package modules can't import other modules from this package, and if I'll change all imports, then it'll not work when compiles with --path option, without babel
20:53:26reactormonkAraq, bet you got a shitload there
20:53:46Araqthey are hidden and yet often important, so I made them visible
20:53:52VladarAlso, I like ~/.babel more =)
20:54:56Araqyou're supposed to open ~/babel and fix problems there
20:55:03dom96Vladar: hrm, why not?
20:55:13reactormonkthe backtrace tells you where to find the files - hopefully
20:55:21reactormonkand I'd copy/paste the path from the backtrace anyway
20:55:49AraqBabel copies Linux's approach :P
20:56:20Araqif it's broken, fix it yourself by endless tinkering
20:56:22reactormonkso you don't like the .babel on windows idea?
20:57:29dom96Vladar: I'm not sure what you mean. Take a look at how jester does it maybe?
20:58:00Vladardom96, when I use --babelPath, I must import like "import nimgame/lib/engine", right?
20:59:21dom96Vladar: It depends on your directory structure.
20:59:30VladarThen, I must change all imports inside nimgame to this form instead of "import engine, image", etc.?
20:59:54Araqok fine it's .babel
21:00:08Araqdamn you and your voting
21:00:28VladarI mean, nimgame does not have "main" module, modules imported when they needed
21:00:30dom96Vladar: no. The imports work based on the module's directory.
21:00:39Vladarhm�
21:01:07dom96in that case it might be a good idea to rename 'lib' into 'nimgame'
21:01:29dom96then you will import by doing "import nimgame/engine"
21:01:47dom96But say if your audio module wants to import engine
21:01:53dom96all it has to do is "import engine"
21:01:58dom96because engine is in the directory
21:02:05dom96*the same
21:05:05Vladardom96, when I rename lib to nimgame I get "babel/libs/nimgame/nimgame"
21:05:06dom96Araq: Don't worry, i'll add a configuration file to accommodate for your hate for dotfolders :P
21:05:25dom96Vladar: yeah. I know it looks bleh.
21:06:21*reactormonk bows.
21:06:59Vladardom96, also I got this error: "/home/vladar/babel/libs/nimgame/lib/engine.nim(3, 8) Error: cannot open 'common'" so it seems to not be able find modules in the same dir
21:09:13AraqVladar: used --path or --babelPath?
21:09:23VladarbabelPath
21:09:37Araqhrm could be a bug
21:09:43Vladarmaybe
21:10:03dom96mmm
21:14:00Araqer ... ok this can't work
21:14:20Araqit's babel/libs/nimgame/lib/engine.nim
21:14:38Araqbut --babelPath is babel/libs/
21:14:54Araqso the compiler adds babel/libs/nimgame to its path
21:15:33Araqso you need to 'import lib/engine'
21:16:15Vladaryeah
21:16:39Araqbut then 'engine' needs to import 'common' via 'lib/common'
21:17:23dom96ugh, that shouldn't be necessary
21:17:28Araqit's a feature that the compiler does not add the dir of some module to its path implicitly
21:18:14Araqzahary and I talked about it for days and thought it's a good idea given the current configuration system
21:18:20Vladarso if user doesn't uses babel and just puts lib dir in his project dir, then he must use --path:. ?
21:18:20dom96wait.
21:18:50dom96hrm, never mind
21:18:53Araqbut tbh I can't remember the details :P
21:19:25Araqso hm, we need a solution
21:19:53AraqVladar: no, if you put lib dir into the project dir, it will work
21:20:04Araqbut babelPath doesn't do that
21:20:07Araqthat's the problem
21:22:37Araqit's easy to fix once we decided what --babelPath should do with nimgame's structure
21:25:08Araqthe problem is nimgame/*.nim modules would be accessible with --babelPath
21:25:25Araqbut nimgame has them in nimgame/lib/*.nim
21:26:01Araqso we could teach babelPath about an optional 'lib' subdirectory?
21:26:07Araqany other ideas?
21:26:47Vladarmaybe babel-config-file might have an option like "lib"?
21:27:44VladarCan compiler get info from *.babel files?
21:28:13Araqit could, but it doesn't and I'd like to keep it this way
21:29:15AraqI think I'll make the compiler look for a *.nim file and if there is none, it will add all subdirectories to its path (but only 1 level, not recursively)
21:29:50VladarHm, good idea
21:30:30VladarActually, it will work very nice
21:31:14Araqhow did you generate index.html btw?
21:31:38reactormonkAraq, subdirs... but only if it doesn't find _any_ nim files in the current dir?
21:31:51reactormonk... but that could break shit again in unpredictable ways
21:32:14reactormonkI'd say add a loadpath which defaults to something
21:32:50VladarAraq, I made doc.nim file with all the imports, "nimrod doc2 doc.nim" and then edit doc.html manually.
21:33:05Araqreactormonk: the whole purpose of --babelPath is to be 'smart' so that the --path list doesn't need to be updated
21:34:08dom96IMO it should simply add the damn path of the current module to that module only.
21:34:55AraqVladar: I see; now you need to use --project for 'doc2' btw
21:35:21Araqso that the docs are generated for all modules you imported
21:36:07Araqdom96: and then I have to import it via 'lib/engine'? you've got to be kidding
21:36:26dom96ugh, that's the point.
21:36:36dom96I mean.
21:36:53dom96engine.nim should be able to do "import common"
21:36:59Araqsure
21:37:04dom96but module outside of the lib dir should not
21:37:14Araqugh
21:37:17dom96Because what happens when another package has a module with the same name?
21:37:33Araqwe discussed that already and yes it is a problem
21:37:49Araqand no, fixing the --path issues won't fix that
21:49:18VladarGoing to sleep, bye.
21:49:41*Vladar quit (Quit: Leaving)
22:03:27Araqso reactormonk, any better ideas?
22:04:34Araqotherwise I'm going for "subdirs... but only if it doesn't find _any_ nim files in the current dir"
22:09:05reactormonkAraq, and be sure to document that somewhere
22:12:14Araqalright
22:17:49reactormonkbecause it sounds like something that could bite you... hard.
22:19:04Araqthat's the purpose of a package manager :P
22:19:54reactormonkI prefer my packages to be shipped without any booby traps
22:27:06dom96Araq: So now I will be able to do 'import engine'...?
22:27:25dom96I don't get "subdirs... but only if it doesn't find _any_ nim files in the current dir"
22:29:41Araqwell try it :P
22:29:47AraqI implemented it
22:29:52Araqand it works for nimgame
22:30:16dom96just answer my question
22:33:09Araqnimgame/ has no .nim file
22:33:27Araqso the compiler looks into nimgame/lib
22:33:38Araqand nimgame/doc
22:33:45Araqand nimgame/fnt
22:34:01Araqand adds any of those that have any .nim file
22:34:07Araqwhich is nimgame/lib
22:34:20Araqand thus you can 'import engine' and it works
22:34:36dom96awesome. So now as soon as any other package decides to have a audio module, or an engine module, or a common module, or ... it will simply fail.
22:35:03Araqnah
22:35:20Araqer, yes, exactly
22:35:27dom96lol?
22:35:34dom96seriously?
22:36:34dom96ok. Fine. I realise that it's a hard problem to solve because of how the c files are generated.
22:53:01Araqgood night