<< 03-06-2013 >>

00:00:27fowlmount multiple directories to one
00:00:27fowltheres probably a replacement for unionfs out now
00:00:44fowlhttp://en.wikipedia.org/wiki/UnionFS
00:02:31fowltesting would have to be done to make sure it still reports getAppDir() correctly
00:02:49dom96I dunno, sounds complex.
00:02:59dom96How would it work on Windows exactly?
00:03:30fowlwindows may have some kind of directory union, otherwise it would involve installing the files just like you'd do to put something in /usr
00:03:42dom96I think a better plan is to just install anything else that is required to $babelDir/libs/pkgname/
00:03:51dom96And have the app honor that scenario
00:04:27fowlin gobolinux packages are installed to /Programs/PackageName/Version and unionFS'd together to make the FHS
00:04:55fowlwell they could be unionFS'd or syminked
00:05:22dom96hrm, I may also change what gets installed. Instead of installing all files, just .nim files will be installed for the library packages.
00:06:21dom96I doubt Windows has a directory union.
00:06:28fowlwindows has symlinks though
00:06:31dom96So for this reason this solution is probably out
00:07:23dom96Anything wrong with the solution I described?
00:07:48fowlyeah, .nim files arent needed to run a binary
00:08:06dom96I'm talking about:
00:08:10fowli'd keep the source around, but they dont need to be 'installed'
00:08:15dom96<dom96> I think a better plan is to just install anything else that is required to $babelDir/libs/pkgname/
00:08:15dom96<dom96> And have the app honor that scenario
00:08:38dom96What I mentioned about the .nim files only being installed applies to library packages.
00:08:52fowlthat will probably work with a symlink into $babeldir/bin but it'd need to be tested for windows
00:09:10dom96no. There is no need for a symlink.
00:09:19dom96Binaries will still be placed in $babelDir/bin
00:09:24fowlis there a standard layout for nimrod apps, like main.nim in ./, or could main.nim be in ./bin
00:09:36fowlthen how will aporia know where ./share is
00:09:41dom96The app will be required to look in ../libs/pkg/ for its files
00:11:19dom96The layout of $babelDir will always be the same, so it shouldn't be a problem.
00:11:35fowlmeh why not just copy all the installed files into $babel/bin with the exe so it can look in "share"
00:11:43fowlor getAppDir()/"share"
00:12:41dom96What if another package gets installed with the same directory name?
00:13:09fowlthey live happily together, or have conflicting filenames
00:13:10fowlfhs baby
00:13:46fowlbut you need only install the exe and whatever extra data is required, no .nim
00:13:50dom96Yeah, they will conflict and bad things will happen :P
00:14:02dom96yes
00:14:09dom96I never said otherwise
00:14:16fowli dont think this will happen
00:14:29fowlhow often do the names of binaries conflict
00:14:40dom96it's not the names of binaries
00:14:53dom96it's the names of extra files
00:15:14dom96if names of binaries conflict then... you're screwed :P
00:15:32fowlyeah but that doesnt even happen that often in FHS
00:16:03dom96indeed.
00:16:21dom96FHS does use the same scheme I suggest for the extra data that may be required.
00:17:17fowlyou're implicitely forcing the packages into fhs style though, now they are like ./main.nim, ./lib/data, ./share, etc
00:18:04fowlim cool with that, but how do i get to getAppDir()/".."/"lib" and expand the path because now its required
00:18:52fowlactually will need getAppDir()/".."/"lib"/"mypackage"/"lib"
00:19:24dom96That's how you do it
00:20:26dom96getAppDir().parentDir() / "libs" / "mypkg" / "lib"
00:21:37fowlthats annoying, i probably wont use it
00:22:45*JesseH left #nimrod ("github.com/jessehorne")
00:23:15dom96so you want UnionFS + symlinking on windows?
00:24:24fowlno, on windows it should jst be an `install`-like thing, it could be on linux too if unionfs fails/is not available
00:24:54dom96what do you mean? how do you suggest it's installed?
00:25:16fowlwell the linux `install` copies and sets permissions
00:25:34dom96oh are you talking about nimrod's install.sh?
00:25:38fowlno
00:25:44fowl`install` from binutils
00:26:03fowlcoreutils*
00:26:06dom96I never used that.
00:26:51fowlits almost always used in make scripts
00:28:33dom96can you explain what it does exactly?
00:29:07fowlThis install program copies files (often just compiled) into destination
00:29:07fowllocations you choose.
00:29:20fowlsee install --help
00:29:26fowlor man
00:30:20dom96huh, isn't that basically 'cp' + 'chmod'?
00:32:06fowlwith provisions for preserving security settings, backing things up if they already exist, etc
00:32:51dom96the question is where to copy things, not what properties the copied files should get
00:34:46dom96sorry, but I'm still not sure how you want this to work.
00:39:36fowli dont like having to look for my data in ../lib/mypackage/datadir , i can't test my program locally now because its not going to conform to this structure (unless i go to ../ and symlink lib to ./mypackage, then it would work, but i can only do this for one package)
00:40:36fowlactually i'd have to symlink lib to ..
00:40:45fowler .
00:41:22fowli dunno, its confusing now because i have to hack my filesystem so i can run my program locally
00:42:25dom96You would look for your data in ../lib/mypacakge/datadir in addition to wherever you were looking for it before.
00:43:03dom96In that case it would work in both cases: whether after being installed by babel, or before.
00:44:22dom96I know it's not ideal, but I don't know how else to do it. I'm not familiar with UnionFS.
00:44:53dom96symlinking might work
00:45:10dom96but getAppDir may be reported incorrectly anyway
00:46:10fowli just tried import os; echo getappdir()
00:46:32fowlln -s /home/fowl/test /home/fowl/bin/test23 ; test23 #=> /home/fowl
00:47:24fowland i use that method to install nimrod, it works fine
00:47:39fowli think bsd has a broken getappdir() though
00:48:07dom96true. But then it would be broken with the way I want to do it too.
00:49:03fowlgobo used symlinks too, and updating software was just a matter of symlinking new files
00:50:06fowlinside /Programs/Foo it would have ./Version and ./Current -> Version and the symlinks in /usr were to /Programs/Package/Current (/usr was a symlink to some /System/Aliases/FHS or something like that)
00:50:16*amarsahinovic quit (Quit: Leaving.)
00:51:02dom96hrm, ok I'll think about it later.
00:51:07dom96Time for sleep.
00:51:08fowlthen switching versions was a matter of changing ./Current to point to the right one
00:51:09dom96Good night.
00:51:12fowlnight
01:30:13fowldom96, i thought fowltek wasnt updating, turns out the old version dir was still there and taking precedence, had to be manually deleted
01:32:46fowldom96, i have to do this for every package, soo maybe there should be a check for unversioned packages still existing
01:59:04*q66 quit (Remote host closed the connection)
02:43:16*SirSkidmore is now known as SirSkids|Zzz
03:51:40*fowl quit (Ping timeout: 246 seconds)
04:04:00*fowl joined #nimrod
04:14:30*ARCADIVS joined #nimrod
04:20:13*fowl quit (Ping timeout: 252 seconds)
04:27:00*OrionPK quit (Read error: Connection reset by peer)
04:32:53*fowl joined #nimrod
06:08:34*ARCADIVS quit (Quit: WeeChat 0.3.8)
07:05:30*Araq_ joined #nimrod
07:16:32*Araq_ quit (Quit: ChatZilla 0.9.90 [Firefox 19.0.2/20130307023931])
08:29:41*Araq_ joined #nimrod
08:38:44*Araq_ quit (Quit: ChatZilla 0.9.90 [Firefox 19.0.2/20130307023931])
08:43:18*zahary joined #nimrod
08:51:31*q66 joined #nimrod
09:00:24*amarsahinovic joined #nimrod
09:08:08*fowl quit (Quit: Leaving)
09:26:46*zahary quit (Ping timeout: 252 seconds)
10:13:23*greyfox1 quit (Ping timeout: 276 seconds)
10:14:43*Araq_ joined #nimrod
10:15:54*greyfox1 joined #nimrod
10:23:56*amarsahinovic quit (Quit: Leaving.)
10:40:54*Araq_ quit (Read error: Connection timed out)
10:41:59*Araq_ joined #nimrod
10:54:56*Araq_ quit (Quit: ChatZilla 0.9.90 [Firefox 19.0.2/20130307023931])
11:09:49*amarsahinovic joined #nimrod
11:57:56*Araq_ joined #nimrod
12:03:44*SirSkids|Zzz is now known as SirSkidmore
12:19:17*Araq_ quit (Read error: Connection timed out)
12:21:12*Araq_ joined #nimrod
12:44:11*amarsahinovic1 joined #nimrod
12:45:44*amarsahinovic1 quit (Client Quit)
12:45:56*amarsahinovic quit (Ping timeout: 260 seconds)
13:47:29*Araq_ quit (Quit: ChatZilla 0.9.90 [Firefox 19.0.2/20130307023931])
14:19:38dom96Feedback much appreciated: http://forum.nimrod-code.org/t/163
14:20:14tangentstormwhat's babel, dom96 ?
14:20:36tangentstormoh hence the readme :)
14:22:38dom96it's the nimrod package manager :)
14:25:10tangentstormdo you want to try and handle the case where two installed different versions of the same package?
14:25:35dom96only for library packages
14:25:43tangentstormor more importantly: where you have two applications/repos, one using an old version and one using a new version
14:26:06dom96different versions of library packages should already be possible
14:26:15dom96*of the same
14:26:27tangentstormdoes the compiler know about it?
14:26:41dom96not really
14:27:08dom96it can find the latest version itself, but when using `babel build` babel passes the paths explicitly.
14:27:24tangentstormso if i have say foo-01 and foo-02 installed...aha
14:27:26tangentstormnice
14:27:56tangentstormso can use use it as a makefile as well?
14:28:00tangentstormcan you
14:28:13tangentstormsounds like it
14:28:15dom96yeah, I suppose
14:28:24tangentstormactually that makes a lot of sense.
14:28:31tangentstormyou're already doing dependency analysis
14:28:34dom96it's better than a makefile though, it gets dependencies for you :P
14:28:54tangentstorm:)
14:46:57*Boscop quit (Ping timeout: 252 seconds)
15:02:42*Boscop joined #nimrod
16:50:30*fowl joined #nimrod
16:51:29fowldom96, did you see my comment
16:52:36fowlwhen i installed new packages they are versioned but the old (unversioned) ones were kept in ~/.babel/libs and had to be manually deleted
17:00:42Araqhi greyfox1, welcome
17:25:42greyfox1Araq, hi Nice language!
17:26:05tangentstormindeed :)
17:28:44Araqthank you :-)
17:34:11NimBotAraq/Nimrod master 255b4d9 Araq [+0 ±3 -0]: fixes semicolon parsing issue
17:34:11NimBotAraq/Nimrod master 8b0be9c Araq [+0 ±2 -0]: tiny doc improvement
18:03:50dom96fowl: Yes, I did. The new version of babel breaks the directory structure, so you should just delete the old packages and reinstall them.
18:04:03dom96However, as described in my forum post I will change it once more.
18:05:03fowlyea if its changing to $babel/pkgs its not a problem
19:44:37*gradha joined #nimrod
20:09:36Araqgradha: how about a patch for #461
20:11:33gradhaI know not what libedit is supposed to replace, or if it provides the expected symbols renamed, I was hoping zahary__ would know something about it
20:12:21gradhaif the patch for "readlineDll* = "libreadline.dylib"" is good enough for you I'll submit it later
20:13:41AraqI dunno
20:15:21AraqI'm not sure where tilde_expansion_preexpansion_hook is used
20:15:47*__ joined #nimrod
20:15:58fowlhttps://github.com/antirez/linenoise
20:16:02Araqoh I see it's a 'var' and as such not optimized away
20:16:11*__ is now known as Guest58645
20:18:39fowlwe should just support every readline-like library
20:18:40fowl(:
20:19:36Araqgradha: I think the proper fix is to nest the vars into an 'when not defined(macosx)'
20:21:09gradhawelcome, shapeshifting Guest58645
20:21:37*Guest58645 left #nimrod (#nimrod)
20:21:50gradhaah, shouldn't have grinned so much
20:21:56Araqwell done, scared him away :P
20:23:03dom96aww don't be so hard on gradha
20:23:23Araqfowl's idea is good too though; wrapping linenoise
20:23:41tangentstormi ported linenoise to pascal
20:24:02tangentstormhttps://github.com/tangentstorm/linenoise
20:24:07tangentstormperhaps it'll work with the translator
20:24:11Araqyou're a funny guy, tangentstorm
20:24:19Araqsure try to convert it to nimrod
20:24:46tangentstormi haven't looked into the converter yet. what would i run?
20:25:11Araqpas2nim linenoise.pas
20:28:21fowlim modifying sdl2.nim to allow for static linking
20:29:09Araqfowl: tried --dynlibOverride ?
20:29:45Araq--dynlibOverride:sdl -passL:"-lsdl" or something like that should do the job
20:30:52fowlstructs have to be {.importc: "SDL_$1", header: "<SDL2/SDL.h>".} too
20:31:18Araqno they don't
20:31:48Araqit doesn't work by #including some header
20:32:16Araqthe information the header would provide is already there, in the nimrod code
20:32:33Araqbut you need to link to the static libraries
20:32:51Araqand make the compiler not use dlsym for the dynlib'ed symbols
20:32:59fowlTRenderer need to be SDL_Renderer in the generated c
20:33:16Araqno it doesn't
20:33:19tangentstormhrm. It doesn't approve of my use of 'class'.
20:33:25*tangentstorm hacks the code
20:34:06fowli do {.passl: gorge("pkg-config --libs sdl2").}
20:34:40Araqhmm good; does that work?
20:34:59tangentstormhrm. also doesn't like objects with procedures. i guess i just delete them from the interface? or use that {@ignore trick..?
20:34:59fowlyea
20:35:26Araqtangentstorm: remember your TP days to know what pas2nim supports ;-)
20:36:10fowltangentstorm, just comment if you can and uncomment/convert to nimrod afterwards
20:36:19tangentstormAraq: i started with turbo pascal 5.5... it likes objects but not methods i guess
20:36:20fowlassuming comments are kept
20:36:38Araqthey are, fowl
20:36:43tangentstormwould be better for me if i hacked the converter but i'll try comments first
20:37:01Araqa better converter would be awesome
20:40:29AraqI wish a got a nickel whenever somebody checks the return value of 'malloc'
20:41:53AraqI guess these guys even think it's "good style"
20:42:05gradhanowadays programmers don't even know what malloc is, you would be poor
20:42:40Araqnever mind the OS stopped returning NULL for malloc decades ago when they invented overcomitting due to unix's brain dead fork&exec model
20:43:28Araqand happily ignoring you can't catch "out of stack space" in C anyway either
20:45:50tangentstormhttps://github.com/tangentstorm/linenoise/blob/nim/ln.nim
20:46:19tangentstormseems to be missing quite a bit
20:46:34Araqlol yeah
20:46:37tangentstormhrm. almost 200 lines :)
20:46:56Araqbut tbh it looks easier to hack that feature into terminal.nim
20:47:11Araqsince linenoise only uses escape sequences anyway
20:47:29tangentstormi don't know what we're talking about but yeah, this isn't cross platform
20:47:55Araqthe rest of linenoise consists of typical C noise
20:48:25tangentstormi ported this by hand so i could show c and pascal side by side
20:48:50Araqsetting errno, checking for some edge cases, computing memory requirements etc.
20:49:14tangentstormi wonder why it cut off there
20:51:38AraqI dunno, pas2nim is mostly unmaintained
20:52:06tangentstormhrm.. also this depends on crt anyway :)
20:53:15tangentstormah well. i will look into it more when i have time.. it was pretty straightforward to port by hand though.
20:57:37reactormonkAraq, no way to make the two equivalent? http://sprunge.us/IdGg
20:57:40*gradha quit (Quit: bbl, have youtube videos to watch)
20:58:38Araqreactormonk: you could try a TR macro ... but I wouldn't
20:58:55reactormonkAraq, TR macro?
20:59:52reactormonkAraq, btw, is there a gensym in templates? so I can have var foo = pstr("bar") and implement it with a gensym
21:01:57Araqvar x {.gensym.} = ... ?
21:02:25reactormonkkk
21:02:41reactormonkand how do I fetch the generated symbol?
21:02:46Araqbut it's the default for clean templates anyway
21:04:47Araqtemplate freshSym(T: typedesc): expr = (var x: T; x) # may work, never tried it though
21:07:18*amarsahinovic joined #nimrod
21:07:40reactormonkoh, I asked the wrong question. I want to know the emitted symbol for the variable
21:07:49reactormonkhttp://sprunge.us/UFYY
21:09:11Araqit's "result"
21:09:20Araqthat's the symbol's name
21:10:12Araqtry to use:
21:10:31Araq{.emit: "progchar `result`[] PROGMEM = " & ... }
21:14:45reactormonkworks as expected \o/
21:14:59reactormonkfind the error: http://sprunge.us/UFii
21:15:10reactormonkhint: usage before declaration
21:16:00reactormonkthe problem is that the emit in the template is executed immediatly instead of in the context of the proc
21:16:41Araqno result_73029 is declared twice
21:17:34reactormonkoh, right.
21:18:06reactormonkhttp://sprunge.us/OKIM better?
21:18:35*fowl quit (Ping timeout: 240 seconds)
21:19:05Araqnot really
21:19:14Araq foo_73030 = result_73029;
21:19:15Araq strcpy_P(((NCSTRING) (buffer_73035)), foo_73030);
21:19:27Araqthe store to foo seems wrong
21:20:04reactormonknah, that's fine, it's the other way round
21:20:05reactormonkdon't ask.
21:20:14reactormonkstrcpy_P(buffer, (char*)pgm_read_word(&(string_table[i])))
21:20:23reactormonk... gotta change that stuff a bit anyway
21:21:29Araqyou know ...
21:21:42Araqyou should redefine STRING_LIT in nimbase.h
21:22:59Araqand use strcpy_P instead of c_memcpy in system/sysstr.nim
21:23:07Araqthen you may get the string semantics you desire
21:23:54reactormonkI can't have nimstrings
21:25:33reactormonkany way to define something down on the C level? Just the default defines?
21:28:43Araqnot sure what you mean, you already know about emit
21:29:26reactormonkYeah, but are nimrod defines (as in -d:release) propagated down to C?
21:29:38Araqhell no
21:29:57reactormonkfigured so
21:30:35reactormonkwell, nimbase is a header, so how do I propagate the current build env down there? Or don't bother and ship a separate nimbase for arduino?
21:31:36AraqI'd patch the existing nimbase.h
21:32:07Araqgcc likely defines some symbol like ARDINO for you
21:35:38*fowl joined #nimrod
21:36:58reactormonkkk
21:51:19reactormonkAraq, can I have my own little world in there?
21:51:30reactormonkcan I store the string length at compile time?
21:52:07reactormonkas they're immutable, that is known. And I need the size for strcpy_P
21:55:24Araqstring literals know their length
21:56:16reactormonkyes, but how do I query that length?
21:56:23Araq.len?
21:56:27reactormonkat compiletime?
21:56:32Araq.len?
21:56:37reactormonktouché
21:57:35fowlAraq, i think you should take out dumptree_imm and just make it dumptree
21:57:46Araqfowl: I agree
21:57:58Araqmake it pull request please
21:58:03fowlok
21:58:17Araqplease document it in web/news.txt
22:00:01*OrionPK joined #nimrod
22:02:28reactormonkAraq, still can't have an ifdef in nimbase.h, because it's the first .h to be included :-/
22:06:13Araqbs
22:06:30Araqcou defines are in no header
22:06:36Araq*cpu
22:06:40*zahary__ quit (Ping timeout: 276 seconds)
22:07:25reactormonkAraq, no sweet ARDUINO then.
22:08:39Araqreactormonk: ARDUINO shouldn't come from some header
22:25:38reactormonkAraq, it does
22:26:07Araqwhich header?
22:26:24Araqand why can't you include it in nimbase?
22:33:51reactormonkstill the question how nimbase should know if I'm compiling for arduino
22:35:16Araqand now you know why ARDUINO should be defined by GCC for you
22:35:58*q66 quit (Remote host closed the connection)
22:38:36reactormonkso you say I should add -DARDUINO somewhere in nimcfg?
22:38:55Araqthat's a good idea
22:39:04Araqit's not what I said, but it's a good idea
22:39:21Araqpassc:"-DARUINO"
22:39:23reactormonkwhat did you say?
22:40:04AraqI said GCC should define it for you, just like it defines "POWERPC" for you
22:40:52Araqor perhaps PPC who knows
22:41:10reactormonkwell, it does defined AVR, but that doesn't mean it's arduino
22:41:39fowlreactormonk, echo 'main(){}' | cpp -dM look for a define there
22:42:27reactormonkfowl, gcc -dM -E - < /dev/null
22:42:47fowlwhat
22:42:53reactormonkdoes the same
22:43:01fowlok
22:43:03fowlso do it
22:43:14reactormonknah, I'll just define arduino in my nimrod.cfg
22:45:53reactormonkAraq, is a string-literal assumed to be of time 'string'?
22:46:23Araqyeah but cstring("abc") works
22:46:59Araqand string literals are not heap allocated anyway, they cause no harm
22:48:04reactormonkbut they still go to the stack
22:49:57Araqno?
22:51:09reactormonkas soon as they are mentioned in a function, they need to be loaded into memory?
22:52:01Araqno?
22:52:14Araqbut you need to know what you're doing
22:53:31reactormonkapparently loading all strings into RAM is part of the initialization...
22:53:48reactormonkI want all string literals in the flash
22:55:07reactormonkwhich also requires me to kinda rewrite a bunch of how to access strings...
22:55:25Araqno idea why you want string literals in the first place
22:55:35reactormonkbecause of all the raise newException in the stdlib
22:56:29Araqwhen not defined(arduino): e.msg = msg # else: ignore the string
22:57:03Araqit's so easy to do ... it's already a template which provides the necessary laziness
22:58:33reactormonkwhich means you have no clue what has gone wrong
22:59:16Araqhave you managed to send the error message to some output device yet?
23:00:04NimBotAraq/Nimrod master 2048f70 Araq [+0 ±5 -0]: manyloc test should be green again
23:01:42reactormonkjust send it back via the serial line
23:02:50AraqI'd use an enum instead of error messages and document the error codes
23:03:12reactormonkthat's gonna be messy
23:03:12fowli thought you were just going to turn newException into echo msg; quit 1
23:03:26reactormonkfowl, more or less, but I still need to store them
23:07:18Araqgood night
23:25:31*fowl quit (Quit: Leaving)
23:25:48*fowl joined #nimrod