00:00:59 | * | libman quit (Quit: Connection closed for inactivity) |
00:04:14 | SusWombat | Anyone in here using nim-mode in emacs? |
00:15:56 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:43:59 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
00:45:35 | demi- | has anyone implemented any code that uses a plugin architecture in nim? |
01:09:07 | * | def-pri-pub joined #nim |
01:25:17 | * | bjz joined #nim |
01:30:50 | * | Guest45610 quit (Quit: ...) |
01:35:01 | * | vlad1777d quit (Quit: Leaving) |
02:01:24 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
02:17:18 | def-pri-pub | Is there such a thing in the nim standard library like a file system watcher? E.g. A proc that you call to watch a file for changes, and it shoots off an event when, well, a change is made |
02:26:03 | def-pri-pub | Also, what's the timeout for this measured in? |
02:26:03 | def-pri-pub | |
02:26:05 | def-pri-pub | https://nim-lang.org/docs/osproc.html#waitForExit,Process,int |
02:26:08 | def-pri-pub | Is it milliseconds? |
02:31:49 | * | chemist69 quit (Ping timeout: 240 seconds) |
02:37:38 | * | xet7 joined #nim |
02:39:03 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
02:45:42 | * | chemist69 joined #nim |
03:12:43 | * | bjz joined #nim |
03:30:24 | * | LeNsTR|away joined #nim |
03:32:36 | * | zama_ joined #nim |
03:33:14 | * | pigmej_ joined #nim |
03:34:19 | * | Jesin quit (Quit: Leaving) |
03:34:43 | * | kier joined #nim |
03:34:59 | * | Araq_ joined #nim |
03:35:15 | * | d10n_ joined #nim |
03:35:40 | * | vqrs_ joined #nim |
03:35:55 | * | jackkv joined #nim |
03:36:38 | * | roygbiv quit (*.net *.split) |
03:36:38 | * | zachcarter quit (*.net *.split) |
03:36:39 | * | kier_ quit (*.net *.split) |
03:36:39 | * | lenstr quit (*.net *.split) |
03:36:39 | * | onionhammer quit (*.net *.split) |
03:36:40 | * | jackv quit (*.net *.split) |
03:36:40 | * | zama quit (*.net *.split) |
03:36:40 | * | EastByte_ quit (*.net *.split) |
03:36:41 | * | stisa quit (*.net *.split) |
03:36:42 | * | d10n quit (*.net *.split) |
03:36:42 | * | tstm quit (*.net *.split) |
03:36:42 | * | pigmej quit (*.net *.split) |
03:36:42 | * | vqrs quit (*.net *.split) |
03:36:42 | * | Araq quit (*.net *.split) |
03:36:52 | * | pigmej_ is now known as pigmej |
03:40:20 | * | zama_ quit (Changing host) |
03:40:20 | * | zama_ joined #nim |
03:40:28 | * | zama_ is now known as zama |
03:47:30 | * | rauce quit (Quit: WeeChat 1.7) |
03:47:40 | * | rauss joined #nim |
03:49:20 | * | 21WAAR6LT joined #nim |
03:49:20 | * | zachcarter joined #nim |
03:49:20 | * | onionhammer joined #nim |
03:49:20 | * | EastByte_ joined #nim |
03:49:20 | * | stisa joined #nim |
03:49:20 | * | tstm joined #nim |
03:55:39 | * | girvo joined #nim |
03:55:43 | * | girvo waves hello |
03:55:57 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
03:57:03 | * | bjz joined #nim |
03:57:11 | girvo | If I'm defining an ADT via a "case kind" statement in my object definition, is it possible to define a given property name? Currently, it's complaining about redefinition of hte property within the case statement :( |
03:58:34 | girvo | https://hastebin.com/ohijetepoj.nim |
04:35:11 | * | byte512 quit (Ping timeout: 264 seconds) |
04:51:45 | * | girvo quit (Ping timeout: 256 seconds) |
04:59:13 | cheatfate | def-pri-pub, timeout in milliseconds, and there no cross-platform file watcher in stdlib yet |
05:00:23 | cheatfate | def-pri-pub, there only linux version in lib/fsmonitor.nim |
05:27:00 | * | girvo joined #nim |
05:45:31 | * | zachcarter quit (Quit: zachcarter) |
05:50:45 | def-pri-pub | Is the `events` module threadsafe? |
05:54:57 | * | gangstaguy joined #nim |
05:56:18 | * | nsf joined #nim |
06:00:54 | * | Jesin joined #nim |
06:05:56 | * | girvo quit (Ping timeout: 240 seconds) |
06:14:04 | FromGitter | <Varriount> zachcarter: Aww, no bgfx? |
06:18:37 | * | jivank quit (Quit: WeeChat 0.3.8) |
06:34:53 | * | chemist69 quit (Ping timeout: 256 seconds) |
06:37:48 | * | chemist69 joined #nim |
06:52:21 | * | arnetheduck joined #nim |
07:02:02 | * | def-pri-pub quit (Quit: leaving) |
07:17:39 | * | rokups joined #nim |
07:36:31 | cheatfate | def-pri-pub: nope |
07:41:19 | * | PMunch quit (Quit: leaving) |
07:43:30 | * | 21WAAR6LT quit (Quit: WeeChat 1.7) |
08:11:00 | * | bjz_ joined #nim |
08:11:36 | * | bjz quit (Ping timeout: 240 seconds) |
08:32:31 | * | deavmi joined #nim |
08:46:32 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
08:53:19 | * | bjz joined #nim |
08:53:21 | * | deavmi quit (Quit: deavmi) |
08:59:09 | * | gangstaguy quit (Quit: Connection closed for inactivity) |
09:34:45 | * | Matthias247 joined #nim |
10:18:23 | * | Gonzih quit (Quit: WeeChat 1.7) |
10:25:33 | * | smt__ quit (Ping timeout: 260 seconds) |
10:26:10 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
10:31:38 | * | Guest4568 quit (Quit: ...) |
10:42:09 | * | chemist69 quit (Ping timeout: 240 seconds) |
10:44:43 | * | chemist69 joined #nim |
10:57:54 | * | bjz joined #nim |
11:18:31 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
11:20:29 | * | bjz joined #nim |
11:20:29 | * | rauss quit (Read error: Connection reset by peer) |
11:23:42 | * | Vladar joined #nim |
11:34:09 | * | rauss joined #nim |
11:37:53 | * | Snircle joined #nim |
12:02:45 | * | xmonader joined #nim |
12:16:44 | * | synshroud joined #nim |
12:18:19 | * | elrood joined #nim |
12:41:47 | * | vlad1777d joined #nim |
13:20:09 | * | gokr joined #nim |
13:28:26 | * | vlad1777d quit (Quit: Leaving) |
13:30:12 | * | vlad1777d joined #nim |
14:02:17 | * | xet7 quit (Quit: Leaving) |
14:07:29 | * | synshroud quit (Quit: ZNC 1.6.4 - http://znc.in) |
14:14:00 | * | synshroud joined #nim |
14:20:53 | * | bjz_ joined #nim |
14:21:31 | * | zachcarter joined #nim |
14:22:23 | * | bjz quit (Ping timeout: 256 seconds) |
14:23:19 | * | couven92 joined #nim |
14:31:44 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
14:34:35 | * | elrood quit (Quit: Leaving) |
14:36:16 | * | Matthias247 quit (Read error: Connection reset by peer) |
14:36:50 | * | xet7 joined #nim |
14:40:28 | * | smt joined #nim |
14:41:46 | * | synshroud left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.") |
15:01:17 | * | gokr quit (Ping timeout: 260 seconds) |
15:13:11 | FromGitter | <Almynic> I installed aporia via nimble but the aporia executable doesn't start the ide. I'm under ubuntu gnome and use nim 0.16.0. |
15:21:11 | Araq_ | works for me. |
15:23:54 | FromGitter | <Almynic> I will try to compile aporia from source maybe that will work |
15:27:16 | * | sz0 joined #nim |
15:28:16 | Araq_ | nimble does compile aporia from source |
15:30:02 | FromGitter | <Almynic> Ok, now I tried it with nimble install aporia@#head and it still doesn't start ... |
15:31:27 | cheatfate | Almynic: ubuntu gnome is gtk3 based or gtk2 based? |
15:33:40 | FromGitter | <Almynic> i think it's gtk3 based |
15:33:52 | cheatfate | aporia is gtk2 based |
15:33:52 | FromGitter | <Almynic> j |
15:34:35 | FromGitter | <Almynic> but i installed gtk2 so it should still work |
15:37:55 | FromGitter | <Araq> @Almynic still like to translate Aporia to Arabic? |
15:39:25 | * | vendethiel joined #nim |
15:46:53 | FromGitter | <Almynic> ok, are there any good alternatives to aporia? |
15:48:21 | FromGitter | <Araq> VS Code. please answer my question. |
15:49:30 | FromGitter | <Almynic> no i'm don't speak arabic my family name is french not arabic ;) |
15:52:17 | FromGitter | <Almynic> I think you mistook me for someone else. |
15:53:52 | FromGitter | <Araq> we'll see about that. |
15:53:53 | * | Snircle quit (Ping timeout: 246 seconds) |
15:55:10 | * | Snircle joined #nim |
16:15:45 | * | gangstaguy joined #nim |
16:21:28 | * | couven92 quit (Ping timeout: 240 seconds) |
16:26:47 | * | vlad1777d quit (Remote host closed the connection) |
16:29:29 | * | kulelu88 joined #nim |
16:30:41 | demi- | is there any way to do string->type creation at runtime? |
16:31:25 | demi- | like, if the object type already exists, but i'm telling it to initialize a new object i might not know the name of? |
16:35:14 | dom96 | Almynic: The Nimble version that Nim 0.16.0 comes with has a bug that causes executables created by it to be invalid. |
16:35:49 | dom96 | Almynic: To fix this you can upgrade to Nimble 0.8.4. |
16:36:58 | Araq_ | demi-: and then what? Nim is statically typed there is little you could do with such an object. |
16:38:24 | dom96 | Almynic: Using VS Code nowadays is probably the right way to go though. |
16:38:55 | * | Araq_ is now known as Araq |
16:38:58 | demi- | Araq_: I want to dynamically load in modules and run them |
16:41:55 | demi- | to create plugins for an application, if i standardize the API that these plugins use then i could define the init point and then run them, though the limiting factor here is if i can do that initial type association from a string or something -- otherwise i'll have to fall back on linker behavior which wouldn't necessarily make this very portable |
16:46:50 | Araq | I can't really follow. dynamic loading doesn't mean you don't know the types. types are an approximation of the runtime behaviour. if you don't know much about the incoming data, your type can easily reflect this. |
16:47:21 | Araq | case in point: Everything can be modeled as a Nim JsonNode. |
16:50:35 | * | chemist69 quit (Ping timeout: 246 seconds) |
16:52:03 | demi- | ok, let me back up. I want to build something with a plugin-based architecture. the application will do one rather general thing, and each plugin is designed to interface with this general thing. the application will need to know how to get the plugins to do the individual specific logic that they contain; the way i'm most familiar with this design is through a statically (and stringly) declared class name or |
16:52:06 | demi- | function in the metadata for the plugin's code. This describes the entry-point. what i'm looking for is the best way to describe that entry-point in nim to be able to interact with the plugin code at runtime. |
16:53:48 | * | chemist69 joined #nim |
16:54:23 | * | yeeve quit (Ping timeout: 264 seconds) |
16:56:33 | Araq | that's just |
16:56:45 | Araq | type PluginRoot = ref object of RootObj |
16:57:03 | Araq | proc create*(): PluginRoot # entry point in your DLL |
16:57:31 | Araq | proc destroy*(x: PluginRoot) # plugin is destroyed |
16:58:08 | demi- | would't that conflict if i have multiple of them? |
16:59:45 | Araq | oh yeah, *shrug*, so make it proc registerPlugin(name: string; factory: proc (): Plugin) |
17:03:45 | demi- | it looks like the dynlib functionally is directly tied to the underlying C implementation, is there a way to do the same thing with nim as it does with C? |
17:09:35 | * | yeeve joined #nim |
17:22:04 | * | Arrrr joined #nim |
17:22:04 | * | Arrrr quit (Changing host) |
17:22:04 | * | Arrrr joined #nim |
17:34:22 | * | sz0 quit (Quit: Connection closed for inactivity) |
17:46:57 | * | arnetheduck quit (Ping timeout: 260 seconds) |
17:50:34 | * | Trustable joined #nim |
18:01:44 | * | couven92 joined #nim |
18:02:50 | * | LeNsTR|away is now known as lenstr |
18:03:09 | * | lenstr quit (Changing host) |
18:03:09 | * | lenstr joined #nim |
18:19:21 | * | Matthias247 joined #nim |
18:28:12 | * | rosshadden joined #nim |
18:29:09 | * | gangstaguy quit (Quit: Connection closed for inactivity) |
18:34:52 | * | libman joined #nim |
18:39:23 | * | def-pri-pub joined #nim |
18:42:06 | def-pri-pub | Is there a simple library for audio playback in Nim (or a wrapper)? |
18:42:36 | def-pri-pub | I'm looking to do that Linux Game Jam, but I want to avoid using SDL2 or SFML, and do something that a bit more raw (and fun). |
18:43:20 | def-pri-pub | i.e., I want to slap together other audio/visual components instead of relying on one complete package. |
18:44:20 | stisa | def-pri-pub : maybe https://github.com/zacharycarter/soloud-nim ? Never used it though |
18:51:09 | zachcarter | having trouble getting that to work on linux :/ |
18:51:15 | zachcarter | works great on OSX though |
18:52:38 | dom96 | def-pri-pub: I think you should just use SDL or SFML |
18:53:37 | zachcarter | dom96: neither of those options are ideal for some tasks |
18:53:53 | zachcarter | I guess it depends on the scope of what you’re trying to do though |
18:54:29 | demi- | dom96: i put a PR up for nimble to enhance some of the behavior around publishing packages |
18:55:34 | zachcarter | def-pri-pub: I’m working on a cross platform 2d framework for Nim using Modern OpenGL and perhaps OpenGL ES if I get that far, it’s lower level than SDL2, maybe you’d want to consider contributing if that sounds interesting to you |
19:04:13 | zachcarter | def-pri-pub: https://github.com/zacharycarter/dEngine |
19:11:06 | * | nsf quit (Quit: WeeChat 1.7) |
19:13:08 | * | Sentreen quit (Quit: WeeChat 1.4) |
19:15:08 | dom96 | demi-: yes, thank you, I saw. Didn't get a chance to review yet. |
19:26:04 | * | vlad1777d joined #nim |
19:26:29 | * | vlad1777d quit (Remote host closed the connection) |
19:31:22 | demi- | no worries |
19:38:08 | * | gokr joined #nim |
19:38:39 | Calinou | >low-level >fun |
19:38:41 | Calinou | choose one :) |
19:46:42 | * | Sentreen joined #nim |
19:48:41 | Araq | low-level is fun. |
19:51:40 | zachcarter | I agree |
19:51:48 | zachcarter | and I don’t even work at that low of a level |
19:52:00 | zachcarter | but writing your own opengl draw calls is way more challenging and fun than writing sdl.drawrect |
19:52:02 | zachcarter | or whatever |
19:53:09 | * | Ven joined #nim |
19:53:40 | zachcarter | I’m using this module - https://nim-lang.org/docs/events.html |
19:54:11 | zachcarter | I’m wondering how exactly I’m supposed to be using or customizing EventArgs |
19:54:21 | zachcarter | right now I have my own object : dEngineEventMessage* = object of EventArgs |
19:54:43 | zachcarter | but when I try to cast eventargs into that type in my event handler, it doesn’t work, anyone have any ideas / ever used the module before |
19:57:54 | zachcarter | nevermind I think I figured it out |
20:03:41 | Arrrr | The year is 2050. Still no `clear` proc. |
20:04:02 | Arrrr | Do people actually `setLen seq, 0`? Or just define a global proc for clearing seqs? |
20:08:02 | Araq | Arrrr: I use setLen 0 all the time, but tables need a clear. PR please. |
20:09:30 | Arrrr | But tables do have a clear, as far as i'm concerned |
20:10:48 | Araq | oh? must have been a recent addition then :P |
20:11:36 | Arrrr | Also, coffeepot tried it before but you rejected it because system was too packed already. |
20:11:46 | * | vlad1777d joined #nim |
20:12:14 | * | rokups quit (Quit: Connection closed for inactivity) |
20:14:02 | * | vlad1777d quit (Remote host closed the connection) |
20:18:44 | * | bjz joined #nim |
20:25:38 | * | vlad1777d joined #nim |
20:26:10 | Araq | you can have your own implicitly imported modules via --import |
20:26:32 | * | vlad1777d quit (Remote host closed the connection) |
20:26:37 | Araq | and add template clear*(x) = setLen(x, 0) to it |
20:27:24 | Araq | we could make setLen default to take 0 but it will make dom96 angry |
20:28:16 | cheatfate | low-level is fun + 1 |
20:29:25 | Arrrr | In my opinion default to 0 would not be obvious, given the nature of the proc. Now, you can understand it once you have written enough nims |
20:29:26 | cheatfate | and maybe better, there is no real fun if there is no low-level |
20:30:55 | dom96 | Yeah, that's a bad idea. |
20:36:12 | * | vlad1777d joined #nim |
20:36:45 | * | Arrrr quit (Quit: Leaving.) |
20:40:53 | * | yeeve quit (Ping timeout: 246 seconds) |
20:43:16 | * | vlad1777d quit (Remote host closed the connection) |
20:51:45 | * | yeeve joined #nim |
21:11:47 | SusWombat | how do i do a function that accepts a 2 dimensional array of any size? |
21:12:07 | SusWombat | proc* |
21:13:15 | stisa | SusWombat `proc myfn [N,M:static[int]] (m:array[N,array[M,float]]) = ...` I think |
21:13:16 | * | dexterk__ joined #nim |
21:13:35 | * | dexterk_ quit (Ping timeout: 264 seconds) |
21:15:01 | SusWombat | ok thx |
21:25:55 | def-pri-pub | i think i asked this last night but I don't recall seeing an answer: Is the `events` module threadsafe? |
21:26:59 | * | PMunch joined #nim |
21:27:43 | * | Vladar quit (Quit: Leaving) |
21:33:57 | * | bozaloshtsh joined #nim |
21:39:46 | def-pri-pub | stisa: thanks for that link, but soloud was failing to build on my system. |
21:41:18 | zachcarter | def-pri-pub: the framework moved to : https://github.com/fragworks/frag |
21:43:30 | Araq | def-pri-pub: dunno, but it's tiny, just read its code |
21:44:34 | * | Gonzih joined #nim |
21:55:13 | * | nsf joined #nim |
21:57:12 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:10:03 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:14:28 | * | bozaloshtsh quit (Quit: WeeChat 1.7) |
22:15:15 | * | bozaloshtsh joined #nim |
22:30:25 | ldlework | Is there a way to interface with Golang code? |
22:31:55 | PMunch | https://christine.website/blog/ffi-ing-golang-from-nim-for-fun-and-profit-2015-12-20 |
22:33:14 | PMunch | Seems like making a dll and calling functions from the dll works |
22:33:46 | ldlework | I'm looking to call the docker client code from Nim |
22:33:57 | ldlework | PMunch: do you have any context about doing something like that? |
22:34:07 | PMunch | What do you mean? |
22:34:43 | PMunch | Have you looked at this by the way: https://github.com/kamilchm/docker-nim ? |
22:35:15 | PMunch | Or this: https://github.com/tulayang/asyncdocker ? |
22:35:20 | * | vendethiel quit (Ping timeout: 246 seconds) |
22:35:51 | ldlework | the former is basically nothing |
22:36:02 | * | vendethiel joined #nim |
22:36:05 | ldlework | the latter I haven't been able to get to work with unix sockets (or otherwise really) |
22:36:38 | PMunch | Hmm, that's a shame |
22:36:42 | PMunch | What seems to be the problem? |
22:37:58 | ldlework | I just dont get any output |
22:38:43 | PMunch | Hmm, strange |
22:39:17 | ldlework | Ill try to get a minimal example |
22:39:48 | PMunch | But yeah, as I said. Seems like using Go (if that's the route you want to go) would require you to basically expose the functionality you need through a dll. |
22:41:50 | * | ftsf_ joined #nim |
22:45:53 | ldlework | I wonder if docker puts out a go dll |
22:46:30 | * | Trustable quit (Remote host closed the connection) |
22:50:32 | ldlework | Xe: you around? |
22:51:40 | * | girvo joined #nim |
22:53:42 | ldlework | Hmm, does httpclient really not support unix sockets?! |
22:54:50 | PMunch | Pretty sure that it does |
22:56:02 | ldlework | A minimal example doesn't work for me |
22:56:18 | ldlework | let resp = client.get("/var/lib/docker.sock/v1.25/info") |
22:56:53 | ftsf_ | ldlework, what happens? |
22:57:11 | ldlework | literally nothing |
22:57:18 | ldlework | when echoing resp |
22:57:41 | ldlework | if I change it to the http://127.0.0.1:2375/v1.25/info version I get output |
22:58:23 | PMunch | Mine works fine |
22:58:42 | ldlework | ...? |
22:58:53 | PMunch | Trying httpclient here |
22:58:55 | PMunch | On linux |
22:58:56 | ldlework | ah crap |
22:58:58 | PMunch | And it works fine |
22:59:02 | ldlework | /var/lib /var/run |
22:59:03 | ldlework | fml |
22:59:06 | PMunch | :P |
22:59:13 | ldlework | still doesn't work |
22:59:15 | PMunch | But it's still bad that it doesn't give you an error |
22:59:24 | ldlework | Error: unhandled exception: |
22:59:25 | ldlework | Additional info: Name or service not known [OSError] |
22:59:44 | PMunch | Ah |
22:59:49 | ldlework | let resp = client.get("/var/runk/docker.sock/v1.25/info") |
22:59:57 | ldlework | oops runk |
22:59:59 | PMunch | I don't think it works with local paths does it? |
23:00:08 | ldlework | same |
23:00:14 | ldlework | what do you mean local paths |
23:00:14 | PMunch | Or maybe you have to use file:// |
23:00:18 | ldlework | where-else would the socket be |
23:00:20 | ldlework | ok |
23:00:42 | PMunch | I mean httpclient is meant for HTTP |
23:00:45 | ldlework | different error |
23:00:50 | ldlework | Error: unhandled exception: Expected authority got nothing. [ValueError] |
23:01:10 | ldlework | wonder what that means |
23:01:26 | PMunch | https://nim-lang.org/docs/streams.html |
23:01:35 | ldlework | If I ever make a programming language, I will make it so that it produces wiki links |
23:01:39 | PMunch | Maybe that's what you're looking for? |
23:01:49 | ldlework | so that I can assume the user has no fucking clue what an "authority" is in this context |
23:01:49 | ldlework | lol |
23:02:15 | ldlework | PMunch: why would that be what I'm looking for? |
23:02:36 | PMunch | It seems like you're trying to read a file with a httpclient |
23:02:41 | PMunch | Which probably isn't going to work.. |
23:02:44 | * | libman quit (Quit: Connection closed for inactivity) |
23:02:52 | PMunch | Since it's not served over the http protocol.. |
23:03:05 | ldlework | PMunch: ... |
23:03:18 | ldlework | PMunch: you can speak http or any other protocol over a unix socket file. |
23:03:39 | ldlework | PMunch: you know that all sockets of any kind of represented as file in linux? |
23:03:48 | PMunch | Yeah |
23:04:02 | PMunch | Oh, so your path is a socket |
23:04:04 | PMunch | Right |
23:04:06 | PMunch | Hmm |
23:04:06 | ldlework | I don't want to read a file over httpclient, I want to use a file as a socket |
23:04:08 | ldlework | yah |
23:04:10 | ldlework | <3 |
23:05:06 | ldlework | PMunch: huh https://forum.nim-lang.org/t/1206 |
23:05:26 | ldlework | dom96: poke |
23:05:48 | PMunch | https://nim-lang.org/0.11.0/sockets.html |
23:05:52 | PMunch | Look at the Domain enum |
23:05:56 | PMunch | AF_UNIX |
23:06:16 | ldlework | What about it |
23:08:41 | ldlework | You can see the guy in the forum post started using raw sockets to implement his docker client to get unix-file socket support: https://github.com/kamilchm/docker-nim/blob/master/client.nim |
23:08:47 | ldlework | lol and then apparently gave up |
23:08:49 | * | ldlework sighs |
23:09:07 | PMunch | Hmm |
23:09:15 | PMunch | Well, I'm off to bed |
23:09:24 | PMunch | Hope you find a solution :) |
23:09:26 | * | PMunch quit (Quit: leaving) |
23:09:27 | ldlework | doh |
23:11:16 | * | nsf quit (Quit: WeeChat 1.7) |
23:14:29 | * | gokr quit (Ping timeout: 258 seconds) |
23:18:40 | Xe | ldlework: one problem with unix sockets like that |
23:18:49 | Xe | there's no delimiter |
23:19:03 | Xe | between the HTTP route and socket path that is |
23:19:56 | ldlework | Xe: usually I think, the path is greedly consumed until there is a file, then the rest is the path |
23:20:17 | Xe | does asynchttpclient behave like that? |
23:20:45 | ldlework | I dont know how any of this nim-stuff behaves. I literally just decided to use nim yesterday :) |
23:20:59 | ldlework | It doesn't work unix sockets from what I can tell |
23:22:28 | ftsf_ | well it expects a _url_ as the first argument |
23:23:38 | * | vlad1777d joined #nim |
23:24:12 | ldlework | Where does the type Future come from |
23:24:15 | ftsf_ | there's no standard url scheme for http over a unix socket afaik. |
23:24:22 | ldlework | we still got that mega index? |
23:24:33 | ldlework | you should put that mega index in the topic btw |
23:25:18 | ftsf_ | ./includes/asyncfutures.nim |
23:25:29 | ftsf_ | /usr/lib/nim/includes/asyncfutures.nim |
23:25:42 | ldlework | how come I can't import it? |
23:25:47 | ldlework | is it built in? |
23:26:06 | ftsf_ | i don't know? |
23:26:22 | ftsf_ | can you use it without importing it? |
23:27:13 | ldlework | like |
23:27:26 | ldlework | what the fuck is the `Future` type being referred to in the docs here? https://nim-lang.org/docs/httpclient.html |
23:28:03 | ldlework | God I love Nim, but I have this bizare juxtaposiion of feeling more productive than any other language and yet constantly falling into leaf covered pits. |
23:28:17 | ftsf_ | are you familiar with Promises? |
23:28:35 | ftsf_ | ldlework, that's a good description of nim =) |
23:28:37 | ldlework | C#, I just MSDN and I'm -never- wondering how any part of the language or language ecosystem works for more than the time it takes me to skim the article |
23:28:44 | ftsf_ | it's a young language |
23:28:58 | ftsf_ | still alpha |
23:29:03 | ldlework | like I think there should be a MSDN/MDN worship da |
23:29:05 | ldlework | y |
23:29:27 | stisa | idlework: https://nim-lang.org/docs/asyncdispatch.html if I remember correctly, this explains futures |
23:29:28 | * | bjz joined #nim |
23:29:30 | ldlework | Just to bring our appreciation of solid coheisive documentation the forefront of society's consciousness :) |
23:29:48 | ldlework | stisa: thanks I'll read |
23:32:54 | * | bjz quit (Client Quit) |
23:35:11 | ldlework | I kinda feel like nim documentation should group procs by types |
23:36:27 | ftsf_ | that'd be nice, would be cool if you could specify a type/types and it'd return all procs that match that type |
23:36:56 | stisa | to the left under the search box, change "group by" from section to type? |
23:38:33 | ftsf_ | stisa, ooh handy, kinda |
23:40:27 | ldlework | undeclared identifier: 'await' ? |
23:40:48 | ldlework | don't tell me I have to fucking import the await identifier |
23:41:01 | ftsf_ | did you use {.async.} ? |
23:41:34 | * | dexterk joined #nim |
23:41:37 | * | dexterk__ quit (Ping timeout: 260 seconds) |
23:41:46 | ftsf_ | actually, don't listen to me, i've never really played with the async stuff |
23:41:59 | ldlework | what is the right way to write this |
23:42:01 | ldlework | import asyncdispatch |
23:42:03 | ldlework | import httpclient |
23:42:05 | ldlework | var client = newAsyncHttpClient() |
23:42:07 | ldlework | proc get: {.async.} = |
23:42:09 | ldlework | await promise = client.getContent("http:///var/run/docker.sock/v1.25/info") |
23:42:11 | ldlework | echo get |
23:43:54 | ldlework | ok I see some obvious errors |
23:44:01 | ldlework | just bad nimlang on my part |
23:45:35 | ldlework | but I still don't get it |
23:45:54 | ftsf_ | what don't you get? the future/async stuff? |
23:46:06 | * | couven92 quit (Quit: Client Disconnecting) |
23:46:10 | ldlework | I just don't know how to write this snippet the way that makes nim happy |
23:46:16 | ldlework | an example would be crystallizing |
23:46:34 | ldlework | I'd appreciate anyone who would just copy this to a gist and make it right |
23:47:03 | ftsf_ | does the synchronous version work ok? |
23:47:52 | ldlework | are you trollin me? :P |
23:47:56 | ftsf_ | no... |
23:48:01 | ldlework | heh ok |
23:48:11 | ftsf_ | i'm curious if the problem is with the async stuff or the http connection in general |
23:49:31 | ftsf_ | "Note: You will need to run asynchronous examples in an async proc otherwise you will get an Undeclared identifier: 'await' error." |
23:49:48 | ftsf_ | would be good if the docs explained what that was |
23:49:48 | ldlework | I did that though |
23:50:04 | ldlework | import httpclient |
23:50:06 | ldlework | var client = newHttpClient() |
23:50:08 | ldlework | proc get: string = |
23:50:10 | ldlework | result = client.getContent("http:///var/run/docker.sock/v1.25/info") |
23:50:12 | ldlework | echo get() |
23:50:14 | ldlework | this doesn't work either |
23:50:17 | ldlework | Error: unhandled exception: Expected authority got nothing. [ValueError] |
23:50:52 | ldlework | how long have I been at this |
23:51:15 | ldlework | 3 hours and 50 minutes |
23:51:25 | Xe | why not wrap /usr/bin/docker |
23:51:32 | ldlework | I'm gonna switch to C# mono and see how far I get in that time. |
23:51:38 | ldlework | Xe: don't be insultinng |
23:53:56 | ftsf_ | ldlework, https://gist.github.com/ftsf/2b74405267a3300f483ed83aebafd9a0 |
23:54:01 | ftsf_ | got a working thing happening |
23:54:43 | * | ldlework looks |
23:55:43 | ldlework | sill no workie on the socket file though |
23:55:50 | ftsf_ | no, it's not going to work for a socket file |
23:55:59 | ftsf_ | because you'd need a http over unix socket url |
23:56:02 | ftsf_ | which doesn't exist |
23:56:17 | ldlework | it does exist though |
23:56:20 | ftsf_ | could try "http+unix://foo/bar" but doubt it's implemented |
23:56:23 | ldlework | maybe not for nim... |
23:56:41 | * | tax joined #nim |
23:56:44 | ldlework | talking http over unix sockets is normalized |
23:56:54 | ftsf_ | there's no standard url type for it afaik |
23:57:08 | ftsf_ | you can talk http over the socket once you're connected |
23:57:21 | ftsf_ | but there's no url form for connecting to a unix socket to speak http |
23:57:28 | tax | is nim any easier to learn than haxe? and what are the nim perks otherwise? |
23:57:29 | ftsf_ | you can open a unix socket and then talk http over it |
23:57:59 | ftsf_ | ldlework, you might have an easier time using lower level sockets rather than httpclient |
23:58:04 | ldlework | I think the standard is unix+http:// |
23:58:23 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:58:30 | ldlework | ftsf_: no, I am tired of wasting my life on this kind of thing heh |
23:58:37 | ftsf_ | ldlework, problem is it's not a defined "standard" |
23:58:48 | ldlework | ftsf_: yeah its just used everywhere I look |
23:58:56 | ldlework | you're technically right though! |
23:59:30 | ftsf_ | so people implementing http clients aren't going to add support for something not in the standards unless there's demand for it |
23:59:44 | ldlework | honestly though, starting right now, with no C# of any kind on my machine |
23:59:51 | ldlework | gonna try to solve the same problem and see how bad it is |