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:30 | cheatfate | Araq_, 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:35 | Araq_ | semcall.nim(111) notFoundError |
08:32:35 | Araq_ | sigmatch.nim(262) describeArgs |
08:32:36 | Araq_ | semexprs.nim(39) semOperand |
08:32:51 | Araq_ | cheatfate: ^ it generates an error while producing an error |
08:32:58 | Araq_ | hiding the real error lol |
08:34:03 | cheatfate | Araq_, lol |
08:35:25 | yglukhov | cheatfate: commented on your gist just in case you still need it =) |
08:35:40 | * | Pisuke joined #nim |
08:36:22 | yglukhov | Araq_: mind looking at https://github.com/nim-lang/Nim/pull/4223? |
08:37:14 | cheatfate | yglukhov, wow nice |
08:39:57 | Araq_ | hmmm I spend more time reviewing code than writing code ... I guess that means Nim is successful. |
08:41:55 | cheatfate | Araq_, you need to take a look yglukhov just modified my gist and it works https://gist.github.com/cheatfate/622f3720ee04c6a7b82ed18dac594723 |
08:42:06 | cheatfate | And now i have a question how to make `bbody` optional |
08:42:11 | cheatfate | is it possible? |
08:42:17 | yglukhov | cheatfate: overload? |
08:42:46 | cheatfate | yeah it will work |
08:42:50 | cheatfate | i think :) |
08:42:52 | cheatfate | lets test |
08:43:04 | Araq_ | why does describeArgs do any type resolution? that's madness |
08:44:10 | cheatfate | yglukhov, thanks |
08:44:47 | yglukhov | welcome ;) |
08:47:06 | Araq_ | cheatfate: did you have a look at the blog from wlan's author? |
08:47:30 | Araq_ | he describes lots of useful techniques of how to create a super fast http server |
08:47:40 | cheatfate | Araq_, i want to take a look |
08:51:02 | cheatfate | you mean lwan or wlan (https://tia.mat.br/posts/2012/09/29/asynchronous_i_o_in_c_with_coroutines.html this link?) |
08:52:17 | Araq_ | your link yes. and all the other articles on that site. |
08:53:56 | cheatfate | Araq, 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:30 | cheatfate | epoll, kqueue, windows iocp all a thread safe |
08:57:14 | cheatfate | iocp getqueuedcompletionstatus() (equal to epoll's epoll_wait() or kqueue's kevent()) must be used in N threads to achieve maximum performance... |
08:58:00 | cheatfate | but in my way there much harder to schedule coroutines in particular threads... |
08:58:33 | Araq_ | well his architecture sounds reasonably simple and it wins benchmarks |
08:58:59 | Araq_ | why complicate it any further for uncertain never measured benefits? |
08:59:52 | Araq_ | he uses your idea to use the file handles as an array index so he needs no shared hash table. |
08:59:55 | Araq_ | correct? |
09:02:16 | cheatfate | i'm not using hash table anymore it is not needed in posix systems |
09:02:33 | cheatfate | and you are correct |
09:05:23 | cheatfate | but i need hash tables to implement windows select()... |
09:06:09 | cheatfate | because windows has not getrlimit() and looks like last fd number can be 16,000,000 |
09:06:19 | cheatfate | too big to allocate table |
09:08:05 | cheatfate | i'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:20 | cheatfate | but to replace old selectors.nim i need to make windows select() |
09:09:24 | cheatfate | and to be full i need to implement /dev/poll (old solaris and based distros) and event ports (new solaris) |
09:13:43 | cheatfate | Araq_, what do you think about this templates i want to add to sharedtables.nim: https://gist.github.com/cheatfate/7b33bcb29e5cfe79732e5d1196efb1c3 |
09:14:25 | cheatfate | But i dont like `value` parameter |
09:14:44 | Araq_ | you could .inject 'it' |
09:14:52 | Araq_ | that's what many templates do. |
09:15:03 | Araq_ | and then name it 'withIt' lol |
09:15:44 | cheatfate | so i can inject value to body1? |
09:16:34 | * | aharlan joined #nim |
09:16:40 | cheatfate | i want to inject `t.data[index].val` to avoid `memcpy` |
09:18:14 | cheatfate | its possible? |
09:18:23 | Araq_ | that's hmm possible if you inject a nullary template |
09:23:08 | cheatfate | there is another way is it possible to convert `t.data[index].val` to `var B` reference |
09:23:34 | cheatfate | without calling to proc? |
09:25:16 | cheatfate | but of course i can make it to be `ptr` with addr(t.data[index].val) |
09:29:33 | Araq_ | yeah, that's usually what I do, use 'addr' |
09:32:28 | Araq_ | 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:08 | Araq_ | cheatfate: but yeah, I will accept templates like these, as I said. |
09:43:27 | yglukhov | Araq_: 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:27 | cheatfate | yglukhov, and how is font render quality, because last version of Araq's nimedit looks weird :) |
09:45:04 | yglukhov | cheatfate: http://yglukhov.github.io/nimx/livedemo/main.html |
09:46:06 | cheatfate | and it still looks weird maybe usable by game but not for editor |
09:47:23 | cheatfate | what are you using for font rendering? |
09:48:25 | yglukhov | cheatfate: 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:35 | cheatfate | i'm not rendering font expert but some years ago i have configured freetype2 to render fonts on linux like sublimetext |
09:50:13 | cheatfate | i even checked my results pixel by pixel |
09:50:22 | cheatfate | and it was equal |
09:51:35 | yglukhov | cheatfate: 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:05 | yglukhov | initial bitmap is generated for font size 64 to allow better "resolution independance" =) |
09:55:36 | yglukhov | cheatfate: 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:36 | cheatfate | yglukhov, i think Araq is waiting until you make crisp sharp fonts :) |
09:57:53 | yglukhov | cheatfate: 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:36 | yglukhov | the best thing about it currently is that only one set of textures is used for all font sizes. |
09:59:30 | Araq_ | "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:30 | yglukhov | i think (hope) that the key to this problem should be somewhere in the shader. |
10:00:45 | Araq_ | yglukhov: "after GL is initialized", I have no GL context. |
10:01:08 | yglukhov | Araq_, but you have sdl window, no? |
10:01:52 | yglukhov | how do you do the rendering? |
10:02:18 | cheatfate | Araq_, i know you dont want to make your editor to use GTK/QT but why you are using SDL then? |
10:03:22 | Araq_ | cheatfate: it was just a proof of concept gone wild. I wanted to play with immediate mode UIs |
10:03:50 | cheatfate | Araq_, i think you need to switch to libui and continue to work on your editor |
10:04:10 | yglukhov | oh come on guys, i don't think it's hard to do a fixed-size font rendering. |
10:04:32 | yglukhov | basically theres just a couple of lines to adjust in nimx to test it. |
10:04:48 | cheatfate | yglukhov, Text Editor needs the best font rendering you can achieve :) |
10:05:17 | Araq_ | yglukhov: alright alright, let me test it |
10:07:03 | Araq_ | cheatfate: I thought about backporting all the essential features to Aporia but it's just so much work |
10:10:59 | Araq_ | Downloading https://github.com/yglukhov/jnim into /tmp/nimble_14583/githubcom_yglukhovjnim using git... |
10:11:00 | Araq_ | Traceback (most recent call last) |
10:11:00 | Araq_ | nimble.nim(960) nimble |
10:11:01 | Araq_ | nimble.nim(892) doAction |
10:11:04 | Araq_ | nimble.nim(538) install |
10:11:05 | Araq_ | nimble.nim(367) installFromDir |
10:11:07 | Araq_ | nimble.nim(273) processDeps |
10:11:09 | Araq_ | nimble.nim(536) install |
10:11:11 | Araq_ | nimble.nim(495) downloadPkg |
10:11:13 | Araq_ | download.nim(191) doDownload |
10:11:16 | Araq_ | download.nim(91) getTagsListRemote |
10:11:17 | Araq_ | 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:19 | Araq_ | [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:38 | dom96 | Araq_: what's your version of git? |
10:49:08 | Araq_ | hmm never mind, I updated nimble and after 1 more hickup it installed, yummy |
10:50:03 | dom96 | good |
10:51:11 | Araq_ | still I think it should retry after a timeout |
10:51:53 | dom96 | Why should it be Nimble's job? Git should. |
10:53:38 | cheatfate | dom96, i dont think Git will do reconnect :) |
10:54:26 | dom96 | Also, doesn't it kind of defeat the purpose of that error? |
10:56:29 | * | arnetheduck joined #nim |
11:00:15 | Araq_ | ok, whatever, what's nimble's policy for stack traces? |
11:00:39 | Araq_ | are they gone now? cause a stack trace indicates a nimble bug to me. |
11:01:47 | dom96 | Only NimbleError's should be allowed to crash Nimble. |
11:02:59 | dom96 | So yes, this is a bug, it should be caught and wrapped in a NimbleError. |
11:09:43 | Araq_ | no, it's not a bug anymore, that stack trace came from an old nimble |
11:09:51 | Araq_ | but good to know. |
11:10:26 | Araq_ | would a "script gen" feature make sense? where nimble generates a script that describes what nimble would do? |
11:29:19 | Araq_ | yglukhov: for the nimx example I get ".nimble/pkgs/nimx-0.1/nimx/sdl_window.nim(174, 34) Error: undeclared identifier: 'captureMouse'" |
11:30:10 | yglukhov | Araq_: either use sdl 2.0.4 or comment captureMouse related strings in nimx.sdl_window |
11:31:02 | Araq_ | 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:35 | dom96 | Do 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:57 | Araq_ | I think so. |
11:35:01 | * | StarBrilliant joined #nim |
11:35:11 | dom96 | That is *incredibly* annoying. |
11:35:21 | Araq_ | so learn how to use Nim :P |
11:35:42 | Araq_ | 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:57 | Araq_ | ar points: array[4, (cint, cint)] = [ci(300, 400), ci(300, 200), ci(400, 400), ci(400, 200)] |
11:36:13 | dom96 | Still a PITA |
11:36:27 | dom96 | What is the reason that this doesn't just work? |
11:38:56 | * | Matthias247 quit (Read error: Connection reset by peer) |
11:41:21 | Araq_ | there is no super duper context sensitivity for int literals |
11:47:21 | dom96 | oh 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:44 | Araq_ | I can write a macro that deeply annotates everything |
11:55:12 | dom96 | Can't the compiler look at the lhs of the expression and work out the type of the array constructor from that? |
11:59:37 | Araq_ | it does that to some extend, but it's "overloading by return value" |
11:59:55 | Araq_ | instead of determineType(x): Type |
12:00:14 | Araq_ | you have annotate(x, Type) |
12:00:49 | Araq_ | which doesn't work *at all* when you leave out the ': array[4, (cint, cint)]'. |
12:01:07 | Araq_ | so yeah, why use one mechanism when you can use two. |
12:01:27 | Araq_ | why try to create a simple language when you can have a complex one? |
12:05:04 | CcxCZ | IcyFoxy: So, what is the proper place to discuss your capability-secure-rust? :-) |
12:12:05 | dom96 | Araq_: Because it annoys me :P |
12:20:24 | CcxCZ | Araq_: 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:39 | CcxCZ | It'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:53 | cheatfate | Araq_, please take a look https://github.com/nim-lang/Nim/pull/4224 |
13:38:44 | dom96 | hrm. 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:37 | IcyFoxy | CcxCZ: A query |
14:00:03 | Araq_ | CcxCZ: I've looked at them and very generally speaking |
14:00:16 | Araq_ | everything that you attach to a type sucks |
14:00:32 | Araq_ | and everything that you attach to a proc/function/method/whatever rules |
14:01:16 | * | irrequietus joined #nim |
14:07:07 | CcxCZ | Araq_: 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:46 | yglukhov | Araq_: no, i meant the sdl2.dll |
14:14:38 | yglukhov | found some problems with the fonts meanwhile. i guess they should get crisper when i fix it =) |
14:15:47 | yglukhov | bbl |
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:23 | tautologico | capabilities 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:04 | ldleworker | tautologico: join #monte :) |
15:43:25 | ldleworker | and 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:07 | tautologico | inspired by E? E was one of the last attempts at capabilities |
15:52:22 | tautologico | I'm not saying it can't work, it just never worked before, at scale |
15:54:04 | ldleworker | tautologico: you should ask them questions though |
15:54:09 | ldleworker | they love talking about their ideas |
15:54:13 | ldleworker | and they are cool guys |
15:55:50 | tautologico | I'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:45 | kier | is it possible to check is a proc is defined in a 'when' condition? |
17:30:19 | kier | specifically, 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:45 | Arrrr | You can use http://nim-lang.org/docs/system.html#declared,expr |
17:35:58 | Arrrr | Or http://nim-lang.org/docs/system.html#compiles,expr |
17:37:46 | kier | awesome, 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:47 | libman | Vote 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:29 | derka | Hello Guys |
20:19:08 | libman | hello derka |
20:19:15 | derka | Hello Libman |
20:19:28 | dom96 | hello derka |
20:19:34 | derka | hi dom |
20:19:47 | derka | just finished reading your latest chapter about concurrency |
20:21:44 | dom96 | derka: Awesome, what did you think? :) |
20:21:54 | dom96 | libman: voted. Also added 'async' as a pro |
20:22:22 | derka | I liked it, though i found the regexp and stuff part was too long |
20:22:24 | derka | lol |
20:23:25 | dom96 | derka: fair enough :) |
20:23:34 | * | space-wizard quit (Read error: Connection reset by peer) |
20:23:49 | dom96 | it was kind of doing the same thing but differently, guess that can get boring |
20:24:03 | dom96 | just wanted to teach as much as possible |
20:24:04 | derka | is there any way to do functions like __sync_add_and_fetch in Nim over shared variables |
20:26:16 | derka | no equivalent of __sync_add_and_fetch / |
20:26:18 | derka | ?? |
20:27:19 | * | jeffc joined #nim |
20:29:12 | libman | feh --bg-tile http://libman.org/img/bak/20160526-NimWin.jpg |
20:30:42 | dom96 | derka: hrm, not sure. |
20:30:43 | GangstaCat | voted for runtime speed and async because that's clearly the advantages, but what clearly wrap this is the awesome syntax |
20:31:04 | dom96 | derka: not familiar with that tbh. Araq_, any ideas? |
20:31:06 | derka | i am struggling with the fact that gc is per thread |
20:31:22 | derka | I want to move something i have in C in Nim |
20:31:38 | dom96 | derka: maybe if you could describe what you are trying to do I could help |
20:31:46 | derka | but the fact that i can’t easily share stuff is blocking me, un less i dont use gc |
20:31:55 | derka | imagine you have a counter |
20:32:04 | derka | all thread increase the counter |
20:32:35 | dom96 | I think my chapter explains how to use shared memory doesn't it? |
20:32:52 | dom96 | and in fact uses what you are describing as an example |
20:35:22 | derka | yes but it is not as efficient as __sync_add_and_fetch |
20:35:25 | jeffc | Q 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:54 | cheatfate | Araq_, is there reason why `mget` is deprecated in tables.nim? |
20:36:03 | derka | __sync_add_and_fetch increment a variable atomatically accross theads without using any lock and in a single cpu instruction |
20:36:20 | derka | i 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:59 | dom96 | jeffc: hrm, won't {.passC: "-I ...".} work? |
20:40:38 | jeffc | dom96: 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:56 | irrequietus | dom96: https://twitter.com/sarahjeong/status/735924335412543488 |
20:41:20 | irrequietus | this is big, for everybody, especially for everybody doing a language of their own. |
20:41:56 | dom96 | Indeed. Just saw on reddit :) |
20:43:04 | dom96 | jeffc: hrm. Sounds like a problem indeed. |
20:43:32 | cheatfate | derka, try to look on lib/system/atomics.nim |
20:43:38 | derka | ok gh |
20:43:39 | derka | thx |
20:43:54 | dom96 | jeffc: I guess you need some way to pass -I<path/to/nimble/pkg/header.h> when your package is being compiled? |
20:49:02 | dom96 | but perhaps it's the compiler's responsibility to copy the header for you into nimcache |
20:50:19 | gokr | Ok, 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:59 | derka | dom96 this would be a good additional stuff to your counter example, just using atomicInc |
20:52:10 | derka | thx a lot cheatfate |
20:52:28 | cheatfate | Araq_, np |
20:53:37 | cheatfate | Araq_, 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:42 | dom96 | gokr: isn't `==` enough? |
20:53:49 | cheatfate | Araq_, or maybe you just forgot? |
20:53:56 | gokr | Hmmm, right... I have asked this before :) |
20:54:36 | gokr | dom96: I recalled incorrectly that == did some deep comparison, thanks. |
20:55:04 | * | space-wizard quit (Read error: Connection reset by peer) |
20:55:06 | dom96 | gokr: hehe. I was sitting here thinking about it for 5 minutes whether it does or not :) |
20:55:24 | dom96 | I even looked at its definition, but gave up after I saw "{.magic.}" |
20:55:41 | gokr | I am so used to Smalltalk where "identity" has its own method. |
20:56:06 | derka | cheatfate which news are you referring to? URL ? |
20:56:31 | Araq_ | derka: atomicInc is in system.nim |
20:56:56 | derka | yeah i saw that thanks to cheatfate Araq_ thanks a lot |
20:56:58 | Araq_ | cheatfate: hmmm? no idea what you mean. memcpy is only used when ordinary '=' won't do. |
20:57:05 | jeffc | dom96: that was my thought, perhaps a pragma that specifies a resource file that needs copied into nimcache |
20:57:19 | cheatfate | derka, https://github.com/nim-lang/Nim/blob/devel/web/news.txt |
20:57:32 | dom96 | derka: thanks, will make a note to mention it in Ch6. |
20:57:35 | derka | thx cheatfate |
20:57:43 | derka | yeah dom96 this would be really nice |
20:57:46 | dom96 | Araq_: What do you think about jeffc's issue? |
20:57:57 | Araq_ | what is the issue? |
20:58:34 | cheatfate | Araq_, i just want to get reference to value stored in table... |
20:58:54 | dom96 | Araq_: just search 'jeffc' in irclogs |
20:59:35 | cheatfate | Araq_, there was possible with `mget` but now it deprecated and replaced with getOrDefault() and event not see `default`... |
21:02:26 | Araq_ | cheatfate: no, mget is now simply [] |
21:03:20 | cheatfate | Araq_, so now nim support reloading return value? |
21:04:23 | * | space-wizard joined #nim |
21:04:48 | cheatfate | Araq_, there currently two `[]` and i think when i try to use `[]` first one will be used... |
21:05:13 | Araq_ | it's called "overloading by var-ness" |
21:05:42 | Araq_ | it's not overloading based on how the result will be used, but instead whether the table param is an L-value |
21:05:49 | Araq_ | if it is, the 'var T' version is used |
21:06:06 | Araq_ | you can only get a mutable view on the data when the data is mutable to begin with. |
21:06:35 | jeffc | Araq_: 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:36 | Araq_ | 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:54 | jeffc | I can include them with passC -I<relative_path_to_header>, but that doesn't work with nimble |
21:07:02 | jeffc | once the package is installed |
21:07:31 | Araq_ | jeffc: well there are a couple of solutions |
21:07:35 | cheatfate | Araq_, now i'm completely confused |
21:08:13 | cheatfate | Araq_, we dont using tables.nim for multithreading environment |
21:08:24 | cheatfate | there sharedtables.nim for this case |
21:10:24 | Araq_ | jeffc: does the .c file #include the .h file on its own? |
21:11:07 | jeffc | Araq_: yes |
21:11:09 | cheatfate | Araq_, 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:59 | Araq_ | cheatfate: hmm? |
21:12:11 | Araq_ | you just use it. |
21:12:17 | Araq_ | like the array's [] |
21:12:43 | Araq_ | jeffc: then one solution is to merge the header and the C file and refer to that merged file instead. |
21:13:12 | Araq_ | 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:32 | Araq_ | another solution is to copy the file in your .nims build script, which supports 'cpFile' |
21:13:48 | cheatfate | Araq_, 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:50 | Araq_ | well you need a nims script for that to work, obviously. |
21:14:23 | jeffc | Araq_: will that be compatible with nimble should I want to distribute this package? |
21:14:27 | Araq_ | cheatfate: no, that wasn't possible with mget either. |
21:14:31 | jeffc | (the nims script) |
21:14:51 | Araq_ | sure, well. |
21:15:12 | Araq_ | in fact, you should use the Nimble NimScript integration ... ah hmmm |
21:15:37 | notfowl | Here 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:47 | Araq_ | 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:21 | jeffc | notfowl: That looks very useful indeed, I'll give that a shot! |
21:17:25 | Araq_ | means that the value is copied into 'x' and so changes to x are not reflected in the original location |
21:17:47 | Araq_ | to keep the 'var-ness' you need to do: var x = addr(mget(a, i)) |
21:18:29 | Araq_ | 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:03 | dom96 | That's awesome. Didn't realise something like `currentSourcePath` existed. |
21:19:32 | dom96 | Somebody ought to document this in the wiki :) |
21:20:00 | * | space-wizard quit (Read error: Connection reset by peer) |
21:20:22 | Araq_ | currentSourcePath? never heard of it. |
21:20:40 | notfowl | It's in os |
21:21:06 | dom96 | nope, it's in system http://nim-lang.org/docs/system.html#currentSourcePath |
21:21:42 | notfowl | Ah |
21:22:03 | Araq_ | ah, a instantiationInfo(-1, true).filename hack. nice. |
21:22:10 | dom96 | hah |
21:22:23 | * | space-wizard joined #nim |
21:22:25 | dom96 | Did zahary add this? |
21:22:44 | Araq_ | maybe, maybe somebody else. instantiationInfo is quite popular |
21:23:32 | jeffc | notfowl: 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:18 | cheatfate | Araq_, you are right, could i add withValue to tables.nim? |
21:32:54 | Araq_ | yup |
21:33:12 | Araq_ | seems like a good idea |
21:33:43 | dom96 | jeffc: Glad you got it working. Which library are you wrapping? :) |
21:34:40 | jeffc | dom96: 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:07 | dom96 | jeffc: 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:44 | jeffc | dom96: 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:55 | Matthias247 | dom96, 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:17 | cheatfate | Araq_, 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 |