00:08:32 | * | quipa quit (Read error: Connection reset by peer) |
00:17:28 | * | theelous3 joined #nim |
00:17:30 | FromGitter | <irskep> Anyone got a sec to help me debug a compile-time issue? I'm getting an error from the C compiler on code that looks correct in Nim. |
00:17:35 | FromGitter | <irskep> https://github.com/irskep/raylibtest/blob/master/demo.nim |
00:18:26 | FromGitter | <irskep> I'm trying to use what looks like a half-baked C binding for a simple game dev library, but this part doesn't look problematic to me at all |
00:22:51 | FromGitter | <irskep> Don't be scared by the source link, it's short and contains (I hope) all relevant info including the error message :-) |
00:23:56 | * | theelous3 quit (Ping timeout: 250 seconds) |
00:25:18 | FromGitter | <irskep> Specifically, I don't understand why `camera.begin_mode3D()` is being compiled to `BeginMode3D((&camera_blahblah))`, since `camera` is not a reference type and shouldn't need the & |
00:27:59 | FromDiscord_ | <exelotl> irskep: maybe Camera3D type definition needs the {.bycopy.} pragma? |
00:29:04 | FromDiscord_ | <exelotl> I noticed that the latest c2nim always adds that to my structs |
00:32:16 | * | oculuxe joined #nim |
00:34:20 | * | oculux quit (Ping timeout: 250 seconds) |
00:34:36 | FromGitter | <irskep> @exelotl it at least compiles now! thanks! :-) |
00:35:09 | FromDiscord_ | <exelotl> oh cool :D |
00:37:53 | * | oculux joined #nim |
00:38:13 | * | oculuxe quit (Ping timeout: 244 seconds) |
00:43:10 | FromGitter | <irskep> Looks like I'll be forking the wrapper library and giving it some love |
00:46:02 | shashlick | Which library is this |
00:54:31 | FromGitter | <irskep> https://github.com/Skrylar/raylib-nim |
00:54:44 | FromGitter | <irskep> I'm working my way through these examples and porting them to nim https://www.raylib.com/examples.html |
00:59:06 | FromDiscord_ | <demotomohiro> struct types are usually passed as pointer to function in C language because it is usually faster than pass by value |
00:59:09 | FromDiscord_ | <demotomohiro> https://github.com/raysan5/raylib/blob/0d2cfce18edf8016b7ff865aafab25ee7a352507/src/raylib.h#L875 |
01:00:10 | FromDiscord_ | <demotomohiro> But raylib pass struct Camera3D by value in BeginMode function |
01:03:05 | * | cspar quit (Ping timeout: 268 seconds) |
01:03:53 | * | cspar joined #nim |
01:05:25 | * | secondchoice joined #nim |
01:09:26 | * | s3govesus quit (Ping timeout: 250 seconds) |
01:11:22 | * | theelous3 joined #nim |
01:17:54 | rayman22201 | Use nimterop! it's better than c2nim! |
01:25:45 | * | cspar quit (Ping timeout: 244 seconds) |
01:27:10 | * | darithorn joined #nim |
01:31:14 | * | zachk quit (Quit: Leaving) |
01:33:05 | shashlick | Worth checking how nimterop performs with raylib |
01:40:38 | * | seni joined #nim |
01:54:04 | * | oculux quit (Ping timeout: 250 seconds) |
01:56:44 | FromGitter | <irskep> Good thought, I hadn't heard of it. I'll look at some point soon; for now more interested in how raylib works than diving into nim c bridging again :-) |
02:00:14 | FromGitter | <irskep> I also need to somehow smush the raylib and glfw packages together, because raylib vendors in glfw |
02:03:20 | FromGitter | <zacharycarter> I wonder how much zengine differs from raylib now |
02:03:30 | FromGitter | <zacharycarter> when I wrote it - there wasn't much parity b/w the two |
02:03:46 | FromGitter | <zacharycarter> but I know raylib has been continually worked on - so I'm guessing it has more features than when I stopped working on zengine |
02:04:36 | FromGitter | <zacharycarter> then again - there issues with raylib that the author wasn't even aware of |
02:05:14 | FromGitter | <zacharycarter> clued him into them when they were found in the ported code base - and then we referred to the OGL specs and found out raylib's code was incorrect |
02:05:16 | * | lritter joined #nim |
02:05:32 | FromGitter | <irskep> Honestly, I'll always opt for things that are actively maintained over things that fixed certain bugs at some point |
02:05:55 | FromGitter | <zacharycarter> but correcting it broke other things - and then shortly after I decided I wanted to not work on the project any more in favor of something more robust eventually |
02:06:12 | FromGitter | <zacharycarter> I'm not advocating you ditch raylib :P I'm just thinking out-loud :) |
02:06:24 | FromGitter | <irskep> I only want it for simple 2D stuff anyway |
02:06:35 | FromGitter | <zacharycarter> it wasn't a minor bug - it was actually quite deep in the OpenGL rendering code |
02:06:57 | FromGitter | <zetashift> Think raylib shines more in the docs/samples than most other simple frameworks like SFML or love2d |
02:07:20 | FromGitter | <zacharycarter> probably |
02:07:41 | FromGitter | <irskep> that's a pretty big factor for me, just trying to get stuff running. I've used tons of libraries like this so I just want to get past the how-to and get going. |
02:07:43 | FromGitter | <zacharycarter> I'm not much interested in 2d graphics these days - but there is no doubt a slew of options |
02:07:53 | * | oculux joined #nim |
02:08:01 | FromGitter | <zacharycarter> raylib is probably NOT the best option then - if that's your goal |
02:08:09 | FromGitter | <irskep> it's going pretty well so far... |
02:08:20 | FromGitter | <zacharycarter> I'm just saying - there are higher level libraries |
02:08:32 | FromGitter | <irskep> with good nim bindings? :-) |
02:08:33 | FromGitter | <zacharycarter> that are much better tested / more widely used - than raylib |
02:08:35 | FromGitter | <zacharycarter> sure |
02:08:44 | FromGitter | <zacharycarter> have you checked out Nimgame? |
02:08:48 | FromGitter | <zacharycarter> or Nimgame 2 I guess? |
02:08:54 | FromGitter | <zetashift> nimgame2 and godot are the only ones I can think of |
02:09:02 | FromGitter | <zetashift> and godot isn't even a library |
02:09:05 | FromGitter | <zacharycarter> well - Godot isn't simple |
02:09:07 | FromGitter | <irskep> readme: "Deprecaded since sdl2 came out. Still works and could be used for reference, though." |
02:09:16 | FromGitter | <zacharycarter> yeah - try Nimgame2 |
02:09:24 | FromGitter | <irskep> deeper googling: https://vladar4.github.io/nimgame2/ |
02:09:30 | FromGitter | <zetashift> https://github.com/Vladar4/nimgame2 |
02:09:37 | FromGitter | <zacharycarter> https://vladar4.github.io/nimgame2/index.html |
02:09:40 | FromGitter | <zacharycarter> haha |
02:10:04 | FromGitter | <zetashift> it's all in Nim and the samples are great, I tried some stuff in it! |
02:10:06 | FromGitter | <zacharycarter> @irskep - please don't get me wrong - raylib is fantastic |
02:10:09 | FromGitter | <zacharycarter> but it is not high level |
02:10:20 | FromGitter | <irskep> I know :-) I don't actually need "high-level," I need "simple" |
02:10:25 | FromGitter | <zacharycarter> you'll end up re-implementing a lot of stuff other already existing libraries do for you |
02:10:30 | FromGitter | <irskep> so seeing this cheatsheet made me really happy https://www.raylib.com/cheatsheet/cheatsheet.html |
02:10:56 | FromGitter | <zacharycarter> well - raylib's API is akin to XNA's |
02:11:02 | FromGitter | <zacharycarter> and people loved XNA for its simplicity |
02:11:09 | FromGitter | <irskep> I'm the kind of person who wants to redo a lot of things anyway |
02:11:22 | FromGitter | <zacharycarter> maybe you should work on a game engine with me ;P |
02:11:35 | FromGitter | <irskep> nope, I have a rule: no hobby projects that come with long term commitments |
02:11:38 | FromGitter | <zacharycarter> or maybe you don't want to re-do THAT many things haha |
02:11:41 | FromGitter | <irskep> g2g, I'll be back later :-) |
02:11:50 | FromGitter | <zacharycarter> o/ cya later |
02:12:54 | * | secondchoice quit (Read error: Connection reset by peer) |
02:14:17 | FromGitter | <zacharycarter> @zetashift - I'm excited :D about to boot up my new PC |
02:15:51 | * | theelous3 quit (Ping timeout: 268 seconds) |
02:29:14 | FromGitter | <zetashift> @zacharycarter nice!! always sweet |
02:32:26 | FromGitter | <zacharycarter> I wish I had the RGB header cable(s) I need - the pictures would be better |
02:32:27 | FromGitter | <zacharycarter> doh well |
02:40:06 | * | NimBot joined #nim |
02:45:50 | * | Tyresc quit (Quit: WeeChat 2.4-dev) |
03:09:02 | * | banc quit (Ping timeout: 250 seconds) |
03:11:10 | FromDiscord_ | <exelotl> irskep: wow a rule like that would have saved myself and those around me from a lot of disappointment over the years xD |
03:15:54 | * | dddddd quit (Remote host closed the connection) |
03:26:22 | * | abm quit (Ping timeout: 250 seconds) |
03:26:45 | FromGitter | <zacharycarter> https://imgur.com/a/zRK3aAg |
03:37:57 | * | lritter quit (Ping timeout: 246 seconds) |
03:38:56 | * | lritter joined #nim |
03:42:57 | * | leorize quit (Read error: Connection reset by peer) |
03:46:32 | * | leorize joined #nim |
04:03:04 | * | seni quit (Ping timeout: 272 seconds) |
04:15:06 | * | d10n joined #nim |
04:15:41 | d10n | Hey, it has been a while since I did something with Nim and I noticed a forum post asking for opinions about style insensitivity |
04:17:38 | d10n | I prefer not to write a post but I have some thoughts |
04:20:06 | d10n | style insensitivity may make simple tools like grep harder to use. Case insensitivity can be user-friendly in some cases but I would not intuitively expect foo_bar to be the same as foobar |
04:21:34 | leorize | I expect it to be the same as fooBar :P |
04:22:22 | leorize | I've been spoiled by early versions of Nim :P |
04:23:50 | d10n | If there was a way to enforce style consistency despite having style insensitivity I think that would make Nim much more appealing or easier to sell to a team |
04:24:15 | leorize | --styleCheck:error |
04:24:28 | leorize | ^ that's a new flag for the compiler :) |
04:25:17 | d10n | awesome I will have to try it out |
04:27:09 | d10n | I might suggest making it default if it isn't already. Lots of languages have lots of useless noise like 'use strict', Option Strict, set -euo pipefail, use warnings |
04:27:52 | leorize | you can put it in the global config file |
04:29:08 | leorize | or the project-wide config file |
04:29:57 | d10n | minimizing configuration required to get a preference most people will have is ideal. I guess the question is how much of the general population that wants a language like Nim also wants stricter defaults |
04:30:13 | leorize | well, styleCheck enforces NEP1 |
04:30:50 | leorize | and some people might not like NEP1 identifiers |
04:33:02 | d10n | I don't know about NEP1 yet but whatever it suggests will become my preference for Nim. The fewer style debates the better |
04:34:55 | d10n | Python lets you mix tabs and spaces but if it enforced spaces then there would be less hair pulling |
04:35:09 | leorize | https://nim-lang.org/docs/nep1.html |
04:37:54 | FromGitter | <gogolxdong> ocasinally occurs [Warning] WS negotiation failed: the only supported sec-websocket-version is 13 ⏎ ../../usr/local/Nim/lib/system.nim(3011) sysFatal ⏎ ../../usr/local/Nim/lib/pure/asyncfutures.nim(308) read ⏎ ../../usr/local/Nim/lib/pure/asyncfutures.nim(355) :anonymous ⏎ Error: unhandled exception: /usr/local/Nim/lib/pure/ioselects/ioselectors_epoll.nim(196, 11) ` ... |
04:37:54 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=5c43fb22f780a1521f3b0178] |
04:41:06 | d10n | I think a good summary of my thoughts is that I prefer to reduce bikeshedding, minimize configuration and operational overhead required for conventional projects, and facilitate integration with tooling |
04:41:51 | d10n | I'd like to read more peoples' opinions |
04:42:10 | leorize | you can read that thread in the forums :P |
04:42:22 | leorize | people are mostly asleep at this time of day |
04:42:22 | d10n | yep, short thread though :( |
04:55:23 | rayman22201 | Style insensitivity has been discussed to death: |
04:55:23 | rayman22201 | https://forum.nim-lang.org/t/4483 |
04:55:23 | rayman22201 | https://forum.nim-lang.org/t/4388 |
04:55:23 | rayman22201 | https://github.com/nim-lang/Nim/issues/9980 |
04:55:23 | rayman22201 | many other places and irc logs I'm sure.... |
04:58:08 | * | nsf joined #nim |
04:58:09 | rayman22201 | What ever your opinion is on the matter, the fact remains, atm, there is no chance of style insensitivity going anywhere any time soon. Araq has shown that he is firm on this point many times. |
04:58:41 | d10n | what's your opinion? |
04:58:58 | rayman22201 | Or I should say, nobody has yet given him a convincing enough argument to change it :-P |
05:02:33 | d10n | oh I was skipping right over the "load more posts" links |
05:02:35 | rayman22201 | My opinion doesn't matter. As you said, "I prefer to reduce bikeshedding". I think Nim is a great language with or without style insensitivity. |
05:04:00 | d10n | bikeshedding stops once the bike shed is my favorite color though |
05:04:03 | d10n | :) |
05:04:05 | rayman22201 | lol. fair enough. I could see how the load more posts link could be easily missed. |
05:05:09 | rayman22201 | lol |
05:44:07 | * | darithorn quit (Quit: Leaving) |
06:40:58 | * | rockcavera joined #nim |
06:46:43 | * | vlad1777d joined #nim |
06:54:38 | * | narimiran joined #nim |
07:51:19 | * | hoijui joined #nim |
07:51:31 | * | hoijui quit (Remote host closed the connection) |
07:54:41 | * | zyklon joined #nim |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:32 | * | gmpreussner joined #nim |
08:40:43 | FromGitter | <Bennyelg> Hey, How can I pass ⏎ seq[JsonNode] as a key to json object ⏎ ⏎ ```SUCCESS_200.add("content", parseJson(students))``` [https://gitter.im/nim-lang/Nim?at=5c44340bf780a1521f3c38cd] |
08:43:45 | * | banc joined #nim |
08:48:14 | Araq | keys must be string. |
08:49:23 | Araq | obj["content"] = parseJson(students) |
08:49:34 | Araq | is I think what you're looking for. |
08:59:53 | * | cspar joined #nim |
09:10:37 | * | nsf quit (Quit: WeeChat 2.3) |
10:10:38 | leorize | Araq: what do you think about this? https://github.com/nim-lang/Nim/pull/10361#issuecomment-455748732 |
10:16:15 | * | vlad1777d quit (Ping timeout: 246 seconds) |
10:18:54 | * | seni joined #nim |
10:25:37 | * | aguspiza joined #nim |
10:26:14 | * | cspar_ joined #nim |
10:26:47 | * | cspar quit (Ping timeout: 240 seconds) |
10:27:59 | Zevv | !eval echo "test" |
10:28:00 | NimBot | Compile failed: <no output> |
10:28:49 | * | nsf joined #nim |
10:39:03 | * | stefanos82 joined #nim |
10:52:15 | * | cspar joined #nim |
10:52:47 | * | cspar_ quit (Ping timeout: 240 seconds) |
10:56:36 | * | cspar quit (Ping timeout: 250 seconds) |
11:01:36 | FromGitter | <Bennyelg> @Araq students is typed `var students: seq[JsonNode] = @[]` doing `let studentsContent = parseJson(students)` results `proc parseJson(buffer: string): JsonNode ⏎ proc parseJson(s: Stream; filename: string = ""): JsonNode ⏎ ⏎ expression: parseJson(students)` ⏎ should I parse it to string first ? [https://gitter.im/nim-lang/Nim?at=5c44551020b78635b65287ef] |
11:02:03 | FromGitter | <Bennyelg> this works `parseJson($students)` |
11:24:07 | * | ng0 joined #nim |
11:24:29 | * | Vladar joined #nim |
11:31:23 | Araq | seq[JsonNode] makes little sense, better is a JsonNode that is a JArray |
11:32:41 | FromGitter | <Bennyelg> How I define JArray like so |
11:35:09 | Araq | var students = newJArray() iirc |
11:35:24 | Araq | students.add jsonStudent |
11:35:58 | * | enow joined #nim |
11:36:41 | enow | not sure if anyone sympathises with my HTML VNC clone, but I got mjpeg streming up and running, with a partial libjpeg binding |
11:37:36 | FromGitter | <Bennyelg> @Araq thanks! now it's make sense! |
11:39:18 | * | vonHabsi__ joined #nim |
11:40:06 | * | vonHabsi1 joined #nim |
11:40:43 | * | vonHabsi quit (Ping timeout: 246 seconds) |
11:41:37 | * | vonHabsi_ quit (Ping timeout: 244 seconds) |
11:47:23 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c445fcb95e17b45257eb4f7] |
11:48:35 | FromGitter | <Bennyelg> heterogeneous types not supported ?(means only string? ) |
11:49:08 | FromGitter | <Bennyelg> oh the Datetime was doing the trouble :/ |
12:01:39 | * | nsf quit (Quit: WeeChat 2.3) |
12:03:48 | * | narimiran quit (Ping timeout: 245 seconds) |
12:42:05 | * | Yardanico quit (Quit: No Ping reply in 180 seconds.) |
12:43:31 | * | Yardanico joined #nim |
13:29:56 | * | narimiran joined #nim |
13:41:41 | * | nsf joined #nim |
13:50:40 | * | zyklon_ joined #nim |
13:52:08 | * | zyklon quit (Ping timeout: 245 seconds) |
13:54:26 | * | Vladar quit (Remote host closed the connection) |
14:03:48 | FromGitter | <zacharycarter> I'll look into fixing the playground later today - need to figure out what happened first. Got an e-mail from someone saying they ran `while true: discard ⏎ fork()` |
14:04:10 | FromGitter | <zacharycarter> but now apparently, the service I had installed on the box, doesn't exist |
14:04:33 | FromGitter | <zacharycarter> by service - I mean the nim-playground.service I had created with systemd |
14:05:30 | FromGitter | <zacharycarter> I guess I'll have to disable forking of processes somehow |
14:16:28 | FromGitter | <deech> Hi, `nimble`'s `before` hook doesn't seem to be working as documented, I have: ⏎ ⏎ ```before build: ⏎ echo "before build"``` ⏎ ⏎ in my `nimble` file and doing `nimble build` doesn't seem to invoke it. [https://gitter.im/nim-lang/Nim?at=5c4482bccb47ec30007332a2] |
14:18:04 | FromGitter | <deech> This is with `nimble` built with `koch tools` so presumably from `master`. |
14:19:53 | FromGitter | <timotheecour> @zacharycarter here’s a better way to prevent fork bombs wo disbling forking of processes: https://www.cyberciti.biz/tips/linux-limiting-user-process.html |
14:20:47 | FromGitter | <timotheecour> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4483be83189945241cf619] |
14:21:33 | leorize | it doesn't really work in this case imo |
14:21:33 | * | zyklon_ quit (Read error: Connection reset by peer) |
14:21:43 | leorize | because every process will run with that user |
14:22:04 | leorize | a fork bomb might not be able to bring down the system, but that user would still be useless |
14:22:28 | FromGitter | <zacharycarter> thanks - I can try a few things |
14:22:28 | FromGitter | <timotheecour> ok so it’s still an improvement over crashing the system |
14:22:35 | FromGitter | <timotheecour> could we use a user pool ? |
14:22:43 | FromGitter | <zacharycarter> what I'm confused by is this - why is the service no longer present on the box... |
14:22:48 | FromGitter | <zacharycarter> I didn't ssh in and delete it or anything |
14:23:13 | leorize | or you could just put them in a cgroups |
14:23:20 | leorize | then limit nproc there |
14:23:30 | leorize | after a set amount of time kill the cgroup |
14:24:22 | FromGitter | <timotheecour> btw u prob wanna limit other things too (again, see https://www.unixmen.com/fork-bomb-can-prevent-danger/) |
14:28:05 | FromGitter | <timotheecour> @zacharycarter can each user run inside a docker container? then each is isolated, and docker has a prevention against fork bombs via: |
14:28:07 | FromGitter | <zacharycarter> I was limiting some things through docker - but I'll have a look at that later this afternoon |
14:28:08 | FromGitter | <timotheecour> `But, Docker 1.11 introduced a "--pid-limits" option which limits the number of processes on the container to protect from the fork bomb**.` |
14:28:14 | FromGitter | <zacharycarter> potentially |
14:28:43 | FromGitter | <zacharycarter> somehow the nim-playground.service file got destroyed - it's no longer in /etc/systemd/system |
14:29:06 | FromGitter | <zacharycarter> so I'm going to have to re-create it and figure out what all needs to go in it |
14:29:15 | FromGitter | <zacharycarter> I'll work on it this afternoon - I don't have time this morning |
14:29:34 | leorize | so how's the playground still running w/o that service? |
14:30:00 | FromGitter | <zacharycarter> it's not |
14:30:11 | FromGitter | <zacharycarter> it's been down since it got hit with the fork bomb |
14:30:22 | leorize | !eval echo "hello, world!" |
14:30:23 | NimBot | Compile failed: <no output> |
14:30:25 | FromGitter | <zacharycarter> guy said he did it on friday |
14:30:30 | leorize | same for our bot :P |
14:30:32 | FromGitter | <zacharycarter> that's the Nim bot - Nim bot != nim playground |
14:30:33 | FromGitter | <zacharycarter> yeah |
14:30:37 | FromGitter | <zacharycarter> but it uses the playground |
14:30:53 | FromGitter | <timotheecour> just to clarify: currently each user didn’t run inside a docker container, correct? |
14:31:20 | FromGitter | <zacharycarter> every request ran inside of a docker container |
14:31:46 | leorize | do you have a timeout for them? |
14:31:47 | FromGitter | <timotheecour> separate one for each user? |
14:31:56 | FromGitter | <zacharycarter> https://github.com/zacharycarter/nim-playground/blob/master/src/nim_playground.nim#L65 |
14:32:06 | FromGitter | <zacharycarter> I don't know what you mean by each user |
14:32:21 | FromGitter | <zacharycarter> I'm not messing with system users in any capacity |
14:32:24 | * | dom96_ joined #nim |
14:32:38 | FromGitter | <zacharycarter> yes there is a timeout |
14:32:39 | dom96_ | May want to check if your server got pwned |
14:33:02 | FromGitter | <zacharycarter> well - some files appear to still be there |
14:33:06 | dom96_ | As in someone was able to reverse tunnel into your server and delete your services |
14:33:11 | dom96_ | And god knows what else |
14:33:13 | FromGitter | <timotheecour> each user as in each logged in user |
14:33:45 | leorize | timotheecour: I don't think he needs that |
14:34:12 | leorize | everytime you clicked "Run" a new container is spawn if I understand correctly |
14:34:18 | dom96_ | Also. Are you sure docker doesn’t protect against fork bombs? |
14:34:41 | FromGitter | <zacharycarter> Off the top of my head I'm not sure |
14:34:43 | FromGitter | <timotheecour> it does, via the newish options `--pid-limits` |
14:34:54 | FromGitter | <zacharycarter> well yeah - there's that too |
14:35:00 | FromGitter | <timotheecour> so that seems like an easy thing to try |
14:35:01 | FromGitter | <zacharycarter> as @timotheecour pointed out earlier |
14:35:11 | dom96_ | In any case, we’ll be loving the playground to our servers soon |
14:35:31 | dom96_ | *moving |
14:35:36 | leorize | dom96_: can you fix NimBot? |
14:36:17 | FromGitter | <zacharycarter> dom96_: are you guys just building a new version or something? I spoke with PMunch a few weeks ago regarding handing it over to him |
14:36:23 | FromGitter | <zacharycarter> but we were waiting for you to be available |
14:36:24 | FromGitter | <timotheecour> > everytime you clicked "Run" a new container is spawn if I understand correctly ⏎ ⏎ why not use 1 per user instead of 1 per “run” (eg using a cookie to identify user) ; would make it more efficeint |
14:36:27 | FromGitter | <zacharycarter> but if something is already in the works.... |
14:36:51 | leorize | timotheecour: because you'd want timing out |
14:37:20 | leorize | also containers are lightweight so there shouldn't be much problem spining them up rapidly |
14:37:43 | FromGitter | <timotheecour> well u can also do timing out, doesn’t seem hard conceptually |
14:38:30 | leorize | it's still hard, you'd want to kill every spawned processes |
14:38:36 | leorize | either you do docker-in-docker |
14:38:41 | * | zyklon_ joined #nim |
14:38:41 | * | dom96__ joined #nim |
14:38:44 | leorize | or hack up your own cgroups-based solution |
14:38:55 | dom96__ | leorize: fix what? |
14:39:05 | leorize | !eval echo "hello" |
14:39:05 | NimBot | Compile failed: <no output> |
14:39:09 | leorize | ^ that |
14:39:23 | leorize | someone on IRC ran a fork bomb here as well |
14:39:38 | FromGitter | <zacharycarter> nimbot uses the playground |
14:39:44 | FromGitter | <zacharycarter> so if pg is down - nimbot won't work |
14:40:11 | * | dom96_ quit (Ping timeout: 256 seconds) |
14:42:36 | FromGitter | <zacharycarter> looks like someone was def brute forcing the box |
14:43:31 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c448912c45b986d118f01c0] |
14:43:35 | * | dom96__ quit (Ping timeout: 256 seconds) |
14:44:05 | leorize | I believe you used pubkey auth, yes? |
14:45:26 | FromGitter | <zacharycarter> I don't know if I ever set that up for this droplet |
14:45:54 | FromGitter | <zacharycarter> anyway - I need to go run some errands and take the dog for a walk, I'll work on re-creating the droplet this afternoon |
14:51:13 | FromGitter | <deech> So I see the reason I'm not able to add a `before` hook to `build` is because `build` is built-in and not a `task` in the same sense as `task foo, "...": ...`, so I guess my question becomes how do I wrap a `build` in my `.nimble` file? |
14:53:09 | FromGitter | <zacharycarter> DO will let me rebuild the droplet with the same IP |
14:53:24 | FromGitter | <zacharycarter> so we don't have to mess with any networking rules - I'll try to secure it better this time, and will report back with what steps I take |
14:53:33 | FromGitter | <zacharycarter> I'm not, and don't pretend to be, a sys admin |
14:54:01 | FromGitter | <zacharycarter> so help in this area will be useful once I've got something that we can secure :) |
14:57:18 | FromGitter | <deech> The hackiest way seems to be to invoke `nimble build` from the task itself but I'm hoping there's a better way. |
15:02:44 | * | Geezus42 quit (Ping timeout: 250 seconds) |
15:03:11 | FromGitter | <zacharycarter> @deech - I think that's how I've usually done it before |
15:03:18 | FromGitter | <zacharycarter> I basically make a new task and then call build from it |
15:03:25 | FromGitter | <zacharycarter> and make that my "new build task" |
15:04:10 | * | skellock joined #nim |
15:04:33 | * | Geezus42 joined #nim |
15:09:12 | * | Geezus42 quit (Ping timeout: 246 seconds) |
15:21:11 | Calinou | there's a Nim project in /trending at the bottom! https://github.com/trending |
15:21:54 | FromGitter | <zacharycarter> \o/ |
15:22:01 | FromGitter | <zacharycarter> wasn't even aware of pipelines - looks neat! |
15:25:52 | Zevv | Has anyone ever tried targeting the Nim compiler itself to JS? |
15:25:53 | * | Geezus42 joined #nim |
15:26:31 | Zevv | zacharycarter: btw, pleased to meet you. Ico here |
15:26:41 | FromGitter | <deech> @zacharycarter Thanks! |
15:26:51 | FromGitter | <zacharycarter> Likewise Zevv :D I didn't realize it was you :) |
15:27:00 | FromGitter | <zacharycarter> @deech - no problem bud! |
15:27:49 | FromGitter | <deech> How does passing a command line flag to `nimble` work? I have this in my `.nimble` file: ⏎ ⏎ ```when defined(foo): ⏎ echo "foo is defined"``` ⏎ ⏎ and I invoked `nimble` with `nimble build -d:foo` but I don't see the echo output. [https://gitter.im/nim-lang/Nim?at=5c449375f780a1521f3e8793] |
15:35:40 | * | lritter quit (Ping timeout: 268 seconds) |
15:42:49 | * | dddddd joined #nim |
15:44:12 | dom96 | Disabling password auth is like the first thing you do :( |
15:47:25 | dom96 | deech: hrm, IIRC `before build` should work. |
15:48:47 | FromGitter | <deech> dom96: It doesn't seem to, this is `nimble` built from `master` as of a couple of hours ago: ⏎ ⏎ ```before build: ⏎ echo "before build"``` [https://gitter.im/nim-lang/Nim?at=5c44985fdab15872cec4be25] |
15:50:39 | FromGitter | <deech> dom96: Also how do I check whether a flag has been passed in, eg. `-d:foo`? `when defined(foo): ...` does not seem to work and I can't find a function that retrieves flags in the nimscript docs. https://nim-lang.org/docs/nimscript.html |
15:51:04 | dom96 | You can't do that right now I'm afraid |
15:51:46 | dom96 | Looks like there is a test for `before install` but nothing for `build` https://github.com/nim-lang/nimble/blob/master/tests/nimscript/nimscript.nimble#L48 |
15:51:49 | dom96 | Please make an issue |
15:52:43 | FromGitter | <deech> Should I also make an issue for getting defined flags or is that out of scope for near future? |
15:53:01 | * | zyklon_ quit (Read error: Connection reset by peer) |
15:56:56 | dom96 | Yeah, make an issue for that too. Could have sworn it already exists but can't find it |
16:01:52 | * | darithorn joined #nim |
16:03:11 | FromGitter | <deech> Done. |
16:09:39 | * | abm joined #nim |
16:10:31 | * | zyklon_ joined #nim |
16:11:42 | narimiran | "/home/miran/.choosenim/toolchains/nim-0.19.2/lib/pure/parseutils.nim(1, 2) Error: module names need to be unique per Nimble package; module clashes with /home/miran/Documents/programming/nim/Nim/lib/pure/parseutils.nim" !?! |
16:13:56 | shashlick | I've been looking into Linux binary builds for nightlies |
16:14:20 | shashlick | Does anyone know how to include binaries into koch xz |
16:14:44 | shashlick | I tried updating installer.ini but it didn't work |
16:15:47 | FromGitter | <zacharycarter> Dom96: as I said, I dont maintain linux boxes or servers... |
16:16:14 | Zevv | hehe blame game on the playground hack :) |
16:16:50 | FromGitter | <zacharycarter> Its not an area Im knowledgable in |
16:16:51 | Zevv | noone likes system administration |
16:17:19 | dom96 | Digital Ocean has multiple awesome guides that explain step by step how to set up servers |
16:18:15 | FromGitter | <zacharycarter> Well I will refer to more of them this time around. |
16:19:01 | Zevv | i suggest retricting all but the required syscalls on execution. |
16:19:16 | Zevv | if it comes back up and allows networking I'll start a spambot |
16:19:37 | * | leorize quit (Quit: WeeChat 2.3) |
16:19:47 | * | leorize joined #nim |
16:19:52 | Zevv | but i'll donate my earning to araq |
16:22:44 | FromGitter | <zacharycarter> It never allowed networking to my knowledge |
16:23:45 | Zevv | too bad :) |
16:24:08 | Zevv | on the serious note: if there is anything I can do to help |
16:26:20 | FromGitter | <zacharycarter> I appreciate it - once I have things set up Ill ask for some feedback |
16:26:30 | Zevv | ok |
16:26:54 | FromGitter | <zacharycarter> Should be later this afternoon |
16:34:43 | * | aguspiza quit (Ping timeout: 246 seconds) |
16:42:26 | * | couven92 quit (Quit: Client disconnecting) |
16:46:08 | shashlick | If anyone can help with niminst / installer / xz, please ping |
16:47:23 | * | vlad1777d joined #nim |
16:52:08 | * | Geezus42 quit (Ping timeout: 244 seconds) |
16:54:00 | * | Geezus42 joined #nim |
16:54:01 | * | zyklon_ quit (Read error: Connection reset by peer) |
17:08:50 | * | Geezus42 quit (Ping timeout: 250 seconds) |
17:10:31 | * | zyklon_ joined #nim |
17:11:23 | * | Geezus42 joined #nim |
17:14:18 | * | Trustable joined #nim |
17:15:07 | * | darithorn quit (Read error: Connection reset by peer) |
17:28:35 | FromGitter | <alehander42> The compiler is strongly based on files and |
17:35:34 | * | PMunch joined #nim |
17:51:04 | FromGitter | <zetashift> damn finally got godot-nim to compile on latest devel |
17:51:26 | skellock | \o/ |
17:51:30 | * | PMunch quit (Excess Flood) |
17:51:55 | * | PMunch joined #nim |
17:52:35 | PMunch | zetashift, nice! |
17:56:37 | * | vlad1777d quit (Ping timeout: 246 seconds) |
18:10:00 | FromGitter | <zetashift> main bulk of errors was solved by bluenote's I just had 2 other macro errors to solve |
18:22:22 | shashlick | any linux users here? want to test out a nightly binary build of linux |
18:22:56 | shashlick | built using holy build box, want to see if it works on different linux versions |
18:23:54 | enow | shashlick: yeah I'm on linux |
18:24:19 | enow | Ubuntu 18.04 to be specific |
18:24:51 | shashlick | ok that's what I have too 😄 |
18:25:11 | Zevv | shashlick: I have access to a dozen different dists and versions I think |
18:25:55 | Zevv | make that half a dozen, to be on the safe side |
18:27:08 | Zevv | we have some kind of server farm thingy at my customer on site where I can spin vm boxes of all flavours |
18:27:35 | shashlick | oh nice |
18:27:44 | shashlick | i need to clean up some more stuff, will post a link shortly |
18:27:53 | shashlick | based on 1/20 nightly build |
18:28:19 | Zevv | ok, Ill try some this evening, otherwise tomorrow morgning |
18:29:25 | FromGitter | <irskep> followup from yesterday: I tried importing raylib with nimterop and it's not going very well |
18:29:43 | shashlick | what issues are you seeing? |
18:30:17 | * | hoijui joined #nim |
18:30:17 | FromGitter | <irskep> 1) it defines an anonymous struct that nimterop can't handle (`typedef struct MusicData *Music`) |
18:30:38 | FromGitter | <irskep> 1) it imports stdarg.h but nimterop doesn't seem to actually recurse into that header even if I ask it to, so I get an 'undeclared identifier' later on |
18:31:42 | FromGitter | <irskep> my code: https://gist.github.com/irskep/546ea1dd2525f166d0026160468f8273 |
18:31:48 | * | aguspiza joined #nim |
18:31:54 | FromGitter | <irskep> the header: https://github.com/raysan5/raylib/blob/master/src/raylib.h |
18:31:56 | shashlick | cool, both are known |
18:32:07 | shashlick | so #1 is not yet supported |
18:32:30 | shashlick | hold on, it's just a typedef, let me check that |
18:32:43 | shashlick | #2 - it is intentional not to recurse into standard libraries |
18:32:50 | shashlick | which symbol is being missed? |
18:32:54 | FromGitter | <irskep> va_list |
18:33:00 | FromGitter | <irskep> thanks for your help btw! |
18:33:10 | shashlick | yes that is also known, i have no idea what that should translate into |
18:35:37 | FromGitter | <irskep> In the c2nim wrapper for this library, the MusicData struct ends up as `Music* {.importc, incompleteStruct.} = object` |
18:35:53 | shashlick | well, MusicData isn't defined in the file at all |
18:36:52 | shashlick | a workaround is to add a type MusicData {.import.} = object at the top of your nim file |
18:37:53 | FromGitter | <irskep> that doesn't compile, unless I'm missing something obvious. my nim experience is still pretty small. `Error: expression expected, but found 'keyword import'` |
18:38:08 | FromGitter | <zacharycarter> `importc` |
18:38:12 | FromGitter | <zacharycarter> not `import` |
18:38:23 | FromGitter | <irskep> :-) thought of it just as I finished typing |
18:38:30 | shashlick | yep sorry 🙂 |
18:38:34 | FromGitter | <zacharycarter> she's purty |
18:38:34 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/v2EL/3863675606325646862.jpg) |
18:38:51 | FromGitter | <irskep> Is there any way around the va_list issue? |
18:38:51 | shashlick | so MusicData is defined in raudio.c so best to put in that line |
18:39:44 | FromGitter | <zacharycarter> yes |
18:39:48 | shashlick | so only proc that uses va_list is TraceLogCallback - if you don't intend using that, you can simply do type va_list = object and call it a day |
18:39:50 | FromGitter | <zacharycarter> there is a way around the va_list stuff |
18:40:13 | shashlick | @zacharycarter - if you know how va_list translates to nim, i can implement that in nimterop |
18:40:34 | FromGitter | <zacharycarter> https://github.com/zacharycarter/bgfx.nim/blob/0cd707680a9ee17dd024e42521766832dac451f9/bgfxdotnim.nim#L15 |
18:40:41 | FromGitter | <irskep> if I wnated to use TraceLogCallback I suppose I could simply write it in C :-) |
18:40:41 | FromGitter | <zacharycarter> see if that will work for you? |
18:41:07 | FromGitter | <irskep> Certainly for now! if I hit a wall later then I will have more interesting problems |
18:41:09 | FromGitter | <irskep> thanks! |
18:41:20 | FromGitter | <zacharycarter> it's worked for me in using BGFX for a while now - I think Andreas originally helped me with it |
18:41:22 | FromGitter | <zacharycarter> years ago |
18:41:32 | FromGitter | <zacharycarter> np! glad to help! |
18:41:47 | shashlick | @zacharycarter - but how do you use those procs? what's va_list - an array of cstring? |
18:41:58 | FromGitter | <zacharycarter> I can find examples |
18:41:59 | FromGitter | <zacharycarter> one sec |
18:42:22 | FromGitter | <zacharycarter> oh - you'd just cast it to a va_list |
18:42:37 | FromGitter | <zacharycarter> also - I'm guessing I should have a `bycopy` included in the pragma |
18:43:08 | FromGitter | <zacharycarter> so when calling the proc, the va_list parameter would be - `castva_list (param)` |
18:43:23 | FromGitter | <zacharycarter> and that should be fine - however please rename va_list to your liking |
18:43:56 | shashlick | what would param be in nim? |
18:44:58 | shashlick | it looks like va_list would only exist at compile time |
18:46:14 | FromGitter | <zacharycarter> why would it only exist at CT? |
18:46:48 | FromGitter | <zacharycarter> I see your point though regarding the Nim type |
18:47:53 | FromGitter | <zacharycarter> shashlick, @irskep : just found this - https://github.com/judofyr/bob/blob/20c6dcbf59ae41410256bdf81e1a4362d423df47/bobpreload.nim#L175-L200 |
18:47:58 | FromGitter | <zacharycarter> seems like it would work, but it's fugly |
18:48:00 | shashlick | it say macro all over the place so I'm wondering what it really is at runtime |
18:48:56 | FromGitter | <zacharycarter> this is why I really hope nimterop succeeds |
18:49:10 | FromGitter | <zacharycarter> because w/ languages like Zig - these things aren't headaches |
18:49:19 | shashlick | ok so as far as nimterop is concerned, all i have to do is declare that type and walk away |
18:49:29 | FromGitter | <zacharycarter> assuming the ABI is already supported - which in many cases it isn't - Zig isn't a panacea either |
18:49:32 | FromGitter | <irskep> nimterop is working OK for me so far, but if I put more code in the same nim file as the cimport, vscode doesn't see any of the imports :-( |
18:49:38 | shashlick | if you want to use va_list, you have to generate the appropriate C code |
18:49:43 | FromGitter | <zacharycarter> seems like it |
18:49:50 | FromGitter | <zacharycarter> but that isn't very ergonomic |
18:50:10 | shashlick | such is life, if you want C, you have to interface with it |
18:50:23 | shashlick | i'll bet zig also has to deal with this preprocessor grade stuff |
18:50:26 | FromGitter | <zacharycarter> and I suppose this is why LLVM is an increasingly more attractive option |
18:50:29 | * | abm quit (Quit: Leaving) |
18:50:51 | FromGitter | <zacharycarter> well, it does I'm sure - but with the LLVM backend it doesn't have such a large splash on userland |
18:50:58 | FromGitter | <zacharycarter> like Nim's C interop does |
18:51:04 | shashlick | @irskep: i think you'd do one of two things - simply import this file in your main code or generate a static file with toast and import that |
18:51:07 | FromGitter | <zacharycarter> then again - Zig can't touch C++ code - so I suppose there are tradeoffs |
18:51:34 | shashlick | if you want to see the generated nim code, you will have to do the latter |
18:51:46 | FromGitter | <irskep> Easy enough to wrap it in its own nim file :-) |
18:52:10 | shashlick | i believe you would rather refer to the C code headers, documentation and examples |
18:52:15 | Araq | C interop is always a headache if you seek to improve over C. |
18:52:50 | shashlick | so don't see the point in caching the nim file, but there are others who prefer that method so both are possible |
18:53:06 | FromGitter | <zacharycarter> yeah - I guess that's why Zig's approach is to try and replace C, rather than improve upon it |
18:53:13 | shashlick | hey Araq - please see my questions from earlier on koch xz |
18:53:17 | FromGitter | <zacharycarter> which in its own right, is quite ambitious |
18:53:30 | Araq | C's pointer: points to one, points to many, who knows? is it supposed to be an address on the stack, can I pass &s to char**. Nobody knows. |
18:54:14 | ryukoposting | The problem with C interop is that pointer behavior lies in semantics |
18:54:35 | FromGitter | <zacharycarter> you forgot to do `/me appears out of thin air` |
18:54:36 | FromGitter | <zacharycarter> :P |
18:54:41 | Araq | the problem is C's type system is absurdly underspecified |
18:54:43 | shashlick | what's a good place to share binary files |
18:54:48 | FromGitter | <zacharycarter> bintray? |
18:55:04 | ryukoposting | which means it interfaces extremely well with asm, and is very easy to translate into machine code for most architectures, but makes it very difficult to create higher level abstractions |
18:55:05 | shashlick | that's paid right? |
18:55:11 | shashlick | need a pastebin type service for binaries |
18:55:33 | FromGitter | <zacharycarter> I think so - not sure of non-enterprise offerings |
18:55:42 | ryukoposting | C's type system is very lacking, there are a lot of things that it could do without negating any of the language's strengths |
18:55:50 | FromGitter | <zacharycarter> I figured they had an OSS version - but I guess not :/ |
18:55:58 | * | zyklon_ quit (Read error: Connection reset by peer) |
18:56:04 | Araq | oh not that again. C is NOT low level, it is not assembler like. C has a stack abstraction |
18:56:06 | ryukoposting | >zyklon_ |
18:56:09 | ryukoposting | now that's a name |
18:56:35 | ryukoposting | Araq I don't mean to say it's "low level" |
18:57:43 | ryukoposting | but it's certainly less abstracted than most high-level languages |
18:59:18 | * | abm joined #nim |
19:00:03 | FromGitter | <irskep> I got the raylib "first person shooter" demo working! had to declare the color constants in nim, but no other hiccups. I am amazed. |
19:01:04 | shashlick | ok anyone who has a linux, please try out this nim nightly build and see if it works - all binaries are already compiled so just need to run bin/nim |
19:01:10 | shashlick | http://www.filedropper.com/nim-0199-linuxx64tar |
19:01:15 | ryukoposting | on it |
19:01:18 | Araq | ryukoposting: so what, its only merit is its good interop with the rest of the world because the rest of the world had to place nice with what the OS exposes |
19:01:30 | Araq | *play nice |
19:02:31 | FromGitter | <irskep> Is there a reason why my editor is still claiming all of the raylib symbols used in this file are undefined, even after I moved all the nimterop code to its own file? https://github.com/irskep/raylibtest/blob/master/src/raylib.nim |
19:02:38 | * | abm quit (Client Quit) |
19:02:40 | dom96 | irskep: awesome, post about it on forum and/or reddit |
19:03:13 | dom96 | The editor is probably failing to re-run `nim check` |
19:03:16 | FromGitter | <irskep> Soon - I want to get through more examples to find corners of the API that I'm missing |
19:03:39 | dom96 | It really is a shame how bad that is, I mostly ignore it unless I'm working on a new project where it seems more reliable |
19:03:45 | shashlick | @irskep - cause none of the stuff from cimport is visible to vscode |
19:03:58 | FromGitter | <irskep> Weird, it autocompletes fine in another file |
19:04:09 | ryukoposting | it helps that its ABI is extremely simple, and that it doesn't make any sweeping assumptions about the underlying platform, e.g. heap as a userspace abstraction, architecture-defined integer widths (which do have weaknesses as well, yes) |
19:04:11 | Araq | restart your editor, can help |
19:04:28 | FromGitter | <irskep> yep, restarting the editor worked |
19:04:31 | Araq | no no no. its ABI is not simple. Alignments are complex |
19:04:44 | shashlick | oh so even though you only have a cimport, everything is visible? that's nice! |
19:04:45 | ryukoposting | alignments are a pain in the ass, yeah |
19:05:09 | Araq | and let's not even go into its aliasing rules. |
19:05:10 | shashlick | dom96 - for OSX, if you build on travis, will the binaries work on any Mac? |
19:05:29 | * | Vladar joined #nim |
19:05:55 | dom96 | Good question, I'm not too sure |
19:06:02 | ryukoposting | I guess my counterargument to both would be "find me a high-level language with a simpler ABI" |
19:07:24 | Araq | maybe Fortran had one. Would you know? |
19:07:39 | ryukoposting | not familiar enough with fortran to comment |
19:08:19 | Araq | well *nowadays* Fortran has to interface with C, so it has to replicate its alignments etc etc |
19:08:39 | Araq | which is why the "simpler ABI" cannot exist anymore, anywhere. |
19:08:52 | * | leorize quit (Quit: WeeChat 2.3) |
19:08:54 | ryukoposting | fair enough |
19:09:10 | * | leorize joined #nim |
19:09:16 | * | nsf quit (Quit: WeeChat 2.3) |
19:09:18 | ryukoposting | why would fortran need to interface with C? not trying to be facetious, I'm genuinely curious |
19:10:07 | ryukoposting | system calls, I guess maybe |
19:10:31 | Araq | because people enjoy being able to call C libs from Fortran. |
19:10:39 | Araq | I don't understand your question. |
19:10:58 | shashlick | is there value in posting 32-bit binaries for linux? |
19:11:00 | Araq | C interop is part of the ISO standard. |
19:11:07 | FromGitter | <irskep> Found out why my editor keeps breaking: because the process that's supporting it can't find the header (I used a relative path) |
19:12:01 | FromGitter | <irskep> but finding the right incantation to fix it hasn't worked yet. looks like there's a magic value $projpath that the tests use, but it doesn't seem to work for me |
19:13:08 | * | zyklon_ joined #nim |
19:13:20 | ryukoposting | so ISO made a stupid decision (which is their MO honestly) or there's some kind of value in C interop that outweighs the cost of the added complexity |
19:14:14 | Araq | obviously the latter. but C is not a good language, it's ubiquitous though and that's what matters most. |
19:14:49 | dom96 | shashlick: AFAIK 32 bit Linux is super rare nowadays |
19:15:16 | ryukoposting | it certainly has its flaws, I guess feel less strongly about its weaknesses than some |
19:17:05 | ryukoposting | shashlick any particular gcc version I should be using to build this? |
19:18:50 | Araq | C is just Modula 2 with a MUCH worse type system, a worse module system and a worse, objectively error prone syntax. |
19:19:10 | shashlick | Don't build |
19:19:13 | shashlick | It is already built |
19:19:15 | Araq | "you can keep its merits" my ass, there are none. |
19:19:26 | ryukoposting | too late shashlick lol |
19:19:54 | shashlick | Ok then it defeats the test |
19:20:18 | shashlick | We want to check if the same binary works across distros |
19:20:24 | ryukoposting | alright then, guess I'll download again |
19:22:04 | shashlick | :) |
19:22:17 | shashlick | What distro do you have |
19:22:43 | ryukoposting | Devuan ascii |
19:22:52 | ryukoposting | kernel 4.9.0 |
19:23:28 | Zevv | shashlick: how deep should I test? I running the nim binary enough? Or do you want a complete test suite? |
19:23:49 | dom96 | Linux binaries will work across distros as long as the glibc version it was compiled against is older than the distro you're running on |
19:24:19 | Zevv | dependencies are minimal, so I don't expect too much problems |
19:24:41 | Zevv | ^ what dom says |
19:25:08 | Zevv | I've tested back to ubuntu 12.04 |
19:25:22 | shashlick | Good test then |
19:25:26 | ryukoposting | that's usually the case, but regressions can sometimes cause weird stuff to pop up |
19:26:06 | shashlick | For starters if all the binaries run |
19:26:23 | shashlick | Can run tests too if you want |
19:26:24 | * | zyklon_ quit (Read error: Connection reset by peer) |
19:26:35 | Zevv | shipping binaries with linux is mostly a PITA if you have lots of complex lib dependencies. GUI apps are always hard with all the gtk/qt versions in the field. But with only libc and libpthreads this should be fine |
19:26:38 | shashlick | But use the pre-built binaries |
19:26:43 | Zevv | fcourse |
19:26:56 | Zevv | I'll test on 12.04, if that works you should be fine on all above |
19:27:01 | Zevv | and lets test some old centos's |
19:27:21 | Araq | you can use docker to distribute Linux binaries |
19:27:31 | Zevv | Baaah |
19:27:39 | ryukoposting | shashlick nimble works on one of my projects, so I'm assuming the compiler is doing its job too lol |
19:28:00 | shashlick | That's what I'm doing Araq |
19:28:08 | dom96 | lolwat |
19:28:12 | Araq | good. |
19:28:18 | shashlick | Well I'm building Nim using old glics |
19:28:27 | shashlick | Glibc |
19:28:52 | leorize | or you could build Nim with musl then bundles the library with :P |
19:29:17 | leorize | C interop story wouldn't be nice afterwards, but it's something :P |
19:29:34 | Araq | dunno, Linux begged for docker, so give it docker. |
19:29:44 | dom96 | Are we really just making people install Docker for apps? |
19:29:54 | ryukoposting | I'd rather not |
19:29:59 | Zevv | or snap, or whatever kludge |
19:30:16 | leorize | flatpak! |
19:30:27 | leorize | no, that thing is terrible for CLI apps |
19:31:01 | Zevv | recently I got some kind of "portable" single binary app. Guess what: it makes a fuse loopback mount in which there is a copy of *all* the shared libs it needs |
19:31:09 | Zevv | just ship the world with every binary |
19:31:21 | ryukoposting | eeeww |
19:31:31 | shashlick | No this is not a docker blob dom96 |
19:31:44 | shashlick | It's just built using holy build box which uses docker |
19:31:53 | FromGitter | <alehander42> well how else would you create a portable binary app Zevv .. |
19:32:03 | shashlick | So you now have an xz file with the bin directory populated |
19:32:16 | Araq | shashlick: ah... your question |
19:32:19 | Araq | what was it? |
19:33:49 | Zevv | alehander42: you don't. portable binaries are NP hard, I heard |
19:34:00 | ryukoposting | alehander42 just go full Gentoo and distribute everything as source |
19:35:30 | FromGitter | <alehander42> or you just maintain simple binaries for the <n> most popular distros/versions of your userbase and leave the weird option for the other ones |
19:35:38 | shashlick | I was asking about koch xz and how to include Linux binaries in it |
19:35:46 | shashlick | Updating installer.ini didn't help |
19:36:07 | FromGitter | <alehander42> it depends on the app ofc |
19:37:26 | Araq | shashlick: let me have a look |
19:37:43 | FromDiscord_ | <demotomohiro> shashlick: binary nim for linux worked on my gentoo |
19:38:16 | shashlick | Nice |
19:38:20 | * | vegax87 quit (Changing host) |
19:38:20 | * | vegax87 joined #nim |
19:38:20 | * | vegax87 quit (Changing host) |
19:38:20 | * | vegax87 joined #nim |
19:38:49 | Zevv | ok on Ubuntu 12.04.5 LTS / Ubuntu 16.04.4 LTS / Debian GNU/Linux buster/sid / CentOS Linux release 7.2.1511 |
19:39:32 | Araq | shashlick: it's a niminst problem, open niminst.nim |
19:39:57 | Araq | check what fcWinBin does and what fcUnixBin does NOT do. |
19:40:10 | Araq | fcUnixBin needs the same logic as fcWinBin |
19:40:48 | Araq | and then patch the [UnixBin] section in installer.ini |
19:42:08 | Zevv | RHEL6.5 also runs, although I'm not able to unpack .xz's by default :) |
19:42:44 | FromGitter | <zacharycarter> having a devil of a time getting windows installed on this box - the only other machine I have at my disposal atm is my macbook |
19:43:07 | FromGitter | <zacharycarter> bootcamp assistant is not an option - and I tried cmdline + diskutil but that didn't work |
19:43:19 | FromGitter | <zacharycarter> trying a program called UNetbootin - hopefully this works |
19:44:51 | * | zyklon_ joined #nim |
19:47:05 | shashlick | Thanks araq |
19:47:18 | shashlick | Thanks zevv for the tests |
19:47:34 | shashlick | I'll incorporate this into koch and nightlies |
19:47:36 | Zevv | yw |
19:47:50 | Zevv | why would you distrib c_sources in there btw? |
19:50:01 | ryukoposting | shashlick just ran your build with a project that uses some macros templates, whatnot. Nothing sophistigated wrt to proper testing, but it seems to work a-okay for me |
19:51:47 | shashlick | Cause someone could still want to rebuild |
19:51:56 | shashlick | And it's not really much space in the xz |
19:56:49 | Zevv | euh say whay |
19:56:58 | Zevv | https://zevv.nl/div/dist.png |
19:56:58 | * | zyklon_ quit (Read error: Connection reset by peer) |
19:58:11 | FromGitter | <alehander42> album cover art is really weird in 2019 |
19:58:24 | Zevv | shashlick: ow, "in the xz", true |
19:59:14 | Zevv | but on disk it eats 435 Mb |
20:04:53 | shashlick | Zevv I agree and will implement deleting it in choosenim |
20:05:34 | shashlick | But whether it stays or not in the xz is up to Araq since it's been that way for a while and I don't have the history |
20:11:02 | Zevv | sweet, just learned about karax looking into the playground client code |
20:12:39 | * | zyklon_ joined #nim |
20:14:53 | * | Sembei joined #nim |
20:16:03 | FromDiscord_ | <demotomohiro> there are online compilers that support Nim languages |
20:16:34 | FromDiscord_ | <demotomohiro> https://wandbox.org |
20:17:17 | FromDiscord_ | <demotomohiro> It seems it is the only online compiler that supports 0.19.2 and nightly build |
20:18:21 | Calinou | Zevv: that FUSE loopback thing is probably an AppImage |
20:18:23 | FromDiscord_ | <demotomohiro> other online compiler site except playgound supports only 0.18 or older |
20:18:25 | * | darithorn joined #nim |
20:18:34 | Zevv | Calinou: yes, that's it |
20:18:46 | Calinou | they don't ship every library though, only the ones that cannot be reasonably expected to be present on a base desktop system |
20:18:53 | Calinou | (so glibc isn't bundled for instance) |
20:18:55 | PMunch | Hmm, play.nim-lang.org seems to be down |
20:20:15 | Calinou | (so you'll need to build them on the oldest distribution you wish to support, unlike Flatpaks which have a base runtime) |
20:21:06 | shashlick | holy build box makes it super easy |
20:23:51 | Zevv | PMunch: zah is working on that |
20:23:58 | PMunch | Ah okay, nice |
20:24:15 | Zevv | I killed it with a fork bomb friday, but it seems there was more wrong, someone got in somewho I believe |
20:24:27 | PMunch | I'm supposed to take over the playground at some point, but I would prefer it to at least be working when I start :P |
20:24:35 | Zevv | nimbot relies on the same backend, is also dead |
20:24:43 | PMunch | Ouch, that's no good |
20:25:03 | Zevv | PMunch: while you're at it - would it make sense to change it to compile to js and exec in the browser? |
20:25:08 | PMunch | I remember talking about it when it first got set up, and it seemed to be pretty well sand-boxed |
20:25:45 | PMunch | Hmm, well it might for the simple stuff that most people probably use it for |
20:26:23 | Zevv | I did a quick peek to see if the compiler itself could run in js, but that takes some effort |
20:26:31 | Zevv | in that case there's no need for server side |
20:26:43 | ryukoposting | anyone know why echo'ing an object of Options might cause the compiler to crash |
20:27:18 | PMunch | Cause the compiler to crash? |
20:28:11 | ryukoposting | yeah, it's a bit weird. I have 3 objects of options, the types are acyclic though they do contain each other |
20:28:47 | ryukoposting | so A has Option[B], B has Option[C], and C has Option[seq[A]] |
20:29:14 | ryukoposting | I'll see what happens if I make it into refs |
20:31:11 | PMunch | Yeah I think object, even in an option, is counted as illegal |
20:31:18 | PMunch | Compiler shouldn't crash though.. |
20:31:24 | PMunch | Do you have a minimal example? |
20:31:37 | ryukoposting | I can slap one together really quick |
20:33:41 | dom96 | all compiler crashes are bugs you should report |
20:33:53 | FromGitter | <alehander42> Zevv: the compiler uses a lot of os/system stuff which is not currently supported in the js backend |
20:34:15 | FromGitter | <alehander42> the problem is that you either need to add support for it in the nodejs target(which people wouldn't approve) |
20:34:30 | FromGitter | <alehander42> (and it doesnt makes sense for client-side code) |
20:34:41 | FromGitter | <alehander42> or to immitate that with stuff like local storage |
20:35:01 | Zevv | no I figured, I was just trying a quick hack to see how much I would need to throw out to get it to work |
20:35:04 | FromGitter | <alehander42> or to rewrite/abstract it somehow |
20:35:10 | Zevv | or stub |
20:35:15 | FromGitter | <alehander42> yeah, i wondered about that once too |
20:35:41 | Zevv | emscripten might be an option, but that's a bit of a let down if people look under the hood |
20:36:10 | FromGitter | <alehander42> but even in this case, you generate c code .. and you need to actually compile/run that |
20:36:18 | FromGitter | <alehander42> which is again tricky on the client side |
20:36:38 | FromGitter | <alehander42> another option is to actually run the compiler on the backend |
20:36:42 | FromGitter | <alehander42> but to generate JS code |
20:36:47 | FromGitter | <alehander42> and run this result on the client |
20:37:07 | FromGitter | <alehander42> however you still have macros & static code blocks |
20:37:10 | ryukoposting | huh. the moment I make a minimal example of how these object are structured, it works fine |
20:37:18 | FromGitter | <alehander42> so you can still run random code on the server this way |
20:38:06 | Zevv | yes, but there all the nimvm restrictions apply |
20:38:18 | Zevv | so 'random' is quite limited |
20:38:27 | FromGitter | <alehander42> yeah, maybe it's easier to limit |
20:38:35 | FromGitter | <alehander42> this sounds like the easiest option to me |
20:38:47 | FromGitter | <alehander42> as most examples that you'd want to run on a playground |
20:38:59 | PMunch | ryukoposting, yeah that tends to happen :P |
20:39:02 | FromGitter | <alehander42> are language stuff, not low-level specific or doing side effects (files etc) |
20:39:10 | PMunch | Means the bug is not quite as simple as you think ;) |
20:39:11 | FromGitter | <alehander42> so they should work correctly on the js backend too |
20:39:17 | Zevv | ryukoposting: I just tried to recreate here, and no problems |
20:39:34 | Zevv | alehander42: and it is a nice showcase for the JS backend |
20:39:53 | Zevv | we could also give a peek into the generated JS code |
20:40:29 | FromGitter | <alehander42> yeah, that's true |
20:41:07 | FromGitter | <alehander42> @zacharycarter wyat |
20:41:14 | FromGitter | <alehander42> about this hypothetical idea ^ |
20:41:38 | FromGitter | <alehander42> (nim playground generating JavaScript code for the examples and running it only on the client) |
20:42:49 | Zevv | then again - nimbot will still need the remote API |
20:42:54 | Zevv | my IRSII doesn't do JS yet |
20:43:00 | dom96 | You can't use most of the stdlib in the JS backend |
20:43:08 | rayman22201 | IMO, running the compiler client side is not worth it, but I do think having a the playground allow you to run js code output would be very useful. |
20:43:13 | FromGitter | <alehander42> but you dont need most of the stdlib in playground examples |
20:43:44 | FromGitter | <alehander42> but i agree, having both modes is best ofc |
20:44:46 | FromGitter | <alehander42> btw @dom96 this reminds me: is it possible to have something like a "<X> backend" view of the reference |
20:44:58 | FromGitter | <alehander42> e.g. if you want to see the JS backend to see only the available modules/funcs |
20:45:05 | FromGitter | <zacharycarter> I think ideally the Nim playground suits all backends |
20:45:32 | FromGitter | <alehander42> maybe just having some kind of simple filter / info box is enough |
20:45:35 | FromGitter | <zacharycarter> the thing is - I don't really want to extend or maintain it - others have volunteered to take on the task (PMunch), but ideally it moves off of my DO account (I guess) |
20:45:40 | * | vonHabsi1 quit (Ping timeout: 246 seconds) |
20:45:50 | FromGitter | <zacharycarter> well - it already supports / supported C and CPP |
20:46:05 | FromGitter | <alehander42> yeah, it should be on nim servers |
20:46:07 | FromGitter | <zacharycarter> when I added CPP I wanted to add JS too - but it's quite a different task right? |
20:46:28 | * | vonHabsi__ quit (Ping timeout: 268 seconds) |
20:46:29 | FromGitter | <zacharycarter> with C/CPP you run the docker image to compile the code and store the result in a text file in a tmp dir |
20:46:33 | PMunch | Yeah, and mostly when using JS in a browser you would want to interact with the browser elements |
20:46:37 | FromGitter | <zacharycarter> exactly |
20:46:42 | FromGitter | <zacharycarter> with JS - that paradigm doesn't work |
20:46:44 | FromGitter | <alehander42> so like a NimFiddle |
20:46:44 | FromGitter | <alehander42> ? |
20:46:45 | PMunch | So it would need to have a little playground frame as well |
20:46:52 | FromGitter | <alehander42> that would be an interesting thing to have |
20:46:54 | rayman22201 | I think both back ends are ideal as well. C and JS have very different underlying semantics... exactly. |
20:46:55 | * | vonHabsi joined #nim |
20:47:00 | FromGitter | <zacharycarter> I really wanted to turn the playground into something like WASM studio |
20:47:02 | * | vonHabsi_ joined #nim |
20:47:11 | FromGitter | <zacharycarter> https://webassembly.studio/ |
20:47:17 | FromGitter | <zacharycarter> but there was some push back against this idea |
20:47:35 | FromGitter | <alehander42> this is very cool |
20:47:39 | FromGitter | <zacharycarter> I agree |
20:47:41 | FromGitter | <alehander42> but i feel it should be a separate project |
20:47:49 | FromGitter | <alehander42> playground are like runnable paste sites |
20:48:01 | FromGitter | <alehander42> they should be very simple |
20:48:08 | PMunch | I also want to do something similar to Go's playground |
20:48:15 | rayman22201 | It's cool, it's just such a big scope! It's like building a whole ide. It feels like you will have a lot of the same issues as what happened with Aporia |
20:48:17 | FromGitter | <zacharycarter> well - I don't see why you couldn't combine both experiences |
20:48:31 | FromGitter | <alehander42> you can reuse the technology/code |
20:48:32 | PMunch | Along with allowing you to write whatever, it could also include some hand-holding tutorial |
20:48:37 | FromGitter | <zacharycarter> I don't think it's like building an entire IDE - WASM studio uses Monaco editor under the hood |
20:48:40 | FromGitter | <alehander42> but i'd still want to have them on separate url-s |
20:48:46 | PMunch | So people can try it out before downloading Nim and setting up tools |
20:48:58 | FromGitter | <zacharycarter> and I'm sure you could implement a tutorial / lay-over somewhere that acted like a code-walkthrough similar to what GO has |
20:49:07 | FromGitter | <zacharycarter> and show / hide it via a menu option somewhere |
20:49:25 | rayman22201 | Runnable examples in the docs would be cool too... /me pie in the sky wishes lol |
20:49:28 | FromGitter | <zacharycarter> but the nice thing about WASM studio is - you can look at intermediate representations |
20:49:30 | FromGitter | <zacharycarter> and the resulting wasm |
20:49:31 | PMunch | Would help people which are curious but can't be bothered to put in the effort (or are on e.g. an Android tablet or work/school machine without support for downloading programs) |
20:49:31 | ryukoposting | I took my entire project that was causing the crash, put it into one file, and now it's fine??? |
20:49:45 | FromGitter | <alehander42> @zacharycarter this is more similar to compiler explorer |
20:49:58 | FromGitter | <alehander42> (to me) |
20:49:58 | FromGitter | <zacharycarter> yes - but some folks have asked for those features in the playground |
20:50:03 | FromGitter | <zacharycarter> Andreas specifically |
20:50:18 | FromGitter | <alehander42> yeah, seeing the representation is useful and can be simple in the ui |
20:50:23 | FromGitter | <zacharycarter> maybe it's a layered thing - at the core is the playground or whatever - the embedable copmiler |
20:50:27 | FromGitter | <zacharycarter> and then things build on top of it |
20:50:27 | dom96 | PMunch: yeah, I would love to see a Nim tour |
20:50:27 | FromGitter | <alehander42> but i think having the whole "file/project/folder" abstraction |
20:50:30 | FromGitter | <alehander42> is too much |
20:50:32 | rayman22201 | somewhat tangentially, I think it would be nice to add Nim support to godbolt compiler explorer... Pascal and Haskell have support now, so we totally should be able to :-P |
20:50:34 | FromGitter | <alehander42> i mean, it's cool to have it |
20:50:40 | FromGitter | <alehander42> but not in the simple playground |
20:50:41 | ryukoposting | ooooh i think it's something in nimscript maybe? |
20:50:41 | FromGitter | <zacharycarter> I guess - but at times I also wish I had that with the playground |
20:50:45 | PMunch | dom96, I actually have all the code for it. Just have to write the actual tutorial :P |
20:50:56 | FromGitter | <zacharycarter> being able to modularize an example - and then share that with the community |
20:51:05 | FromGitter | <zacharycarter> and also being able to potentially add C files, etc |
20:51:16 | FromGitter | <zacharycarter> but I see what you're saying in that - it's more complex than what other playgrounds are |
20:51:18 | FromGitter | <zacharycarter> like Go langs |
20:51:30 | FromGitter | <zacharycarter> ideally we have both worlds maybe |
20:51:41 | FromGitter | <alehander42> @zacharycarter yes: this is useful, but my point is that the default playground + repr is ok for ~80% of the cases |
20:51:42 | ryukoposting | kotlin playground is pretty nice imo |
20:51:44 | FromGitter | <zacharycarter> I don't know - it's not something I'm too much interested in |
20:52:00 | FromGitter | <alehander42> the studio idea is very cool |
20:52:04 | FromGitter | <zacharycarter> I initially built the playground as a POC / toy project and it was useful, so it stuck around |
20:52:13 | PMunch | Would be nice to pull a nimble project as well |
20:52:15 | FromGitter | <zacharycarter> I was just copying what they did with Rust initially |
20:52:35 | FromGitter | <zacharycarter> there wasn't a lot of engineering or forethought that went into it |
20:52:37 | * | enow quit (Remote host closed the connection) |
20:52:45 | FromGitter | <alehander42> but it works well! |
20:52:50 | FromGitter | <alehander42> for a "toy" |
20:52:52 | FromGitter | <zacharycarter> until it doesn't haha :P |
20:53:06 | rayman22201 | 90% of the time, I use playgrounds when I'm too lazy / unable to open a proper terminal or editor. The current playground is perfect for that usecase lol. I think a lot of people have similar thoughts |
20:53:33 | FromGitter | <zacharycarter> I'm working on getting my new PC booted - having a shitty time with trying to create boot images for windows on macos |
20:53:45 | FromGitter | <zacharycarter> but as soon as I solve that - I'll set up my Nim env on my new box and start working on fixing it |
20:54:17 | Zevv | What's araqs main os? |
20:54:23 | FromGitter | <zacharycarter> windows |
20:54:24 | * | Trustable quit (Remote host closed the connection) |
20:54:24 | rayman22201 | Windows iirc |
20:54:28 | Zevv | wow :) |
20:54:31 | ryukoposting | would someone be willing to help me identify what might cause this error? only happens if I try to convert an object to a string https://pastebin.com/z3fYfqqJ |
20:55:19 | ryukoposting | all it makes clear is that an exception occurs while running nim c |
20:55:59 | PMunch | ryukoposting, maybe try the latest Nim version? |
20:56:09 | ryukoposting | sure, one sec |
20:56:10 | PMunch | Might already be fixed |
20:56:33 | ryukoposting | aaaah new error |
20:56:35 | ryukoposting | good call |
20:56:42 | Zevv | The message itselfs seems to come from nimscript:exec() |
20:56:43 | ryukoposting | "generic instantiation too nested" |
20:57:10 | ryukoposting | which would point towards my circular types nested in Option, I suppose |
20:58:11 | ryukoposting | yeah, it says the template instantiation is coming from the echo $... |
21:00:04 | ryukoposting | i don't know the inner workings of the compiler, but with the compiler I work on at work, circular types caused problems for stringification because the template for it would just call itself forever |
21:02:15 | ryukoposting | weird thing with this case is that if I have seq[AcyclicButCircularTypeHere], compiler gives error, but if I just stringify AcyclicButCircularTypeHere it works fine |
21:04:11 | Zevv | isolate and file an issue |
21:04:25 | Zevv | I've been told that repr should be able to print anything, always |
21:04:40 | Zevv | although I forgot *who* told me that |
21:04:42 | ryukoposting | It looks like it's fixed in 0.19.2, compiler isn't blowing up, just gives an error |
21:04:55 | ryukoposting | ooooh alright so it is a problem |
21:06:01 | Zevv | ryukoposting: https://github.com/nim-lang/Nim/issues/4766 |
21:06:40 | ryukoposting | yeah, that looks exactly like what I had |
21:06:49 | ryukoposting | very similar, at least |
21:06:56 | Zevv | funny history |
21:10:16 | * | hoijui quit (Remote host closed the connection) |
21:10:36 | ryukoposting | >converter |
21:10:42 | ryukoposting | jesus, I have much to learn still |
21:13:07 | PMunch | Haha, not that useful in pure Nim programs. But I find them helpful when working with C libraries that works with cint or various int types |
21:13:18 | ryukoposting | makes sense |
21:14:44 | PMunch | But also when working with option types you might want to have a T -> Option[T] converter |
21:15:36 | ryukoposting | with this project, I could probably benefit from an Option[T] -> T converter, really (furious haskell users screaming in the background) |
21:15:46 | PMunch | Well that would be a bad idea :P |
21:16:04 | ryukoposting | it's a breakout for the last.fm API, so it's a ton of music metadata stuff |
21:16:07 | * | narimiran quit (Ping timeout: 240 seconds) |
21:16:14 | PMunch | Well I guess using get on the option would allow it to just throw an exception |
21:16:24 | ryukoposting | It would make life a lot easier if converting Option[Artist] to a string would just give " |
21:16:35 | ryukoposting | "Unknown Artist" if it's None |
21:16:55 | PMunch | Oh yeah, that would be possible if Artist is a distinct string |
21:17:09 | PMunch | Or an object of some kind |
21:17:37 | ryukoposting | yeah, it gets hairy because artists have other properties than a nam |
21:18:54 | Zevv | speaking of distinct strings: I was trying to "upgrade" one of my old project by using a lot of distinct string types for all kinds of things, but I was put off by the lack of hash() for those. Is there a way to inherit string hash for distinct string types without having to name them all explicitly? |
21:19:30 | PMunch | You might also want to check out something like this: https://github.com/PMunch/Nim/commit/606544db01663ed9870e2ede26589f15c9d7dd13#diff-fdaf5ed8685e0ec96346e47f49ec2041 |
21:20:05 | PMunch | Zevv, some kind of template/macro |
21:20:19 | Zevv | probably, this is Nim after all :) |
21:20:21 | PMunch | Is probably the "right" way of doing it |
21:21:25 | Zevv | let's answer my own question: {.borrow.} ! |
21:22:07 | PMunch | Yeah, but for that you need to name hash for each one no? |
21:22:17 | Zevv | true |
21:22:45 | PMunch | Like `proc hash(x: MyString): array[32, byte] {.borrow.}` |
21:23:07 | PMunch | I was thinking of using a vararg template to create those for you :) |
21:23:17 | Zevv | indeed - but I didn't know about borrow until an hour ago, I just happend to see it in the compiler sources somewhere, and I just thought it might apply to my problem |
21:23:26 | PMunch | So you would do something like `hashable(MyString, MyOtherString)` |
21:23:45 | Zevv | I could just make a simple template that creates the type and the hash borrow in one go |
21:23:46 | PMunch | Oh yeah, borrow is definitely what you would want to use :) |
21:23:56 | PMunch | That's true |
21:25:05 | ryukoposting | Zevv I'm trying to cobble together a minimal example |
21:25:14 | * | Tyresc joined #nim |
21:26:09 | * | theelous3 joined #nim |
21:27:27 | * | aguspiza quit (Ping timeout: 240 seconds) |
21:28:05 | Zevv | PMunch: http://paste.debian.net/1061573/ |
21:28:25 | * | troido joined #nim |
21:28:31 | Zevv | {.experimental defaultBorrow.} would be cool as well |
21:28:43 | ryukoposting | heeeeey I managed to get a minimal example working |
21:28:49 | PMunch | Zevv, yeah that's a nice way of doing it |
21:28:59 | PMunch | What would defaultBorrow do though? |
21:29:15 | Zevv | remove all 'distinct' keywords from the code :) |
21:29:29 | PMunch | Haha, why even use distinct then? |
21:29:43 | Zevv | To show my good intentions to other programmers reading my code |
21:30:08 | Zevv | oh, nevermind, I'm the only one using Nim :( |
21:30:12 | ryukoposting | use dirty templates like the C preprocessor, that's how to be truly evil |
21:30:40 | PMunch | Zevv, there are dozens of us! |
21:30:42 | shashlick | is it possible to check if nim doc is processing a file versus nim c/cpp |
21:30:52 | shashlick | want to skip some code with when XYZ |
21:30:53 | PMunch | shashlick, yes |
21:31:45 | PMunch | Think it's something like `when not defined(nimdoc)` or similar |
21:31:48 | ryukoposting | shashlick one sec |
21:32:05 | ryukoposting | https://www.reddit.com/r/nim/comments/afviuw/nimble_docs_help/ |
21:32:31 | shashlick | wow thanks guys |
21:32:46 | ryukoposting | only reason I had that link is because I'm the OP lmao |
21:33:38 | ryukoposting | who needs documentation, guys? entire manual should just be an IRC client |
21:36:03 | PMunch | Haha :P |
21:36:25 | PMunch | I was actually thinking about implementing something like the Clojure documentations comment section for procedures |
21:36:42 | PMunch | But I think in Nim the biggest issue is finding the feature that does what you want |
21:38:05 | Zevv | ^ that |
21:38:37 | PMunch | Not quite sure how to solve that though, apart from just referring to IRC :P |
21:38:41 | Calinou | that's the price of having a large stdlib |
21:38:47 | Zevv | people are working hard on improving the docs |
21:41:15 | Zevv | Calinou: its not even the stdlib. The language is just packed. |
21:41:39 | shashlick | i'm pretty sure this is what you do in other languages too |
21:41:47 | PMunch | We should make our own stdlib, with blackjack and hookers |
21:41:55 | shashlick | unless something is already answered on stack overflow |
21:42:47 | FromGitter | <irskep> The main thing I've found missing from the Nim docs, as a relative newbie, is repetition with examples |
21:43:07 | Zevv | 'repetition'? |
21:43:22 | FromGitter | <irskep> I've learned a dozen-ish languages pretty well at this point, and nim's docs feel like "Just enough" docs to feel like a real usable language |
21:43:49 | federico3 | who's alaviss on github? |
21:43:58 | FromGitter | <irskep> my gold standard for docs will always be python's official tutorials and guides. don't just say something once; give a zillion examples using different use cases |
21:44:33 | FromGitter | <irskep> I also find their docs just plan easier to read and navigate |
21:44:36 | FromGitter | <irskep> here's a decent example: https://docs.python.org/3/tutorial/errors.html |
21:45:13 | FromGitter | <irskep> nim docs are something I could see myself contributing to a lot in the future, having written probably 100k words of software docs over the past 10 years |
21:45:33 | federico3 | examples are good, repetition is not |
21:45:59 | FromGitter | <irskep> maybe redundancy is the word I'm looking for, particularly in guides about language features |
21:46:06 | Zevv | I guess you could learn the basics of programming from the python docs, but with Nim docs there is the assumption that the reader knows what it's all about, and just wants to read how to do things in Nim specifically |
21:46:14 | FromGitter | <irskep> what I mean is, nim's docs are over-deduped |
21:46:31 | FromGitter | <irskep> I am literally in the center of that target audience and I find them too sparse |
21:46:50 | FromGitter | <irskep> I still refer to the third party 'nim by example' site all the time |
21:47:23 | Zevv | or I look in the compiler sources to find the idioms. Which is apparently a bad thing to do because whole chunks are leftovers from pascal-generated code :( |
21:47:26 | FromGitter | <irskep> I don't think anybody wants language docs to teach you programming from first principles |
21:47:36 | shashlick | @irskep - you might need to change your raylib code a bit - i'm exporting va_list now |
21:47:46 | FromGitter | <irskep> LOL yeah I'll go read the source for the compiler, that sounds really appealing |
21:47:53 | Zevv | shashlick: how will you handle va_list? |
21:48:28 | shashlick | i simply export it in cimport now |
21:48:38 | shashlick | so all C'isms will be globally available |
21:48:43 | Zevv | is there a way to actually *use* it from nim then? |
21:48:59 | Zevv | or does it simply not translate |
21:49:15 | * | skellock quit (Ping timeout: 246 seconds) |
21:49:26 | shashlick | you can use va_list using emit i think, no idea how that works though here's the example https://github.com/judofyr/bob/blob/20c6dcbf59ae41410256bdf81e1a4362d423df47/bobpreload.nim#L175-L200 |
21:50:08 | shashlick | doing the same for time_t and more C interop stuff as we grow |
21:50:28 | Zevv | good enough, the result now compiles anyway |
21:50:46 | shashlick | cool |
21:51:10 | shashlick | is there an automated way to post docs on http://github.io |
21:51:41 | FromGitter | <irskep> just push to the gh-pages branch and include a magic `.nojekyll` empty file |
21:52:07 | FromGitter | <irskep> I'd be happy to set it up for you, though I'll have to learn whatever nim's doc tool is |
21:52:34 | shashlick | i've added docs to cimport, you just need to run nim doc nimterop/cimport and that's it |
21:52:47 | shashlick | it generates an html file which needs to be posted somewhere |
21:53:08 | Tyresc | The new vim plugin from alaviss looks nice, someone should put it into the editor support section |
21:53:39 | FromGitter | <irskep> this is a pretty easy way to do it in a script https://github.com/davisp/ghp-import |
21:53:41 | Zevv | shashlick: would it make sense to have toast accept multiple input files and just iterate them in order? |
21:54:02 | FromGitter | <irskep> so you would use `ghp-import --no-jekyll -fp $PATH_TO_HTML_FILES` |
21:56:43 | Zevv | oh and another nice bug/feature: ./toast -np /usr/include/readline/rltypedefs.h eats my CPU but never finishes |
21:57:07 | shashlick | Zevv that's doable i think |
21:57:33 | FromGitter | <irskep> How can I find the options to `nim doc`? `nim doc --help` is only giving general options |
21:58:14 | shashlick | don't think it has any - read the code 😉 |
21:58:34 | shashlick | zevv: it will just merge everything into one blob i think |
21:58:42 | FromGitter | <irskep> wish I had a year to just write docs for stuff |
21:58:47 | Zevv | shashlick: sounds good to me |
21:59:03 | Zevv | ok, found the line causing the problem |
21:59:06 | Zevv | typedef int rl_command_func_t PARAMS((int, int)); |
21:59:32 | Zevv | put that in a file on its own, and toast never finishes |
21:59:32 | shashlick | ok please open an issue for the multi-file thing - it needs a little bit of work to do right |
21:59:53 | FromGitter | <kaushalmodi> shashlick: look at Nim repo Travis |
22:00:29 | FromGitter | <kaushalmodi> That auto updates the Nim devel docs |
22:00:46 | shashlick | nice - will do |
22:01:05 | FromGitter | <irskep> shashlick: here's a super simple github pages script that works on your repo https://gist.github.com/irskep/a2261b6f6af92337dca3e4d617903b02 |
22:01:53 | shashlick | gosh todo is exploding today 😄 |
22:01:55 | FromGitter | <irskep> I guess you also want --index:on |
22:03:00 | ryukoposting | Zevv I think it has to do with the double-nested generic, e.g. Option[seq[Foo]] |
22:03:08 | ryukoposting | https://github.com/nim-lang/Nim/issues/10396 |
22:03:23 | FromGitter | <kaushalmodi> shashlick: or you can look at the travis in here on how I update docs: https://github.com/kaushalmodi/elnim |
22:06:54 | shashlick | thanks @irskep @kaushalmodi - will deploy this tonight |
22:07:11 | FromGitter | <irskep> I am astounded that nim includes an rst parser! python's is spaghetti, it's nice to have another implementation |
22:07:39 | FromGitter | <irskep> maybe time to reboot my documentation generator project |
22:10:00 | FromGitter | <irskep> rst is the worst markup language for writing docs, except for all the others |
22:13:01 | * | Vladar quit (Remote host closed the connection) |
22:13:35 | FromGitter | <kaushalmodi> @irskep Org mode is the best format for docs, blogs, anything |
22:14:28 | shashlick | @kaushalmodi - we need to update nightlies to use koch CI instead of the manual script |
22:14:46 | shashlick | also am planning on changing tag to v0.19.9-date instead of hash since the releases page is just a mess |
22:15:18 | FromGitter | <irskep> @kaushalmodi I'd love to learn it...if anyone writes a nim parser for it :-) |
22:17:46 | ldlework | +1 to org-mode |
22:17:51 | ldlework | so good |
22:17:53 | shashlick | @irskep, @kaushalmodi - https://genotrance.github.io/nimterop/cimport.html |
22:17:56 | shashlick | yay 🙂 |
22:22:48 | FromGitter | <irskep> oof, I just tried to go through the nimgame2 tutorial and nimgame2 itself doesn't compile right now |
22:25:01 | FromGitter | <irskep> raylib it shall be |
22:29:26 | FromGitter | <kaushalmodi> @irskep I kind of made Org mode docs work for Nim docs, automated using Pandoc :) |
22:29:30 | FromGitter | <kaushalmodi> https://github.com/kaushalmodi/strfmt |
22:29:59 | FromGitter | <kaushalmodi> ^ you can see its example in above project |
22:30:15 | FromGitter | <irskep> yep, pretty nice |
22:30:45 | FromGitter | <irskep> the thing I tend to miss about sphinx (python) and scribble (racket) is the widespread direct linking of symbols to their definitions |
22:31:20 | FromGitter | <irskep> so when you say "The `format` function", `format` is a link to the `format` docs 100% of the time |
22:31:48 | FromGitter | <kaushalmodi> shashlick:I agree on both, use koch CI and release tagging |
22:32:02 | FromGitter | <kaushalmodi> I wish it sorted by last updated first |
22:33:59 | * | skellock joined #nim |
22:34:12 | FromGitter | <kaushalmodi> @irskep I'm pretty sure Nim doc has a custom markup to link to definitions @narimiran ? |
22:34:35 | FromGitter | <irskep> could be that people just aren't using it consistently yet |
22:35:01 | FromGitter | <irskep> but e.g. the Swift doc generator actually looks at all your backticked markdown strings and makes a good guess about whether it's a symbol it needs to link |
22:40:06 | FromGitter | <kaushalmodi> @irskep about your earlier comment about repetition of examples, I find that approach great for my own learning, so I take notes that way: https://scripter.co/notes/nim/ |
22:40:30 | FromGitter | <kaushalmodi> But I think that such verbose examples might not fit in the official docs. |
22:40:52 | FromGitter | <kaushalmodi> (btw guess what markup I used for those notes ;-)) |
22:50:45 | FromGitter | <irskep> conundrum: I want to create a fresh repo for my raylib nim binding, but there are already 3 called raylib-nim, ray.nim, and raylib-Nim |
22:51:09 | FromGitter | <irskep> `raylib_nim_best_free_frozen` |
23:02:58 | * | theelous3 quit (Ping timeout: 245 seconds) |
23:04:24 | * | PMunch quit (Remote host closed the connection) |
23:08:28 | FromGitter | <irskep> shashlick: how can I have a nim package import a header using nimterop, and have the header path be relative to the original package tree? I used $projdir but it's looking for the header in the project I've imported my module from. |
23:09:26 | FromGitter | <irskep> *$projpath |
23:12:13 | shashlick | Not sure I get it - can you post a gist perhaps? |
23:12:40 | shashlick | You can use sourcePath |
23:13:00 | shashlick | See tree-sitter directory inside nimterop |
23:13:18 | FromGitter | <irskep> looks like `splitPath(currentSourcePath()).head` might be what I want |
23:16:41 | shashlick | Cool |
23:17:16 | shashlick | Is it something nimterop should have built in? |
23:17:36 | FromGitter | <irskep> It seems like it would be common to want to bundle the C header in a module |
23:19:10 | FromGitter | <irskep> It was super easy to figure out, but you might want to just add a how-to in the readme |
23:19:42 | FromGitter | <irskep> anyway here's my raylib binding :-D https://github.com/irskep/raynim |
23:28:30 | shashlick | Nice work |
23:28:58 | shashlick | You might want to remove the va_list declaration since nimterop now adds it |
23:35:30 | ryukoposting | anyone interested in a ladder logic macro library? |
23:38:42 | rayman22201 | I have no practical need for something like that at all, but it sounds cool lol. |
23:40:16 | ryukoposting | It's a little hacky since I declare a variable contactValue behind the user's back, but super simple |
23:48:00 | ryukoposting | (nim in PLCs... now that would be cool) |
23:51:01 | * | theelous3 joined #nim |
23:52:34 | * | stefanos82 quit (Remote host closed the connection) |