<< 09-07-2015 >>

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:36Araqzezba9000: you can see the implementation and add an isAllocatedPtr
00:17:22*thaless joined #nim
00:21:19zezba9000Araq: 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:41Araqyes
00:24:11zezba9000Yes I would need to modify gc.nim
00:24:27Araqno
00:24:38Araqonly the allocator
00:24:45zezba9000So yes I only need to modify the alloc.nim?
00:24:49zezba9000ok cool
00:25:02*X67r quit (Quit: leaving)
00:25:03Araqin theory yes
00:25:47Araqin practice the gc uses some data structures that start with room for 1500 elements or something
00:26:01Araqso ... it will instantly fail with OOM
00:26:17*vendethiel quit (Ping timeout: 240 seconds)
00:26:45Araqgc_ms.nim is much easier to hack for the first versions
00:26:53Araqand can used with --gc:markAndSweep
00:27:03Araqyou're better off starting with that one
00:36:22Araqzezba9000: thinking about it... you can do it *way* simpler
00:36:33zezba9000Araq: Does the markAndSweep pre-allocat a smaller amount of memory?
00:36:52Araqyes but allocator + GC can be made tiny
00:37:05Araqthink about it
00:37:23Araq2048 div 8 = 256
00:37:35Araqso you only care about 8 byte sized chunks
00:37:52Araqyou need to 256 *bits* to store the free vs full distinction
00:38:15Araqthats 32 bytes
00:39:07Araqduring 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:54Araqno need to have a 'free' and malloc is just "find X free bits in 32 bytes"
00:45:26zezba9000ok thinking about it. So the gc_ms.nim is using a bit vector to store what memory is used vs free.
00:46:35zezba9000Or 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:59Araqno, the M&S GC already uses a bitvector
00:47:03Araqbut the allocator doesn't
00:47:18Araqif the allocator uses one too things get really simple
00:47:59Araqof course teh bitvector that the GC uses has not been designed to manage only 2K either :P
00:48:05Araqso you need to simplify it
00:48:55EXetoCwhat's array[char, int]?
00:49:43Araqa lookup table. a mapping from char to int
00:50:08EXetoCok
00:51:06zezba9000Araq: 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:50Araqone is only temporary during collection
00:52:08Araqand no, you cannot share them
00:52:24zezba9000So the GC creates a temp one
00:52:29Araqaye
00:52:40Araqyou can have it on the stack though
00:52:44EXetoCI see how it works now
00:53:50EXetoCon which platforms is set faster compared to a generic approach?
00:54:06*gyeates quit (Ping timeout: 255 seconds)
00:54:37AraqEXetoC: do you mean nim's bitsets or hashsets?
00:55:32EXetoCthe type named 'set'
00:55:57Araqthat's a bitset. it kicks ass pretty much everytime you can use it
00:56:57Araqespecially if you leave benchmarking land and enter the land of reality where caches are always the bottleneck and so packed data wins
00:58:02Araqzezba9000: after the GC is done, its bitvector is the new truth, just copy it over to the allocators bitvector
01:03:02EXetoCI've mostly had <= 64 bit flags in mind, but set does of course support up to 8192 bytes
01:04:47zezba9000ic 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:22Araqexactly.
01:07:01Araqand isAllocatedPtr is really easy to implement too. Just check the corresponding bit.
01:08:36zezba9000isAllocatedPtr 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:57EXetoCis set and that array variant used anywhere now?
01:10:26*elbow joined #nim
01:13:30AraqEXetoC: hrm?
01:17:36EXetoCnothing
01:18:14EXetoCdom96: 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:10zezba9000What 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:30reactormonkdtscode, 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:30r-kuAraq, 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:32r-kuuntil 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:44Varriountr-ku: *gasp*, is Nim getting coroutines?!
07:39:42fowlWe 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:50fowlVarriount, 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:47r-kuVarriount: 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:59Araqr-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:09Araq*to solve
10:18:19r-kusurprise - they are not humans
10:18:42r-kuand even if they were puzzle should be such that requires one to know a topic at hand
10:18:55r-kufor example simple programming puzzle involving some function calls from c
10:19:09Araqso you think somebody uses OCR to solve our captcha?
10:19:17r-kueven if they are humans they do it at bulk and investing into research to spam just this one forum is not profitable
10:19:25r-kulol no.. noone uses ocr
10:19:33r-kuwell last time i checked it was so. it was too unreliable
10:19:43federico3(how about using an external catpcha service, like recaptha?)
10:19:47r-kuits all dedicated captcha-solving networks powered by humans
10:19:56Araqyes exactly
10:20:05r-kusomeone in india clicks ok, gets captcha, types in and clicks ok and types in next one
10:20:12Araqhence my question
10:20:35r-kuwell captcha solving service is not same as human navigating to forum using browser
10:20:43fowlthe service isnt free
10:20:46federico3r-ku: but someone has to bother spending time to write adaptors to extract the captchas from a specific website
10:20:58r-kusure does, but once its done then its done
10:21:00Araqfederico3: the advanced stuff is also too hard for humans
10:21:13r-kushow me someone who would bother to spend time learning for example how sprintf() works
10:21:21federico3r-ku: but if our html is custom, someone has to write one adapter only for forum.nim-lang
10:21:41r-kufederico3: not necessarily, but even if so its not hard
10:21:49r-kuforms usually are VERY generic
10:21:50federico3rather than one adaptor for every e.g. wordpress website
10:21:54r-kuname/password/etc..
10:22:09r-kuwith some smart coding you can get most of forms right in automated fashion
10:22:26r-kusince same field names and general idea is used all over and over..
10:22:27federico3and infer which image is the capcha?
10:23:48r-kuif something loads image from recaptcha domain good indication its captcha image right?
10:24:01r-kuor if it loads catcha.php or whatever
10:24:32fowlUm
10:24:43fowlIsnt a closure iterator a coroutine
10:24:45r-kufor some time i worked in a company which tasked me on creating app which auto-submits entries to various craiglist-like websites
10:25:11r-kuso i saw good deal of automated spamming lol. hardest was dealing with js/ajax-heavy forms
10:25:30r-kufowl: it kind of is but you cant yield from a subcall
10:26:19*johnsoft quit (Ping timeout: 244 seconds)
10:26:36Araqit'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:35r-kuAraq: 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:39Araqit's impossible without doing what you're doing
10:32:00Araqyour work is the foundation for fully featured coroutines
10:33:04Learath2the nim compiler doesnt seem to like importing itself couldnt import nimeval :/
10:34:01AraqLearath2: nimeval is the part we expose for others, the compiler itself already uses the VM
10:34:50Learath2Im trying to import it from the outside but cant seem to get it working
10:35:03r-kuAraq: well i know, but cant we do what i do with iterators? :D
10:35:34Learath2its either failing when prettybase failing to import compiler/ast or docgen failing to import rstast
10:36:05AraqLearath2: do you use Nimble?
10:37:05Learath2yep did a nimble install compiler
10:37:37Araqr-ku: depends on what "what I do" means. closure iterators are good enough for our async framework...
10:37:53EXetoCis that a real reason to have iterators as a language feature now or what? :p
10:37:58Learath2after that import compiler/nimeval fails because prettybase tries to include ast which fails as it should be compiler/ast
10:38:12coffeepotr-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:09EXetoCor are there any downsides to having an accompanying forEach macro?
10:40:41coffeepotr-ku: in case the alloc0 fails maybe, to keep trying?
10:41:10EXetoCwhich seems essential for userland iterators
10:41:16r-kuyeah totally should do that coffeepot
10:41:57AraqLearath2: oh bah I hate these Nimble packages that depend on the "compiler package"
10:42:15Araqdom96: fix this shit
10:42:56EXetoCit's broken?
10:45:26coffeepotah fair enough, thought there was a more esoteric reason :)
10:46:07Araqbtw I don't think alloc0 ever returns 'nil'. it dies with OOM instead.
10:47:08AraqLearath2: import nimeval instead and add "compiler" to your --path
10:47:25EXetoCdoesn'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:13Araqwell I wrote alloc0 ... it's not Windows code
10:48:55r-kuAraq: 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:10Learath2Araq: that fails on prettybase.nim cannot open compiler/ast then
10:49:41Araqedit prettybase and perhaps make a PR
10:50:22*arnetheduck joined #nim
10:50:25*Jesin joined #nim
10:51:26EXetoCdoesn't it call some windows function on.. windows?
10:51:33EXetoCbut an exception would be raised in nim then I assume
10:52:34Araqexactly
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:00Learath2Araq: 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:49Araqagreed
11:27:53Learath2well and the built executable still depends on all the nim stdlib being in place
11:29:08EXetoCif only I could resume this iterator elsewhere
11:31:12*Kingsquee quit (Quit: Konversation terminated!)
11:31:16Learath2i guess ill stick to compiling nim code into dynlibs and loading them at runtime
11:32:26*stefantalpalaru joined #nim
11:35:02AraqLearath2: ok but you can set the library path
11:36:47stefantalpalaruHi. 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:47stefantalpalaruwhat gets shipped with Nim.
11:39:12*johnsoft quit (Ping timeout: 256 seconds)
11:39:43*johnsoft joined #nim
11:39:47Araqstefantalpalaru: one is named compiler_linenoise.c or something since it's a Nimble package
11:40:30Araqso it generates 2 different object files, no clash
11:41:23Learath2Araq: how would i set the library path ?
11:42:26Araqmaybe it doesn't work for nimsuggest though, can you report it properly, stefantalpalaru ?
11:42:41AraqLearath2: --lib:path
11:43:58Learath2I'm using execute() from nimeval
11:46:03Araqyeah but that ends up reading from your command line, I think ...
11:46:16Araqor maybe not
11:46:18Araqbbl
11:53:04EXetoCmaybe I'll do async redis next
12:08:49*vasher_ quit (Quit: Connection closed for inactivity)
12:12:09stefantalpalaruAraq, 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:01r-kuAraq: 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:41r-kucould 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:00r-kuif 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:07r-kubut 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:39Araqstefantalpalaru: 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:18AraqI really want these installation problems to disappear
13:58:26stefantalpalaruOK, I'll make a PR in a few minutes
13:58:36Araqthanks. excellent.
14:00:33Araqr-ku: we can make the codegen execute e.g. "yasm"
14:01:04r-kuso you are saying you are ok with compiler having dependency on external assembler?
14:02:21r-kuif so i would like to suggest fasm for x86/x64 instead http://flatassembler.net/download.php
14:02:21r-kuits much more lightweight
14:02:30Araqyeah. Not sure about the details yet.
14:04:03r-kufasm binary alone is 91k. and its x86
14:04:08r-kucan be bundled w/ compiler even
14:04:38Araqbut 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:59AraqI wonder what they were thinking.
14:05:20r-kudidnt RMS start gcc? and he was working in AT&T. and its AT&T asm syntax
14:05:26r-kuand yeah its horrible..
14:05:37r-kuas someone would say retarded monkey on crack came up w/ that syntax
14:05:44Araqwho wants to prefix every fucking register name with % anyway? asm should at least be more convenient than Perl...
14:06:48r-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:20r-kuas if they cant tell if eax is number constant or local variable or register lol
14:08:39Araq asm """
14:08:40Araq "addl %%ecx, %%eax\n"
14:08:42Araq "jno 1\n"
14:08:43Araq "call _raiseOverflow\n"
14:08:45Araq "1: \n"
14:08:46Araq :"=a"(`result`)
14:08:48Araq :"a"(`a`), "c"(`b`)
14:08:49Araq """
14:09:05r-kui just checked fasm - its statically linked too so no problems running it on x64 w/o multilib
14:09:16r-kuand yeah, gcc inline asm is sooo pretty :)
14:09:44r-kuwhen i saw how they do mov eax, [ebx+ecx*2] it blew my mind lol
14:09:47*pregressive joined #nim
14:10:04r-kusomething like $label(ebx, ecx, 2) or similar
14:11:28Araqyeah. In fact, I never got the above snippet to work.
14:16:53*Demos joined #nim
14:17:30r-kuheh, 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:47r-kuit kept generating invalid asm.. like mov rax, rsp; mov rsp, rax
14:17:57r-kuhad to split it up into separate sections :D
14:18:07r-kulater did it the other way though
14:19:02*Demos quit (Client Quit)
14:26:13*pmac_ joined #nim
14:29:47avsejno, still relevant. I messed up with the dates
14:31:21avsejlast 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:20stefantalpalaruhttps://github.com/nim-lang/Nim/pull/3092
14:33:42Araqavsej: what's wrong?
14:34:31avsejAraq, 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:21avsej proc contains*(s: Selector, fd: SocketHandle): bool =
14:35:26avsejold signature
14:35:31avsejI will make pr
14:35:40Araqexcellent!
14:36:34avsejproc contains*(s: Selector, key: SelectorKey): bool =
14:36:34avsej defined outside of `when` guards
14:37:13avsejso it is not straightforward how to override it for nimdoc
14:43:13avsejAraq, 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:55EXetoCI'm thinking of implementing loadExtensions in userland
14:55:29EXetoCand 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:13EXetoCand it's now possible to write to a global variable at compile-time and then use it at runtime, right?
15:00:45Araqhrm i dunno
15:00:53Araqperhaps
15:02:53EXetoCor maybe that's just at compile-time
15:06:18EXetoCbut lazy loading for each individual proc is doable, and that's a good default
15:08:27EXetoCthat's just one branch instruction per call
15:08:47EXetoC(by default)
15:08:52*pregressive quit (Remote host closed the connection)
15:09:32*pregressive joined #nim
15:16:25EXetoC<type>typedef unsigned int <name>GLenum</name>;</type>
15:16:31EXetoCsilly 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:10ArrrrHello, how can i tell if type x has been defined already?
15:29:52avsejAraq, 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:23r-kuArrrr: 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:32ArrrrI'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:20ArrrrBtw, i didnt know emit existed, it makes everything easier
15:47:10r-kuyou meant messier? yeah its messier with emit :D
15:47:17r-kucant be avoided sometimes though
15:47:34*Miko_ joined #nim
15:47:40Miko_Hi.
15:47:57ArrrrHello.
15:48:16Miko_Can it be that for some types (such as uint8) serveral operations are not defined such as mod or div?
15:48:18ArrrrWell, i'll tell you when i get more experience with the macro
15:48:33ArrrrYes Miko_, import unsigned
15:48:51ArrrrWait, i think you cant mod with unsigneds
15:49:05r-kuwe must bug Araq until unsigned is made first class citizen
15:49:35EXetoChas it not been merged yet?
15:49:39*pregress_ joined #nim
15:49:40*pregressive quit (Ping timeout: 256 seconds)
15:49:49r-kuthere is a PR?
15:49:54r-kugot 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:00ArrrrI 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:29Miko_? Yes they do and it works. Never understood that differently. Thanks for the hint
16:05:08Miko_I want to write a nim programm that compiles to both javascript (and uses typed arrays) and c.
16:05:49Miko_I hope it works the way it want it too and wouldn't be suprised if it wasn't.
16:06:00Miko_If it does nim is even more amazing
16:12:30*yglukhov_ quit (Ping timeout: 248 seconds)
16:13:27EXetoCit should work with minimal effort, provided that you're doing things that are actually possible in javascript
16:14:41Miko_What am i doing wrong when the c code does not compile?
16:14:50Miko_ execution of an external program failed; rerun with --parallelBuild:1 to see the error message
16:15:05EXetoCthat indicates a compiler bug
16:15:33EXetoCrun it with that flag enabled, and then you can try to figure out if it has been reported already
16:15:45EXetoCset to 1 rather
16:18:55*sepisoad quit (Quit: Leaving)
16:21:02*vendethiel quit (Ping timeout: 248 seconds)
16:24:51ArrrrSo, 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:41EXetoCdo you mean foo(str) or something else?
16:26:32ArrrrThis declared http://nim-lang.org/docs/system.html#declared,expr
16:26:49*Miko_ quit (Ping timeout: 246 seconds)
16:27:10ArrrrI want to know if any ident inside a macro belongs to a declared identifier
16:29:55ArrrrWell, 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:50VarriountAraq: 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:16VarriountAraq: 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:20AraqVarriount: hrm, works for me.
17:35:03r-kuAraq: do you happen to know wth is at fs:30h on linux?
17:35:33Araqthe fs segment register points to thread local storage?
17:36:39r-kui have no idea \o/ i can tell this stuff on windows, not on linux :|
17:37:28r-kursp is like encrypted with value at fs:30h in setjmp()
17:37:41r-kui thought maybe i can abuse it to do more portable stack switching
17:37:48r-kubut universe is against us
17:39:08Araqdon't mess with the segment registers
17:39:37r-kui dont intend to mess with that. i just want it to give me rsp value :|
17:39:46r-kumust be some kind of anti-exploit protection i guess
17:40:44*vendethiel quit (Ping timeout: 256 seconds)
17:42:13AraqVarriount: 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:09Araqapense: you're a machine! :-)
17:59:28r-kuAraq: 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:21Arrrrwhy would adding a value to a table, inside a macro, fail?
18:00:32Arrrr(with string key)
18:00:39r-ku(show the error)
18:00:52Arrrr(Error: unhandled exception: regs[rb].node.kind == nkRefTy [AssertionError])
18:01:01Arrrr(rb being the name of the module)
18:01:23ArrrrDoesnt it like ref types?
18:01:23*dgellow joined #nim
18:01:25r-kuit checks if something is reference and fails when its not
18:01:41r-kuif im not mistaken
18:01:46AraqArrrr: the VM hates the table's implementation and fails to run it at compile-time
18:02:12Arrrri see, ugly thing
18:02:52Arrrrthen, how could i change inside a macro if certain type has been defined already?
18:03:04ArrrrHaving only the name as a expr
18:03:21AraqArrrr: hard to say without knowing what you like to accomplish
18:04:15Araqr-ku: nope wasn't aware but it's hardly news that C becomes ever more unusable as time passes
18:04:38Arrrri need a table using defined objects as keys.
18:05:01ArrrrSince i cannot use typedesc, i need another thing
18:05:02Araq"pointer encryption" for "security" my ass
18:05:37r-kuim also unconvinced of benefits..
18:05:58Araqa configure script could send the entire contents of my home dir to some foreign server
18:06:04r-kuguess nim will have to bundle its own setjmp/longjmp
18:06:55Araq"security" is a word without meaning.
18:07:09r-kusee thing is.. bash that sends your home dirs has pointers encrypted !!
18:08:08Araqnot to mention they should have stopped using fucking C decades ago when they would truely care about security ...
18:08:56r-kuyou know they must love coding bit more abstracted asm
18:09:02r-kulike that guy who wrote fasm
18:09:06r-kuall written in 32 bit asm
18:09:14r-kuand hes making new version that will work on arm or something
18:09:19r-kuall in 32 bit asm
18:09:37r-kuor guy who wrote x64 debugger - in asm
18:09:47r-kusomeone started entire OS - all in asm
18:09:55r-kumasochism..
18:10:10r-kubtw cant use fasm cause it wont build .o that gcc eats..
18:10:24EXetoCtemple OS? :p
18:11:13Araqr-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:16r-ku29 folders in glibc/sysdeps. thats arch-dependent code
18:15:24r-kulots of setjmp/longjmp implementations..
18:15:53Araqwell the setjmp based implementation will always be there as a fallback solution
18:16:14Araqand as I said, there are 3 archs left anyway :P
18:16:23r-kuwhat i have in mind is grabbing some of their implementations and bundling w/o register mangling
18:16:36r-kubigger problem is making all compilers happy w/ that asm
18:16:53r-kuunless we adapt and yasm that code
18:19:02Araqbtw we need to look at licenses, I don't want to bundle (L)GPL code anymore
18:21:12r-kuwell rats. glibc is VERY gpl, kernel also quite gpl (it also has said impls)
18:21:39AraqD's GC uses inline assembler for register marking
18:21:51Araqand is Boost I think so it's save to copy from that
18:22:04r-kumusl libc is MIT btw
18:22:14Araqor that yeah
18:24:18r-kumusl implementations are a lot cleaner too
18:24:38r-kucompared to it glibc is maze of headers
18:26:54*Miko_ joined #nim
18:30:01r-kuvasm supports lots of archs. x86/x64/arm/other. might be worth to look into https://en.wikipedia.org/wiki/Vasm
18:32:50drewsremCan 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:52r-kuecho tree_repr(thing)
18:34:25drewsremr-ku, much obliged
18:34:37*Ven joined #nim
18:35:12r-kur-ku - the documentation AI
18:35:33r-kuim goner, good night crowd
18:36:05drewsremsleep tight
18:47:16*Miko_ quit (Ping timeout: 264 seconds)
18:48:50Arrrrwhat is this: ???(???, 0) Error: VM: immediate value does not fit into an int16
18:49:37EXetoCbug?
18:51:53Arrrrmaybe, because i changed a thing and now i got sigsegv
18:52:28drewsremWhat could I use to model object hierarchies in nim? - e.g. an event hierarchy
18:55:19*Miko_ joined #nim
18:57:09drewsremnvm, just saw there's inheritance
18:58:49*vasher_ quit (Quit: Connection closed for inactivity)
19:05:13AraqArrrr: can you please report these issues properly?
19:07:13ArrrrDont worry, i dont have the problem anymore
19:07:56EXetoCchances are someone else is going to run into the same issue
19:09:11ArrrrBut i dont even know what was the problem, just burnt the file and moved on
19:09:27*jszymanski joined #nim
19:10:45EXetoCAraq is the one who needs to know that
19:10:49EXetoCin most cases anyway
19:14:10Arrrrok, 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:17VarriountAraq: I don't have a website.ini file. If I create a blank one, then only part of the website gets generated.
19:32:48VarriountAraq: Also, what's the purpose of doc/nimdoc.css ?
19:33:29AraqVarriount: https://github.com/nim-lang/Nim/blob/devel/web/website.ini
19:33:40Araqgithub has it
19:34:05VarriountWeird.
19:34:26Araqwell our docs have CSS so that they look better
19:34:52VarriountAraq: Yeah, but it appears that the CSS is actually in nimdoc.cfg
19:34:59VarriountIn a string.
19:38:31VarriountSee: https://github.com/nim-lang/Nim/blob/devel/config/nimdoc.cfg#L90
19:42:09Araqmaybe it started as an external file and then the config assimilated it
19:50:32Varriountnom nom
19:52:52*Matthias247 joined #nim
20:00:19*FedeOmoto joined #nim
20:02:09VarriountAraq: 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:21Araqno, work on something important please
20:07:36Araqalso it's called "gorge" not gulp ;-)
20:09:42*drewsrem quit (Quit: Leaving)
20:12:58VarriountAraq: 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:49Araqoki
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:51Miko_I'm doing some bitmagick and I'd like some feedback on my code
20:36:52Miko_http://www.pastebin.ca/3054715
20:37:23*pregress_ quit (Read error: Connection reset by peer)
20:37:30Miko_These converstaions to uint8 do make the code somewhat unreadable
20:37:40*pregressive joined #nim
20:37:49avsejAraq, https://github.com/nim-lang/Nim/pull/3093#issuecomment-120120380
20:40:14Miko_In the doc it says nim wants to discurrate the usage of unsigned integers, i wonder why
20:45:17EXetoCyou can specify literals of all int types
20:45:37EXetoChttp://nim-lang.org/docs/manual.html#lexical-analysis-numerical-constants
20:46:27*X67r quit (Ping timeout: 256 seconds)
20:46:40EXetoCMiko_: because unsigned integers are rarely needed
20:49:47EXetoChttps://github.com/nim-lang/Nim/wiki/Nim-for-C-programmers#unsigned-integers
20:51:57Miko_Thanks for hints
20:53:14*wedowmaker quit (Quit: Connection closed for inactivity)
20:56:44AraqMiko_: most of these are superfluous though
20:57:00Araqbyte and 12 == 34 # should work
20:57:06Araqer I mean
20:57:12Araq(byte and 12) == 34 # should work
20:57:51*raza quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
21:00:42Miko_mmm
21:01:16Miko_In the case construct i didn't state the unsigned and it does work
21:02:11Miko_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:18Miko_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:55Miko_Ok, the documentation say right that unsigned integer arithmetic is not supported on the js backend
21:13:11*apense joined #nim
21:13:20Miko_I wonder what's the way the deal with a bitstream anyway in nim
21:13:34Miko_Or a blob
21:15:26Miko_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:42wu-leereactormonk: hi, been a while. did your forked blink.nim work for you?
21:27:00wu-leeI managed to get mine to work, if...
21:27:26wu-lee-d:release and -opt:<anything> off
21:28:21wu-leeboth passC and passL are "-mmcu=atmega168"
21:29:06wu-leeboth avr.standalone.gcc.exe and avr.standalone.gcc.linkerexe are "avr-gcc"
21:29:37wu-leehowever, I could not get the arduino delay() function to work (although I could link and upload ok)
21:30:28reactormonkwu-lee, nope, I don't think so
21:30:45reactormonkgot distracted by other stuff :-( Having some fun with elisp
21:31:29wu-leedo you know if it was the delay() function which was the problem
21:31:44*drewsrem joined #nim
21:32:15reactormonkI 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:30reactormonk... which didn't link correctly, apparently too big or something :-/
21:32:42wu-leeyes, I saw your fork and copied that part
21:32:51reactormonkThen I tried to find out how to do it in pure C, that's +/- where I broke off
21:33:17wu-leeworking version is current head of arduino branch in my github repo
21:33:29reactormonkCan you compile it from c?
21:33:32reactormonkehh, via nim c
21:33:40wu-leeI didn't link quite so many c files however
21:33:56wu-leeI can now compile in C and with the nim compiler
21:34:20wu-lee(the latter took some experimenting)
21:34:41reactormonk^^
21:35:20*gokr quit (Ping timeout: 256 seconds)
21:35:24wu-leevia "nim c" the compiler? yes
21:38:09wu-leeI think i remember seeing gcc complain when compiling blink.c with a delay() call if it wasn't using -O3
21:38:36EXetoCMiko_: http://nim-lang.org/docs/streams.html
21:38:46EXetoCwhich is what I need to start using
21:38:49wu-leeso my hypothesis is that delay() requires it to work (but who knows why)
21:40:47Miko_EXetoC, Well, it's not exatly a "string" stream, but more a cstring stream
21:41:29Miko_but that sounds exactly what javascript typed arrays should be encapsulated into
21:41:32Miko_thanks
21:42:33EXetoCI 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…)