00:01:44 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:04:28 | * | Trustable quit (Quit: Leaving) |
00:22:00 | * | novist quit (Ping timeout: 276 seconds) |
00:24:52 | * | BitPuffin joined #nim |
00:34:51 | Synatra | ello |
00:39:22 | * | lws_ quit (Ping timeout: 265 seconds) |
00:39:39 | * | threewood quit (Ping timeout: 264 seconds) |
00:41:23 | Araq | onionhammer: here you go. dirty files still don't work though |
00:46:02 | * | gmpreussner__ joined #nim |
00:46:07 | * | JStoker quit (Quit: JStoker is gone :() |
00:51:28 | Synatra | Ok() |
00:52:10 | * | JStoker joined #nim |
01:02:03 | * | novist joined #nim |
01:03:09 | Mat4 | ciao |
01:03:12 | * | Mat4 left #nim (#nim) |
01:13:29 | * | sampwing quit (Ping timeout: 252 seconds) |
01:13:49 | * | gmpreussner__ quit (Quit: Konversation terminated!) |
01:15:12 | * | sampwing joined #nim |
01:25:31 | * | rational quit (Quit: Lost terminal) |
01:31:07 | flaviu | Btw, is that thing that ekarlso a bug? Other people have hit against it, but I'm not really sure what the problem is. |
01:31:34 | flaviu | *that ekarlso came across |
01:32:33 | * | sampwing quit (Ping timeout: 252 seconds) |
01:38:01 | Araq | dunno |
01:38:39 | Araq | if you use .compile then the compiler generates a crc32 checksum to detect if it needs recompilation |
01:41:59 | flaviu | But it seems that if you already have a nimcache before introducing the compile pragma, the compiler doesn't look at the files. |
01:43:13 | flaviu | totally unrelated to this: I'd like to point out that crc32 is pretty terrible for this use, but I'm sure you already know that :) |
01:45:59 | Araq | yup I do |
01:46:18 | Araq | I copied it from FPC back in the days |
01:47:11 | Araq | never heard of any problem whatsoever related to this, but I'm sure academics find it horrible |
01:53:16 | * | threewood joined #nim |
01:55:47 | * | fizzbooze joined #nim |
02:01:40 | * | gokr quit (Ping timeout: 244 seconds) |
02:02:04 | Varriount | dom96: Have you applied security patches to the VPS? |
02:04:12 | Varriount | dom96: I've updated the VPS, however a restart is *required* to fix some recent security vulnerabilities with glibc. |
02:04:58 | Varriount | Since I don't know what's in the initscripts and what's not, I'll leave you to do it. |
02:09:54 | Araq | onionhammer: dirtyfile now works too :-) |
02:09:56 | Araq | good night |
02:22:05 | * | Puffin joined #nim |
02:23:44 | * | BitPuffin quit (Ping timeout: 246 seconds) |
02:25:29 | * | springbok joined #nim |
02:25:58 | * | gtrundle joined #nim |
02:28:20 | gtrundle | Hi all |
02:28:54 | reactormonk | morning/evening |
02:29:23 | flaviu | reactormonk: it's always morning! |
02:30:17 | * | sampwing joined #nim |
02:31:34 | gtrundle | Ha, my days of being a morning person are over. Quick dumb question about a foreign thread calling back into nim. |
02:32:56 | gtrundle | Specifically, I see where I'm supposed to call setupForeignGc(), and I do that. But on windows, I end up crashing the first time the callback is hit because it looks like the Tls vars aren't set up. |
02:33:27 | gtrundle | This happens in nimFrame(), so it's technically before I can do anything in that function anyway, unless there's a pragma I missed. |
02:35:05 | gtrundle | Works on linux, but it's not having to do the emulated TLS vars. Anyone know if I'm missing something, or should I just open a defect? |
02:38:16 | flaviu | Araq is probably the person who could help you, but he's asleep. |
02:38:24 | flaviu | I think an issue would be best. |
02:38:55 | * | sampwing quit (Ping timeout: 252 seconds) |
02:40:51 | Synatra | Hallo |
02:41:17 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
02:44:21 | gtrundle | ok, thanks flaviu. |
02:45:53 | * | ehaliewicz quit (Ping timeout: 252 seconds) |
02:51:19 | * | meanfish` quit (Remote host closed the connection) |
02:52:05 | * | vendethiel quit (Ping timeout: 246 seconds) |
02:56:17 | * | vendethiel joined #nim |
02:57:10 | * | darkf joined #nim |
03:17:26 | onionhammer | Araq awesome |
03:19:26 | * | vendethiel quit (Ping timeout: 276 seconds) |
03:28:33 | * | VinceAddons quit (Read error: Connection reset by peer) |
03:30:30 | EXetoC | innit! |
03:30:57 | * | brson quit (Quit: leaving) |
03:31:05 | * | brson joined #nim |
03:32:40 | * | fizzbooze quit (Quit: WeeChat 1.1) |
03:32:57 | * | fizzbooze joined #nim |
03:33:40 | * | brson quit (Client Quit) |
03:33:48 | * | brson joined #nim |
03:34:40 | * | brson quit (Client Quit) |
03:35:23 | * | EXetoC quit (Ping timeout: 252 seconds) |
03:39:17 | * | vendethiel joined #nim |
04:03:01 | * | vendethiel quit (Ping timeout: 264 seconds) |
04:07:33 | * | Puffin quit (Ping timeout: 276 seconds) |
04:15:04 | * | ehaliewicz joined #nim |
04:19:20 | * | vendethiel joined #nim |
04:21:39 | * | gtrundle quit (Ping timeout: 264 seconds) |
04:29:37 | * | lws joined #nim |
04:29:37 | * | lws quit (Changing host) |
04:29:37 | * | lws joined #nim |
04:38:01 | * | sampwing joined #nim |
04:42:12 | * | vendethiel quit (Ping timeout: 272 seconds) |
04:42:29 | * | sampwing quit (Ping timeout: 252 seconds) |
04:43:36 | * | Boscop_ quit (Read error: Connection reset by peer) |
04:43:55 | * | Boscop_ joined #nim |
04:44:29 | * | vendethiel joined #nim |
05:08:35 | * | vendethiel quit (Ping timeout: 265 seconds) |
05:19:06 | * | vendethiel joined #nim |
05:22:09 | * | kashyap_ joined #nim |
05:22:33 | kashyap_ | Hi ... I am trying to implement the outb function using inline assembly - not sure what the problem is - http://lpaste.net/119486 |
05:26:24 | * | Demon_Fox quit (Quit: Leaving) |
05:26:35 | * | threewood quit (Ping timeout: 256 seconds) |
05:29:52 | * | brson joined #nim |
05:35:56 | * | girvo joined #nim |
05:36:32 | girvo | Hey all. Quick Q: Does anyone use a build system for their Nim projects, like CMake for example (or even bare Makefiles)? What works best with Nim? |
05:42:53 | * | vendethiel quit (Ping timeout: 265 seconds) |
05:57:32 | * | fizzbooze quit (Quit: WeeChat 1.1) |
06:06:13 | kashyap_ | girvo ... I've noticed something called nakefile |
06:14:02 | * | sampwing joined #nim |
06:24:13 | Varriount | girvo: Well, there's nothing stoping you from using a build system, but the module system Nim provides (along with project files) negates a most of the need for any sort of build syste, |
06:24:17 | Varriount | *build system |
06:24:50 | Varriount | kashyap_, girvo: Nake is a build system meant for Nim . fowlmouth wrote it |
06:27:55 | kashyap_ | Thanks Varriount |
06:28:18 | kashyap_ | I have a question about implementing inline assembly functions where there is return value |
06:28:33 | kashyap_ | Looks like it may be a bug in nim |
06:29:11 | * | sampwing quit (Ping timeout: 252 seconds) |
06:31:23 | * | girvo quit (Ping timeout: 252 seconds) |
06:59:48 | * | sdw quit (Ping timeout: 276 seconds) |
07:03:33 | * | Puffin joined #nim |
07:08:04 | * | Puffin quit (Ping timeout: 255 seconds) |
07:08:50 | * | gokr joined #nim |
07:13:14 | * | bjz joined #nim |
07:15:19 | reactormonk | kashyap_, oh yeah, lemme look up the number |
07:15:42 | * | bjz quit (Client Quit) |
07:15:54 | reactormonk | kashyap_, https://github.com/Araq/Nim/issues/1907 try the devel branch of the compiler |
07:17:37 | reactormonk | yeah, the devel branch includes the fix |
07:26:41 | kashyap_ | cool...thanks reactormonk |
07:28:21 | reactormonk | kashyap_, you know how to build it? |
07:28:45 | * | nande quit (Remote host closed the connection) |
07:28:54 | kashyap_ | Is it not the same as the master branch? |
07:29:32 | kashyap_ | I've been building the master branch using the steps mentioned in the download page |
07:29:55 | reactormonk | yeah, it's the same. Just mix in a git checkout devel somewhere |
07:30:11 | kashyap_ | got it |
07:34:56 | dtscode | if we actually decide to setup a repo, i think i might provide both devel and master and wrap an executable around it with an added --devel option |
07:35:16 | reactormonk | dtscode, too much trouble |
07:35:55 | dtscode | apparently everything i do is too much trouble |
07:36:31 | reactormonk | dtscode, no, seriously. you'd need two separate namespaces. I don't think the compiler is built to be namespaced. |
07:37:15 | reactormonk | You'd have to rewrite the compiler for that. Or something that packages both binaries into a single one... which doesn't sound too easy either |
07:37:25 | dtscode | not neccesarily |
07:37:31 | dtscode | youre over complicating it |
07:37:37 | reactormonk | how come? |
07:37:43 | dtscode | ill explain more clearly |
07:37:49 | dtscode | cause i said it really weird |
07:38:21 | dtscode | ok, so it would have "nim" in say /bin or /usr/bin or something like that. |
07:39:33 | dtscode | nim would then pass all of the arguments to /etc/nim/master/bin/nim (or some path like that) with the added flag of where the libs are located |
07:39:52 | reactormonk | now that sounds better |
07:40:04 | dtscode | if --devel is passed, it does the same thing,, except it calls /etc/nim/devel/bin/nim (minus the --devel flag) |
07:41:06 | * | reem joined #nim |
07:41:22 | * | MattAitchison quit (Ping timeout: 255 seconds) |
07:41:29 | reactormonk | so you basically wanna have a wrapper script |
07:42:11 | dtscode | yes |
07:42:16 | * | JinShil joined #nim |
07:42:30 | dtscode | either that, or provide nim-devel, and put the libraries in a central location |
07:42:47 | * | MattAitchison joined #nim |
07:58:10 | * | st2p quit (Ping timeout: 246 seconds) |
08:05:31 | * | bjz joined #nim |
08:06:34 | * | MattAitchison quit (Ping timeout: 255 seconds) |
08:08:50 | * | MattAitchison joined #nim |
08:19:14 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
08:23:40 | * | MattAitchison quit (Ping timeout: 255 seconds) |
08:27:51 | * | MattAitchison joined #nim |
08:33:27 | * | Sphax joined #nim |
08:45:43 | * | MattAitchison quit (Ping timeout: 255 seconds) |
08:46:53 | * | MattAitchison joined #nim |
08:51:34 | * | MattAitchison quit (Ping timeout: 255 seconds) |
08:56:32 | * | ehaliewicz quit (Ping timeout: 245 seconds) |
08:57:02 | * | JinShil quit (Quit: Konversation terminated!) |
09:00:34 | * | genbattle joined #nim |
09:02:01 | * | dtscode quit (Quit: (dtscode.io)) |
09:02:32 | * | vendethiel joined #nim |
09:03:07 | * | Sphax quit (Quit: ZZZZZzzzzz) |
09:05:28 | * | genbattle left #nim ("Leaving") |
09:07:54 | * | wtw quit (Quit: leaving) |
09:14:41 | * | wtw joined #nim |
09:23:22 | * | Sphax joined #nim |
09:29:49 | * | vendethiel quit (Ping timeout: 245 seconds) |
09:33:19 | * | brson quit (Quit: leaving) |
09:42:46 | * | Trustable joined #nim |
09:49:46 | * | reem quit (Remote host closed the connection) |
10:00:52 | * | dumdum joined #nim |
10:15:16 | * | BlaXpirit joined #nim |
10:18:12 | * | bjz joined #nim |
10:21:44 | ekarlso | so nimble now reads a .nimble file and posts the info with a release |
10:21:52 | ekarlso | also it can install now from the registry |
10:29:18 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
10:42:41 | reactormonk | Araq, morning ;-) |
10:44:34 | reactormonk | I'd post a short "nope, not gonna happen for speed reasons" to https://github.com/Araq/Nim/issues/2029 but that wouldn't help, would it? |
10:45:38 | * | VinceAddons joined #nim |
10:50:09 | * | bjz joined #nim |
11:07:56 | reactormonk | def-, mind adding a few tests to the mitems? |
11:08:50 | def- | reactormonk: never understood how Nim testing works, since many tests don't even compile for me |
11:09:58 | reactormonk | def-, the readme is short an concise. one of the keys in the "discard" section is output: "..." run the tests via ./koch c <folder where your tests are> |
11:10:04 | reactormonk | don't forget to start the test with a "t" |
11:10:40 | * | Sphax quit (Quit: ZZZZZzzzzz) |
11:10:41 | reactormonk | e.g. https://github.com/reactormonk/nim/blob/5ecc461a944b54a516e6f81df4bd6db95a86e682/tests/exprs/thighCString.nim |
11:12:08 | reactormonk | in your case patch some into stdlib/ and some into system/ or just everything into collection/ |
11:13:25 | * | vendethiel joined #nim |
11:16:19 | reactormonk | def-, short enough of an elevator pinch? |
11:16:46 | def- | ok, will look at it later |
11:27:34 | * | JinShil joined #nim |
11:34:03 | * | keyle joined #nim |
11:34:38 | * | vendethiel quit (Ping timeout: 246 seconds) |
11:43:25 | * | keyle quit (Quit: <Morbo> Chitchat achieved!) |
11:43:33 | * | EXetoC joined #nim |
11:45:37 | * | chemist69 joined #nim |
11:50:02 | * | kuzy000_ joined #nim |
11:59:06 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
12:01:29 | Araq | hrm uh oh |
12:01:48 | * | Araq just got an idea for an incredible hack |
12:03:03 | Araq | BlaXpirit: what if we make '..<' a first class iterator/proc and warn about old usages that use '.. <' (note the space!)? |
12:03:50 | Araq | this way, we can keep the negative indexing and have the exclusive upper bound |
12:04:28 | * | Araq wonders if this is brilliant or horrible |
12:04:55 | kashyap_ | Hi... I am trying to translate the source code of xv6 (a teaching unix os) into nim - https://github.com/ckkashyap/nim-xv6 .... After introducing some "structures" I've started getting Error: system module needs 'asgnRefNoCycle' ... |
12:05:31 | * | bjz joined #nim |
12:05:37 | kashyap_ | I'm compiling with --noLinking --os:standalone |
12:06:23 | Araq | kashyap_: what kind of "structures"? |
12:06:42 | Araq | note that you cannot use 'string' as that relies on the GC |
12:06:46 | kashyap_ | essentially translating structs from the c code into type |
12:06:51 | EXetoC | Araq: why not slices+items? |
12:07:32 | kashyap_ | I've now pushed in the change that is giving this error |
12:07:42 | kashyap_ | https://github.com/ckkashyap/nim-xv6 |
12:08:11 | Araq | kashyap_: use 'cstring' instead of 'string' in Tspinlock |
12:08:22 | Araq | also note that the T convention is deprecated |
12:08:37 | * | vendethiel joined #nim |
12:08:39 | Araq | so it should be Spinlock with a capital S instead |
12:08:49 | kashyap_ | got it .. thanks Araq |
12:08:57 | * | Sphax joined #nim |
12:09:01 | kashyap_ | so ... I would not be able to use string in the kernel? |
12:09:18 | Araq | I would port the GC to work in kernel space |
12:09:36 | Araq | then you can use strings ;-) |
12:10:03 | kashyap_ | :) .. yeah...btw the coding guidelines page needs to be updated |
12:10:20 | Araq | which one? |
12:10:54 | kashyap_ | http://nim-lang.org/intern.html#coding-guidelines |
12:11:08 | Araq | well these are for compiler development |
12:11:17 | Araq | the compiler still uses T and P everywhere |
12:11:42 | kashyap_ | oh okay |
12:12:31 | kashyap_ | and btw ... nim - awesome ! |
12:12:37 | Araq | https://github.com/Araq/Nim/wiki/Style-Guide-for-Nim-Code |
12:12:49 | Araq | these are the official guidelines |
12:12:54 | kashyap_ | thanks |
12:13:03 | Araq | and ugh ... we don't link them from the website ... of course ... |
12:13:31 | Araq | kashyap_: please check out "regionized pointers" for kernel development |
12:13:52 | Araq | http://nim-lang.org/manual.html#memory-regions |
12:14:52 | kashyap_ | thanks - is there some place that lists kernel projects in Nim? |
12:15:40 | Araq | nah, there are not many kernel projects in Nim |
12:16:42 | Araq | I can give you instructions for porting the GC to kernel space, but I think you're not ready for that yet ;-) |
12:17:04 | kashyap_ | far from it |
12:17:21 | kashyap_ | I just want to see a working readable kernel code :) |
12:23:00 | dumdum | I introduce a new symbol in a template, but its not visible at call sites :( http://pastebin.com/VAMjH2x2 |
12:23:44 | dumdum | errors with: Error: undeclared identifier: 'it' |
12:24:44 | EXetoC | https://github.com/dom96/nimkernel.git |
12:28:16 | dumdum | nm, needed {.inject.} |
12:31:23 | Araq | dumdum: or just .immediate, dirty for templates |
12:31:32 | Araq | that's usually easier for newbies |
12:32:30 | dumdum | thanks |
12:34:00 | dumdum | yep, that works too |
12:50:10 | * | BlaXpirit quit (Read error: Connection reset by peer) |
12:50:55 | * | BlaXpirit joined #nim |
12:51:03 | Synatra | Hi |
12:52:49 | ekarlso | Araq: would it be hard to add db transaction support ? |
12:53:30 | Araq | ekarlso: there is no query abstraction whatsoever so your question makes no sense |
12:53:44 | ekarlso | ah, that's correct :/ |
12:53:52 | ekarlso | would be soo nice to have |
12:55:45 | Araq | btw there is an SQL parser in Nim |
12:55:55 | Araq | somebody should make that work with the VM |
12:56:15 | Araq | and then you can get compiletime checking of your SQL statements |
13:01:01 | BlaXpirit | now i'm here |
13:01:57 | BlaXpirit | Araq, I'm pretty sure I made that suggestion about ..< or something pretty close |
13:02:23 | BlaXpirit | the problem would be duplication of slice-based operations for every instance |
13:03:00 | BlaXpirit | what do you think "..<" would return? |
13:03:55 | BlaXpirit | you might remember the workaround i suggested - https://gist.github.com/BlaXpirit/3de6485bc57bee074a21 - this is a "..<" that requires no other changes but is hacky |
13:04:10 | BlaXpirit | making a non-hacky one is problematic |
13:04:34 | ekarlso | Araq: where is that ? |
13:07:49 | BlaXpirit | problematic - as in, would require a separate slice type and addition of operations on it |
13:13:47 | BlaXpirit | now i'm kinda away again |
13:25:26 | * | ibeex joined #nim |
13:27:27 | ibeex | i was looking at online documentation and I can't find anywhere doc for 'open("out.txt", fmWrite)' |
13:27:40 | ibeex | i am trying nim for first time on osx |
13:27:57 | * | gtrundle joined #nim |
13:28:03 | def- | ibeex: http://nim-lang.org/system.html#open,File,string,FileMode,int_2 |
13:28:30 | * | Puffin joined #nim |
13:28:46 | def- | And you can find most documentation through here: http://nim-lang.org/documentation.html |
13:29:23 | * | dumdum quit (Ping timeout: 256 seconds) |
13:29:55 | ibeex | thx, I guess I was confused by proc in front off it |
13:30:37 | ibeex | one more thing in nim interactive |
13:30:42 | ibeex | this crashes |
13:30:44 | ibeex | >>> var o = open("output.txt", fmWrite) |
13:30:44 | ibeex | lib/system/sysio.nim(217, 19) Error: cannot 'importc' variable at compile time |
13:30:45 | ibeex | lib/system/sysio.nim(220, 8) Error: VM is not allowed to 'cast' |
13:30:45 | ibeex | Error: unhandled exception: lib/system/sysio.nim(220, 8) Error: VM is not allowed to 'cast' [ERecoverableError] |
13:30:57 | ibeex | osx brew nim |
13:31:01 | def- | nim interactive doesn't really work. I would recommend not using it |
13:31:45 | ibeex | to bad, I am dedicated ipython user so that was looking realy handy |
13:32:08 | def- | I'm working to get a new interactive mode, but i'm pretty busy. So no idea when it will be done |
13:33:38 | EXetoC | before 2016? :-) |
13:33:44 | def- | sure |
13:34:07 | def- | if i get it working at all |
13:34:09 | * | gtrundle quit (Ping timeout: 252 seconds) |
13:39:15 | ekarlso | i'll push a fix later to make nimble support proxies.. |
13:40:05 | * | Roin joined #nim |
13:43:03 | kashyap_ | Hi...How can I do bitfields? |
13:44:03 | xeizlif | One way is to manually implement some bit manipulation functions. |
13:44:43 | kashyap_ | I was hoping to be able to give names to the bits in a structure |
13:45:22 | xeizlif | Also there are valid reasons to use bitfields but are you certain that you need them? Unless you're writing for a C file format, are extremely cache-constrained and/or have a bunch of bits it's probably better to just use the bool type |
13:45:37 | xeizlif | because bitfields are slow |
13:45:57 | Araq | no, it's better to use a set[SomeEnum] |
13:45:59 | xeizlif | I see. I don't know of any way to do that but it's probably a good idea to just write a function to access them |
13:46:24 | xeizlif | like proc someBits and then do Type.someBits to pull them out of Type's .data member |
13:46:30 | xeizlif | (no need fo r[]) |
13:46:33 | xeizlif | *for [] |
13:46:40 | xeizlif | or do what Araq did which is more general |
13:47:03 | kashyap_ | I'll check out set |
13:47:15 | kashyap_ | thanks Araq and xeizlif |
13:47:26 | xeizlif | no problem :) |
13:47:39 | Araq | xeizlif: bitfields are not really slow. and one is always cache-constrained ;-) |
13:48:24 | Araq | calculating square roots is faster than a cache miss |
13:48:35 | xeizlif | but a bitfield has nothing to do with that |
13:48:52 | xeizlif | well, in that cache misses are really slow, yes |
13:49:05 | kashyap_ | sorry .. I just checked out set data type and not sure how I can make it map to a certain memory size |
13:49:10 | xeizlif | but you'd have to actually see if you'd benefit before expending the effor |
13:49:11 | xeizlif | t |
13:50:33 | kashyap_ | i'd like to map a 64bit mem region ( a segment descriptor) .. can I do that with set? |
13:51:08 | xeizlif | For that I'd really recommend writing accessor functions to do it, with proc |
13:51:36 | xeizlif | then directly do the bit manipulation -- but this way the rest of the code is neat as if you were doing it with C's struct bitfields |
13:51:53 | kashyap_ | got it |
13:53:27 | Araq | kashyap_: you cannot do that in C either as C specifies nothing about bitfield layout |
13:53:58 | xeizlif | This is true. It's compiler-dependent and even then it can change between compiles |
13:54:38 | xeizlif | however it's what I did when I wrote an OS >_>. It worked for me but it's certainly bad practice for C |
13:55:17 | kashyap_ | well https://github.com/ckkashyap/xv6/blob/master/mmu.h#L193 ... I thought if the structure size is "round" then the bitfields fall in place |
13:55:41 | * | Roin quit (Quit: WeeChat 1.1) |
13:55:52 | * | Roin joined #nim |
13:56:32 | xeizlif | BTW you can use overloading for read (no arguments) and write (1 (or more?) argument) to get it to look almost like C's bitfields would |
13:56:34 | kashyap_ | there is no guarantee from the language ....somehow never thought about it |
13:57:06 | xeizlif | reading is var x = Type.field, writing is Type.field x |
13:57:21 | xeizlif | (with no = -- oh but you can use `=` to get that, too) |
13:57:30 | xeizlif | but you might already know that :) |
13:57:52 | kashyap_ | got it ... thanks |
14:00:52 | * | threewood joined #nim |
14:10:06 | * | Sphax quit (Quit: ZZZZZzzzzz) |
14:18:33 | def- | is there a reason we don't have `$` for arrays? |
14:20:22 | * | dumdum joined #nim |
14:22:10 | Araq | def-: yeah, it gets priority for array[X, char] then |
14:22:16 | Araq | which sucks |
14:22:49 | Araq | bootstrapping even fails then iirc |
14:23:09 | def- | what about overloading for array[X, char]? |
14:23:45 | Araq | that should work but it's meh |
14:24:15 | * | Sphax joined #nim |
14:24:18 | Araq | you can also do 'when T is char' in the $ for arrays |
14:24:32 | def- | right |
14:24:59 | def- | I think it would be nice to echo arrays by default |
14:25:10 | def- | why is it meh? |
14:25:55 | Araq | because it needs to special case 'array of char' |
14:27:16 | Araq | also ... it's not clear that 'array of char' should be special cased |
14:27:40 | Araq | but if you don't what used to match 'cstring' now matches your array version better |
14:29:48 | Araq | it breaks code is sublte and suprising ways, let's not do it |
14:29:56 | Araq | *in subtle |
14:31:22 | Araq | bug report: 'echo' for my array ['a', 'b', '\0', 'd'] produces only "ab" WTF. |
14:31:22 | Varriount | def-: echo(repr(arrayOfChars)) |
14:32:04 | Araq | but array [1, 2, 0, 4] works |
14:32:18 | Varriount | Araq: I found something that you would have liked with regards to processor instructions |
14:33:08 | Varriount | The 80186/80188 Intel processor supported a 'BOUND' instruction, which checked an array index against boundaries. |
14:33:24 | Araq | I know ;-) |
14:33:56 | Araq | and then that instruction got slower than explicit checking |
14:34:15 | Varriount | Really? How odd. |
14:34:59 | Araq | and now it's coming back with AVX |
14:35:44 | def- | Varriount: are you sure the code in your tester is ok? In my experience cstring of a string does weird things |
14:36:02 | def- | This segfaults for me for example: https://gist.github.com/def-/15feb9775721a13a851e |
14:36:26 | Araq | it's not odd at all, native code was mostly produced by C/C++ compilers which never emitted the BOUND instruction so it didn't get optimized |
14:37:07 | Varriount | def-: Tester? You mean my code snippet? |
14:37:10 | def- | yes |
14:37:27 | Varriount | *shrug* I didn't run it. |
14:37:40 | def- | wait, that wasn't yours, that was reactormonk's. sorry |
14:37:46 | dumdum | if I have enum members: a,b,c and object variants defined using case .. of, how do I model the case when option 'c' for example contributes no new data field to the object? |
14:37:59 | def- | dumdum: nil |
14:38:12 | Araq | discard works now too |
14:38:16 | def- | nice |
14:38:17 | dumdum | thanks! |
14:38:17 | Varriount | Well, it should be 'discard' |
14:38:33 | dumdum | Error: identifier expected, but found 'keyword discard' |
14:38:37 | dumdum | nil works |
14:38:40 | Varriount | Araq: I'm doing evil things today, like taking the address of a parameter. |
14:38:57 | Varriount | (an immutable, non-var parameter) |
14:39:05 | EXetoC | how? |
14:39:37 | Varriount | EXetoC: template immutAddr(a: expr): expr = addr(cast[var type(a)](a)) |
14:39:57 | def- | dumdum: works for me on current devel branch |
14:40:19 | def- | (since 2015-01-12) |
14:40:43 | dumdum | oo i am on pre built 0.10.2 |
14:41:12 | dumdum | i will get on devel once aporia suggest/ide tools works :) |
14:41:32 | Araq | Varriount: does that compile? o.O |
14:45:27 | Varriount | Araq: Yeah. |
14:45:58 | * | Puffin is now known as BitPuffin |
14:46:19 | Araq | does it also work? |
14:46:37 | Araq | add it to the test suite then, but hrm |
14:46:40 | Varriount | Araq: Well, I've only been using it in assertions |
14:46:56 | Araq | I'm not sure the compiler should allow it |
14:47:01 | Varriount | Eg: assert(immutAddr(a) == immutAddr(b)) |
14:47:30 | Varriount | Araq: But if you disallow it, I can't copy the contents of a parameter using copyMem |
14:48:02 | Araq | Varriount: if I disallow it, I'll provide 'unsafeAddr' too |
14:48:29 | Varriount | Oh. Hm. |
14:49:11 | Varriount | Although, 'unsafeAddr' is something of a misnomer, since 'addr' is already unsafe. |
14:49:16 | Varriount | :P |
14:49:20 | Araq | yeah indeed |
14:49:30 | Araq | but it's even more unsafe then :P |
14:50:09 | * | JinShil quit (Quit: Konversation terminated!) |
14:50:49 | Varriount | 'reallyUnsafeAddr'! :D |
14:55:53 | * | dtscode joined #nim |
15:02:17 | * | darkf quit (Quit: Leaving) |
15:05:53 | * | Sphax quit (Quit: ZZZZZzzzzz) |
15:08:51 | BlaXpirit | Araq, are you still up for discussion of ..< ? |
15:09:03 | BlaXpirit | i scrolled through messages, but didn't see any more replies |
15:10:35 | dom96 | Araq: Does $['a', 'b', 'c'] produce "abc"? |
15:10:45 | dom96 | if so, it shouldn't IMO. |
15:10:58 | Araq | I think it does |
15:11:10 | Araq | and we have code relying on that |
15:11:27 | Araq | BlaXpirit: I'm thining about your suggestions |
15:11:32 | Araq | *thinking |
15:11:44 | BlaXpirit | well i haven't really suggested anything new today? |
15:11:45 | Varriount | dom96: Array's don't have a '$' operator |
15:11:54 | dom96 | ahh. I guess cstring is an array[x, char] |
15:12:08 | BlaXpirit | probably |
15:12:10 | dom96 | Perhaps cstring should be distinct? |
15:12:40 | BlaXpirit | .eval echo($['a', 'b', 'c']) |
15:12:43 | Mimbus | BlaXpirit: eval.nim(3, 5) Error: type mismatch: got (Array constructor[0..2, char]) |
15:12:48 | BlaXpirit | what are you talking about, dom96 |
15:13:18 | dom96 | Araq: In regards to `..<`. Sounds risky and many will be confused. |
15:13:44 | BlaXpirit | i still prefer just removing negative indices |
15:17:06 | * | Sphax joined #nim |
15:42:13 | Synatra | Hello |
15:43:11 | dumdum | can anyone point me to doc for 'magic' pragma please? |
15:43:52 | BlaXpirit | dumdum, it's for internal use |
15:44:15 | BlaXpirit | i think it means things implemented deep in the compiler |
15:44:32 | BlaXpirit | I haven't seen any documentation on it |
15:44:41 | dumdum | got it, thanks |
15:53:12 | * | ibeex quit (Quit: Textual IRC Client: www.textualapp.com) |
16:12:19 | * | irrequietus joined #nim |
16:31:06 | dumdum | == for references compares refs or the value/objects pointed to? |
16:32:04 | dumdum | or we need to overload it like in java: equals method |
16:32:15 | dumdum | override |
16:34:02 | BlaXpirit | i'd like to know too |
16:34:13 | BlaXpirit | huge white spot in my knowledge of nim |
16:34:18 | gokr | dumdum: Thing is == checks if two "things" are equal. Now, in Nim ... my understanding is that it depends on the type. |
16:34:20 | BlaXpirit | probably because it is never explained |
16:34:36 | gokr | So if the type is a "ref type" - you are obviously comparing "the pointers". |
16:34:53 | gokr | But if the type is not a ref type - you are comparing "the actual thing". |
16:35:06 | gokr | Sorry if that is either fuzzy or plain wrong - but that is my understanding. |
16:35:23 | gokr | In Java (and Smalltalk) every variable is a "ref". |
16:35:49 | gokr | But in Nim, a variable can be either a ref, or the actual value itself (thus not allocated on the heap). |
16:35:57 | gokr | Now, feel free to correct me ;) |
16:37:09 | BlaXpirit | ok |
16:37:11 | BlaXpirit | .eval type T = ref object; x: int;var a, b: T;echo a==b |
16:37:16 | Mimbus | BlaXpirit: true |
16:38:00 | BlaXpirit | ah |
16:38:04 | BlaXpirit | they're both nil |
16:38:52 | BlaXpirit | type T = ref object; x: int;var a, b: T;new a;new b;echo a==b |
16:39:01 | BlaXpirit | .eval type T = ref object; x: int;var a, b: T;new a;new b;echo a==b |
16:39:04 | Mimbus | BlaXpirit: false |
16:40:33 | BlaXpirit | dumdum, == for references compares refs by default, but can be overridden. |
16:41:39 | BlaXpirit | dumdum, == for non-references seems to compare value by default, but can be overridden |
16:43:09 | dumdum | o well :) thanks |
16:45:33 | * | matkuki joined #nim |
16:48:35 | def- | for value comparison of ref types you can dereference them of course: a[] == b[] |
16:49:15 | BlaXpirit | really? |
16:49:20 | def- | yes |
16:49:54 | BlaXpirit | time for me to remember that ref is nothing more than a garbage collected pointer |
16:50:16 | matkuki | Can someone help with some initialization code: "https://bpaste.net/show/d9f2ab55d222" ? The code is SDL2. |
16:50:18 | matkuki | A hint appears durin compilation: "Warning: Cannot prove that 'event' is initialized. This will become a compile time error in the future. [ProveInit]" |
16:50:48 | BlaXpirit | matkuki, well yeah, you are not initializing anything |
16:50:59 | BlaXpirit | for seq a newSeq call is definitely mandatory |
16:51:11 | BlaXpirit | for TEvent - refer to the library itself on how it should be initialized |
16:51:44 | BlaXpirit | as is, event_list is just a nil pointer |
16:52:21 | def- | event doesn't need to be initialized, it's fine like that |
16:52:40 | BlaXpirit | yeah, just realized |
16:52:52 | def- | PollEvent will fill it |
16:53:01 | matkuki | But will it become an error in the future as it is? |
16:53:45 | def- | matkuki: Getting the same warning with the examples the SDL2 wrapper ships with |
16:53:51 | def- | so it's probably fine |
16:54:03 | matkuki | def-: Ok, thanks. |
16:54:40 | BlaXpirit | this may be considered a bug in compiler |
16:56:59 | matkuki | I'm a little cautious about these things, ever since the upgrade from 0.9.6 to 0.10.2 case-insensitivity change. |
17:00:06 | * | ehaliewicz joined #nim |
17:04:53 | * | grundle_ joined #nim |
17:05:38 | * | grundle_ quit (Client Quit) |
17:07:37 | * | gtrundle joined #nim |
17:13:09 | dumdum | argh, dereferenced == does not work for object variants |
17:13:19 | dumdum | Error: parallel 'fields' iterator does not work for 'case' objects |
17:13:34 | BlaXpirit | huh |
17:13:41 | BlaXpirit | seems like the error might be somewhere else |
17:15:00 | dumdum | well objects I am comparing are 'case objects' , nothing unusual otherwise |
17:15:26 | dumdum | https://github.com/Araq/Nim/blob/master/lib/system.nim#L1916 uses 'fields' |
17:16:36 | BlaXpirit | oh wow |
17:16:50 | BlaXpirit | so `==` on objects is actually a memberwise comparison, not jsut bytewise |
17:16:59 | BlaXpirit | well it totally makes sense |
17:18:43 | dumdum | yep, so I might just implement my own in the end :) |
17:23:25 | * | dumdum quit (Ping timeout: 256 seconds) |
17:26:27 | * | Sphax quit (Quit: CYA!!) |
17:27:07 | BlaXpirit | such strange pleasure I get from those different implementations |
17:27:28 | BlaXpirit | and from realizing why a `seqToPtr` function is needed before finding it |
17:33:39 | * | ehaliewicz quit (Ping timeout: 264 seconds) |
17:37:42 | * | chemist69 quit (Quit: leaving) |
17:38:00 | * | gokr_ joined #nim |
17:39:29 | * | ehaliewicz joined #nim |
17:40:14 | * | Matthias247 joined #nim |
17:51:54 | * | ehaliewicz quit (Ping timeout: 245 seconds) |
17:55:38 | * | gokr_ quit (Ping timeout: 276 seconds) |
18:06:24 | ekarlso | any of you wanna help with some stylish loving for packages? : | |
18:08:10 | dtscode | huh? |
18:09:10 | saml | loving bro |
18:09:19 | * | dumdum joined #nim |
18:10:47 | * | reem joined #nim |
18:11:43 | * | threewood quit (Ping timeout: 252 seconds) |
18:13:54 | ekarlso | haha, as in css ;P |
18:15:27 | dtscode | ah |
18:15:31 | dtscode | not my forte |
18:16:18 | saml | i'm good with css |
18:16:25 | saml | cascading style sheet |
18:30:37 | * | UberLambda joined #nim |
18:34:30 | matkuki | Does anyone know how to convert a SDL2 TEvent object to a TKeyboardEvent object? |
18:35:01 | Araq | matkuki: there have to be procs to do that, but ultimately it's a 'cast' away, I think |
18:36:11 | matkuki | Araq: "key_event = cast[TKeyboardEvent](event)" gives "Error: expression cannot be casted to TKeyboardEvent". Let me look for the proc you mentioned ... |
18:36:35 | Araq | matkuki: well be more creative then ;-) |
18:36:43 | matkuki | :) |
18:36:51 | Araq | key_event = cast[ptr TKeyboardEvent](event)[] |
18:36:56 | Araq | key_event = cast[ptr TKeyboardEvent](addr event)[] |
18:40:18 | gtrundle | I thought there was a key() proc that would do that. |
18:42:14 | gtrundle | So you could do event.key to get the keyboard event pointer. |
18:48:14 | matkuki | Araq: You were close: key_event = cast[ptr TKeyboardEvent](addr event) |
18:48:37 | matkuki | Also, there's a template for conversion: EvConv |
18:49:58 | matkuki | gtrundle: I thought there was a "key()" too, PySDL2 uses it and I'm porting my code from it. |
18:50:21 | * | ehaliewicz joined #nim |
18:51:19 | def- | matkuki: there is a key() and it works |
18:51:45 | matkuki | def-: Where? Can you point me to it? |
18:51:58 | matkuki | sdl2.nim, line? |
18:52:57 | def- | 411 |
18:53:09 | def- | created with a template |
18:53:21 | matkuki | Right! |
18:53:37 | matkuki | I found it a few minutes ago, thanks. |
19:04:43 | * | sampwing joined #nim |
19:13:07 | * | UberLambda quit (Quit: Leaving the Matrix) |
19:24:19 | * | sampwing quit (Ping timeout: 252 seconds) |
19:28:37 | * | brson joined #nim |
19:32:37 | * | dumdum quit (Ping timeout: 256 seconds) |
19:46:11 | * | zahary1 joined #nim |
19:46:15 | * | zahary quit (Read error: Connection reset by peer) |
19:56:36 | * | profan quit (Ping timeout: 264 seconds) |
19:59:28 | * | nande joined #nim |
19:59:29 | * | nande quit (Read error: Connection reset by peer) |
20:00:06 | * | threewood joined #nim |
20:10:40 | * | profan joined #nim |
20:14:41 | matkuki | Can someone help me with this out of bounds error: "https://bpaste.net/show/dc9d0ca1bd51" |
20:15:14 | matkuki | It's SDL2 again. |
20:29:53 | gtrundle | K_UP is a keycode, not a scan code. |
20:31:15 | * | dumdum joined #nim |
20:34:10 | matkuki | It works for example with "K_H" for example, which is: "K_h: cint = 'h'.cint" |
20:34:30 | matkuki | sorry, double example :) |
20:34:47 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:34:55 | * | Sphax joined #nim |
20:37:29 | matkuki | def-: Is there a problem with the template "SDL_SCANCODE_TO_KEYCODE" maybe? |
20:37:54 | * | dymk quit (Ping timeout: 272 seconds) |
20:39:22 | * | superfunc|lab joined #nim |
20:39:22 | * | reem quit (Remote host closed the connection) |
20:39:22 | * | nande joined #nim |
20:39:55 | * | reem joined #nim |
20:40:14 | * | dymk joined #nim |
20:43:23 | * | sampwing joined #nim |
20:43:26 | def- | matkuki: no idea, haven't used it |
20:44:48 | * | dymk quit (Ping timeout: 265 seconds) |
20:45:40 | * | dymk joined #nim |
20:48:33 | * | dumdum quit (Ping timeout: 256 seconds) |
20:54:28 | * | bjz joined #nim |
20:55:54 | * | Sphax quit (Quit: ZZZZZzzzzz) |
20:57:30 | * | Sphax joined #nim |
20:57:39 | * | Sphax quit (Client Quit) |
21:00:55 | * | CyberDrifter joined #nim |
21:01:19 | CyberDrifter | Hello Room. |
21:01:43 | * | CyberDrifter left #nim (#nim) |
21:03:14 | * | irrequietus quit () |
21:04:08 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:04:22 | * | dumdum joined #nim |
21:05:09 | * | sampwing quit (Ping timeout: 252 seconds) |
21:08:12 | * | brson quit (Quit: leaving) |
21:08:20 | * | brson joined #nim |
21:08:38 | dumdum | I have written decent amount of nim code for past 2 days, and truly feel happiest I have ever been programming :D |
21:10:42 | * | fizzbooz1 joined #nim |
21:20:22 | Araq | dumdum: now that is a nice compliment. Thank you. :-) |
21:24:34 | matkuki | dumdum: I second that! |
21:27:05 | dumdum | you are most welcome! thank you!! |
21:28:54 | dtscode | now if only the compiler was bug free... |
21:29:27 | * | bjz joined #nim |
21:32:40 | * | matkuki quit (Read error: Connection reset by peer) |
21:35:13 | * | Demon_Fox joined #nim |
21:36:01 | * | matkuki joined #nim |
21:36:20 | gtrundle | Huh, I changed a ptr to a region pointer in existing code, and got a "genRecordField 2" internal error. |
21:36:27 | matkuki | gtrundle: I'm sorry, you were right, scancodes should be used. What are the K_x constants used for? |
21:37:45 | gtrundle | matkuki: keycodes are what you usually use, scancode more "raw". Roughly, might want to check the sdl2 docs on that. |
21:38:02 | matkuki | Thanks. |
21:41:28 | matkuki | Is there an empty statement in Nim, something like "pass" in Python? Something to fill a yet unimplemented case clause for example? |
21:42:07 | BlaXpirit | discard |
21:42:14 | BlaXpirit | matkuki, |
21:42:20 | matkuki | Ahh right, thanks. |
21:42:35 | BlaXpirit | that's definitely in the manual and/or tutorial >_> |
21:43:31 | matkuki | I though it was only to discard function return. |
21:44:18 | ldlework | think again! |
21:44:23 | EXetoC | gtrundle: report it if it hasn't been reported already. just search for that name in the repo |
21:44:55 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:47:50 | gtrundle | EXetoC: thanks, I will once I can reduce this down a bit. |
21:50:07 | EXetoC | no need to try too hard though |
22:01:39 | * | matkuki is now known as matkuki_ |
22:01:55 | * | matkuki_ is now known as matkuki |
22:02:23 | * | matkuki is now known as matkuki_ |
22:03:00 | Araq | gtrundle: are you on devel? cause it might have been fixed already |
22:04:50 | reactormonk | matkuki_, nim doesn't have the concept of "return value", it disconnects data flow and control flow |
22:05:08 | gtrundle | Araq: no, I can give that a try. |
22:05:32 | reactormonk | matkuki_, there's result, which is the implicit value that's returned, but you'll never see something like "return X" at the end of a function |
22:05:55 | Araq | reactormonk: well "never" is a strong word |
22:06:12 | Araq | lot's of people coming from other langs use it, and it works as expected |
22:07:07 | matkuki_ | reactormonk, Araq: I use it for now. It makes porting from Python easier on the eyes for me. |
22:07:33 | reactormonk | Araq, looks like there's a lot of that in the compiler, I stand correct. |
22:07:46 | reactormonk | matkuki_, assign your result to "result" instead. |
22:08:06 | matkuki_ | Will do for future programs. |
22:08:52 | reactormonk | matkuki_, an example where to use it: https://github.com/Araq/Nim/blob/devel/lib/system/sysstr.nim#L23-L27 |
22:09:40 | reactormonk | Because you're aborting the flow of the function explicitly. If you use a return in nim, I read it as an explicit flow control statement. Might just be me. |
22:12:33 | matkuki_ | Yes I agree, "result" is more structured, but I usually use return to avoid nesting, like the proc you showed. |
22:16:33 | gtrundle | Araq: can still get it with devel . I'll put details in a defect a bit later. |
22:21:49 | * | Arcanum_za is now known as Trixar_za |
22:22:03 | * | dumdum quit (Ping timeout: 256 seconds) |
22:33:02 | * | sampwing joined #nim |
22:34:24 | reactormonk | matkuki_, yeah, in that case return is totally justified. |
22:35:20 | BlaXpirit | just ending proc with an expression seems to be a black sheep |
22:35:25 | BlaXpirit | is it a recent addition? |
22:35:56 | def- | BlaXpirit: i think it doesn't always work and might be confusing |
22:36:15 | def- | for one-line procs it's really nice |
22:37:19 | Araq | it does work but the spec is kinda weird |
22:37:44 | * | milosn quit (Ping timeout: 245 seconds) |
22:38:03 | BlaXpirit | is it really discouraged? |
22:38:07 | BlaXpirit | why is it present then? |
22:38:15 | Araq | it's not discouraged |
22:38:57 | BlaXpirit | i do remember that returning tuples with it does not work |
22:45:17 | * | matkuki_ quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0.1/20150122214805]) |
22:45:39 | * | milosn joined #nim |
22:47:45 | EXetoC | I have done it |
22:47:46 | BlaXpirit | it appears I am wrong |
22:47:50 | BlaXpirit | even with typedef it works |
22:48:19 | BlaXpirit | strange, because I definitely remember having to add return somewhere |
23:00:23 | * | reem quit (Remote host closed the connection) |
23:00:58 | * | ehaliewicz quit (Remote host closed the connection) |
23:02:37 | * | reem joined #nim |
23:05:47 | * | sampwing quit (Ping timeout: 252 seconds) |
23:06:07 | * | milosn quit (Ping timeout: 255 seconds) |
23:06:14 | * | milosn_ joined #nim |
23:13:24 | * | milosn_ is now known as milosn |
23:15:27 | * | kuzy000_ quit (Ping timeout: 276 seconds) |
23:23:49 | * | superfunc|lab quit (Ping timeout: 256 seconds) |
23:24:39 | * | reem quit (Remote host closed the connection) |
23:34:49 | dtscode | can asyncnet sockets accept multiple connections |
23:35:29 | * | sillesta quit (Ping timeout: 252 seconds) |
23:37:48 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:37:58 | flaviu | use multiple sockets? |
23:39:23 | dtscode | well yeah, but looking through the code, it looked like one socket could connect to two ports |
23:39:28 | dtscode | oops |
23:39:30 | * | fizzbooz1 quit (Ping timeout: 276 seconds) |
23:39:33 | dtscode | two addresses rather |
23:39:55 | EXetoC | yeah, see the example in the documentation |
23:40:18 | dtscode | thats for a server |
23:40:25 | dtscode | oh wait |
23:40:27 | dtscode | doesnt matter |
23:40:31 | dtscode | thanks EXetoC |
23:41:12 | EXetoC | you're right |
23:41:29 | dtscode | yeah |
23:42:23 | EXetoC | but a socket does represent a single connection |
23:42:29 | dtscode | yeah |
23:46:07 | EXetoC | I should try this stuff already |
23:46:12 | * | ARCADIVS joined #nim |
23:47:38 | * | Trustable quit (Remote host closed the connection) |