<< 22-12-2014 >>

00:00:30Araq_yeah but then we allow staticExec
00:02:36*shevy joined #nim
00:03:44*brson quit (Ping timeout: 256 seconds)
00:05:08*brson joined #nim
00:07:00*BlaXpirit quit (Quit: Quit Konversation)
00:07:54*brson_ joined #nim
00:09:27*brson quit (Ping timeout: 252 seconds)
00:09:57*boydgreenfield quit (Quit: boydgreenfield)
00:11:16*brson_ quit (Client Quit)
00:11:32*brson joined #nim
00:36:16*Mat4 left #nim (#nim)
00:40:54*starless joined #nim
00:43:10*AFKMorpork is now known as AMorpork
00:45:43*Matthias247 quit (Read error: Connection reset by peer)
00:57:10*BitPuffin joined #nim
00:57:21*brson quit (Quit: leaving)
00:57:33*brson joined #nim
00:59:08*boydgreenfield joined #nim
01:08:00*boydgreenfield quit (Quit: boydgreenfield)
01:20:26*Trustable quit (Remote host closed the connection)
01:24:21*Demos quit (Read error: Connection reset by peer)
01:25:35*starless quit (Quit: WeeChat 0.4.2)
01:58:06*rpag quit (Ping timeout: 264 seconds)
01:59:37dts|pokeballnim ffi's can work with js right?
01:59:50dts|pokeballassuming i dont want to compile to js for some reason?
02:11:46*darkf joined #nim
02:20:43*willwillson quit (Ping timeout: 252 seconds)
02:26:13*flaviu quit (Ping timeout: 252 seconds)
02:36:52*flaviu joined #nim
02:57:38*brson quit (Quit: leaving)
02:59:22*BitPuffin quit (Ping timeout: 240 seconds)
03:03:11*brson joined #nim
03:11:12*dain joined #nim
03:37:48*dain quit (Quit: dain)
04:17:53*brson quit (Quit: leaving)
04:45:59*j3rky_ is now known as gmpreussner
05:04:11*Boscop_ joined #nim
05:06:57*Boscop quit (Ping timeout: 245 seconds)
05:10:56*jez0990 joined #nim
05:11:00*skroll3 joined #nim
05:11:03*vezzy quit (Quit: No Ping reply in 180 seconds.)
05:12:09*quasinoxen joined #nim
05:58:27*kapil__ joined #nim
06:28:34*z1y joined #nim
06:29:05*Nimbus joined #nim
06:29:27*Nimbus quit (Remote host closed the connection)
07:02:30*MyMind quit (Ping timeout: 244 seconds)
07:03:07*DarkSuccess joined #nim
07:04:36*DarkSuccess quit ()
07:06:19*yglukhov joined #nim
07:07:03*yglukhov quit (Client Quit)
07:14:19*Nimbus joined #nim
07:17:06*Nimbus quit (Remote host closed the connection)
07:31:03*Nimbus joined #nim
07:31:14*AMorpork is now known as ZzZMorpork
07:31:26*Nimbus quit (Remote host closed the connection)
07:44:43*Nimbus joined #nim
07:44:56*Nimbus quit (Remote host closed the connection)
07:45:56*Nimbus joined #nim
07:46:50*Nimbus quit (Remote host closed the connection)
07:47:21*Nimbus joined #nim
07:50:57*Nimbus quit (Remote host closed the connection)
07:51:35*khmm joined #nim
07:56:11*khmm quit (Ping timeout: 265 seconds)
08:00:34*khmm joined #nim
08:14:21*gour joined #nim
08:36:21*Sembei joined #nim
08:43:46*milosn joined #nim
08:53:12*BlaXpirit joined #nim
09:41:29*kapil__ quit (Quit: Connection closed for inactivity)
09:44:51*yglukhov joined #nim
09:54:35*wan quit (Quit: WeeChat 1.0.1)
10:10:27*Trustable joined #nim
10:21:41*Matthias247 joined #nim
10:23:15*kniteli quit (Ping timeout: 252 seconds)
10:30:05*tillzy joined #nim
10:31:09*dirkk0 joined #nim
10:34:16*tillzy quit (Quit: Page closed)
10:35:52*kapil__ joined #nim
10:36:46*darkf_ joined #nim
10:38:14*darkf quit (Ping timeout: 258 seconds)
10:47:18*gokr_ joined #nim
10:58:33*gokr_ quit (Ping timeout: 258 seconds)
10:59:22*gokr_ joined #nim
11:02:04*dyu joined #nim
11:04:05*gokr_ quit (Remote host closed the connection)
11:04:22*gokr_ joined #nim
11:04:52*dom96_ quit (Ping timeout: 245 seconds)
11:08:42*gokr_ quit (Ping timeout: 250 seconds)
11:09:14*BitPuffin joined #nim
11:09:32*gokr_ joined #nim
11:18:14*willwillson joined #nim
11:21:10*repax joined #nim
11:26:30*darkf_ is now known as darkf
11:29:59*z1y quit (Ping timeout: 258 seconds)
11:29:59*khmm quit (Read error: Connection reset by peer)
11:32:21*khmm joined #nim
11:52:31*dirkk0 quit (Quit: This computer has gone to sleep)
11:57:11*gokr_ quit (Remote host closed the connection)
11:57:25*gokr_ joined #nim
12:10:22*khmm quit (Ping timeout: 240 seconds)
12:13:18*gokr_ quit (Ping timeout: 258 seconds)
12:15:20*khmm joined #nim
12:18:08*dom96_ joined #nim
12:42:50*z1y joined #nim
12:45:11*dirkk0 joined #nim
12:49:53*yglukhov quit (Read error: Connection reset by peer)
12:50:23*yglukhov joined #nim
12:52:16*dirkk0 quit (Quit: Leaving)
13:08:12*willwillson quit (Ping timeout: 245 seconds)
13:21:57*milosn quit (Ping timeout: 244 seconds)
13:31:04*dom96_ quit (Ping timeout: 245 seconds)
13:41:32*khmm quit (Ping timeout: 245 seconds)
13:50:15gokrAraq_: Do you still need some testing on OSX?
13:50:30gokrSaw something last night about that
13:50:50Araq_gokr: yeah
13:50:58Araq_please run: koch boot -d:release
13:51:01Araq_koch web
13:51:13Araq_and tell me if it works for you
13:51:18Araq_er, no, run
13:51:27Araq_koch web --parallelBuild:1
13:51:35gokrdevel=
13:51:37gokr?
13:51:42Araq_yes
13:55:04gokrSuccessful
13:56:54gokrLooks nice too
13:57:03gokrGotta eat some lunch, family waiting
14:03:22*jefus_ is now known as jefus
14:04:17repaxkoch web on osx didn't work for me some days ago
14:04:32repaxperhaps there have been changes since then
14:05:14repaxit failed while processing "atomics"
14:05:55yglukhovkoch web went successful. Now how where do I see the site?
14:07:38repaxyglukhov: in the documentation sub directory
14:09:00yglukhovah ok
14:09:05yglukhovseems good.
14:09:24repaxyglukhov: do you run os x?
14:09:27yglukhovyep
14:09:30repaxclang?
14:09:33repaxor gcc
14:09:33yglukhovyep
14:09:36yglukhovclang
14:09:42repax nice
14:10:01repaxI will try it again then
14:11:00gokrI haven't gone to Yosemite yet though
14:11:13gokrOk, off to ... christmas tasks
14:13:51*[CBR]Unspoken joined #nim
14:18:26*willwillson joined #nim
14:19:36dv-hm if i pass a tuple into a proc, why can't i assign to its elements?
14:23:57Araq_dv-: because parameters are immutable
14:24:17Araq_use 'var tuple[...]' as the parameter's type
14:24:24Araq_and then you can modfiy the tuple
14:24:50dv-i see. thanks
14:33:17dyuAraq_: I'd like to call a nim function with openarray as arg, from c/cpp (raw memory from a flat buffer) ... possible?
14:33:38Araq_sure
14:33:49Araq_it's mapped to a pointer + int length parameter
14:34:02Araq_so pass these in your c++ code
14:36:45dyuAraq_: thanks.
14:37:49dyuIs it possible to return a construct a nim sequence backed by external memory (not gc'ed)?
14:38:58dyuwith openarray, I've to pass a callback function to cpp to do this (openarray as args limitation), where a sequence can be returned directly
14:40:31dyuto construct a nim sequence*
14:44:14dv-Error: for a 'var' type a variable needs to be passed
14:44:35dv-not sure what to do with this error
14:45:15Araq_dv-: well if you modify the tuple, the modifications also affect the argument that you passed
14:45:30Araq_so you need to pass something that in fact can be modified
14:45:39Araq_like a variable
14:45:48Araq_var x = (2, 2)
14:45:55Araq_p(x) # works
14:46:01Araq_p((2, 2)) # fails
14:46:29Araq_dyu: no the language requires you to allocate a seq with the builtin methods
14:46:44dyuhmm
14:47:22*gokr_ joined #nim
14:47:24Araq_but you can do this:
14:47:49Araq_proc allocateSeq(len: int): seq[int] {.exportc.} = ...
14:47:59Araq_and then use allocateSeq from C++
14:51:17dyuAraq_: ok ... so for int, i'd return a struct { int len; int* data; }?
14:52:20Araq_no
14:52:55Araq_you have to use Nim and let the Nim compiler generate the required code for you
14:53:17Araq_hence my suggestion to .exportc it
14:53:36Araq_in fact
14:53:42Araq_do as little in C++ as possible
14:55:40*dom96_ joined #nim
14:56:51dv-ok, what if i want to iterate over a var array of tuples and modify its fields?
14:57:37Araq_since mitems is still missing from system.nim, you use an old fashioned index and a[i].field = bar
14:58:32dyulooking at the generated code, the structure is struct { struct { int len; int reserved; int data[SEQ_DECL_SIZE] }
14:58:56Araq_yes
14:59:26dyustruct { struct { int len; int reserved; } int data[SEQ_DECL_SIZE] }*
14:59:39dyuhmm, so data is preallocated
14:59:49dyunot simply a pointer
15:01:09Araq_well I already told you what to do
15:01:30dyuyea I'm doing as little in c++ as possible ... what I"m trying to do is allocated X size of type T from a flatbuffer and return a seq/array that nim can use
15:02:29dyuerr, so many typos :/
15:03:21*z1y quit (Remote host closed the connection)
15:04:12*z1y joined #nim
15:04:39*gokr_ quit (Ping timeout: 258 seconds)
15:05:08*milosn joined #nim
15:06:09dyuyou have to use Nim and let the Nim compiler generate the required code for you <-- I get this, though the allocated seq's is no longer from the flatbuffer, which I'll means any write to it will not be reflected in the flatbuffer
15:06:23dyuwhich means*
15:07:56Araq_well maybe it's better to return a ptr array[] to Nim then?
15:09:41*EXetoC quit (Quit: WeeChat 1.0.1)
15:10:40dyuarray[] without the length embedded in the type? Didn't know that (which is why I only brought up openarray) - I'ma test it
15:10:41dyuthanks
15:12:02Araq_well that was pseudo-code
15:12:24Araq_type UncheckedArray[T] {.unchecked.} = array [0..0, T]
15:12:46Araq_proc fromCpp(): ptr UncheckedArray[int] # use this code instead
15:13:23Araq_dom96_: oh look, UncheckedArray is still missing from system.nim too. :P
15:13:45dyuAraq_: I'ma try that. thanks
15:14:22*willwillson quit (Ping timeout: 240 seconds)
15:33:19dom96_ Araq_ why are you telling me this?
15:35:50*darkf quit (Quit: Leaving)
15:36:07shevyadd it dom96_!
15:38:17*z1y quit (Ping timeout: 240 seconds)
15:38:48dom96_Finally an article about Rust which talks about Nim for at least a paragraph https://news.ycombinator.com/item?id=8781522
15:47:01flaviuAraq_: I feel that "everybody should learn about browser refreshes" is targeted at me, but I did refresh my browser. Caches were the problem.
15:47:20*khmm joined #nim
16:01:29*kapil__ quit (Quit: Connection closed for inactivity)
16:17:36gmpreussner@dom96, @Araq: i forgot to tell you this earlier this week, but there might be an issue with importing external libraries. on a fresh ArchLinux install with Nim from devel and all project dependencies installed, Aporia doesn't compile due to glib2 (and possibly other libraries) not being found. flaviu was able to repro this. It's not Aporia specific though.
16:18:18flaviugmpreussner: glib2 needs to be installed with nimble
16:18:28flaviubut it hasn't been updated for devel yet.
16:18:43gmpreussnerbut didn't you run into some other error after that?
16:18:55gmpreussnergood morning btw :)
16:18:59dom96_Yes, and you need to ensure that your nim cfg has ~/.nimble/ set as its --babelpath
16:19:20flaviuYes, but I think it was unrelated. Some sort of syntax error in the wrapper.
16:19:48gmpreussnerok, i'll give that a try then, thanks!
16:19:58flaviudom96_: fwi, gtk needs to be updated against the latest devel
16:20:02flaviulots of `func`
16:20:19dom96_It already was.
16:25:42*repax quit (Ping timeout: 245 seconds)
16:27:21flaviulambdalifting.nim(727) liftIterSym Error: unhandled exception: assignment to discriminant changes object branch [FieldError]
16:31:43*willwillson joined #nim
16:50:52gmpreussnerdom96: does nimble require its PATH to be added, or can it also work with symlinks? i created a symlink in /usr/local/bin and added nimble.ini with nimbleDir to point to my nimble install directory, but it's still trying to include nim core libs from /usr/local/bin
16:51:50gmpreussner(i have a symlink for nim itself in /usr/local/bin as well)
16:51:57ldleworkI personally use the path option so I'm not sure
16:52:19dom96_You can put nimble wherever you want. You need to put the nimble.ini config file in the right place though.
16:52:37gmpreussneri have it in ~/.config/nimble/nimble.ini
16:53:13dom96_what are you trying to do?
16:53:17dom96_Build Aporia?
16:53:28gmpreussneryeah :)
16:53:44dom96_How are you trying to build it?
16:54:06*BlaXpirit-UA joined #nim
16:54:43*gokr_ joined #nim
16:55:16gmpreussnerdom96: well, previously i tried 'nim c aporia', but that didn't get very far. now i'm tyring with nible, but im stuck at 'nimrod c -r src/nimble install', because it's trying to pull dependency libs from the wrong place
16:55:44gmpreussnerto be fair, i haven't followed the instructions - instead of adding nim and nimble to PATH i created symlinks in /usr/local/bin
16:56:00gmpreussnerso i probably just need to RTFM, unless there's a way to make it work without PATH
16:56:23dom96_Are you getting an error when trying to run 'nimrod c -r src/nimble install' ?
16:56:41gmpreussneryep, Error: cannot open '/usr/local/lib/nim/system.nim'
16:57:22*BlaXpirit quit (Ping timeout: 240 seconds)
16:58:06dom96_That's not Nim related.
16:58:08dom96_er
16:58:13dom96_That's not Nimble related
16:58:21gokr_ah, classic problem. Better to add to path, then Nim will find libraries
16:58:29gmpreussnerok
16:59:27gokr_Although I thought I used symlinks and it worked... hm
16:59:35dom96_There should be a way to detect this scenario and make it work.
16:59:44dom96_gmpreussner: Create an issue on github for this.
17:00:19*jefus_ joined #nim
17:00:25gmpreussnerok, that would be in the nim repo, correct?
17:00:31gokr_I think I wrote about this in my article
17:01:04*gokr_ not at computer now
17:03:11dom96_gmpreussner: yes
17:04:06*jefus quit (Ping timeout: 264 seconds)
17:05:17*gokr_ quit (Ping timeout: 240 seconds)
17:06:25*Mat4 joined #nim
17:06:38Mat4hi all
17:16:06*milosn quit (Ping timeout: 264 seconds)
17:19:54gmpreussnerhi Mat4
17:20:09Mat4hello
17:20:10gmpreussnerdom96: adding nim and nimble to PATH worked fine. I added https://github.com/Araq/Nimrod/issues/1768
17:23:20dom96_thanks
17:32:04Araq_dom96_: I see no real bugs so far but didn't play with it.
17:32:20Araq_.async doesn't affect proc types, why should it?
17:32:30gmpreussnerdom96_: so, from what i can tell, gtk2 is not in the package list of nim-lang's master branch. do i need to sync the list from elsewhere?
17:32:39Araq_capturing an openArray is simply not supported either
17:32:57dom96_Araq_: For convenience.
17:33:03Mat4does one know why changes to the PATH variable in .bash_profile are ignored ? (Fedora, I want to add the path to my Nim installation directory)
17:33:06dom96_Araq_: Why can't macros transform proc types?
17:33:12gmpreussnerdom96_: sorry, i meant glib2, not gtk2
17:33:31Araq_Mat4: use .bashrc instead
17:34:05Araq_dom96_: why should they? what convenience are you talking about?
17:34:21Araq_the macro is supposed to transform *procs* not *proc types*
17:34:33Araq_does your macro even deal with proc types?
17:34:48Araq_we surely can make it work, but I think it's a bad idea
17:35:23Araq_so every proc transforming macro also gets the burden of handling proc types then... meh.
17:37:38*BlaXpirit-UA quit (Quit: Quit Konversation)
17:37:57*BlaXpirit joined #nim
17:38:29Araq_dom96_: let's not take that route before 1.0 is out, ok? just document your async better.
17:39:31Mat4Araq: thanks
17:39:41dom96_Araq_: sure
17:42:09*yglukhov quit (Ping timeout: 252 seconds)
17:47:40Araq_dom96_: why do we need the logo in SVG format?
17:47:57dom96_Araq_: In case you want a large version of it.
17:47:58Araq_what's the benefit?
17:48:10dom96_It's scalable.
17:48:24Araq_ok, but does it look the same as now?
17:49:29*khmm quit (Ping timeout: 252 seconds)
17:50:29Araq_meh I'll pull it and look at it
17:52:28Araq_dom96_: has nimrod-code been renamed to nim-lang already?
17:52:58Araq_bbl
17:53:16dom96_yeah
17:53:21dom96_a long time ago
17:53:41*asterite joined #nim
18:13:25dv-nim seems to wrap the last digit of floats?
18:24:35*gokr_ joined #nim
18:26:31*Nimbus joined #nim
18:26:45*kniteli joined #nim
18:29:04*Nimbus quit (Excess Flood)
18:37:06*perturbation joined #nim
18:40:16*Nimbus joined #nim
18:43:07*asterite_ joined #nim
18:44:44*milosn joined #nim
18:44:54*asterite quit (Ping timeout: 264 seconds)
18:44:55*asterite_ is now known as asterite
18:47:59*Jesin quit (Remote host closed the connection)
18:53:30*gokr_ quit (Ping timeout: 258 seconds)
18:54:59*gokr_ joined #nim
18:59:29Mat4I have a procedure 'storeContent' :-
18:59:31Mat4proc storeContent (state : var tBeranaBundle, content : tWord)
18:59:39Mat4proc storeContent (state : var tBeranaInterpreterTrace, content : tWord)
19:01:04Mat4a function call as 'bundle.storeContent (tWord) state.aMem[IP]' esults in a comilation error whereby the statement: 'word = (tWord) state.aMem[IP]; bundle.storeContent word' works fine
19:01:07Araq_dv-: no, it doesn't.
19:01:12Mat4^results
19:02:01*shevy left #nim ("I'll be back ... maybe")
19:02:03Araq_Mat4: (T) foo is not valid type conversion syntax
19:02:11Araq_use T(foo) instead
19:02:31Mat4ehm, ok
19:04:03Mat4thanks
19:04:31dv-Araq_: weird. i get -0.16907516382852447 in julia and -0.1690751638285245 in nim
19:05:01Araq_dv-: are you on devel?
19:05:25dv-i guess. i built it from git
19:05:30flaviudv-: It's the same number though.
19:05:51dv-back in a bit
19:05:54flaviuoh, I se
19:06:00flaviu*see
19:07:43flaviubtw, dts|pokeball has been working on an eval bot
19:07:43flaviu.eval echo(0.1+0.2)
19:07:46Nimbusflaviu: 0.3
19:08:16Araq_.eval 0.3+0.8
19:08:19NimbusAraq_: eval.nim(2, 3) Error: value of type 'float' has to be discarded
19:08:26*asterite_ joined #nim
19:08:29dom96_.eval echo(-0.1690751638285245)
19:08:32Nimbusdom96_: -0.1690751638285245
19:08:32Mat4dv-: the value get rounded as you see
19:08:41dom96_.eval echo(-0.16907516382852447)
19:08:44Nimbusdom96_: -0.1690751638285245
19:08:59flaviu.eval echo(-0.16907516382852445)
19:09:02Nimbusflaviu: -0.1690751638285244
19:09:03Araq_pfff Nimbus should be as smart as "nim i"
19:09:28flaviuAraq_: Nimbus doesn't parse the text, it just dumps it to a file. It has no idea what the expression may or may not return.
19:09:39Araq_wow Nimbus is cool. can I try rm -rf /
19:09:52*asterite quit (Ping timeout: 240 seconds)
19:09:53*asterite_ is now known as asterite
19:09:56flaviuAraq_: You'll need --no-preserve-root and superuser
19:10:12*asterite left #nim (#nim)
19:10:19dom96_.eval import os; echo("foo" / "asd")
19:10:19dts|pokeballthanks for the support Araq_ !
19:10:22Nimbusdom96_: eval.nim(3, 5) Error: invalid indentation
19:10:24dom96_meh
19:10:33dom96_That needs to work IMO
19:10:40dts|pokeballfirst, no need to import os
19:10:42flaviudom96_: It's your own fault.
19:10:52dts|pokeballsecond, it will. im fixing it right now
19:10:57flaviu.eval import os;echo("foo" / "asd")
19:11:00Nimbusflaviu: foo/asd
19:11:05flaviusee?
19:11:27dom96_flaviu: No. It's definitely not my fault.
19:11:43dts|pokeballim writing a function to strip leading ws
19:11:56flaviudts|pokeball: But what about when I want indentation?
19:12:06Araq_dts|pokeball: strutils already has such a function
19:12:10dom96_I guess it's the compiler's fault.
19:12:11flaviudom96_: The ; is replaced with a newline directly. That space after the newline indents the next line.
19:12:34Araq_dom96_: I don't think so
19:12:52dts|pokeballAraq_, g2k
19:13:08dts|pokeballflaviu, why would you care about what the compiler sees?
19:13:09dom96_Araq_: In what situation should the whitespace be significant when following a semi-colon?
19:14:03flaviu.eval if true:; echo "blah"
19:14:06Nimbusflaviu: blah
19:14:07flaviudts|pokeball: ^
19:14:31dom96_.eval if true: echo "blah"
19:14:34Nimbusdom96_: blah
19:14:44dom96_The semi-colon is redundant there.
19:14:57dts|pokeball.eval if true:;echo "blah"
19:14:59Nimbusdts|pokeball: eval.nim(3, 4) Error: invalid indentation
19:15:07dts|pokeballhmm
19:15:10Araq_dom96_: wtf you're right
19:15:16Araq_the compiler is stupid
19:15:41Araq_I'll remove ; for version 1.0 anyway, it's too confusing
19:15:53dom96_Araq_: nooo
19:15:53flaviudom96_: The semicolon is intercepted by Nimbus, not the compiler.
19:16:04dom96_flaviu: No, it's not.
19:16:09dom96_Not right now at least.
19:16:11dts|pokeballdom96, yes it is
19:16:12flaviuliterally code.replace(";", "\n")
19:16:35Araq_flaviu: nevertheless import os; echo "foo" fails for Nim itself
19:17:05dom96_I see. import os;echo "foo" also fails in the compiler.
19:17:07dts|pokeballonce i strip leading ws it should be fine
19:17:39dts|pokeballas long as you only use ; for new lines, and not ifs as dom96 deomstrated
19:17:45Araq_dom96_: yeah. but ever since we introduced (;;;) things went downhill ...
19:17:58dom96_The problem with this eval is that I'm guessing this won't work...
19:18:02dom96_.eval var x = 5
19:18:05dom96_.eval echo x
19:18:05Nimbusdom96_: <no output>
19:18:07Nimbusdom96_: eval.nim(2, 5) Error: undeclared identifier: 'x'
19:18:36flaviudom96_: It uses a new file each time.
19:18:41dom96_Yeah. It shouldn't.
19:18:46dom96_You should create a file for each user.
19:18:52dts|pokeballdom96, just as it doesnt work with geordi
19:18:58dom96_And have some command to clear it.
19:19:04dts|pokeballalso, i cant do it for each user
19:19:08flaviudom96_: It's oss: https://github.com/DTSCode/Nimbus
19:19:10dom96_Why?
19:19:41dts|pokeballbecause nim wont let me have - in the name
19:19:58dom96_huh?
19:20:07Araq_lol? so '_' doesn't exist?
19:20:29dom96_var userFiles = newStringTable()
19:20:50dom96_userFiles.mget("dom96").add("var x = 5\n")
19:21:27flaviusounds too complicate
19:21:29flaviud
19:21:32dts|pokeballmeh
19:21:40dts|pokeballmaybe
19:22:08dts|pokeballonce i get a sandboxed version im going to write a makefile to replace my crappy python build script then ill look at that
19:23:59Araq_dom96_: using StringTableRef is a bad idea. you can start a hash collision attack then easily and make user lookup O(n) instead of O(1) and hell freezes over right after that
19:24:22*Araq_ is kidding
19:24:23flaviuAraq_: Hopefully by that time you'll have a chance to ban the guy doing that.
19:24:39dom96_dts|pokeball: Is this not sandboxed?
19:24:46dts|pokeballdom96_, not yet
19:24:56*dyu quit (Quit: Leaving)
19:27:03Araq_dom96_: funnily enough
19:27:05Araq_when true:
19:27:07Araq_ import os; echo "foo"
19:27:10Araq_works ...
19:27:19Araq_so it's just the weird top level parsing
19:27:28dom96_.eval import httpclient, asyncdispatch;var c=newAsyncHttpClient();var r = waitFor(c.request("http://nim-lang.org"));echo(r.status)
19:27:35Nimbusdom96_: 200 OK
19:27:43dom96_Time to DDOS
19:27:44ldleworkif "when" sort of the same thing as "if"?
19:27:45dom96_:P
19:28:07dom96_Araq_: Interesting.
19:28:08Araq_ldlework: quite similar. it's more like C's #if
19:28:14*Nimbus quit (Remote host closed the connection)
19:28:37ldleworkAraq_: ah compiletime if
19:28:46ldleworkI knew that :)
19:28:57ldleworkAraq_: how's it going?
19:29:09flaviudom96_: It's a poor DDOS when you're only using two machines.
19:29:19dom96_bbl
19:29:31dts|pokeballany DDOS that uses my machine is a poor DDOS
19:31:02gmpreussnerdoes anyone remember which commit caused the static[T] regressions? i would really like to be able to use static generic parameters inside procs. looking at various projects on GitHub this must have worked at some point (the ones i've tried no longer compile either). will sync to an earlier revision if needed. it's kinda blocking me boohoo :/
19:31:16flaviubisect?
19:31:59*Mimbus joined #nim
19:32:01Araq_ldlework: I'm burned out. no fixes anymore. I'm working on feature cleanups instead.
19:32:13ldleworkAraq_: still feeling under the weather?
19:32:22flaviu.eval echo("foo")
19:32:24Mimbusflaviu: /home/sandbox/nimcache/stdlib_system.o: In function `nimUnloadLibrary':
19:32:24ldleworkHope you've got some jogging in :)
19:32:46*Mimbus quit (Remote host closed the connection)
19:32:49Araq_with a bit of luck I can go jogging in 2 days
19:33:30Araq_gmpreussner: it's more effective if I tell you how to fix static[T]
19:33:50*Mimbus joined #nim
19:33:57flaviu.eval echo("foo")
19:33:58Mimbusflaviu: /home/sandbox/nimcache/stdlib_system.o: In function `nimUnloadLibrary':
19:34:13*Mimbus quit (Remote host closed the connection)
19:34:29gmpreussnerAraq_: you might as well give me the launch codes to the US nuclear arsenal then :)
19:34:47gmpreussnerbut please try. i really want to learn how the compiler works, too.
19:35:09Araq_what issue does affect you?
19:37:47gmpreussnerthe only real blocker i ran into is that i cannot resolve static generic parameters inside of procs. for example, if i have static[int] parameters, i cannot do arithmetic with them inside procs. the compiler will complain that the types aren't compatible. my uninformed guess is that it passes down the type of the parameter (i.e. static[T]) instead of the value (i.e. "foo" or 42)
19:38:14gmpreussnerit's used heavily in this module, for example: https://github.com/barcharcraz/vecmath/blob/master/src/vecmath.nim
19:38:59gmpreussnerthere are some other projects on GitHub, and also some related forum posts, which i can't find right now.
19:39:51gmpreussnerhere's one post: http://forum.nim-lang.org/t/572#3095
19:41:20gmpreussneri was able to work around it with ranges, but it makes for rather inefficient and complicated algorithms (nested loops etc.)
19:53:23*Mimbus joined #nim
19:53:44flaviuI've got it sandboxed now. Have fun!
19:54:42flaviu,eval var i = 0;while true:; i+=1
19:55:21*brson joined #nim
19:55:41flaviu,eval echo "foo"
19:57:38*Mimbus quit (Remote host closed the connection)
19:57:45*Mimbus joined #nim
19:58:05flaviu.eval var i = 0;while true:; i+=1
19:58:51flaviu.eval echo "foo"
19:59:06Mimbusflaviu: <no output>
19:59:07Mimbusflaviu: foo
19:59:13flaviusee?
19:59:37flaviuIt gets killed after a minute of doing nothing and after 200MB of memory usage
20:00:21flaviu.eval echo(readAll("/etc/shadow"))
20:00:22Mimbusflaviu: eval.nim(1, 12) Error: type mismatch: got (string)
20:00:29flaviu.eval echo(readFile("/etc/shadow"))
20:00:30Mimbusflaviu: Error: unhandled exception: cannot open: /etc/shadow [IOError]
20:00:35flaviu.eval echo(readFile("/etc/passwd"))
20:00:36Mimbusflaviu: root:x:0:0:root:/root:/usr/bin/zsh
20:00:36*Mimbus quit (Excess Flood)
20:00:42*Mimbus joined #nim
20:00:51flaviuIt can still read that file because there isn't any sensitive information there.
20:05:17*ZzZMorpork is now known as AMorpork
20:05:40Araq_,eval import osinfo_posix;echo getSystemVersion()
20:05:57flaviu.eval import osinfo_posix;echo getSystemVersion()
20:05:58Araq_.eval import osinfo_posix;echo getSystemVersion()
20:06:00Mimbusflaviu: Linux 3.17.6-1-ARCH x86_64
20:06:01MimbusAraq_: Linux 3.17.6-1-ARCH x86_64
20:09:23Araq_gmpreussner: sorry, I looked into it and even I have no idea how this ever worked. git bitsect seems the better way.
20:10:18Araq_TMatrix.N doesn't even get resolved to static[int]
20:10:33Araq_but to typeDesc[anything]
20:10:37*Varriount|Busy joined #nim
20:12:41Varriount|BusyI wonder what would be better for storing parts of a path, a sequence of strings, or a single string and a sequence/array of ints
20:13:10flaviuWouldn't it be easiest to work with a sequence of strings?
20:13:13*gmpreussner quit (Ping timeout: 272 seconds)
20:13:45flaviu.eval import strutils;@["home", "user", "blah"].join("/")
20:13:46Mimbusflaviu: eval.nim(2, 25) Error: value of type 'string' has to be discarded
20:13:53flaviu.eval import strutils;echo(@["home", "user", "blah"].join("/"))
20:13:54Mimbusflaviu: home/user/blah
20:14:04Varriount|Busyflaviu: Possibly, if the sequence were being exposed to the user.
20:14:16flaviuEven internally, it'd be easier
20:14:40Varriount|BusyPfft, internal ease
20:17:13Varriount|Busyflaviu: My goal is performance and memory usage.
20:18:34*gmpreussner joined #nim
20:26:39dom96_flaviu: how did you sandbox it?
20:26:54dom96_It probably shouldn't excess flood.
20:27:41*Mimbus quit (Remote host closed the connection)
20:27:48*Mimbus joined #nim
20:30:40*Mimbus quit (Excess Flood)
20:30:47*Mimbus joined #nim
20:30:54dom96_I brokeded it
20:32:10Araq_Varriount|Busy: string + seq[int] seems better
20:33:26*repax joined #nim
20:43:25Varriount|BusyAraq_: Ok, thanks.
20:51:54*perturbation quit (Ping timeout: 245 seconds)
20:53:14*perturbation joined #nim
20:55:10Mat4which constant or variable hold the endianess again ?
20:55:43Araq_system.cpuEndian
20:58:02*brson quit (Quit: leaving)
20:58:48flaviudom96_: I made a new user, and went through my filesystem and set all private files to o-rwx.
20:59:44flaviuI then made a file in /etc/security/limits.d/ to limit it to 1 minute of CPU time and 200MB per process.
21:01:05dom96_I think you should be using SELinux or AppArmor.
21:01:11flaviuArch's default configuration for limits are set to ignore them, so I added `session required pam_limits.so` to /etc/pam.d/su
21:01:19flaviuWhy?
21:02:05*milosn quit (Ping timeout: 265 seconds)
21:02:06flaviuI don't think its practical to set selinux up to protect from malicious reads.
21:02:44flaviuAnd the linux permissions system is powerful enough for that anyway.
21:11:43*vegai left #nim (#nim)
21:11:57*bjz_ quit (Ping timeout: 240 seconds)
21:24:34*gmpreussner quit (Quit: Konversation terminated!)
21:26:21*gour quit (Quit: Leaving)
21:31:24*repax quit (Ping timeout: 250 seconds)
21:32:03*boydgreenfield joined #nim
21:32:22*brson joined #nim
21:33:18Araq_flaviu: what's the motivation again for allowing (foo: 3, bar: 4) being passed to tuple[key, val: int] ?
21:34:07flaviuMost languages don't even have tuple variable names - tuples are supposed to be purely structurally typed.
21:38:42Mat4for declared arrays, is the index to a given element endian dependent or not ?
21:40:11Mat4I mean 'var test: array [0..x, int8]': Address test[0] the least or the most significant byte ?
21:41:38flaviuMat4: Endianess doesn't matter unless you're doing cast[array[8, int8]](myInt53)
21:41:49flaviu*myInt64
21:41:59Araq_Mat4: what flaviu says
21:42:29Araq_flaviu: yeah but we do have the names
21:43:26Araq_oh well, it fixes a bug as a side effect at least
21:44:20Mat4it matters because I use word-sized variables as shift destinations for packed bytes (which should be hold in CPU registers)
21:44:29*skyfex joined #nim
21:45:57Araq_Mat4: just try it
21:47:58Mat4ok, I prepare a QEMU image for 680x0 emulation
21:48:16dv-how come it's not possible to start a multiline var/let on the first line? i.e.
21:48:18dv-let a = ...
21:48:22dv- b = ...
21:48:46Mat4let
21:48:52Mat4 a = ...
21:49:02Mat4 b = ...
21:49:08dv-yes
21:49:57flaviu.eval let a = ""; b = ""
21:49:58Mimbusflaviu: eval.nim(2, 5) Error: invalid indentation
21:50:05flaviu.eval let; a = ""; b = ""
21:50:06Mimbusflaviu: <no output>
21:51:59skyfexAraq_: Have you considered allowing just ``raise "some string"`` ? I do that a lot in Ruby for simple one-off tools
21:52:50Varriount|BusyAraq_: What are the limitations of macro quasi-quoting at the moment? Can we use complex expressions, such as 'for' statements?
21:53:37flaviu.eval converter str2exception(str: string): Exception =; return newException(Exception, str); raise "test"
21:53:38Mimbusflaviu: eval.nim(3, 6) Error: invalid indentation
21:53:57*repax joined #nim
21:55:06flaviuthat doesn't work anyway since raise is a builtin keyword and not a procedure
21:55:12flaviuunfortunate.
22:04:34Araq_flaviu: I think we can fix that to work with raise
22:04:43Araq_skyfex: just use a template
22:05:09Araq_template fatal(x: string) = raise newException(IOError, x)
22:05:27Araq_though quit "you fools" already exists too
22:06:26skyfexCool
22:06:28*boydgreenfield quit (Quit: boydgreenfield)
22:08:53skyfexWhy is it still common to target Gtk2 rather than Gtk3? Is there something wrong with Gtk3?
22:09:07dom96_Araq_: I think we should make that work with 'raise'
22:09:17dom96_I also would like to see 'newException' gotten rid of
22:09:22dom96_In favour of constructors.
22:10:05repaxAre these constructors going to have the same name as the type?
22:11:02*boydgreenfield joined #nim
22:11:03repaxWill you then overload them if one ctor has additional parameters etc?
22:14:08*brson quit (Quit: leaving)
22:14:22*j3rky joined #nim
22:14:27*j3rky is now known as gmpreussner
22:15:02flaviuI said that constructors would be liked :)
22:15:02flaviuhttps://github.com/Araq/Nimrod/issues/1693
22:19:11repaxflaviu, thanks, Interesting.
22:19:59repaxcreate() could become a convention I suppose
22:20:53*StefanSalewski joined #nim
22:22:27StefanSalewskiskyfex: I am working on it...
22:24:43repaxC++ also has the non-explicit conversion constructors. I think implicit conversions are a little bit nasty
22:26:40*kniteli quit (Ping timeout: 265 seconds)
22:32:17Araq_repax: note that this is only flaviu's proposal. I'm not a fan of this idea at all.
22:34:02*kniteli joined #nim
22:39:42repaxI see.
22:41:44*skyfex quit (Quit: (null))
22:41:53*Matthias247 quit (Read error: Connection reset by peer)
22:46:47*stonecol1devin joined #nim
22:49:35ldleworkAraq_: lotr reference?
22:49:57Araq_no. coincidence.
22:50:15ldlework"you fools" wasn't a lotr reference?!
22:50:34ldleworkwhat did it mean?
22:54:00Mat4I think the easiest replacement for preprocessor macros are templates ?
22:54:23flaviuyep.
22:54:59*boydgreenfield quit (Quit: boydgreenfield)
23:05:21Araq_ldlework: oh that... well it didn't occur to me that you were still talking about that
23:05:35ldleworkAraq_: so...was it a lotr reference? :D
23:05:38Araq_yeah
23:09:51*perturbation quit (Quit: Leaving)
23:12:39*stonecol1devin is now known as stonecolddevin
23:14:18*dts|pokeball quit (Ping timeout: 264 seconds)
23:17:32*Sergio965 joined #nim
23:18:48*Jesin joined #nim
23:21:20*dts|pokeball joined #nim
23:24:52*Sergio965 quit (Ping timeout: 245 seconds)
23:27:18*brson joined #nim
23:30:19*brson quit (Client Quit)
23:31:14*Jesin quit (Quit: Leaving)
23:32:36*Jesin joined #nim
23:33:17*brson joined #nim
23:54:40*Jesin quit (Quit: Leaving)
23:55:39*z1y joined #nim
23:56:19*boydgreenfield joined #nim