00:00:03 | * | BitPuffin|osx joined #nim |
00:02:00 | * | vbtt quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
00:02:06 | * | vendethiel joined #nim |
00:03:36 | Araq | zezba9000: you can see the implementation and add an isAllocatedPtr |
00:17:22 | * | thaless joined #nim |
00:21:19 | zezba9000 | Araq: Would I need modify the gc.nim for allocation? Or is modifying alloc.nim all thats needed to convert the system over for low mem devices? By that I mean is alloc.nim responsible for all memory allocation in the Nim language? So I can remove big heap block allocation and replace it with precise allocation so only the minumum amount of ram is allocated per object? |
00:23:41 | Araq | yes |
00:24:11 | zezba9000 | Yes I would need to modify gc.nim |
00:24:27 | Araq | no |
00:24:38 | Araq | only the allocator |
00:24:45 | zezba9000 | So yes I only need to modify the alloc.nim? |
00:24:49 | zezba9000 | ok cool |
00:25:02 | * | X67r quit (Quit: leaving) |
00:25:03 | Araq | in theory yes |
00:25:47 | Araq | in practice the gc uses some data structures that start with room for 1500 elements or something |
00:26:01 | Araq | so ... it will instantly fail with OOM |
00:26:17 | * | vendethiel quit (Ping timeout: 240 seconds) |
00:26:45 | Araq | gc_ms.nim is much easier to hack for the first versions |
00:26:53 | Araq | and can used with --gc:markAndSweep |
00:27:03 | Araq | you're better off starting with that one |
00:36:22 | Araq | zezba9000: thinking about it... you can do it *way* simpler |
00:36:33 | zezba9000 | Araq: Does the markAndSweep pre-allocat a smaller amount of memory? |
00:36:52 | Araq | yes but allocator + GC can be made tiny |
00:37:05 | Araq | think about it |
00:37:23 | Araq | 2048 div 8 = 256 |
00:37:35 | Araq | so you only care about 8 byte sized chunks |
00:37:52 | Araq | you need to 256 *bits* to store the free vs full distinction |
00:38:15 | Araq | thats 32 bytes |
00:39:07 | Araq | during the GC you need to have another 32 bytes and after your done you just overwrite the old 32 "heap info" bytes with what the GC determined |
00:42:54 | Araq | no need to have a 'free' and malloc is just "find X free bits in 32 bytes" |
00:45:26 | zezba9000 | ok thinking about it. So the gc_ms.nim is using a bit vector to store what memory is used vs free. |
00:46:35 | zezba9000 | Or are you saying making a new GC that uses a bit vector is the best idea |
00:46:54 | * | arnetheduck quit (Ping timeout: 255 seconds) |
00:46:59 | Araq | no, the M&S GC already uses a bitvector |
00:47:03 | Araq | but the allocator doesn't |
00:47:18 | Araq | if the allocator uses one too things get really simple |
00:47:59 | Araq | of course teh bitvector that the GC uses has not been designed to manage only 2K either :P |
00:48:05 | Araq | so you need to simplify it |
00:48:55 | EXetoC | what's array[char, int]? |
00:49:43 | Araq | a lookup table. a mapping from char to int |
00:50:08 | EXetoC | ok |
00:51:06 | zezba9000 | Araq: Could the allocator share the same bit vector the GC does? So they both know what memory is free. I'm confused as to why 2 bit vectors would be needed in the overall system. |
00:51:50 | Araq | one is only temporary during collection |
00:52:08 | Araq | and no, you cannot share them |
00:52:24 | zezba9000 | So the GC creates a temp one |
00:52:29 | Araq | aye |
00:52:40 | Araq | you can have it on the stack though |
00:52:44 | EXetoC | I see how it works now |
00:53:50 | EXetoC | on which platforms is set faster compared to a generic approach? |
00:54:06 | * | gyeates quit (Ping timeout: 255 seconds) |
00:54:37 | Araq | EXetoC: do you mean nim's bitsets or hashsets? |
00:55:32 | EXetoC | the type named 'set' |
00:55:57 | Araq | that's a bitset. it kicks ass pretty much everytime you can use it |
00:56:57 | Araq | especially if you leave benchmarking land and enter the land of reality where caches are always the bottleneck and so packed data wins |
00:58:02 | Araq | zezba9000: after the GC is done, its bitvector is the new truth, just copy it over to the allocators bitvector |
01:03:02 | EXetoC | I've mostly had <= 64 bit flags in mind, but set does of course support up to 8192 bytes |
01:04:47 | zezba9000 | ic Ok so after the GC marks its bit vector I can just copy it to the allocators bit vector. With this method the sweep opertion just does the copy from GC to Allocator. cool |
01:06:05 | * | jaco60 quit (Ping timeout: 256 seconds) |
01:06:22 | Araq | exactly. |
01:07:01 | Araq | and isAllocatedPtr is really easy to implement too. Just check the corresponding bit. |
01:08:36 | zezba9000 | isAllocatedPtr would be a one liner of code with the bit vector method probably |
01:08:49 | * | vasher_ quit (Quit: Connection closed for inactivity) |
01:09:57 | EXetoC | is set and that array variant used anywhere now? |
01:10:26 | * | elbow joined #nim |
01:13:30 | Araq | EXetoC: hrm? |
01:17:36 | EXetoC | nothing |
01:18:14 | EXetoC | dom96: async works pretty well, in case no one has said that already. nice stack traces too |
01:23:47 | * | vendethiel joined #nim |
01:41:02 | * | strcmp1 quit (Quit: Leaving) |
01:45:27 | * | vendethiel quit (Ping timeout: 264 seconds) |
01:48:17 | * | gyeates joined #nim |
01:50:22 | * | Kingsquee joined #nim |
01:53:57 | * | apense quit (Read error: No route to host) |
01:54:10 | zezba9000 | What does the Nim lang consider roots for the GC? Does the m&s gc scan starting from the roots? Or is there another approch. Sorry for all the questions. |
01:54:24 | * | apense joined #nim |
02:00:23 | * | vendethiel joined #nim |
02:14:00 | * | gyeates quit (Ping timeout: 276 seconds) |
02:22:51 | * | vendethiel quit (Ping timeout: 256 seconds) |
02:24:31 | * | vendethiel joined #nim |
02:31:25 | * | EXetoC quit (Ping timeout: 246 seconds) |
02:50:34 | * | vendethiel quit (Ping timeout: 250 seconds) |
02:52:31 | * | apense quit (Read error: No route to host) |
02:53:43 | * | pregressive quit (Ping timeout: 244 seconds) |
02:57:04 | * | thaless quit (Quit: Leaving) |
03:00:17 | * | pregressive joined #nim |
03:06:37 | * | vasher_ joined #nim |
03:07:11 | * | darkf joined #nim |
03:08:31 | * | pregressive quit (Remote host closed the connection) |
03:10:44 | * | vendethiel joined #nim |
03:19:44 | * | elbow quit (Remote host closed the connection) |
03:32:31 | * | wuehlmaus quit (Quit: Lost terminal) |
03:34:06 | * | vendethiel quit (Ping timeout: 248 seconds) |
03:42:01 | * | vendethiel joined #nim |
03:43:52 | * | apense joined #nim |
03:47:52 | * | milosn joined #nim |
04:27:58 | * | ChrisMAN quit (Ping timeout: 256 seconds) |
04:28:23 | * | vendethiel quit (Ping timeout: 256 seconds) |
04:37:27 | * | vendethiel joined #nim |
05:08:49 | * | vasher_ quit (Quit: Connection closed for inactivity) |
05:19:46 | * | lokulin quit (Ping timeout: 246 seconds) |
05:20:56 | * | vendethiel quit (Ping timeout: 250 seconds) |
05:23:55 | * | zezba9000 left #nim (#nim) |
05:26:30 | * | filcuc joined #nim |
05:27:19 | * | vendethiel joined #nim |
05:31:47 | * | filcuc quit (Ping timeout: 240 seconds) |
05:31:58 | * | filcuc joined #nim |
05:36:42 | * | lokulin joined #nim |
05:39:02 | * | milosn quit (Quit: leaving) |
05:44:44 | * | elbow joined #nim |
05:45:30 | reactormonk | dtscode, got somewhere. https://github.com/andreaferretti/patty/pull/1 |
05:49:17 | * | vendethiel quit (Ping timeout: 240 seconds) |
05:51:43 | * | vendethiel joined #nim |
05:56:46 | * | gyeates joined #nim |
06:10:01 | * | jszymanski joined #nim |
06:15:09 | * | vendethiel quit (Ping timeout: 276 seconds) |
06:33:44 | * | vendethiel joined #nim |
06:41:49 | * | gyeates quit (Ping timeout: 252 seconds) |
06:44:30 | r-ku | Araq, dom96: my current coroutines do not really need to return values. that restriction is only for top level coroutine which for example runs main loop. now from that main loop we can call say var data = read_file() which inside has a loop that waits on data and yields if data is not available. in my case yielding is giving up execution, not providing a value like in iterators. so read_file() would not return |
06:44:32 | r-ku | until all data is available but it would also not completely block and let other parts of application execute. its different from returned futures. only drawback i can see is that we can not wait on returned future after executing some more code. but on the other hand its more like single-threaded code that blocks thus its simpler. |
07:10:30 | * | dalarmmst quit (Ping timeout: 244 seconds) |
07:16:00 | * | johnsoft quit (Ping timeout: 264 seconds) |
07:16:28 | * | johnsoft joined #nim |
07:17:15 | * | vendethiel quit (Ping timeout: 256 seconds) |
07:19:11 | * | Trustable joined #nim |
07:22:57 | * | vendethiel joined #nim |
07:25:52 | * | jszymanski quit (Quit: computer sleeps...) |
07:28:46 | * | johnsoft quit (Ping timeout: 248 seconds) |
07:28:52 | * | johnsoft joined #nim |
07:31:49 | * | dr_G joined #nim |
07:32:03 | * | dr_G left #nim (#nim) |
07:32:44 | Varriount | r-ku: *gasp*, is Nim getting coroutines?! |
07:39:42 | fowl | We have coroutines |
07:39:42 | * | dalarmmst joined #nim |
07:40:25 | * | apense quit (Ping timeout: 265 seconds) |
07:44:14 | * | vendethiel quit (Ping timeout: 248 seconds) |
07:47:50 | fowl | Varriount, http://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-first-class-iterators |
07:49:55 | * | yglukhov joined #nim |
07:51:16 | * | BitPuffin|osx quit (Ping timeout: 246 seconds) |
08:13:51 | * | sepisoad joined #nim |
08:23:39 | * | coffeepot joined #nim |
08:36:53 | * | vendethiel joined #nim |
08:46:36 | * | sepisoad quit (Ping timeout: 244 seconds) |
08:46:47 | * | pwzoii quit (Ping timeout: 256 seconds) |
08:46:47 | * | gsingh93 quit (Ping timeout: 256 seconds) |
08:47:12 | * | low-profile quit (Ping timeout: 250 seconds) |
08:52:22 | * | gsingh93 joined #nim |
08:54:54 | * | pwzoii joined #nim |
08:58:39 | * | vendethiel quit (Ping timeout: 264 seconds) |
09:02:13 | * | low-profile joined #nim |
09:06:33 | * | vendethiel joined #nim |
09:22:43 | * | livcd joined #nim |
09:22:57 | * | livcd left #nim (#nim) |
09:57:47 | r-ku | Varriount: looks like so. my intention was me getting coroutines but apparently Araq has other plans hehe. anyway you can peek if you are interested https://github.com/nim-lang/Nim/compare/devel...r-ku:coroutines |
09:57:58 | * | wuehlmaus joined #nim |
09:58:07 | * | ufm joined #nim |
09:58:34 | * | vasher_ joined #nim |
10:01:02 | * | ufm quit (Client Quit) |
10:10:56 | * | EXetoC joined #nim |
10:15:05 | * | umurgdk joined #nim |
10:16:45 | * | umurgdk quit (Client Quit) |
10:17:59 | Araq | r-ku: if our spammer(s) are humans or use human help to save our captchas how would a puzzle be a different obstacle to our spammers? |
10:18:09 | Araq | *to solve |
10:18:19 | r-ku | surprise - they are not humans |
10:18:42 | r-ku | and even if they were puzzle should be such that requires one to know a topic at hand |
10:18:55 | r-ku | for example simple programming puzzle involving some function calls from c |
10:19:09 | Araq | so you think somebody uses OCR to solve our captcha? |
10:19:17 | r-ku | even if they are humans they do it at bulk and investing into research to spam just this one forum is not profitable |
10:19:25 | r-ku | lol no.. noone uses ocr |
10:19:33 | r-ku | well last time i checked it was so. it was too unreliable |
10:19:43 | federico3 | (how about using an external catpcha service, like recaptha?) |
10:19:47 | r-ku | its all dedicated captcha-solving networks powered by humans |
10:19:56 | Araq | yes exactly |
10:20:05 | r-ku | someone in india clicks ok, gets captcha, types in and clicks ok and types in next one |
10:20:12 | Araq | hence my question |
10:20:35 | r-ku | well captcha solving service is not same as human navigating to forum using browser |
10:20:43 | fowl | the service isnt free |
10:20:46 | federico3 | r-ku: but someone has to bother spending time to write adaptors to extract the captchas from a specific website |
10:20:58 | r-ku | sure does, but once its done then its done |
10:21:00 | Araq | federico3: the advanced stuff is also too hard for humans |
10:21:13 | r-ku | show me someone who would bother to spend time learning for example how sprintf() works |
10:21:21 | federico3 | r-ku: but if our html is custom, someone has to write one adapter only for forum.nim-lang |
10:21:41 | r-ku | federico3: not necessarily, but even if so its not hard |
10:21:49 | r-ku | forms usually are VERY generic |
10:21:50 | federico3 | rather than one adaptor for every e.g. wordpress website |
10:21:54 | r-ku | name/password/etc.. |
10:22:09 | r-ku | with some smart coding you can get most of forms right in automated fashion |
10:22:26 | r-ku | since same field names and general idea is used all over and over.. |
10:22:27 | federico3 | and infer which image is the capcha? |
10:23:48 | r-ku | if something loads image from recaptcha domain good indication its captcha image right? |
10:24:01 | r-ku | or if it loads catcha.php or whatever |
10:24:32 | fowl | Um |
10:24:43 | fowl | Isnt a closure iterator a coroutine |
10:24:45 | r-ku | for some time i worked in a company which tasked me on creating app which auto-submits entries to various craiglist-like websites |
10:25:11 | r-ku | so i saw good deal of automated spamming lol. hardest was dealing with js/ajax-heavy forms |
10:25:30 | r-ku | fowl: it kind of is but you cant yield from a subcall |
10:26:19 | * | johnsoft quit (Ping timeout: 244 seconds) |
10:26:36 | Araq | it's a coroutine but not a fullblown continuation but I don't really recall the official CS definitions |
10:26:57 | * | johnsoft joined #nim |
10:29:35 | r-ku | Araq: is it hard to make iterators fully featured coroutines? i kind of get impression this will be bit of code duplication. two systems doing same thing |
10:30:39 | Araq | it's impossible without doing what you're doing |
10:32:00 | Araq | your work is the foundation for fully featured coroutines |
10:33:04 | Learath2 | the nim compiler doesnt seem to like importing itself couldnt import nimeval :/ |
10:34:01 | Araq | Learath2: nimeval is the part we expose for others, the compiler itself already uses the VM |
10:34:50 | Learath2 | Im trying to import it from the outside but cant seem to get it working |
10:35:03 | r-ku | Araq: well i know, but cant we do what i do with iterators? :D |
10:35:34 | Learath2 | its either failing when prettybase failing to import compiler/ast or docgen failing to import rstast |
10:36:05 | Araq | Learath2: do you use Nimble? |
10:37:05 | Learath2 | yep did a nimble install compiler |
10:37:37 | Araq | r-ku: depends on what "what I do" means. closure iterators are good enough for our async framework... |
10:37:53 | EXetoC | is that a real reason to have iterators as a language feature now or what? :p |
10:37:58 | Learath2 | after that import compiler/nimeval fails because prettybase tries to include ast which fails as it should be compiler/ast |
10:38:12 | coffeepot | r-ku: just curious, on line 59 of your link above, why use this "while coro.stack == nil: coro.stack = alloc0(stacksize)" instead of an if statement? |
10:40:09 | EXetoC | or are there any downsides to having an accompanying forEach macro? |
10:40:41 | coffeepot | r-ku: in case the alloc0 fails maybe, to keep trying? |
10:41:10 | EXetoC | which seems essential for userland iterators |
10:41:16 | r-ku | yeah totally should do that coffeepot |
10:41:57 | Araq | Learath2: oh bah I hate these Nimble packages that depend on the "compiler package" |
10:42:15 | Araq | dom96: fix this shit |
10:42:56 | EXetoC | it's broken? |
10:45:26 | coffeepot | ah fair enough, thought there was a more esoteric reason :) |
10:46:07 | Araq | btw I don't think alloc0 ever returns 'nil'. it dies with OOM instead. |
10:47:08 | Araq | Learath2: import nimeval instead and add "compiler" to your --path |
10:47:25 | EXetoC | doesn't windows have a tendency to return nil? but I dunno if it's outdated information |
10:47:38 | * | Jesin quit (Ping timeout: 256 seconds) |
10:48:13 | Araq | well I wrote alloc0 ... it's not Windows code |
10:48:55 | r-ku | Araq: well i meant doing that asm context switching from subcalls in iterator. good thing with iterators is that there already is code to allocate gc'ed stack on the heap and it already does context switching somehow. maybe its not that terribly hard to make it yield from a subcall? |
10:49:10 | Learath2 | Araq: that fails on prettybase.nim cannot open compiler/ast then |
10:49:41 | Araq | edit prettybase and perhaps make a PR |
10:50:22 | * | arnetheduck joined #nim |
10:50:25 | * | Jesin joined #nim |
10:51:26 | EXetoC | doesn't it call some windows function on.. windows? |
10:51:33 | EXetoC | but an exception would be raised in nim then I assume |
10:52:34 | Araq | exactly |
10:56:29 | * | infinity0 quit (Ping timeout: 246 seconds) |
10:57:26 | * | raza joined #nim |
11:03:46 | * | infinity0 joined #nim |
11:08:28 | * | jaco60 joined #nim |
11:25:00 | Learath2 | Araq: I got it compiling but it feels quite hackish as i had to add $nim $nim/compiler and $lib/packages/docutils to path and edit both pretty.nim and prettybase.nim |
11:25:49 | Araq | agreed |
11:27:53 | Learath2 | well and the built executable still depends on all the nim stdlib being in place |
11:29:08 | EXetoC | if only I could resume this iterator elsewhere |
11:31:12 | * | Kingsquee quit (Quit: Konversation terminated!) |
11:31:16 | Learath2 | i guess ill stick to compiling nim code into dynlibs and loading them at runtime |
11:32:26 | * | stefantalpalaru joined #nim |
11:35:02 | Araq | Learath2: ok but you can set the library path |
11:36:47 | stefantalpalaru | Hi. I'm having a problem when compiling nimsuggest - linenoise.o appears twice in the linking command line. I assume it's got something to do with $lib/wrapper/linenoise/ containing both linenoise.c and linenoise.nim from which 2 different objects with the same name are generated, the last one overwriting the first. Any suggestions? I see a linenoise-nim project on github that prefixed the C file with 'c', unlike |
11:36:47 | stefantalpalaru | what gets shipped with Nim. |
11:39:12 | * | johnsoft quit (Ping timeout: 256 seconds) |
11:39:43 | * | johnsoft joined #nim |
11:39:47 | Araq | stefantalpalaru: one is named compiler_linenoise.c or something since it's a Nimble package |
11:40:30 | Araq | so it generates 2 different object files, no clash |
11:41:23 | Learath2 | Araq: how would i set the library path ? |
11:42:26 | Araq | maybe it doesn't work for nimsuggest though, can you report it properly, stefantalpalaru ? |
11:42:41 | Araq | Learath2: --lib:path |
11:43:58 | Learath2 | I'm using execute() from nimeval |
11:46:03 | Araq | yeah but that ends up reading from your command line, I think ... |
11:46:16 | Araq | or maybe not |
11:46:18 | Araq | bbl |
11:53:04 | EXetoC | maybe I'll do async redis next |
12:08:49 | * | vasher_ quit (Quit: Connection closed for inactivity) |
12:12:09 | stefantalpalaru | Araq, I'm probably using an unusual setup, with a global installation of Nim through Gentoo's package manager instead of the usual git clone, so there's no "compiler_" prefix for the object files while compiling nimsuggest. Anyway, renaming linenoise.{c,h} to clinenoise.{c,h} and doing some in-place substitutions with sed to reflect the new names fixes my problem. |
12:30:20 | * | yglukhov_ joined #nim |
12:32:14 | * | strcmp1 joined #nim |
12:33:46 | * | yglukhov quit (Ping timeout: 246 seconds) |
12:39:49 | * | aziz_ joined #nim |
12:57:07 | * | fdsggghh joined #nim |
13:20:01 | r-ku | Araq: so what about external assembler? you want to add it as dependency to compiler? using one that comes with toolchain nim is using creates gazillion of variants already. im more worried about those less popular compilers. they might even not have assembler with them along with no inline asm support. so im at loss which way is the best. |
13:20:41 | r-ku | could do few binary blobs with asm code and then do some self-modification on the fly using OS api... but i dont think its right thing to do here |
13:21:12 | * | vendethiel quit (Ping timeout: 256 seconds) |
13:23:00 | r-ku | if it were just gcc and msvc then could use inline asm where it works and make msvc x64 depend on like fasm (really tiny assembler) |
13:23:07 | r-ku | but that does not solve exotic compilers problem at all |
13:29:51 | * | vendethiel joined #nim |
13:34:55 | * | yglukhov_ quit (Remote host closed the connection) |
13:35:17 | * | aziz_ quit (Remote host closed the connection) |
13:35:31 | * | yglukhov_ joined #nim |
13:42:27 | * | filcuc quit (Ping timeout: 264 seconds) |
13:43:03 | * | savionok joined #nim |
13:51:37 | * | vendethiel quit (Ping timeout: 265 seconds) |
13:57:39 | Araq | stefantalpalaru: if that fixes it for you I can do this change for devel too. Or you create a PR. |
13:58:05 | * | vendethiel joined #nim |
13:58:18 | Araq | I really want these installation problems to disappear |
13:58:26 | stefantalpalaru | OK, I'll make a PR in a few minutes |
13:58:36 | Araq | thanks. excellent. |
14:00:33 | Araq | r-ku: we can make the codegen execute e.g. "yasm" |
14:01:04 | r-ku | so you are saying you are ok with compiler having dependency on external assembler? |
14:02:21 | r-ku | if so i would like to suggest fasm for x86/x64 instead http://flatassembler.net/download.php |
14:02:21 | r-ku | its much more lightweight |
14:02:30 | Araq | yeah. Not sure about the details yet. |
14:04:03 | r-ku | fasm binary alone is 91k. and its x86 |
14:04:08 | r-ku | can be bundled w/ compiler even |
14:04:38 | Araq | but the current situaton doesn't work well anyway where you have to write the assembler code twice because GCC chose to ignore Intel's standard |
14:04:59 | Araq | I wonder what they were thinking. |
14:05:20 | r-ku | didnt RMS start gcc? and he was working in AT&T. and its AT&T asm syntax |
14:05:26 | r-ku | and yeah its horrible.. |
14:05:37 | r-ku | as someone would say retarded monkey on crack came up w/ that syntax |
14:05:44 | Araq | who wants to prefix every fucking register name with % anyway? asm should at least be more convenient than Perl... |
14:06:48 | r-ku | %? well lucky if it was 1 %. once we get into extended asm (which we need to hint assembler we are using local variables) it becomes %% to help assembler tell apart registers and %[0-9] which mark local variables.. |
14:07:20 | r-ku | as if they cant tell if eax is number constant or local variable or register lol |
14:08:39 | Araq | asm """ |
14:08:40 | Araq | "addl %%ecx, %%eax\n" |
14:08:42 | Araq | "jno 1\n" |
14:08:43 | Araq | "call _raiseOverflow\n" |
14:08:45 | Araq | "1: \n" |
14:08:46 | Araq | :"=a"(`result`) |
14:08:48 | Araq | :"a"(`a`), "c"(`b`) |
14:08:49 | Araq | """ |
14:09:05 | r-ku | i just checked fasm - its statically linked too so no problems running it on x64 w/o multilib |
14:09:16 | r-ku | and yeah, gcc inline asm is sooo pretty :) |
14:09:44 | r-ku | when i saw how they do mov eax, [ebx+ecx*2] it blew my mind lol |
14:09:47 | * | pregressive joined #nim |
14:10:04 | r-ku | something like $label(ebx, ecx, 2) or similar |
14:11:28 | Araq | yeah. In fact, I never got the above snippet to work. |
14:16:53 | * | Demos joined #nim |
14:17:30 | r-ku | heh, i could not get working storing rsp into local variable and setting it with value from other local variable while having these ops in one inline asm segment |
14:17:47 | r-ku | it kept generating invalid asm.. like mov rax, rsp; mov rsp, rax |
14:17:57 | r-ku | had to split it up into separate sections :D |
14:18:07 | r-ku | later did it the other way though |
14:19:02 | * | Demos quit (Client Quit) |
14:26:13 | * | pmac_ joined #nim |
14:29:47 | avsej | no, still relevant. I messed up with the dates |
14:31:21 | avsej | last successful build was 10 days ago https://copr.fedoraproject.org/coprs/avsej/nim-devel/builds/ |
14:32:39 | * | arnetheduck quit (Ping timeout: 255 seconds) |
14:33:20 | stefantalpalaru | https://github.com/nim-lang/Nim/pull/3092 |
14:33:42 | Araq | avsej: what's wrong? |
14:34:31 | avsej | Araq, seems like contains() proc is not discarded in nimdoc section https://github.com/nim-lang/Nim/blob/devel/lib/pure/selectors.nim#L292 |
14:35:21 | avsej | proc contains*(s: Selector, fd: SocketHandle): bool = |
14:35:26 | avsej | old signature |
14:35:31 | avsej | I will make pr |
14:35:40 | Araq | excellent! |
14:36:34 | avsej | proc contains*(s: Selector, key: SelectorKey): bool = |
14:36:34 | avsej | defined outside of `when` guards |
14:37:13 | avsej | so it is not straightforward how to override it for nimdoc |
14:43:13 | avsej | Araq, something like this https://github.com/nim-lang/Nim/pull/3093. but I have to check it |
14:43:35 | * | sepisoad joined #nim |
14:46:31 | * | savionok quit (Quit: Page closed) |
14:48:01 | * | sepisoad quit (Ping timeout: 252 seconds) |
14:50:11 | * | BitPuffin joined #nim |
14:52:55 | EXetoC | I'm thinking of implementing loadExtensions in userland |
14:55:29 | EXetoC | and also implement selective loading, which people are going to need |
14:56:14 | * | sepisoad joined #nim |
14:58:06 | * | stefantalpalaru quit (Quit: Leaving) |
14:59:13 | EXetoC | and it's now possible to write to a global variable at compile-time and then use it at runtime, right? |
15:00:45 | Araq | hrm i dunno |
15:00:53 | Araq | perhaps |
15:02:53 | EXetoC | or maybe that's just at compile-time |
15:06:18 | EXetoC | but lazy loading for each individual proc is doable, and that's a good default |
15:08:27 | EXetoC | that's just one branch instruction per call |
15:08:47 | EXetoC | (by default) |
15:08:52 | * | pregressive quit (Remote host closed the connection) |
15:09:32 | * | pregressive joined #nim |
15:16:25 | EXetoC | <type>typedef unsigned int <name>GLenum</name>;</type> |
15:16:31 | EXetoC | silly opengl spec |
15:22:28 | * | vendethiel quit (Ping timeout: 256 seconds) |
15:24:14 | * | vasher_ joined #nim |
15:28:23 | * | Arrrr joined #nim |
15:29:10 | Arrrr | Hello, how can i tell if type x has been defined already? |
15:29:52 | avsej | Araq, I tested https://github.com/nim-lang/Nim/pull/3093 |
15:33:06 | * | vendethiel joined #nim |
15:33:21 | * | pregressive quit (Read error: Connection reset by peer) |
15:33:42 | * | pregressive joined #nim |
15:41:23 | r-ku | Arrrr: i believe you can do when defined(x): ... |
15:41:51 | * | pregress_ joined #nim |
15:42:18 | * | pregressive quit (Ping timeout: 256 seconds) |
15:43:32 | Arrrr | I'll try, thank you r-ku |
15:45:05 | * | pregress_ quit (Read error: Connection reset by peer) |
15:45:15 | * | pregressive joined #nim |
15:46:20 | Arrrr | Btw, i didnt know emit existed, it makes everything easier |
15:47:10 | r-ku | you meant messier? yeah its messier with emit :D |
15:47:17 | r-ku | cant be avoided sometimes though |
15:47:34 | * | Miko_ joined #nim |
15:47:40 | Miko_ | Hi. |
15:47:57 | Arrrr | Hello. |
15:48:16 | Miko_ | Can it be that for some types (such as uint8) serveral operations are not defined such as mod or div? |
15:48:18 | Arrrr | Well, i'll tell you when i get more experience with the macro |
15:48:33 | Arrrr | Yes Miko_, import unsigned |
15:48:51 | Arrrr | Wait, i think you cant mod with unsigneds |
15:49:05 | r-ku | we must bug Araq until unsigned is made first class citizen |
15:49:35 | EXetoC | has it not been merged yet? |
15:49:39 | * | pregress_ joined #nim |
15:49:40 | * | pregressive quit (Ping timeout: 256 seconds) |
15:49:49 | r-ku | there is a PR? |
15:49:54 | r-ku | got a link? |
15:55:54 | * | vendethiel quit (Ping timeout: 256 seconds) |
15:56:11 | * | pregressive joined #nim |
15:56:28 | * | pregress_ quit (Read error: Connection reset by peer) |
15:57:10 | * | ChrisMAN joined #nim |
15:59:48 | * | vendethiel joined #nim |
16:03:00 | Arrrr | I was wrong Miko_, those operations exist inside unsigned http://nim-lang.org/docs/unsigned.html#mod,T,T |
16:03:08 | * | pregress_ joined #nim |
16:03:34 | * | pregressive quit (Ping timeout: 250 seconds) |
16:04:29 | Miko_ | ? Yes they do and it works. Never understood that differently. Thanks for the hint |
16:05:08 | Miko_ | I want to write a nim programm that compiles to both javascript (and uses typed arrays) and c. |
16:05:49 | Miko_ | I hope it works the way it want it too and wouldn't be suprised if it wasn't. |
16:06:00 | Miko_ | If it does nim is even more amazing |
16:12:30 | * | yglukhov_ quit (Ping timeout: 248 seconds) |
16:13:27 | EXetoC | it should work with minimal effort, provided that you're doing things that are actually possible in javascript |
16:14:41 | Miko_ | What am i doing wrong when the c code does not compile? |
16:14:50 | Miko_ | execution of an external program failed; rerun with --parallelBuild:1 to see the error message |
16:15:05 | EXetoC | that indicates a compiler bug |
16:15:33 | EXetoC | run it with that flag enabled, and then you can try to figure out if it has been reported already |
16:15:45 | EXetoC | set to 1 rather |
16:18:55 | * | sepisoad quit (Quit: Leaving) |
16:21:02 | * | vendethiel quit (Ping timeout: 248 seconds) |
16:24:51 | Arrrr | So, if i only have a string, how can i pass it to declared proc ? |
16:25:39 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
16:25:41 | EXetoC | do you mean foo(str) or something else? |
16:26:32 | Arrrr | This declared http://nim-lang.org/docs/system.html#declared,expr |
16:26:49 | * | Miko_ quit (Ping timeout: 246 seconds) |
16:27:10 | Arrrr | I want to know if any ident inside a macro belongs to a declared identifier |
16:29:55 | Arrrr | Well, nevermind, i wont use immediate. |
16:34:57 | * | vendethiel joined #nim |
16:43:17 | * | Miko_ joined #nim |
16:57:57 | * | vendethiel quit (Ping timeout: 244 seconds) |
17:02:04 | * | Miko_ quit (Ping timeout: 250 seconds) |
17:12:11 | * | unclechu joined #nim |
17:15:11 | * | darkf quit (Quit: Leaving) |
17:17:11 | * | Miko_ joined #nim |
17:18:04 | * | vendethiel joined #nim |
17:22:45 | * | drewsrem joined #nim |
17:26:50 | Varriount | Araq: Are there instructions anywhere on how to generate the Nim website and the documentation? When I run 'koch website', I get an error about how an ini file can't be found. |
17:27:16 | Varriount | Araq: I really need to be able to generate the website if I want to add the style guide to it. |
17:27:48 | * | apense joined #nim |
17:34:20 | Araq | Varriount: hrm, works for me. |
17:35:03 | r-ku | Araq: do you happen to know wth is at fs:30h on linux? |
17:35:33 | Araq | the fs segment register points to thread local storage? |
17:36:39 | r-ku | i have no idea \o/ i can tell this stuff on windows, not on linux :| |
17:37:28 | r-ku | rsp is like encrypted with value at fs:30h in setjmp() |
17:37:41 | r-ku | i thought maybe i can abuse it to do more portable stack switching |
17:37:48 | r-ku | but universe is against us |
17:39:08 | Araq | don't mess with the segment registers |
17:39:37 | r-ku | i dont intend to mess with that. i just want it to give me rsp value :| |
17:39:46 | r-ku | must be some kind of anti-exploit protection i guess |
17:40:44 | * | vendethiel quit (Ping timeout: 256 seconds) |
17:42:13 | Araq | Varriount: do you have web/website.ini ? |
17:43:26 | * | pregressive joined #nim |
17:43:41 | * | pregress_ quit (Read error: Connection reset by peer) |
17:45:36 | * | vendethiel joined #nim |
17:48:27 | * | pregressive quit (Read error: Connection reset by peer) |
17:48:48 | * | pregressive joined #nim |
17:51:09 | Araq | apense: you're a machine! :-) |
17:59:28 | r-ku | Araq: gc using c_setjmp to scan registers does not scan them all since some of them are mangled. you aware of this? https://sourceware.org/glibc/wiki/PointerEncryption |
18:00:21 | Arrrr | why would adding a value to a table, inside a macro, fail? |
18:00:32 | Arrrr | (with string key) |
18:00:39 | r-ku | (show the error) |
18:00:52 | Arrrr | (Error: unhandled exception: regs[rb].node.kind == nkRefTy [AssertionError]) |
18:01:01 | Arrrr | (rb being the name of the module) |
18:01:23 | Arrrr | Doesnt it like ref types? |
18:01:23 | * | dgellow joined #nim |
18:01:25 | r-ku | it checks if something is reference and fails when its not |
18:01:41 | r-ku | if im not mistaken |
18:01:46 | Araq | Arrrr: the VM hates the table's implementation and fails to run it at compile-time |
18:02:12 | Arrrr | i see, ugly thing |
18:02:52 | Arrrr | then, how could i change inside a macro if certain type has been defined already? |
18:03:04 | Arrrr | Having only the name as a expr |
18:03:21 | Araq | Arrrr: hard to say without knowing what you like to accomplish |
18:04:15 | Araq | r-ku: nope wasn't aware but it's hardly news that C becomes ever more unusable as time passes |
18:04:38 | Arrrr | i need a table using defined objects as keys. |
18:05:01 | Arrrr | Since i cannot use typedesc, i need another thing |
18:05:02 | Araq | "pointer encryption" for "security" my ass |
18:05:37 | r-ku | im also unconvinced of benefits.. |
18:05:58 | Araq | a configure script could send the entire contents of my home dir to some foreign server |
18:06:04 | r-ku | guess nim will have to bundle its own setjmp/longjmp |
18:06:55 | Araq | "security" is a word without meaning. |
18:07:09 | r-ku | see thing is.. bash that sends your home dirs has pointers encrypted !! |
18:08:08 | Araq | not to mention they should have stopped using fucking C decades ago when they would truely care about security ... |
18:08:56 | r-ku | you know they must love coding bit more abstracted asm |
18:09:02 | r-ku | like that guy who wrote fasm |
18:09:06 | r-ku | all written in 32 bit asm |
18:09:14 | r-ku | and hes making new version that will work on arm or something |
18:09:19 | r-ku | all in 32 bit asm |
18:09:37 | r-ku | or guy who wrote x64 debugger - in asm |
18:09:47 | r-ku | someone started entire OS - all in asm |
18:09:55 | r-ku | masochism.. |
18:10:10 | r-ku | btw cant use fasm cause it wont build .o that gcc eats.. |
18:10:24 | EXetoC | temple OS? :p |
18:11:13 | Araq | r-ku: but yes, we need inline ASM for the register scanning instead of relying on setjmp |
18:11:47 | * | Miko_ quit (Ping timeout: 240 seconds) |
18:15:16 | r-ku | 29 folders in glibc/sysdeps. thats arch-dependent code |
18:15:24 | r-ku | lots of setjmp/longjmp implementations.. |
18:15:53 | Araq | well the setjmp based implementation will always be there as a fallback solution |
18:16:14 | Araq | and as I said, there are 3 archs left anyway :P |
18:16:23 | r-ku | what i have in mind is grabbing some of their implementations and bundling w/o register mangling |
18:16:36 | r-ku | bigger problem is making all compilers happy w/ that asm |
18:16:53 | r-ku | unless we adapt and yasm that code |
18:19:02 | Araq | btw we need to look at licenses, I don't want to bundle (L)GPL code anymore |
18:21:12 | r-ku | well rats. glibc is VERY gpl, kernel also quite gpl (it also has said impls) |
18:21:39 | Araq | D's GC uses inline assembler for register marking |
18:21:51 | Araq | and is Boost I think so it's save to copy from that |
18:22:04 | r-ku | musl libc is MIT btw |
18:22:14 | Araq | or that yeah |
18:24:18 | r-ku | musl implementations are a lot cleaner too |
18:24:38 | r-ku | compared to it glibc is maze of headers |
18:26:54 | * | Miko_ joined #nim |
18:30:01 | r-ku | vasm supports lots of archs. x86/x64/arm/other. might be worth to look into https://en.wikipedia.org/wiki/Vasm |
18:32:50 | drewsrem | Can I pretty-print an AST like dumpTree with a passed symbol in a macro? - i.e. I'm having a macro that has a stmt parameter and which I pass a block of code, now if I do dumpTree(param) it is obviously only going to pretty-print the call to the symbol itself |
18:33:52 | r-ku | echo tree_repr(thing) |
18:34:25 | drewsrem | r-ku, much obliged |
18:34:37 | * | Ven joined #nim |
18:35:12 | r-ku | r-ku - the documentation AI |
18:35:33 | r-ku | im goner, good night crowd |
18:36:05 | drewsrem | sleep tight |
18:47:16 | * | Miko_ quit (Ping timeout: 264 seconds) |
18:48:50 | Arrrr | what is this: ???(???, 0) Error: VM: immediate value does not fit into an int16 |
18:49:37 | EXetoC | bug? |
18:51:53 | Arrrr | maybe, because i changed a thing and now i got sigsegv |
18:52:28 | drewsrem | What could I use to model object hierarchies in nim? - e.g. an event hierarchy |
18:55:19 | * | Miko_ joined #nim |
18:57:09 | drewsrem | nvm, just saw there's inheritance |
18:58:49 | * | vasher_ quit (Quit: Connection closed for inactivity) |
19:05:13 | Araq | Arrrr: can you please report these issues properly? |
19:07:13 | Arrrr | Dont worry, i dont have the problem anymore |
19:07:56 | EXetoC | chances are someone else is going to run into the same issue |
19:09:11 | Arrrr | But i dont even know what was the problem, just burnt the file and moved on |
19:09:27 | * | jszymanski joined #nim |
19:10:45 | EXetoC | Araq is the one who needs to know that |
19:10:49 | EXetoC | in most cases anyway |
19:14:10 | Arrrr | ok, this was the code http://pastebin.com/cfVrbgym |
19:22:23 | * | brson joined #nim |
19:27:51 | * | Arrrr quit (Quit: WeeChat 1.2) |
19:30:17 | Varriount | Araq: I don't have a website.ini file. If I create a blank one, then only part of the website gets generated. |
19:32:48 | Varriount | Araq: Also, what's the purpose of doc/nimdoc.css ? |
19:33:29 | Araq | Varriount: https://github.com/nim-lang/Nim/blob/devel/web/website.ini |
19:33:40 | Araq | github has it |
19:34:05 | Varriount | Weird. |
19:34:26 | Araq | well our docs have CSS so that they look better |
19:34:52 | Varriount | Araq: Yeah, but it appears that the CSS is actually in nimdoc.cfg |
19:34:59 | Varriount | In a string. |
19:38:31 | Varriount | See: https://github.com/nim-lang/Nim/blob/devel/config/nimdoc.cfg#L90 |
19:42:09 | Araq | maybe it started as an external file and then the config assimilated it |
19:50:32 | Varriount | nom nom |
19:52:52 | * | Matthias247 joined #nim |
20:00:19 | * | FedeOmoto joined #nim |
20:02:09 | Varriount | Araq: Should I disentangle the css from the config file, and have it use gulp/staticRead instead? |
20:04:45 | * | pmac_ quit (Ping timeout: 246 seconds) |
20:06:19 | * | Miko_ quit (Ping timeout: 246 seconds) |
20:06:39 | * | Miko_ joined #nim |
20:07:21 | Araq | no, work on something important please |
20:07:36 | Araq | also it's called "gorge" not gulp ;-) |
20:09:42 | * | drewsrem quit (Quit: Leaving) |
20:12:58 | Varriount | Araq: And in case you're wondering, the reason I need to tinker with the CSS is because the list style is... cramped. |
20:15:02 | * | pregressive quit (Read error: Connection reset by peer) |
20:15:14 | * | Jesin quit (Quit: Leaving) |
20:15:19 | * | pregressive joined #nim |
20:16:23 | * | brson quit (Remote host closed the connection) |
20:17:49 | Araq | oki |
20:18:43 | * | pregress_ joined #nim |
20:18:44 | * | pregressive quit (Read error: Connection reset by peer) |
20:20:51 | * | Jesin joined #nim |
20:21:14 | * | pregress_ quit (Read error: Connection reset by peer) |
20:21:22 | * | pregressive joined #nim |
20:23:40 | * | brson joined #nim |
20:26:14 | * | brson quit (Client Quit) |
20:26:22 | * | brson joined #nim |
20:29:34 | * | Miko_ quit (Ping timeout: 248 seconds) |
20:32:00 | * | X67r joined #nim |
20:33:11 | * | pregress_ joined #nim |
20:34:08 | * | Miko_ joined #nim |
20:34:42 | * | pregressive quit (Ping timeout: 256 seconds) |
20:36:51 | Miko_ | I'm doing some bitmagick and I'd like some feedback on my code |
20:36:52 | Miko_ | http://www.pastebin.ca/3054715 |
20:37:23 | * | pregress_ quit (Read error: Connection reset by peer) |
20:37:30 | Miko_ | These converstaions to uint8 do make the code somewhat unreadable |
20:37:40 | * | pregressive joined #nim |
20:37:49 | avsej | Araq, https://github.com/nim-lang/Nim/pull/3093#issuecomment-120120380 |
20:40:14 | Miko_ | In the doc it says nim wants to discurrate the usage of unsigned integers, i wonder why |
20:45:17 | EXetoC | you can specify literals of all int types |
20:45:37 | EXetoC | http://nim-lang.org/docs/manual.html#lexical-analysis-numerical-constants |
20:46:27 | * | X67r quit (Ping timeout: 256 seconds) |
20:46:40 | EXetoC | Miko_: because unsigned integers are rarely needed |
20:49:47 | EXetoC | https://github.com/nim-lang/Nim/wiki/Nim-for-C-programmers#unsigned-integers |
20:51:57 | Miko_ | Thanks for hints |
20:53:14 | * | wedowmaker quit (Quit: Connection closed for inactivity) |
20:56:44 | Araq | Miko_: most of these are superfluous though |
20:57:00 | Araq | byte and 12 == 34 # should work |
20:57:06 | Araq | er I mean |
20:57:12 | Araq | (byte and 12) == 34 # should work |
20:57:51 | * | raza quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
21:00:42 | Miko_ | mmm |
21:01:16 | Miko_ | In the case construct i didn't state the unsigned and it does work |
21:02:11 | Miko_ | But it has to be int(b or (not 0x7Fu8)). int(b or (not 0x7F)) does not. The comparison operator (if case even uses that) seems more generous |
21:03:18 | Miko_ | And I just found out that the JS backend doesn't seem to support u8 litterals |
21:05:05 | * | X67r joined #nim |
21:06:27 | * | shevy2 joined #nim |
21:06:35 | * | vasher_ joined #nim |
21:06:57 | * | shevy2 is now known as shevy |
21:07:20 | * | ChrisMAN quit (Ping timeout: 250 seconds) |
21:08:48 | * | BitPuffin quit (Ping timeout: 264 seconds) |
21:12:41 | * | apense quit (Read error: Connection reset by peer) |
21:12:55 | Miko_ | Ok, the documentation say right that unsigned integer arithmetic is not supported on the js backend |
21:13:11 | * | apense joined #nim |
21:13:20 | Miko_ | I wonder what's the way the deal with a bitstream anyway in nim |
21:13:34 | Miko_ | Or a blob |
21:15:26 | Miko_ | Right now I use a array of bytes, where bytes are uint8s. |
21:17:50 | * | pregressive quit (Remote host closed the connection) |
21:17:53 | * | wu-lee joined #nim |
21:18:53 | * | ChrisMAN joined #nim |
21:26:42 | wu-lee | reactormonk: hi, been a while. did your forked blink.nim work for you? |
21:27:00 | wu-lee | I managed to get mine to work, if... |
21:27:26 | wu-lee | -d:release and -opt:<anything> off |
21:28:21 | wu-lee | both passC and passL are "-mmcu=atmega168" |
21:29:06 | wu-lee | both avr.standalone.gcc.exe and avr.standalone.gcc.linkerexe are "avr-gcc" |
21:29:37 | wu-lee | however, I could not get the arduino delay() function to work (although I could link and upload ok) |
21:30:28 | reactormonk | wu-lee, nope, I don't think so |
21:30:45 | reactormonk | got distracted by other stuff :-( Having some fun with elisp |
21:31:29 | wu-lee | do you know if it was the delay() function which was the problem |
21:31:44 | * | drewsrem joined #nim |
21:32:15 | reactormonk | I think I got hold up because I didn't link correctly - what I did in the end was to include all the cpp stuff |
21:32:30 | reactormonk | ... which didn't link correctly, apparently too big or something :-/ |
21:32:42 | wu-lee | yes, I saw your fork and copied that part |
21:32:51 | reactormonk | Then I tried to find out how to do it in pure C, that's +/- where I broke off |
21:33:17 | wu-lee | working version is current head of arduino branch in my github repo |
21:33:29 | reactormonk | Can you compile it from c? |
21:33:32 | reactormonk | ehh, via nim c |
21:33:40 | wu-lee | I didn't link quite so many c files however |
21:33:56 | wu-lee | I can now compile in C and with the nim compiler |
21:34:20 | wu-lee | (the latter took some experimenting) |
21:34:41 | reactormonk | ^^ |
21:35:20 | * | gokr quit (Ping timeout: 256 seconds) |
21:35:24 | wu-lee | via "nim c" the compiler? yes |
21:38:09 | wu-lee | I think i remember seeing gcc complain when compiling blink.c with a delay() call if it wasn't using -O3 |
21:38:36 | EXetoC | Miko_: http://nim-lang.org/docs/streams.html |
21:38:46 | EXetoC | which is what I need to start using |
21:38:49 | wu-lee | so my hypothesis is that delay() requires it to work (but who knows why) |
21:40:47 | Miko_ | EXetoC, Well, it's not exatly a "string" stream, but more a cstring stream |
21:41:29 | Miko_ | but that sounds exactly what javascript typed arrays should be encapsulated into |
21:41:32 | Miko_ | thanks |
21:42:33 | EXetoC | I dunno what you mean by that |
21:50:34 | * | Miko_ quit (Ping timeout: 246 seconds) |
21:52:31 | * | jszymanski quit (Quit: computer sleeps...) |
22:11:14 | * | elbow_jason joined #nim |
22:14:15 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:17:52 | * | thaless joined #nim |
22:19:19 | * | unclechu quit (Quit: Leaving.) |
22:20:49 | * | keypusher quit (Read error: Connection reset by peer) |
22:22:29 | * | key_ joined #nim |
22:59:04 | * | gokr joined #nim |
23:32:07 | * | Trustable quit (Remote host closed the connection) |
23:35:42 | * | X67r quit (Quit: leaving) |
23:41:45 | * | unclechu joined #nim |
23:50:02 | * | unclechu quit (Remote host closed the connection) |
23:58:24 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |