<< 26-05-2016 >>

00:15:33*Trustable quit (Remote host closed the connection)
00:16:26*yglukhov joined #nim
00:19:12*gagagugu quit (Quit: Leaving)
00:20:58*yglukhov quit (Ping timeout: 258 seconds)
00:21:42*space-wizard quit (Ping timeout: 276 seconds)
00:34:47*space-wizard joined #nim
00:50:34*space-wizard quit (Ping timeout: 272 seconds)
00:50:40*libman quit (Remote host closed the connection)
00:52:43*yglukhov joined #nim
00:57:27*yglukhov quit (Ping timeout: 276 seconds)
01:28:56*yglukhov joined #nim
01:33:14*space-wizard joined #nim
01:33:15*yglukhov quit (Ping timeout: 244 seconds)
01:38:08*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
01:52:56*space-wizard joined #nim
02:05:32*yglukhov joined #nim
02:09:33*yglukhov quit (Ping timeout: 246 seconds)
02:16:26*kulelu88 quit (Quit: Leaving)
02:29:29*yglukhov joined #nim
02:34:04*yglukhov quit (Ping timeout: 264 seconds)
03:01:04*space-wizard quit (Read error: Connection reset by peer)
03:02:04*space-wizard joined #nim
03:02:56*space-wizard quit (Client Quit)
03:04:06*space-wizard joined #nim
03:04:24*space-wizard quit (Client Quit)
03:05:04*yglukhov joined #nim
03:10:03*yglukhov quit (Ping timeout: 276 seconds)
03:11:22*|2701 quit (Quit: Connection closed for inactivity)
03:27:50*space-wizard joined #nim
03:28:47*PMunch quit (Remote host closed the connection)
03:29:29*space-wizard quit (Client Quit)
03:29:32*yglukhov joined #nim
03:34:22*yglukhov quit (Ping timeout: 260 seconds)
03:45:03*StarBrilliant quit (Ping timeout: 250 seconds)
03:46:37*flyx quit (Excess Flood)
03:47:09*flyx joined #nim
03:47:16*fowl quit (Ping timeout: 272 seconds)
03:48:42*notfowl joined #nim
04:01:18*StarBrilliant joined #nim
04:05:30*yglukhov joined #nim
04:09:57*yglukhov quit (Ping timeout: 260 seconds)
04:21:02*dhk joined #nim
04:24:00*space-wizard joined #nim
04:25:20*dhk quit (Client Quit)
04:27:33*gsingh93 joined #nim
04:28:42*space-wizard quit (Ping timeout: 276 seconds)
04:38:42*dhk joined #nim
04:40:57*lubos_cz quit (Ping timeout: 244 seconds)
04:42:07*yglukhov joined #nim
05:02:05*GangstaCat quit (Quit: Leaving)
05:04:22*dhk quit (Quit: Leaving)
05:19:51*GangstaCat joined #nim
05:28:33*endragor joined #nim
05:38:21*endragor quit (Remote host closed the connection)
05:51:47*endragor joined #nim
05:53:50*yglukhov quit (Remote host closed the connection)
06:19:30*endragor_ joined #nim
06:23:15*endragor quit (Ping timeout: 244 seconds)
06:40:22*endragor_ quit (Remote host closed the connection)
06:40:52*endragor joined #nim
06:43:24*GitGud joined #nim
06:43:57*GitGud quit (Remote host closed the connection)
06:43:58*gugugaga joined #nim
07:12:48*gugugaga is now known as gagagugu
07:15:49*gokr joined #nim
07:19:31*endragor quit (Remote host closed the connection)
07:28:47*yglukhov joined #nim
07:39:01*endragor joined #nim
07:45:12*lubos_cz joined #nim
07:54:06*kingofoz joined #nim
07:58:47*Trustable joined #nim
08:04:30cheatfateAraq_, maybe this feature not implemented?
08:05:09*lubos_cz quit (Ping timeout: 276 seconds)
08:05:40*lubos_cz joined #nim
08:31:01*Matthias247 joined #nim
08:32:35Araq_semcall.nim(111) notFoundError
08:32:35Araq_sigmatch.nim(262) describeArgs
08:32:36Araq_semexprs.nim(39) semOperand
08:32:51Araq_cheatfate: ^ it generates an error while producing an error
08:32:58Araq_hiding the real error lol
08:34:03cheatfateAraq_, lol
08:35:25yglukhovcheatfate: commented on your gist just in case you still need it =)
08:35:40*Pisuke joined #nim
08:36:22yglukhovAraq_: mind looking at https://github.com/nim-lang/Nim/pull/4223?
08:37:14cheatfateyglukhov, wow nice
08:39:57Araq_hmmm I spend more time reviewing code than writing code ... I guess that means Nim is successful.
08:41:55cheatfateAraq_, you need to take a look yglukhov just modified my gist and it works https://gist.github.com/cheatfate/622f3720ee04c6a7b82ed18dac594723
08:42:06cheatfateAnd now i have a question how to make `bbody` optional
08:42:11cheatfateis it possible?
08:42:17yglukhovcheatfate: overload?
08:42:46cheatfateyeah it will work
08:42:50cheatfatei think :)
08:42:52cheatfatelets test
08:43:04Araq_why does describeArgs do any type resolution? that's madness
08:44:10cheatfateyglukhov, thanks
08:44:47yglukhovwelcome ;)
08:47:06Araq_cheatfate: did you have a look at the blog from wlan's author?
08:47:30Araq_he describes lots of useful techniques of how to create a super fast http server
08:47:40cheatfateAraq_, i want to take a look
08:51:02cheatfateyou mean lwan or wlan (https://tia.mat.br/posts/2012/09/29/asynchronous_i_o_in_c_with_coroutines.html this link?)
08:52:17Araq_your link yes. and all the other articles on that site.
08:53:56cheatfateAraq, i checked it yesterday and not totally agree with him, just because he using only epoll but even with epoll we can start N accept threads and this can be better
08:55:30cheatfateepoll, kqueue, windows iocp all a thread safe
08:57:14cheatfateiocp getqueuedcompletionstatus() (equal to epoll's epoll_wait() or kqueue's kevent()) must be used in N threads to achieve maximum performance...
08:58:00cheatfatebut in my way there much harder to schedule coroutines in particular threads...
08:58:33Araq_well his architecture sounds reasonably simple and it wins benchmarks
08:58:59Araq_why complicate it any further for uncertain never measured benefits?
08:59:52Araq_he uses your idea to use the file handles as an array index so he needs no shared hash table.
08:59:55Araq_correct?
09:02:16cheatfatei'm not using hash table anymore it is not needed in posix systems
09:02:33cheatfateand you are correct
09:05:23cheatfatebut i need hash tables to implement windows select()...
09:06:09cheatfatebecause windows has not getrlimit() and looks like last fd number can be 16,000,000
09:06:19cheatfatetoo big to allocate table
09:08:05cheatfatei'm already done with kqueue and epoll... and i have already adopted it with asyncdispatch.nim, there no more excessive memory allocations and i think it a threadsafe
09:08:20cheatfatebut to replace old selectors.nim i need to make windows select()
09:09:24cheatfateand to be full i need to implement /dev/poll (old solaris and based distros) and event ports (new solaris)
09:13:43cheatfateAraq_, what do you think about this templates i want to add to sharedtables.nim: https://gist.github.com/cheatfate/7b33bcb29e5cfe79732e5d1196efb1c3
09:14:25cheatfateBut i dont like `value` parameter
09:14:44Araq_you could .inject 'it'
09:14:52Araq_that's what many templates do.
09:15:03Araq_and then name it 'withIt' lol
09:15:44cheatfateso i can inject value to body1?
09:16:34*aharlan joined #nim
09:16:40cheatfatei want to inject `t.data[index].val` to avoid `memcpy`
09:18:14cheatfateits possible?
09:18:23Araq_that's hmm possible if you inject a nullary template
09:23:08cheatfatethere is another way is it possible to convert `t.data[index].val` to `var B` reference
09:23:34cheatfatewithout calling to proc?
09:25:16cheatfatebut of course i can make it to be `ptr` with addr(t.data[index].val)
09:29:33Araq_yeah, that's usually what I do, use 'addr'
09:32:28Araq_yglukhov: how can I use your fonts stuff? is it ready?
09:33:41*aharlan quit (Quit: Textual IRC Client: www.textualapp.com)
09:41:08Araq_cheatfate: but yeah, I will accept templates like these, as I said.
09:43:27yglukhovAraq_: haven't tested font rendering without nimx window, but i think it should work. Create a nimx.context, after gl is initialized: let myContext = newGraphicsContext(). Then create a nimx.font: let myFont = systemFont(). Then draw: myContext.drawText(myFont, newPoint(10, 10), "Hello world!")
09:44:27cheatfateyglukhov, and how is font render quality, because last version of Araq's nimedit looks weird :)
09:45:04yglukhovcheatfate: http://yglukhov.github.io/nimx/livedemo/main.html
09:46:06cheatfateand it still looks weird maybe usable by game but not for editor
09:47:23cheatfatewhat are you using for font rendering?
09:48:25yglukhovcheatfate: well, currenlty thats the best i could do. i guess i would need an expertise from someone who is a font rendering expert :)
09:49:35cheatfatei'm not rendering font expert but some years ago i have configured freetype2 to render fonts on linux like sublimetext
09:50:13cheatfatei even checked my results pixel by pixel
09:50:22cheatfateand it was equal
09:51:35yglukhovcheatfate: i'm using nimx for font rendering =). native version uses stb_truetype to generate the bitmap. webgl version uses web 2d canvas to make the bitmap. then the bitmap is processed to distance fields with this algorithm: https://github.com/yglukhov/ttf/blob/master/private/edtaa3func.nim then the texture is multisampled in the shader
09:53:05yglukhovinitial bitmap is generated for font size 64 to allow better "resolution independance" =)
09:55:36yglukhovcheatfate: i think i could do crisp sharp fonts if the bitmap is rendered for exactly requested font size and with no distance fields, but that doesn't sound flexible/effective enough...
09:56:36cheatfateyglukhov, i think Araq is waiting until you make crisp sharp fonts :)
09:57:53yglukhovcheatfate: you can try open fonts tab, and drag the size slider and see that the font is sharp on bigger sizes. you can apply 3d transformations and it still remains cool. unfortunately, with smaller sizes it gets blurry a bit, and i'm not sure what to do about it
09:58:36yglukhovthe best thing about it currently is that only one set of textures is used for all font sizes.
09:59:30Araq_"i'm not rendering font expert but some years ago i have configured freetype2 to render fonts on linux like sublimetext" dude, then help me :D
10:00:30yglukhovi think (hope) that the key to this problem should be somewhere in the shader.
10:00:45Araq_yglukhov: "after GL is initialized", I have no GL context.
10:01:08yglukhovAraq_, but you have sdl window, no?
10:01:52yglukhovhow do you do the rendering?
10:02:18cheatfateAraq_, i know you dont want to make your editor to use GTK/QT but why you are using SDL then?
10:03:22Araq_cheatfate: it was just a proof of concept gone wild. I wanted to play with immediate mode UIs
10:03:50cheatfateAraq_, i think you need to switch to libui and continue to work on your editor
10:04:10yglukhovoh come on guys, i don't think it's hard to do a fixed-size font rendering.
10:04:32yglukhovbasically theres just a couple of lines to adjust in nimx to test it.
10:04:48cheatfateyglukhov, Text Editor needs the best font rendering you can achieve :)
10:05:17Araq_yglukhov: alright alright, let me test it
10:07:03Araq_cheatfate: I thought about backporting all the essential features to Aporia but it's just so much work
10:10:59Araq_Downloading https://github.com/yglukhov/jnim into /tmp/nimble_14583/githubcom_yglukhovjnim using git...
10:11:00Araq_Traceback (most recent call last)
10:11:00Araq_nimble.nim(960) nimble
10:11:01Araq_nimble.nim(892) doAction
10:11:04Araq_nimble.nim(538) install
10:11:05Araq_nimble.nim(367) installFromDir
10:11:07Araq_nimble.nim(273) processDeps
10:11:09Araq_nimble.nim(536) install
10:11:11Araq_nimble.nim(495) downloadPkg
10:11:13Araq_download.nim(191) doDownload
10:11:16Araq_download.nim(91) getTagsListRemote
10:11:17Araq_Error: unhandled exception: Unable to query remote tags for https://github.com/yglukhov/jnim. Git returned: fatal: unable to access 'https://github.com/yglukhov/jnim/': Failed to connect to github.com port 443: Operation timed out
10:11:19Araq_ [OSError]
10:11:51*fastrom joined #nim
10:14:20*Arrrr joined #nim
10:14:20*Arrrr quit (Changing host)
10:14:20*Arrrr joined #nim
10:24:45*gagagugu quit (Quit: Leaving)
10:48:38dom96Araq_: what's your version of git?
10:49:08Araq_hmm never mind, I updated nimble and after 1 more hickup it installed, yummy
10:50:03dom96good
10:51:11Araq_still I think it should retry after a timeout
10:51:53dom96Why should it be Nimble's job? Git should.
10:53:38cheatfatedom96, i dont think Git will do reconnect :)
10:54:26dom96Also, doesn't it kind of defeat the purpose of that error?
10:56:29*arnetheduck joined #nim
11:00:15Araq_ok, whatever, what's nimble's policy for stack traces?
11:00:39Araq_are they gone now? cause a stack trace indicates a nimble bug to me.
11:01:47dom96Only NimbleError's should be allowed to crash Nimble.
11:02:59dom96So yes, this is a bug, it should be caught and wrapped in a NimbleError.
11:09:43Araq_no, it's not a bug anymore, that stack trace came from an old nimble
11:09:51Araq_but good to know.
11:10:26Araq_would a "script gen" feature make sense? where nimble generates a script that describes what nimble would do?
11:29:19Araq_yglukhov: for the nimx example I get ".nimble/pkgs/nimx-0.1/nimx/sdl_window.nim(174, 34) Error: undeclared identifier: 'captureMouse'"
11:30:10yglukhovAraq_: either use sdl 2.0.4 or comment captureMouse related strings in nimx.sdl_window
11:31:02Araq_shouldn't the nimble package install SDL 2.0.4 (you mean Nim SDL, right?)
11:32:00*StarBrilliant quit (Ping timeout: 260 seconds)
11:32:35dom96Do I really need to explicitly write '.cint' after each int literal in this: var points: array[4, (cint, cint)] = [(300, 400), (300, 200), (400, 400), (400, 200)] ?
11:32:35*avsej quit (Ping timeout: 260 seconds)
11:34:57Araq_I think so.
11:35:01*StarBrilliant joined #nim
11:35:11dom96That is *incredibly* annoying.
11:35:21Araq_so learn how to use Nim :P
11:35:42Araq_template ci(a, b): untyped = (a.cint, b.cint)
11:35:49*avsej joined #nim
11:35:49*avsej quit (Changing host)
11:35:49*avsej joined #nim
11:35:57Araq_ar points: array[4, (cint, cint)] = [ci(300, 400), ci(300, 200), ci(400, 400), ci(400, 200)]
11:36:13dom96Still a PITA
11:36:27dom96What is the reason that this doesn't just work?
11:38:56*Matthias247 quit (Read error: Connection reset by peer)
11:41:21Araq_there is no super duper context sensitivity for int literals
11:47:21dom96oh well. No nice 'N' will be drawn on the screen for my book's SDL FFI example.
11:49:04*Demon_Fox joined #nim
11:50:44Araq_I can write a macro that deeply annotates everything
11:55:12dom96Can't the compiler look at the lhs of the expression and work out the type of the array constructor from that?
11:59:37Araq_it does that to some extend, but it's "overloading by return value"
11:59:55Araq_instead of determineType(x): Type
12:00:14Araq_you have annotate(x, Type)
12:00:49Araq_which doesn't work *at all* when you leave out the ': array[4, (cint, cint)]'.
12:01:07Araq_so yeah, why use one mechanism when you can use two.
12:01:27Araq_why try to create a simple language when you can have a complex one?
12:05:04CcxCZIcyFoxy: So, what is the proper place to discuss your capability-secure-rust? :-)
12:12:05dom96Araq_: Because it annoys me :P
12:20:24CcxCZAraq_: Out of curiosity, have you ever looked at object-capability languages/libraries? I find the design inspiring, though I haven't had opportunity to play with one yet.
12:24:39CcxCZIt's basically the idea of explicitly limiting what each part of code might do by what it has a "reference" to (since first implementations were OO-based, but there FP ones too).
12:31:29*nsf quit (Quit: WeeChat 1.4)
12:46:04*|2701 joined #nim
12:52:58*Arrrr quit (Quit: WeeChat 1.4)
13:09:06*PMunch joined #nim
13:10:48*fredrik92 joined #nim
13:25:53cheatfateAraq_, please take a look https://github.com/nim-lang/Nim/pull/4224
13:38:44dom96hrm. That sucks. I can't mix dynlib and importcpp?
13:39:09*gokr quit (Ping timeout: 250 seconds)
13:48:08*heinrich5991 quit (Ping timeout: 244 seconds)
13:54:37IcyFoxyCcxCZ: A query
14:00:03Araq_CcxCZ: I've looked at them and very generally speaking
14:00:16Araq_everything that you attach to a type sucks
14:00:32Araq_and everything that you attach to a proc/function/method/whatever rules
14:01:16*irrequietus joined #nim
14:07:07CcxCZAraq_: Yeah, it seems to be very dynamic in that you pass capabilities into a piece of code only when it needs them.
14:08:42*heinrich5991 joined #nim
14:12:59*lubos_cz quit (Read error: Connection reset by peer)
14:13:46yglukhovAraq_: no, i meant the sdl2.dll
14:14:38yglukhovfound some problems with the fonts meanwhile. i guess they should get crisper when i fix it =)
14:15:47yglukhovbbl
14:32:00*yglukhov quit (Ping timeout: 272 seconds)
14:40:17*Arrrr joined #nim
14:40:17*Arrrr quit (Changing host)
14:40:17*Arrrr joined #nim
14:40:23tautologicocapabilities are an old idea, they seem neat initially but nobody managed to make them work
14:44:50*nsf joined #nim
14:52:46*PMunch quit (Ping timeout: 252 seconds)
15:06:46*PMunch joined #nim
15:08:43*space-wizard joined #nim
15:08:44*MyMind joined #nim
15:09:21*Pisuke quit (Read error: Connection reset by peer)
15:13:15*Pisuke joined #nim
15:13:34*MyMind quit (Ping timeout: 260 seconds)
15:26:36*sorakun joined #nim
15:27:40*fredrik92 quit (Ping timeout: 260 seconds)
15:34:39*fredrik92 joined #nim
15:39:23*yglukhov joined #nim
15:42:04ldleworkertautologico: join #monte :)
15:43:25ldleworkerand say the same thing
15:43:34*sorakun quit (Remote host closed the connection)
15:44:03*yglukhov quit (Ping timeout: 276 seconds)
15:46:37*irrequietus quit ()
15:52:07tautologicoinspired by E? E was one of the last attempts at capabilities
15:52:22tautologicoI'm not saying it can't work, it just never worked before, at scale
15:54:04ldleworkertautologico: you should ask them questions though
15:54:09ldleworkerthey love talking about their ideas
15:54:13ldleworkerand they are cool guys
15:55:50tautologicoI'll take a look
16:07:23*fredrik92 quit (Read error: Connection reset by peer)
16:12:34*ludocode quit (Read error: Connection reset by peer)
16:13:27*fastrom quit (Read error: Connection reset by peer)
16:13:35*fastrom joined #nim
16:13:46*yglukhov joined #nim
16:17:20*ludocode joined #nim
16:17:36*user2 joined #nim
16:18:34*arnetheduck quit (Ping timeout: 252 seconds)
16:33:09*yglukhov quit (Remote host closed the connection)
16:33:10*endragor_ joined #nim
16:34:15*PMunch quit (Ping timeout: 258 seconds)
16:36:42*endragor quit (Ping timeout: 276 seconds)
16:37:33*endragor_ quit (Ping timeout: 240 seconds)
16:38:21*libman joined #nim
17:04:50*gugugaga joined #nim
17:29:45kieris it possible to check is a proc is defined in a 'when' condition?
17:30:19kierspecifically, inside a generic function I want to do one of two different things depending on whether $ is implemented for the generic type or not
17:35:45ArrrrYou can use http://nim-lang.org/docs/system.html#declared,expr
17:35:58ArrrrOr http://nim-lang.org/docs/system.html#compiles,expr
17:37:46kierawesome, ty
17:39:13*gugugaga quit (Ping timeout: 250 seconds)
17:41:22*|2701 quit (Quit: Connection closed for inactivity)
17:43:51*gugugaga joined #nim
18:04:21*space-wizard quit (Ping timeout: 246 seconds)
18:05:39*gugugaga quit (Ping timeout: 250 seconds)
18:05:47*kulelu88 joined #nim
18:05:47*kulelu88 quit (Changing host)
18:05:47*kulelu88 joined #nim
18:07:23*kulelu88 left #nim (#nim)
18:09:00*gugugaga joined #nim
18:12:02*fastrom quit (Quit: Leaving.)
18:15:23*space-wizard joined #nim
18:19:40*gugugaga quit (Quit: Leaving)
18:28:34*Pisuke quit (Ping timeout: 260 seconds)
18:51:09*gugugaga joined #nim
19:04:29*Arrrr quit (Quit: WeeChat 1.4)
19:27:53*gokr joined #nim
19:30:23*PMunch joined #nim
19:33:33*Jesin joined #nim
19:38:25*Matthias247 joined #nim
20:04:27*derka joined #nim
20:10:47libmanVote up Nim - http://www.slant.co/topics/5984/~productivity-enhancing-well-designed-and-concise-rather-than-just-popular-or-time-tested-programming-la
20:14:20*Jesin quit (Quit: Leaving)
20:14:29derkaHello Guys
20:19:08libmanhello derka
20:19:15derkaHello Libman
20:19:28dom96hello derka
20:19:34derkahi dom
20:19:47derkajust finished reading your latest chapter about concurrency
20:21:44dom96derka: Awesome, what did you think? :)
20:21:54dom96libman: voted. Also added 'async' as a pro
20:22:22derkaI liked it, though i found the regexp and stuff part was too long
20:22:24derkalol
20:23:25dom96derka: fair enough :)
20:23:34*space-wizard quit (Read error: Connection reset by peer)
20:23:49dom96it was kind of doing the same thing but differently, guess that can get boring
20:24:03dom96just wanted to teach as much as possible
20:24:04derkais there any way to do functions like __sync_add_and_fetch in Nim over shared variables
20:26:16derkano equivalent of __sync_add_and_fetch /
20:26:18derka??
20:27:19*jeffc joined #nim
20:29:12libmanfeh --bg-tile http://libman.org/img/bak/20160526-NimWin.jpg
20:30:42dom96derka: hrm, not sure.
20:30:43GangstaCatvoted for runtime speed and async because that's clearly the advantages, but what clearly wrap this is the awesome syntax
20:31:04dom96derka: not familiar with that tbh. Araq_, any ideas?
20:31:06derkai am struggling with the fact that gc is per thread
20:31:22derkaI want to move something i have in C in Nim
20:31:38dom96derka: maybe if you could describe what you are trying to do I could help
20:31:46derkabut the fact that i can’t easily share stuff is blocking me, un less i dont use gc
20:31:55derkaimagine you have a counter
20:32:04derkaall thread increase the counter
20:32:35dom96I think my chapter explains how to use shared memory doesn't it?
20:32:52dom96and in fact uses what you are describing as an example
20:35:22derkayes but it is not as efficient as __sync_add_and_fetch
20:35:25jeffcQ about nimble package + c source files - Is it possible to (either via a pragma or otherwise) append to the C include path (beyond passC -I...) that will allow me to include a header from my installed nimble package?
20:35:54cheatfateAraq_, is there reason why `mget` is deprecated in tables.nim?
20:36:03derka __sync_add_and_fetch increment a variable atomatically accross theads without using any lock and in a single cpu instruction
20:36:20derkai meant atomically
20:36:53*space-wizard joined #nim
20:37:37*space-wizard quit (Max SendQ exceeded)
20:37:46*irrequietus joined #nim
20:38:24*space-wizard joined #nim
20:38:26*gugugaga quit (Ping timeout: 258 seconds)
20:39:59dom96jeffc: hrm, won't {.passC: "-I ...".} work?
20:40:38jeffcdom96: The issue is that some of the C source files include that header, so once they get moved into the nimcache, compilation fails
20:40:56irrequietusdom96: https://twitter.com/sarahjeong/status/735924335412543488
20:41:20irrequietusthis is big, for everybody, especially for everybody doing a language of their own.
20:41:56dom96Indeed. Just saw on reddit :)
20:43:04dom96jeffc: hrm. Sounds like a problem indeed.
20:43:32cheatfatederka, try to look on lib/system/atomics.nim
20:43:38derkaok gh
20:43:39derkathx
20:43:54dom96jeffc: I guess you need some way to pass -I<path/to/nimble/pkg/header.h> when your package is being compiled?
20:49:02dom96but perhaps it's the compiler's responsibility to copy the header for you into nimcache
20:50:19gokrOk, I know I am an idiot... if I have two Foo instances, (type Foo = ref object) - how can I check if they are in fact the same? (check if the pointer is the same)
20:51:59derkadom96 this would be a good additional stuff to your counter example, just using atomicInc
20:52:10derkathx a lot cheatfate
20:52:28cheatfateAraq_, np
20:53:37cheatfateAraq_, i have found info in NEWS but i want to ask a question why we lose possibility to use reference? now all methods using `memcpy`...
20:53:42dom96gokr: isn't `==` enough?
20:53:49cheatfateAraq_, or maybe you just forgot?
20:53:56gokrHmmm, right... I have asked this before :)
20:54:36gokrdom96: I recalled incorrectly that == did some deep comparison, thanks.
20:55:04*space-wizard quit (Read error: Connection reset by peer)
20:55:06dom96gokr: hehe. I was sitting here thinking about it for 5 minutes whether it does or not :)
20:55:24dom96I even looked at its definition, but gave up after I saw "{.magic.}"
20:55:41gokrI am so used to Smalltalk where "identity" has its own method.
20:56:06derkacheatfate which news are you referring to? URL ?
20:56:31Araq_derka: atomicInc is in system.nim
20:56:56derkayeah i saw that thanks to cheatfate Araq_ thanks a lot
20:56:58Araq_cheatfate: hmmm? no idea what you mean. memcpy is only used when ordinary '=' won't do.
20:57:05jeffcdom96: that was my thought, perhaps a pragma that specifies a resource file that needs copied into nimcache
20:57:19cheatfatederka, https://github.com/nim-lang/Nim/blob/devel/web/news.txt
20:57:32dom96derka: thanks, will make a note to mention it in Ch6.
20:57:35derkathx cheatfate
20:57:43derkayeah dom96 this would be really nice
20:57:46dom96Araq_: What do you think about jeffc's issue?
20:57:57Araq_what is the issue?
20:58:34cheatfateAraq_, i just want to get reference to value stored in table...
20:58:54dom96Araq_: just search 'jeffc' in irclogs
20:59:35cheatfateAraq_, there was possible with `mget` but now it deprecated and replaced with getOrDefault() and event not see `default`...
21:02:26Araq_cheatfate: no, mget is now simply []
21:03:20cheatfateAraq_, so now nim support reloading return value?
21:04:23*space-wizard joined #nim
21:04:48cheatfateAraq_, there currently two `[]` and i think when i try to use `[]` first one will be used...
21:05:13Araq_it's called "overloading by var-ness"
21:05:42Araq_it's not overloading based on how the result will be used, but instead whether the table param is an L-value
21:05:49Araq_if it is, the 'var T' version is used
21:06:06Araq_you can only get a mutable view on the data when the data is mutable to begin with.
21:06:35jeffcAraq_: My issue is that I am writing a nim wrapper for a C library that is only distributed as source + headers. When everything is copied to nimcache, the headers are excluded, causing a build failure
21:06:36Araq_note that a mutable view is exactly what you need to avoid, since it must all happen while the lock is held, but you know this.
21:06:54jeffcI can include them with passC -I<relative_path_to_header>, but that doesn't work with nimble
21:07:02jeffconce the package is installed
21:07:31Araq_jeffc: well there are a couple of solutions
21:07:35cheatfateAraq_, now i'm completely confused
21:08:13cheatfateAraq_, we dont using tables.nim for multithreading environment
21:08:24cheatfatethere sharedtables.nim for this case
21:10:24Araq_jeffc: does the .c file #include the .h file on its own?
21:11:07jeffcAraq_: yes
21:11:09cheatfateAraq_, please tell me how i must use `[]` to use `proc `[]`*[A, B](t: var Table[A, B], key: A): var B {.deprecatedGet.} =` this variant not other one...
21:11:59Araq_cheatfate: hmm?
21:12:11Araq_you just use it.
21:12:17Araq_like the array's []
21:12:43Araq_jeffc: then one solution is to merge the header and the C file and refer to that merged file instead.
21:13:12Araq_because you're right, the header is not put into nimcache nor does the Nim compiler know about it, so it cannot copy it either.
21:13:32Araq_another solution is to copy the file in your .nims build script, which supports 'cpFile'
21:13:48cheatfateAraq_, if i need to modify some fields of `value` i need to use table[key].field1 = x, table[key].field2 = y, table[key].field3 = z, but with mget it was possible to v = table.mget(key), v.field1 = x, v.field2 = y, v.field3 = y... so there was not many calls to `[]` proc...
21:13:50Araq_well you need a nims script for that to work, obviously.
21:14:23jeffcAraq_: will that be compatible with nimble should I want to distribute this package?
21:14:27Araq_cheatfate: no, that wasn't possible with mget either.
21:14:31jeffc(the nims script)
21:14:51Araq_sure, well.
21:15:12Araq_in fact, you should use the Nimble NimScript integration ... ah hmmm
21:15:37notfowlHere jeffc https://github.com/fowlmouth/nanovg.nim/blob/master/nvg.nim I define ThisPath for the header which is somewhere in nimbles path
21:16:47Araq_cheatfate: one thing that the manual should contain (but doesn't) is that var x = mget(a, i) # used mget here to better get the point across
21:17:21jeffcnotfowl: That looks very useful indeed, I'll give that a shot!
21:17:25Araq_means that the value is copied into 'x' and so changes to x are not reflected in the original location
21:17:47Araq_to keep the 'var-ness' you need to do: var x = addr(mget(a, i))
21:18:29Araq_and then x[]. This was done on purpose to keep 'var T' memory safe. Well right now, it's not. But it will be.
21:19:03dom96That's awesome. Didn't realise something like `currentSourcePath` existed.
21:19:32dom96Somebody ought to document this in the wiki :)
21:20:00*space-wizard quit (Read error: Connection reset by peer)
21:20:22Araq_currentSourcePath? never heard of it.
21:20:40notfowlIt's in os
21:21:06dom96nope, it's in system http://nim-lang.org/docs/system.html#currentSourcePath
21:21:42notfowlAh
21:22:03Araq_ah, a instantiationInfo(-1, true).filename hack. nice.
21:22:10dom96hah
21:22:23*space-wizard joined #nim
21:22:25dom96Did zahary add this?
21:22:44Araq_maybe, maybe somebody else. instantiationInfo is quite popular
21:23:32jeffcnotfowl: Worked exactly as intended, thanks a bunch :)
21:27:52*space-wizard quit (Read error: Connection reset by peer)
21:31:49*|2701 joined #nim
21:32:18cheatfateAraq_, you are right, could i add withValue to tables.nim?
21:32:54Araq_yup
21:33:12Araq_seems like a good idea
21:33:43dom96jeffc: Glad you got it working. Which library are you wrapping? :)
21:34:40jeffcdom96: Me too :). I'm wrapping libfixmath. I've been using Nim for some automotive embedded work and I wanted to add easy to use fixed point support for DSP
21:36:07dom96jeffc: Wow. Automotive embedded work sounds like a lot of fun! Cool that you're doing it in Nim.
21:36:12*space-wizard joined #nim
21:45:44jeffcdom96: I enjoy it :). Nim has thoroughly impressed me for use in the embedded space. It's so low overhead and easy to get brought up
21:58:43*irrequietus quit ()
22:00:55*derka_ joined #nim
22:02:40*derka quit (Ping timeout: 250 seconds)
22:02:41*derka_ is now known as derka
22:04:38*shodan45 joined #nim
22:06:55Matthias247dom96, jeffc: anyone searching for a job in automotive embedded can ping me ;) Although not in nim
22:14:41*gokr quit (Ping timeout: 240 seconds)
22:16:36*kseg joined #nim
22:21:00*kseg quit (Ping timeout: 244 seconds)
22:24:12*space-wizard quit (Read error: Connection reset by peer)
22:25:33*Jesin joined #nim
22:26:29*space-wizard joined #nim
22:42:17cheatfateAraq_, https://github.com/nim-lang/Nim/pull/4226 same as for sharedtables.nim but without locks and with strange `mixin`
22:51:15*Trustable quit (Remote host closed the connection)
22:55:50*Matthias247 quit (Read error: Connection reset by peer)
23:05:51*|2701 is now known as |meta
23:08:05*Jesin quit (Quit: Leaving)
23:11:33*Jesin joined #nim
23:34:50*space-wizard quit (Read error: Connection reset by peer)
23:34:51*derka quit (Quit: derka)
23:38:26*space-wizard joined #nim
23:39:04*space-wizard quit (Max SendQ exceeded)
23:39:44*space-wizard joined #nim
23:47:24*libman quit (Remote host closed the connection)
23:53:58*space-wizard quit (Ping timeout: 252 seconds)
23:55:02*space-wizard joined #nim