00:00:30 | Araq_ | 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:37 | dts|pokeball | nim ffi's can work with js right? |
01:59:50 | dts|pokeball | assuming 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:15 | gokr | Araq_: Do you still need some testing on OSX? |
13:50:30 | gokr | Saw something last night about that |
13:50:50 | Araq_ | gokr: yeah |
13:50:58 | Araq_ | please run: koch boot -d:release |
13:51:01 | Araq_ | koch web |
13:51:13 | Araq_ | and tell me if it works for you |
13:51:18 | Araq_ | er, no, run |
13:51:27 | Araq_ | koch web --parallelBuild:1 |
13:51:35 | gokr | devel= |
13:51:37 | gokr | ? |
13:51:42 | Araq_ | yes |
13:55:04 | gokr | Successful |
13:56:54 | gokr | Looks nice too |
13:57:03 | gokr | Gotta eat some lunch, family waiting |
14:03:22 | * | jefus_ is now known as jefus |
14:04:17 | repax | koch web on osx didn't work for me some days ago |
14:04:32 | repax | perhaps there have been changes since then |
14:05:14 | repax | it failed while processing "atomics" |
14:05:55 | yglukhov | koch web went successful. Now how where do I see the site? |
14:07:38 | repax | yglukhov: in the documentation sub directory |
14:09:00 | yglukhov | ah ok |
14:09:05 | yglukhov | seems good. |
14:09:24 | repax | yglukhov: do you run os x? |
14:09:27 | yglukhov | yep |
14:09:30 | repax | clang? |
14:09:33 | repax | or gcc |
14:09:33 | yglukhov | yep |
14:09:36 | yglukhov | clang |
14:09:42 | repax | nice |
14:10:01 | repax | I will try it again then |
14:11:00 | gokr | I haven't gone to Yosemite yet though |
14:11:13 | gokr | Ok, off to ... christmas tasks |
14:13:51 | * | [CBR]Unspoken joined #nim |
14:18:26 | * | willwillson joined #nim |
14:19:36 | dv- | hm if i pass a tuple into a proc, why can't i assign to its elements? |
14:23:57 | Araq_ | dv-: because parameters are immutable |
14:24:17 | Araq_ | use 'var tuple[...]' as the parameter's type |
14:24:24 | Araq_ | and then you can modfiy the tuple |
14:24:50 | dv- | i see. thanks |
14:33:17 | dyu | Araq_: I'd like to call a nim function with openarray as arg, from c/cpp (raw memory from a flat buffer) ... possible? |
14:33:38 | Araq_ | sure |
14:33:49 | Araq_ | it's mapped to a pointer + int length parameter |
14:34:02 | Araq_ | so pass these in your c++ code |
14:36:45 | dyu | Araq_: thanks. |
14:37:49 | dyu | Is it possible to return a construct a nim sequence backed by external memory (not gc'ed)? |
14:38:58 | dyu | with 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:31 | dyu | to construct a nim sequence* |
14:44:14 | dv- | Error: for a 'var' type a variable needs to be passed |
14:44:35 | dv- | not sure what to do with this error |
14:45:15 | Araq_ | dv-: well if you modify the tuple, the modifications also affect the argument that you passed |
14:45:30 | Araq_ | so you need to pass something that in fact can be modified |
14:45:39 | Araq_ | like a variable |
14:45:48 | Araq_ | var x = (2, 2) |
14:45:55 | Araq_ | p(x) # works |
14:46:01 | Araq_ | p((2, 2)) # fails |
14:46:29 | Araq_ | dyu: no the language requires you to allocate a seq with the builtin methods |
14:46:44 | dyu | hmm |
14:47:22 | * | gokr_ joined #nim |
14:47:24 | Araq_ | but you can do this: |
14:47:49 | Araq_ | proc allocateSeq(len: int): seq[int] {.exportc.} = ... |
14:47:59 | Araq_ | and then use allocateSeq from C++ |
14:51:17 | dyu | Araq_: ok ... so for int, i'd return a struct { int len; int* data; }? |
14:52:20 | Araq_ | no |
14:52:55 | Araq_ | you have to use Nim and let the Nim compiler generate the required code for you |
14:53:17 | Araq_ | hence my suggestion to .exportc it |
14:53:36 | Araq_ | in fact |
14:53:42 | Araq_ | do as little in C++ as possible |
14:55:40 | * | dom96_ joined #nim |
14:56:51 | dv- | ok, what if i want to iterate over a var array of tuples and modify its fields? |
14:57:37 | Araq_ | since mitems is still missing from system.nim, you use an old fashioned index and a[i].field = bar |
14:58:32 | dyu | looking at the generated code, the structure is struct { struct { int len; int reserved; int data[SEQ_DECL_SIZE] } |
14:58:56 | Araq_ | yes |
14:59:26 | dyu | struct { struct { int len; int reserved; } int data[SEQ_DECL_SIZE] }* |
14:59:39 | dyu | hmm, so data is preallocated |
14:59:49 | dyu | not simply a pointer |
15:01:09 | Araq_ | well I already told you what to do |
15:01:30 | dyu | yea 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:29 | dyu | err, 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:09 | dyu | you 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:23 | dyu | which means* |
15:07:56 | Araq_ | 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:40 | dyu | array[] 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:41 | dyu | thanks |
15:12:02 | Araq_ | well that was pseudo-code |
15:12:24 | Araq_ | type UncheckedArray[T] {.unchecked.} = array [0..0, T] |
15:12:46 | Araq_ | proc fromCpp(): ptr UncheckedArray[int] # use this code instead |
15:13:23 | Araq_ | dom96_: oh look, UncheckedArray is still missing from system.nim too. :P |
15:13:45 | dyu | Araq_: I'ma try that. thanks |
15:14:22 | * | willwillson quit (Ping timeout: 240 seconds) |
15:33:19 | dom96_ | Araq_ why are you telling me this? |
15:35:50 | * | darkf quit (Quit: Leaving) |
15:36:07 | shevy | add it dom96_! |
15:38:17 | * | z1y quit (Ping timeout: 240 seconds) |
15:38:48 | dom96_ | Finally an article about Rust which talks about Nim for at least a paragraph https://news.ycombinator.com/item?id=8781522 |
15:47:01 | flaviu | Araq_: 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:36 | gmpreussner | @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:18 | flaviu | gmpreussner: glib2 needs to be installed with nimble |
16:18:28 | flaviu | but it hasn't been updated for devel yet. |
16:18:43 | gmpreussner | but didn't you run into some other error after that? |
16:18:55 | gmpreussner | good morning btw :) |
16:18:59 | dom96_ | Yes, and you need to ensure that your nim cfg has ~/.nimble/ set as its --babelpath |
16:19:20 | flaviu | Yes, but I think it was unrelated. Some sort of syntax error in the wrapper. |
16:19:48 | gmpreussner | ok, i'll give that a try then, thanks! |
16:19:58 | flaviu | dom96_: fwi, gtk needs to be updated against the latest devel |
16:20:02 | flaviu | lots of `func` |
16:20:19 | dom96_ | It already was. |
16:25:42 | * | repax quit (Ping timeout: 245 seconds) |
16:27:21 | flaviu | lambdalifting.nim(727) liftIterSym Error: unhandled exception: assignment to discriminant changes object branch [FieldError] |
16:31:43 | * | willwillson joined #nim |
16:50:52 | gmpreussner | dom96: 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:50 | gmpreussner | (i have a symlink for nim itself in /usr/local/bin as well) |
16:51:57 | ldlework | I personally use the path option so I'm not sure |
16:52:19 | dom96_ | You can put nimble wherever you want. You need to put the nimble.ini config file in the right place though. |
16:52:37 | gmpreussner | i have it in ~/.config/nimble/nimble.ini |
16:53:13 | dom96_ | what are you trying to do? |
16:53:17 | dom96_ | Build Aporia? |
16:53:28 | gmpreussner | yeah :) |
16:53:44 | dom96_ | How are you trying to build it? |
16:54:06 | * | BlaXpirit-UA joined #nim |
16:54:43 | * | gokr_ joined #nim |
16:55:16 | gmpreussner | dom96: 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:44 | gmpreussner | to 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:00 | gmpreussner | so i probably just need to RTFM, unless there's a way to make it work without PATH |
16:56:23 | dom96_ | Are you getting an error when trying to run 'nimrod c -r src/nimble install' ? |
16:56:41 | gmpreussner | yep, Error: cannot open '/usr/local/lib/nim/system.nim' |
16:57:22 | * | BlaXpirit quit (Ping timeout: 240 seconds) |
16:58:06 | dom96_ | That's not Nim related. |
16:58:08 | dom96_ | er |
16:58:13 | dom96_ | That's not Nimble related |
16:58:21 | gokr_ | ah, classic problem. Better to add to path, then Nim will find libraries |
16:58:29 | gmpreussner | ok |
16:59:27 | gokr_ | Although I thought I used symlinks and it worked... hm |
16:59:35 | dom96_ | There should be a way to detect this scenario and make it work. |
16:59:44 | dom96_ | gmpreussner: Create an issue on github for this. |
17:00:19 | * | jefus_ joined #nim |
17:00:25 | gmpreussner | ok, that would be in the nim repo, correct? |
17:00:31 | gokr_ | I think I wrote about this in my article |
17:01:04 | * | gokr_ not at computer now |
17:03:11 | dom96_ | 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:38 | Mat4 | hi all |
17:16:06 | * | milosn quit (Ping timeout: 264 seconds) |
17:19:54 | gmpreussner | hi Mat4 |
17:20:09 | Mat4 | hello |
17:20:10 | gmpreussner | dom96: adding nim and nimble to PATH worked fine. I added https://github.com/Araq/Nimrod/issues/1768 |
17:23:20 | dom96_ | thanks |
17:32:04 | Araq_ | dom96_: I see no real bugs so far but didn't play with it. |
17:32:20 | Araq_ | .async doesn't affect proc types, why should it? |
17:32:30 | gmpreussner | dom96_: 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:39 | Araq_ | capturing an openArray is simply not supported either |
17:32:57 | dom96_ | Araq_: For convenience. |
17:33:03 | Mat4 | does 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:06 | dom96_ | Araq_: Why can't macros transform proc types? |
17:33:12 | gmpreussner | dom96_: sorry, i meant glib2, not gtk2 |
17:33:31 | Araq_ | Mat4: use .bashrc instead |
17:34:05 | Araq_ | dom96_: why should they? what convenience are you talking about? |
17:34:21 | Araq_ | the macro is supposed to transform *procs* not *proc types* |
17:34:33 | Araq_ | does your macro even deal with proc types? |
17:34:48 | Araq_ | we surely can make it work, but I think it's a bad idea |
17:35:23 | Araq_ | 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:29 | Araq_ | dom96_: let's not take that route before 1.0 is out, ok? just document your async better. |
17:39:31 | Mat4 | Araq: thanks |
17:39:41 | dom96_ | Araq_: sure |
17:42:09 | * | yglukhov quit (Ping timeout: 252 seconds) |
17:47:40 | Araq_ | dom96_: why do we need the logo in SVG format? |
17:47:57 | dom96_ | Araq_: In case you want a large version of it. |
17:47:58 | Araq_ | what's the benefit? |
17:48:10 | dom96_ | It's scalable. |
17:48:24 | Araq_ | ok, but does it look the same as now? |
17:49:29 | * | khmm quit (Ping timeout: 252 seconds) |
17:50:29 | Araq_ | meh I'll pull it and look at it |
17:52:28 | Araq_ | dom96_: has nimrod-code been renamed to nim-lang already? |
17:52:58 | Araq_ | bbl |
17:53:16 | dom96_ | yeah |
17:53:21 | dom96_ | a long time ago |
17:53:41 | * | asterite joined #nim |
18:13:25 | dv- | 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:29 | Mat4 | I have a procedure 'storeContent' :- |
18:59:31 | Mat4 | proc storeContent (state : var tBeranaBundle, content : tWord) |
18:59:39 | Mat4 | proc storeContent (state : var tBeranaInterpreterTrace, content : tWord) |
19:01:04 | Mat4 | a 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:07 | Araq_ | dv-: no, it doesn't. |
19:01:12 | Mat4 | ^results |
19:02:01 | * | shevy left #nim ("I'll be back ... maybe") |
19:02:03 | Araq_ | Mat4: (T) foo is not valid type conversion syntax |
19:02:11 | Araq_ | use T(foo) instead |
19:02:31 | Mat4 | ehm, ok |
19:04:03 | Mat4 | thanks |
19:04:31 | dv- | Araq_: weird. i get -0.16907516382852447 in julia and -0.1690751638285245 in nim |
19:05:01 | Araq_ | dv-: are you on devel? |
19:05:25 | dv- | i guess. i built it from git |
19:05:30 | flaviu | dv-: It's the same number though. |
19:05:51 | dv- | back in a bit |
19:05:54 | flaviu | oh, I se |
19:06:00 | flaviu | *see |
19:07:43 | flaviu | btw, dts|pokeball has been working on an eval bot |
19:07:43 | flaviu | .eval echo(0.1+0.2) |
19:07:46 | Nimbus | flaviu: 0.3 |
19:08:16 | Araq_ | .eval 0.3+0.8 |
19:08:19 | Nimbus | Araq_: eval.nim(2, 3) Error: value of type 'float' has to be discarded |
19:08:26 | * | asterite_ joined #nim |
19:08:29 | dom96_ | .eval echo(-0.1690751638285245) |
19:08:32 | Nimbus | dom96_: -0.1690751638285245 |
19:08:32 | Mat4 | dv-: the value get rounded as you see |
19:08:41 | dom96_ | .eval echo(-0.16907516382852447) |
19:08:44 | Nimbus | dom96_: -0.1690751638285245 |
19:08:59 | flaviu | .eval echo(-0.16907516382852445) |
19:09:02 | Nimbus | flaviu: -0.1690751638285244 |
19:09:03 | Araq_ | pfff Nimbus should be as smart as "nim i" |
19:09:28 | flaviu | Araq_: 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:39 | Araq_ | 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:56 | flaviu | Araq_: You'll need --no-preserve-root and superuser |
19:10:12 | * | asterite left #nim (#nim) |
19:10:19 | dom96_ | .eval import os; echo("foo" / "asd") |
19:10:19 | dts|pokeball | thanks for the support Araq_ ! |
19:10:22 | Nimbus | dom96_: eval.nim(3, 5) Error: invalid indentation |
19:10:24 | dom96_ | meh |
19:10:33 | dom96_ | That needs to work IMO |
19:10:40 | dts|pokeball | first, no need to import os |
19:10:42 | flaviu | dom96_: It's your own fault. |
19:10:52 | dts|pokeball | second, it will. im fixing it right now |
19:10:57 | flaviu | .eval import os;echo("foo" / "asd") |
19:11:00 | Nimbus | flaviu: foo/asd |
19:11:05 | flaviu | see? |
19:11:27 | dom96_ | flaviu: No. It's definitely not my fault. |
19:11:43 | dts|pokeball | im writing a function to strip leading ws |
19:11:56 | flaviu | dts|pokeball: But what about when I want indentation? |
19:12:06 | Araq_ | dts|pokeball: strutils already has such a function |
19:12:10 | dom96_ | I guess it's the compiler's fault. |
19:12:11 | flaviu | dom96_: The ; is replaced with a newline directly. That space after the newline indents the next line. |
19:12:34 | Araq_ | dom96_: I don't think so |
19:12:52 | dts|pokeball | Araq_, g2k |
19:13:08 | dts|pokeball | flaviu, why would you care about what the compiler sees? |
19:13:09 | dom96_ | Araq_: In what situation should the whitespace be significant when following a semi-colon? |
19:14:03 | flaviu | .eval if true:; echo "blah" |
19:14:06 | Nimbus | flaviu: blah |
19:14:07 | flaviu | dts|pokeball: ^ |
19:14:31 | dom96_ | .eval if true: echo "blah" |
19:14:34 | Nimbus | dom96_: blah |
19:14:44 | dom96_ | The semi-colon is redundant there. |
19:14:57 | dts|pokeball | .eval if true:;echo "blah" |
19:14:59 | Nimbus | dts|pokeball: eval.nim(3, 4) Error: invalid indentation |
19:15:07 | dts|pokeball | hmm |
19:15:10 | Araq_ | dom96_: wtf you're right |
19:15:16 | Araq_ | the compiler is stupid |
19:15:41 | Araq_ | I'll remove ; for version 1.0 anyway, it's too confusing |
19:15:53 | dom96_ | Araq_: nooo |
19:15:53 | flaviu | dom96_: The semicolon is intercepted by Nimbus, not the compiler. |
19:16:04 | dom96_ | flaviu: No, it's not. |
19:16:09 | dom96_ | Not right now at least. |
19:16:11 | dts|pokeball | dom96, yes it is |
19:16:12 | flaviu | literally code.replace(";", "\n") |
19:16:35 | Araq_ | flaviu: nevertheless import os; echo "foo" fails for Nim itself |
19:17:05 | dom96_ | I see. import os;echo "foo" also fails in the compiler. |
19:17:07 | dts|pokeball | once i strip leading ws it should be fine |
19:17:39 | dts|pokeball | as long as you only use ; for new lines, and not ifs as dom96 deomstrated |
19:17:45 | Araq_ | dom96_: yeah. but ever since we introduced (;;;) things went downhill ... |
19:17:58 | dom96_ | The problem with this eval is that I'm guessing this won't work... |
19:18:02 | dom96_ | .eval var x = 5 |
19:18:05 | dom96_ | .eval echo x |
19:18:05 | Nimbus | dom96_: <no output> |
19:18:07 | Nimbus | dom96_: eval.nim(2, 5) Error: undeclared identifier: 'x' |
19:18:36 | flaviu | dom96_: It uses a new file each time. |
19:18:41 | dom96_ | Yeah. It shouldn't. |
19:18:46 | dom96_ | You should create a file for each user. |
19:18:52 | dts|pokeball | dom96, just as it doesnt work with geordi |
19:18:58 | dom96_ | And have some command to clear it. |
19:19:04 | dts|pokeball | also, i cant do it for each user |
19:19:08 | flaviu | dom96_: It's oss: https://github.com/DTSCode/Nimbus |
19:19:10 | dom96_ | Why? |
19:19:41 | dts|pokeball | because nim wont let me have - in the name |
19:19:58 | dom96_ | huh? |
19:20:07 | Araq_ | lol? so '_' doesn't exist? |
19:20:29 | dom96_ | var userFiles = newStringTable() |
19:20:50 | dom96_ | userFiles.mget("dom96").add("var x = 5\n") |
19:21:27 | flaviu | sounds too complicate |
19:21:29 | flaviu | d |
19:21:32 | dts|pokeball | meh |
19:21:40 | dts|pokeball | maybe |
19:22:08 | dts|pokeball | once 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:59 | Araq_ | 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:23 | flaviu | Araq_: Hopefully by that time you'll have a chance to ban the guy doing that. |
19:24:39 | dom96_ | dts|pokeball: Is this not sandboxed? |
19:24:46 | dts|pokeball | dom96_, not yet |
19:24:56 | * | dyu quit (Quit: Leaving) |
19:27:03 | Araq_ | dom96_: funnily enough |
19:27:05 | Araq_ | when true: |
19:27:07 | Araq_ | import os; echo "foo" |
19:27:10 | Araq_ | works ... |
19:27:19 | Araq_ | so it's just the weird top level parsing |
19:27:28 | dom96_ | .eval import httpclient, asyncdispatch;var c=newAsyncHttpClient();var r = waitFor(c.request("http://nim-lang.org"));echo(r.status) |
19:27:35 | Nimbus | dom96_: 200 OK |
19:27:43 | dom96_ | Time to DDOS |
19:27:44 | ldlework | if "when" sort of the same thing as "if"? |
19:27:45 | dom96_ | :P |
19:28:07 | dom96_ | Araq_: Interesting. |
19:28:08 | Araq_ | ldlework: quite similar. it's more like C's #if |
19:28:14 | * | Nimbus quit (Remote host closed the connection) |
19:28:37 | ldlework | Araq_: ah compiletime if |
19:28:46 | ldlework | I knew that :) |
19:28:57 | ldlework | Araq_: how's it going? |
19:29:09 | flaviu | dom96_: It's a poor DDOS when you're only using two machines. |
19:29:19 | dom96_ | bbl |
19:29:31 | dts|pokeball | any DDOS that uses my machine is a poor DDOS |
19:31:02 | gmpreussner | does 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:16 | flaviu | bisect? |
19:31:59 | * | Mimbus joined #nim |
19:32:01 | Araq_ | ldlework: I'm burned out. no fixes anymore. I'm working on feature cleanups instead. |
19:32:13 | ldlework | Araq_: still feeling under the weather? |
19:32:22 | flaviu | .eval echo("foo") |
19:32:24 | Mimbus | flaviu: /home/sandbox/nimcache/stdlib_system.o: In function `nimUnloadLibrary': |
19:32:24 | ldlework | Hope you've got some jogging in :) |
19:32:46 | * | Mimbus quit (Remote host closed the connection) |
19:32:49 | Araq_ | with a bit of luck I can go jogging in 2 days |
19:33:30 | Araq_ | gmpreussner: it's more effective if I tell you how to fix static[T] |
19:33:50 | * | Mimbus joined #nim |
19:33:57 | flaviu | .eval echo("foo") |
19:33:58 | Mimbus | flaviu: /home/sandbox/nimcache/stdlib_system.o: In function `nimUnloadLibrary': |
19:34:13 | * | Mimbus quit (Remote host closed the connection) |
19:34:29 | gmpreussner | Araq_: you might as well give me the launch codes to the US nuclear arsenal then :) |
19:34:47 | gmpreussner | but please try. i really want to learn how the compiler works, too. |
19:35:09 | Araq_ | what issue does affect you? |
19:37:47 | gmpreussner | the 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:14 | gmpreussner | it's used heavily in this module, for example: https://github.com/barcharcraz/vecmath/blob/master/src/vecmath.nim |
19:38:59 | gmpreussner | there are some other projects on GitHub, and also some related forum posts, which i can't find right now. |
19:39:51 | gmpreussner | here's one post: http://forum.nim-lang.org/t/572#3095 |
19:41:20 | gmpreussner | i 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:44 | flaviu | I've got it sandboxed now. Have fun! |
19:54:42 | flaviu | ,eval var i = 0;while true:; i+=1 |
19:55:21 | * | brson joined #nim |
19:55:41 | flaviu | ,eval echo "foo" |
19:57:38 | * | Mimbus quit (Remote host closed the connection) |
19:57:45 | * | Mimbus joined #nim |
19:58:05 | flaviu | .eval var i = 0;while true:; i+=1 |
19:58:51 | flaviu | .eval echo "foo" |
19:59:06 | Mimbus | flaviu: <no output> |
19:59:07 | Mimbus | flaviu: foo |
19:59:13 | flaviu | see? |
19:59:37 | flaviu | It gets killed after a minute of doing nothing and after 200MB of memory usage |
20:00:21 | flaviu | .eval echo(readAll("/etc/shadow")) |
20:00:22 | Mimbus | flaviu: eval.nim(1, 12) Error: type mismatch: got (string) |
20:00:29 | flaviu | .eval echo(readFile("/etc/shadow")) |
20:00:30 | Mimbus | flaviu: Error: unhandled exception: cannot open: /etc/shadow [IOError] |
20:00:35 | flaviu | .eval echo(readFile("/etc/passwd")) |
20:00:36 | Mimbus | flaviu: root:x:0:0:root:/root:/usr/bin/zsh |
20:00:36 | * | Mimbus quit (Excess Flood) |
20:00:42 | * | Mimbus joined #nim |
20:00:51 | flaviu | It can still read that file because there isn't any sensitive information there. |
20:05:17 | * | ZzZMorpork is now known as AMorpork |
20:05:40 | Araq_ | ,eval import osinfo_posix;echo getSystemVersion() |
20:05:57 | flaviu | .eval import osinfo_posix;echo getSystemVersion() |
20:05:58 | Araq_ | .eval import osinfo_posix;echo getSystemVersion() |
20:06:00 | Mimbus | flaviu: Linux 3.17.6-1-ARCH x86_64 |
20:06:01 | Mimbus | Araq_: Linux 3.17.6-1-ARCH x86_64 |
20:09:23 | Araq_ | gmpreussner: sorry, I looked into it and even I have no idea how this ever worked. git bitsect seems the better way. |
20:10:18 | Araq_ | TMatrix.N doesn't even get resolved to static[int] |
20:10:33 | Araq_ | but to typeDesc[anything] |
20:10:37 | * | Varriount|Busy joined #nim |
20:12:41 | Varriount|Busy | I 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:10 | flaviu | Wouldn't it be easiest to work with a sequence of strings? |
20:13:13 | * | gmpreussner quit (Ping timeout: 272 seconds) |
20:13:45 | flaviu | .eval import strutils;@["home", "user", "blah"].join("/") |
20:13:46 | Mimbus | flaviu: eval.nim(2, 25) Error: value of type 'string' has to be discarded |
20:13:53 | flaviu | .eval import strutils;echo(@["home", "user", "blah"].join("/")) |
20:13:54 | Mimbus | flaviu: home/user/blah |
20:14:04 | Varriount|Busy | flaviu: Possibly, if the sequence were being exposed to the user. |
20:14:16 | flaviu | Even internally, it'd be easier |
20:14:40 | Varriount|Busy | Pfft, internal ease |
20:17:13 | Varriount|Busy | flaviu: My goal is performance and memory usage. |
20:18:34 | * | gmpreussner joined #nim |
20:26:39 | dom96_ | flaviu: how did you sandbox it? |
20:26:54 | dom96_ | 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:54 | dom96_ | I brokeded it |
20:32:10 | Araq_ | Varriount|Busy: string + seq[int] seems better |
20:33:26 | * | repax joined #nim |
20:43:25 | Varriount|Busy | Araq_: Ok, thanks. |
20:51:54 | * | perturbation quit (Ping timeout: 245 seconds) |
20:53:14 | * | perturbation joined #nim |
20:55:10 | Mat4 | which constant or variable hold the endianess again ? |
20:55:43 | Araq_ | system.cpuEndian |
20:58:02 | * | brson quit (Quit: leaving) |
20:58:48 | flaviu | dom96_: I made a new user, and went through my filesystem and set all private files to o-rwx. |
20:59:44 | flaviu | I then made a file in /etc/security/limits.d/ to limit it to 1 minute of CPU time and 200MB per process. |
21:01:05 | dom96_ | I think you should be using SELinux or AppArmor. |
21:01:11 | flaviu | Arch'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:19 | flaviu | Why? |
21:02:05 | * | milosn quit (Ping timeout: 265 seconds) |
21:02:06 | flaviu | I don't think its practical to set selinux up to protect from malicious reads. |
21:02:44 | flaviu | And 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:18 | Araq_ | flaviu: what's the motivation again for allowing (foo: 3, bar: 4) being passed to tuple[key, val: int] ? |
21:34:07 | flaviu | Most languages don't even have tuple variable names - tuples are supposed to be purely structurally typed. |
21:38:42 | Mat4 | for declared arrays, is the index to a given element endian dependent or not ? |
21:40:11 | Mat4 | I mean 'var test: array [0..x, int8]': Address test[0] the least or the most significant byte ? |
21:41:38 | flaviu | Mat4: Endianess doesn't matter unless you're doing cast[array[8, int8]](myInt53) |
21:41:49 | flaviu | *myInt64 |
21:41:59 | Araq_ | Mat4: what flaviu says |
21:42:29 | Araq_ | flaviu: yeah but we do have the names |
21:43:26 | Araq_ | oh well, it fixes a bug as a side effect at least |
21:44:20 | Mat4 | it 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:57 | Araq_ | Mat4: just try it |
21:47:58 | Mat4 | ok, I prepare a QEMU image for 680x0 emulation |
21:48:16 | dv- | how come it's not possible to start a multiline var/let on the first line? i.e. |
21:48:18 | dv- | let a = ... |
21:48:22 | dv- | b = ... |
21:48:46 | Mat4 | let |
21:48:52 | Mat4 | a = ... |
21:49:02 | Mat4 | b = ... |
21:49:08 | dv- | yes |
21:49:57 | flaviu | .eval let a = ""; b = "" |
21:49:58 | Mimbus | flaviu: eval.nim(2, 5) Error: invalid indentation |
21:50:05 | flaviu | .eval let; a = ""; b = "" |
21:50:06 | Mimbus | flaviu: <no output> |
21:51:59 | skyfex | Araq_: Have you considered allowing just ``raise "some string"`` ? I do that a lot in Ruby for simple one-off tools |
21:52:50 | Varriount|Busy | Araq_: What are the limitations of macro quasi-quoting at the moment? Can we use complex expressions, such as 'for' statements? |
21:53:37 | flaviu | .eval converter str2exception(str: string): Exception =; return newException(Exception, str); raise "test" |
21:53:38 | Mimbus | flaviu: eval.nim(3, 6) Error: invalid indentation |
21:53:57 | * | repax joined #nim |
21:55:06 | flaviu | that doesn't work anyway since raise is a builtin keyword and not a procedure |
21:55:12 | flaviu | unfortunate. |
22:04:34 | Araq_ | flaviu: I think we can fix that to work with raise |
22:04:43 | Araq_ | skyfex: just use a template |
22:05:09 | Araq_ | template fatal(x: string) = raise newException(IOError, x) |
22:05:27 | Araq_ | though quit "you fools" already exists too |
22:06:26 | skyfex | Cool |
22:06:28 | * | boydgreenfield quit (Quit: boydgreenfield) |
22:08:53 | skyfex | Why is it still common to target Gtk2 rather than Gtk3? Is there something wrong with Gtk3? |
22:09:07 | dom96_ | Araq_: I think we should make that work with 'raise' |
22:09:17 | dom96_ | I also would like to see 'newException' gotten rid of |
22:09:22 | dom96_ | In favour of constructors. |
22:10:05 | repax | Are these constructors going to have the same name as the type? |
22:11:02 | * | boydgreenfield joined #nim |
22:11:03 | repax | Will 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:02 | flaviu | I said that constructors would be liked :) |
22:15:02 | flaviu | https://github.com/Araq/Nimrod/issues/1693 |
22:19:11 | repax | flaviu, thanks, Interesting. |
22:19:59 | repax | create() could become a convention I suppose |
22:20:53 | * | StefanSalewski joined #nim |
22:22:27 | StefanSalewski | skyfex: I am working on it... |
22:24:43 | repax | C++ 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:17 | Araq_ | 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:42 | repax | I 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:35 | ldlework | Araq_: lotr reference? |
22:49:57 | Araq_ | no. coincidence. |
22:50:15 | ldlework | "you fools" wasn't a lotr reference?! |
22:50:34 | ldlework | what did it mean? |
22:54:00 | Mat4 | I think the easiest replacement for preprocessor macros are templates ? |
22:54:23 | flaviu | yep. |
22:54:59 | * | boydgreenfield quit (Quit: boydgreenfield) |
23:05:21 | Araq_ | ldlework: oh that... well it didn't occur to me that you were still talking about that |
23:05:35 | ldlework | Araq_: so...was it a lotr reference? :D |
23:05:38 | Araq_ | 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 |