00:17:47 | * | SenasOzys_ quit (Read error: Connection reset by peer) |
00:18:26 | * | SenasOzys joined #nim |
00:19:07 | * | SenasOzys quit (Remote host closed the connection) |
00:19:30 | * | SenasOzys joined #nim |
00:21:04 | * | SenasOzys quit (Read error: Connection reset by peer) |
00:21:21 | * | SenasOzys joined #nim |
00:22:32 | * | SenasOzys quit (Remote host closed the connection) |
00:23:00 | * | SenasOzys joined #nim |
01:06:08 | * | xet7 quit (Quit: Leaving) |
01:44:51 | * | icebattle quit (Ping timeout: 256 seconds) |
03:43:22 | * | smt` quit (Read error: Connection reset by peer) |
03:43:54 | * | smt joined #nim |
03:51:14 | FromGitter | <Varriount> Araq: It appears that toOpenArray wasn't causing the bounds check error, the fact that I was doing a `for` loop over an empty openarray was. |
03:51:38 | FromGitter | <Varriount> should `for index, value in emptyOpenArray` cause an out of bounds error? |
04:13:08 | * | leorize quit (Quit: WeeChat 2.1) |
04:42:00 | * | miran joined #nim |
05:04:54 | FromGitter | <diegogub> Hello, How do I parse this time 2018-04-02T21:20:48.647095988Z with Times package? I can't find the milliseconds reference |
05:28:51 | FromGitter | <gogolxdong> How to make a call in template like |
05:29:07 | FromGitter | <gogolxdong> ```template f(action):untyped= ⏎ action(users,msg)``` [https://gitter.im/nim-lang/Nim?at=5ad2e32327c509a77412b1e7] |
05:31:29 | FromGitter | <Varriount> @diegogub Looks like you might need to ignore milliseconds. |
05:33:09 | FromGitter | <diegogub> @Varriount yes, that's what I'm doing..but I'm losing that info...Guess I will have to reply with stirng |
05:33:12 | FromGitter | <diegogub> string |
05:33:51 | FromGitter | <Varriount> @diegogub You could also add a milliseconds format spec to the format() and parse() procedures. |
05:44:01 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ad2e6a15f188ccc1567c2e0] |
06:10:09 | * | sz0 joined #nim |
06:26:54 | * | yglukhov quit (Remote host closed the connection) |
06:27:14 | * | yglukhov joined #nim |
06:36:39 | * | nsf joined #nim |
07:01:47 | Araq | gogolxdong: simply without the backticks |
07:05:20 | Araq | @varriount: it shouldn't |
07:16:44 | * | yglukhov quit (Read error: Connection reset by peer) |
07:17:21 | * | yglukhov joined #nim |
07:18:13 | * | yglukhov quit (Remote host closed the connection) |
07:18:50 | * | yglukhov joined #nim |
07:20:42 | * | rokups joined #nim |
07:23:09 | * | yglukhov quit (Ping timeout: 264 seconds) |
07:26:46 | * | miran quit (Ping timeout: 264 seconds) |
08:17:19 | * | sz0 quit (Quit: Connection closed for inactivity) |
08:30:11 | * | r3d9u11 joined #nim |
08:45:51 | FromGitter | <alehander42> i am gonna use jester for the first time |
08:48:16 | FromGitter | <alehander42> does it have special support for web sockets? |
08:50:06 | Araq | not as far as I know |
08:53:21 | * | smt quit (Read error: Connection reset by peer) |
08:53:44 | * | smt joined #nim |
08:58:47 | FromGitter | <alehander42> hm, so is https://github.com/niv/websocket.nim usable? |
08:59:10 | FromGitter | <alehander42> I can see it's not stable, but I want to just prototype a simple board game multiplayer |
08:59:23 | FromGitter | <alehander42> so that's not too important |
09:00:12 | Araq | it went from rock-solid to unusable to unknown |
09:00:56 | Araq | I need to test it again, it is blocking my Ormin blog post |
09:01:34 | * | rauss quit (Read error: Connection reset by peer) |
09:02:50 | Araq | „When multiple typedesc params are present, they act like a distinct type class |
09:02:50 | Araq | (i.e. they will bind freely to different types). To force a bind-once behavior |
09:02:51 | Araq | one can use a named alias or an explicit `typedesc` generic param“ |
09:02:55 | Araq | wtf ... |
09:03:17 | * | rauss joined #nim |
09:03:24 | Araq | that is not how to design this feature ... |
09:04:07 | Araq | proc foo[T](x: typeDesc[T], y: int, z: typeDesc[T]) # that is a bind-once here. |
09:17:09 | * | ofelas quit (Ping timeout: 264 seconds) |
09:21:58 | FromGitter | <alehander42> ok, so what kind of client connects with websockets to a server, but not in the browser |
09:22:27 | FromGitter | <alehander42> is the websocket.nim client only for testing , or I am not seeing the usevase |
09:24:09 | FromGitter | <alehander42> if you already have a websocket server, you might want to reuse the websockets with a native client? I never thought of that |
09:25:46 | * | ofelas joined #nim |
09:31:53 | Araq | alehander42: check out how dom's snake game uses websockets |
09:32:28 | Araq | I copy&paste around this code all the time... :P |
09:33:39 | FromGitter | <alehander42> ah good idea |
09:35:48 | FromGitter | <mratsim> Regarding copy-paste seems like the Nim Cookbook guys are struggling with updates: https://github.com/btbytes/nim-cookbook |
09:38:24 | FromGitter | <alehander42> awesome I got it working anyway |
09:38:37 | FromGitter | <alehander42> just using the websocket object in nim js and websocket.nim on the server |
09:40:27 | FromGitter | <alehander42> yeah I think I do the same as dom in snake |
09:40:44 | FromGitter | <alehander42> good resource nevertheless |
09:41:41 | FromGitter | <alehander42> I'll probably make something simpler for now, with only 2 players supported |
09:44:50 | * | xet7 joined #nim |
09:57:56 | * | jaco60 joined #nim |
09:57:56 | Araq | mratsim: .md files and a makefile vs :test:, https://github.com/nim-lang/Nim/commit/70c0ff1be21d2a1fda6432fe2e5b7ae0953840ff |
09:58:20 | Araq | Vorsprung durch Technik? |
09:59:32 | FromGitter | <mratsim> what is this “$1” magic? |
10:00:09 | FromGitter | <mratsim> Is test related to runnable examples? |
10:01:02 | Araq | yeah, it tests the command 'nim c <extracted_file_snippet>' returns 0 |
10:09:20 | dom96 | This is awesome https://forum.nim-lang.org/t/3758 |
10:11:05 | Araq | why do I know what this points to without looking at it? :-) |
10:14:32 | Araq | hmm so the JVM doesn't support value based datatypes. but .NET does. did they ever explain why they didn't use that and went for wasm? |
10:14:59 | Araq | except from the rather obvious "ugh, M$ is evil" |
10:18:58 | dom96 | patents? |
10:19:04 | dom96 | fear of getting sued by MS? |
10:20:04 | dom96 | Plus I doubt those VMs would work in a browser efficiently |
10:20:42 | FromGitter | <mratsim> I never associated Java and .NET with efficient (hint Jsp-let and asp.net) |
10:25:31 | * | yglukhov joined #nim |
10:27:01 | dom96 | Araq: I could also ask you about your custom Nim VM, why not just use .NET? ;) |
10:27:34 | Araq | because my VM has native support for Nim's AST manipulations. |
10:27:52 | Araq | wasm has no support for DOM manipulations. see the pattern here? :P |
10:28:51 | * | yglukhov quit (Read error: Connection reset by peer) |
10:29:24 | * | yglukhov joined #nim |
10:29:49 | Araq | wasm needs DOM ops. |
10:32:20 | Araq | DOM ops will turn this thing from a toy into something very interesting. |
10:35:55 | dom96 | Yeah yeah |
10:36:03 | dom96 | I'm sure it's not far away |
10:36:17 | FromGitter | <mratsim> like Nim 1.0 and Half-Life 3? |
10:36:25 | FromGitter | <mratsim> (ok that’s a low blow) |
10:36:30 | Araq | https://github.com/WebAssembly/design/issues/960 :-) |
10:36:49 | dom96 | hah, krux02 in there |
10:36:57 | Araq | krux02 answered my question |
10:37:05 | Araq | it is a small world |
10:42:18 | * | NimBot joined #nim |
10:45:45 | Araq | mratsim: Half-Life 3 is confirmed! https://www.youtube.com/watch?v=fXgZGZMaUks |
10:49:07 | * | SenasOzys quit (Read error: Connection reset by peer) |
10:49:14 | FromGitter | <mratsim> 😅 |
10:49:43 | * | SenasOzys joined #nim |
11:01:15 | * | noonien joined #nim |
11:02:31 | livcd | I saw the Blazor demo and it looks impressive. |
11:05:26 | * | fredrik92 joined #nim |
11:05:32 | * | fredrik92 quit (Remote host closed the connection) |
11:14:41 | * | smt quit (Ping timeout: 276 seconds) |
11:43:30 | * | Vladar joined #nim |
12:02:45 | * | yglukhov quit (Read error: Connection reset by peer) |
12:03:18 | * | yglukhov joined #nim |
12:04:39 | FromGitter | <arnetheduck> @Araq, why isn't deadcodeelim on by default, or even the only mode? |
12:05:02 | Araq | legacy? |
12:05:05 | FromGitter | <arnetheduck> anything else sounds like a bug, it shouldn't even be listed as a feature, it's so obvious |
12:05:23 | FromGitter | <arnetheduck> remove it? make default on? |
12:05:46 | FromGitter | <arnetheduck> ie remove the option and make it the only mode |
12:06:06 | Araq | sounds good |
12:06:22 | Araq | the JS backend never did anything else |
12:08:09 | * | SenasOzys quit (Ping timeout: 264 seconds) |
12:12:29 | Araq | git pull https://github.com/FedericoCeratto/Nim.git blockdiag |
12:12:30 | Araq | dyld: Symbol not found: __cg_jpeg_resync_to_restart |
12:12:30 | Araq | Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO |
12:12:31 | Araq | Expected in: /usr/local/lib/libJPEG.dylib |
12:12:34 | Araq | in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO |
12:12:44 | Araq | git broken, any ideas? |
12:19:02 | * | SenasOzys joined #nim |
12:37:00 | skelett | How should I translate a VLA from an C Interface into nim? Is this a usecase for an `UncheckedArray`? |
12:38:20 | * | r3d9u11 quit (Ping timeout: 265 seconds) |
12:45:25 | Araq | I doubt that works for VLA |
12:49:04 | skelett | Is there another way I can access fields allocated as a VLA? |
12:49:51 | * | dddddd joined #nim |
12:49:55 | Araq | oh accessing should be fine |
12:50:18 | Araq | but you can't put an UncheckedArray on the stack, the compiler doesn't understand it |
13:01:09 | * | PMunch joined #nim |
13:01:51 | skelett | That's fine. I get a struct like this `struct foo { size_t len; uint8_t buf[0]; }` from a library |
13:05:06 | * | yglukhov quit (Remote host closed the connection) |
13:07:44 | * | Vladar quit (Quit: Leaving) |
13:19:08 | * | yglukhov joined #nim |
13:20:40 | * | yglukhov quit (Remote host closed the connection) |
13:23:06 | * | user1101 joined #nim |
13:37:46 | * | yglukhov joined #nim |
13:38:02 | * | xkapastel quit (Quit: Connection closed for inactivity) |
13:44:39 | * | krux02 joined #nim |
13:45:07 | krux02 | hello people today I am on irc, because irc is cool and retro :P |
13:53:17 | * | Lord_Nightmare quit (Ping timeout: 276 seconds) |
13:56:11 | * | yglukhov quit (Remote host closed the connection) |
13:57:57 | * | Lord_Nightmare joined #nim |
13:58:01 | FromGitter | <dom96> You're damn right... Except when you're AFK :) |
14:11:09 | krux02 | I like irc, because it is a bit less |
14:11:15 | krux02 | focusing more on messages |
14:11:22 | krux02 | and no so much about "notifications" |
14:11:28 | krux02 | notifications are productivity killer |
14:17:28 | * | miran joined #nim |
14:22:42 | skelett | and no running browser |
14:22:46 | skelett | and less resources |
14:22:55 | skelett | *not running in a browser |
14:33:14 | krux02 | well I have the browser open anyway for other stuff, such as documentation and github. |
14:33:35 | krux02 | but the browser as so much productivity killing traps built into it. |
14:34:00 | krux02 | I would say it's not recommendad for anyone to browse the internet without an ad blocking software. |
14:34:27 | FromDiscord | <geckojsc> I like IRC but it's not good when your internet is unstable :( |
14:36:08 | krux02 | For me the biggest time killer is definively youtube. |
14:36:33 | krux02 | but it is also so great for so many things |
14:37:12 | krux02 | gdc talks, nim talks, music, Game Two (if you speak German) |
14:39:05 | * | cheng joined #nim |
14:44:31 | PMunch | Speaking of Nim talks, me and couven92 will be holding one tomorrow at our university |
14:44:47 | krux02 | cool, will it be on youtube? |
14:45:14 | krux02 | I am at RWTH Aachen, I don't where your university is, but it is probably not very close to Aachen. |
14:46:25 | PMunch | Not very close at all unfortunately: https://www.google.com/maps/place/Tromsø/@69.6652343,18.8475394,12z/data=!3m1!4b1!4m5!3m4!1s0x45c4c4526c3b71fd:0x23dca858e6ebed3!8m2!3d69.6492047!4d18.9553238 |
14:46:59 | PMunch | couven92, all the rooms have video equipment right? So we could record the talk and put it on YouTube? |
14:47:58 | krux02 | I would watch it. |
14:48:02 | miran | +1 |
14:49:08 | PMunch | It's going to be an introduction thing, so you both probably know everything we're going to say :P |
14:49:11 | * | PMunch quit (Quit: leaving) |
14:49:41 | miran | doesn't matter, would +1 again :) |
14:49:42 | * | user1101 quit (Quit: user1101) |
14:49:58 | * | user1101 joined #nim |
14:50:11 | krux02 | I can point out the wrong things you say :P |
14:57:54 | * | cheng quit (Ping timeout: 260 seconds) |
15:18:58 | krux02 | I would like to see in the introduction of Nim that GC is thread local. A huge thing, because when you hate GC, you hate it because of stop the world for all threads and sits under everything. |
15:22:16 | FromGitter | <alehander42> @krux02 how do you even learn from videos, I find them the most horrible format for that |
15:22:25 | FromGitter | <alehander42> when I see something is available only as a video, I just ignore it |
15:23:22 | FromGitter | <alehander42> I dream of software that converts videos to annotated text with gifs and clips in the right |
15:23:47 | krux02 | well when a video is the only thing, then I think it's bad, but often I think the core idea of something gets transmitted much better in video form than in text form |
15:23:59 | miran | just mute the video and the gif part is solved :) |
15:23:59 | FromGitter | <alehander42> actually that's a grat idea anyway, but I guess speech recognition is still too bad |
15:24:18 | FromGitter | <alehander42> sometimes, but the random access thing is horrible |
15:24:28 | FromGitter | <alehander42> in text I can just ctrl+f or I can see the contents |
15:24:39 | FromGitter | <alehander42> if I could easily have an high level overview of a video |
15:24:49 | FromGitter | <alehander42> I could still watch the important parts for me |
15:25:08 | krux02 | yea random access is very bad in video, that is why a video about something should never be structured like a reference manual. That would also be totally boring. |
15:25:22 | FromGitter | <alehander42> the same way you usually don't read text from line 1 to line 2000, you browse back and forth to the relevant parts |
15:25:50 | krux02 | yes |
15:25:58 | krux02 | but videos you can't do that |
15:26:25 | krux02 | but videos transport emotions like frustrations about problems and their solutions much better. |
15:26:35 | krux02 | that makes it much more interesting to watch |
15:28:07 | FromGitter | <alehander42> yes, I admit sometimes it's very nice to watch a talk about something when you have time |
15:28:07 | krux02 | when I just have the text form I often loose the interest right at the beginning. |
15:28:24 | FromGitter | <alehander42> but still it's cool to have the alternative option |
15:28:38 | FromGitter | <alehander42> because often I might want to watch 15-20 mins of 1h30min talk |
15:28:43 | FromGitter | <alehander42> which would be most relevant to me |
15:28:48 | krux02 | A video does never replace good alternatives, but it is great to get you interested in something. |
15:28:49 | FromGitter | <alehander42> and I can't really do that with normal videos |
15:28:55 | FromGitter | <alehander42> without skipping and getting lucky |
15:29:07 | krux02 | and videos often pointed me out to really good practices in c++ |
15:29:32 | krux02 | c++ conference talks, I really liked them especially when the person whod did it was cool. |
15:29:41 | krux02 | the c++ people also look so funny |
15:30:05 | FromGitter | <alehander42> I find text entertaining because I can fast forward through it and easily see what's interesting |
15:30:30 | krux02 | well I can also fast forward through video |
15:30:33 | FromGitter | <alehander42> maybe they're just better compressed |
15:30:45 | FromGitter | <alehander42> like, I can imagine reading so much stuff for 1 hour in a new field/topic |
15:30:46 | krux02 | when someone talks to slowly, youtube has a 2x speed option |
15:30:59 | FromGitter | <alehander42> and getting 10-20% of this info trying to go though videos |
15:31:01 | krux02 | I actually do that often with talks, because some people really speak slow |
15:31:05 | FromGitter | <alehander42> for example, you can't index videos |
15:31:14 | krux02 | well you can index videos |
15:31:16 | FromGitter | <alehander42> so search is primitive |
15:31:19 | FromGitter | <alehander42> can you? |
15:31:26 | FromGitter | <alehander42> I haven't seen good search engines for that |
15:31:28 | krux02 | most videos just aren't indexed |
15:31:45 | krux02 | it is for sure improvable |
15:31:50 | FromGitter | <alehander42> well that means the tech isn't developed enough |
15:31:53 | FromGitter | <alehander42> yeah |
15:32:17 | FromGitter | <alehander42> :D maybe it's also my low attention span! |
15:32:27 | FromGitter | <alehander42> but I still think you can have best of both worlds |
15:32:48 | FromGitter | <alehander42> with remapping videos to structured text/video mapping |
15:32:52 | krux02 | well and what I also like about it, I don't need to actively do something, I just watch it and relax. Other people might enjoy watching something on Netflix, I enjoy watching something from CppCon or GDC. |
15:32:54 | FromGitter | <alehander42> with a web app |
15:33:40 | FromGitter | <alehander42> hm my problem is if I don't interact with something, I get really bored |
15:34:03 | FromGitter | <alehander42> maybe I have to try to listen to stuff while I am doing something else |
15:34:16 | krux02 | ok, that is a fair point. For me it is the other way around. Sometimes I just don't want to interact. |
15:35:43 | krux02 | to be honest it is somthing rather recent that a lot of confernce recordngs started to pop up on youtube. |
15:35:49 | krux02 | I really enjoy that. |
15:36:05 | krux02 | maybe in the not too near future, there will be better indexing for such videos. |
15:37:56 | krux02 | but hey, nobody is telling you, that you should watch those videos. |
15:40:02 | * | edcragg quit (Quit: ZNC - http://znc.in) |
15:40:38 | * | ofelas quit (Read error: Connection reset by peer) |
15:40:54 | * | edcragg joined #nim |
15:42:48 | * | ofelas joined #nim |
15:48:47 | * | Vladar joined #nim |
15:48:48 | FromGitter | <alehander42> no, now I want to build this video => textvideosegment app |
15:48:55 | * | Vladar left #nim (#nim) |
15:48:57 | * | Vladar joined #nim |
15:49:38 | FromGitter | <alehander42> :D but from what I've seen from youtube autocomments I don't have the tech for that |
15:49:49 | FromGitter | <alehander42> yeah, I am very happy for people who like them |
15:49:55 | FromGitter | <alehander42> just hard to understand them |
15:50:31 | skelett | Why does `int(getTime)` fail on ARM? |
15:51:04 | dom96 | how does it fail? |
15:51:11 | dom96 | You sure it's only on ARM/ |
15:51:12 | dom96 | *? |
15:52:04 | skelett | I'm currently debugging jester |
15:52:22 | skelett | the application works on my system, but when I move it to my Raspberry, I get an compiler error |
15:52:58 | skelett | Telling me that it got `<Time>` but expected an `int` |
15:53:12 | skelett | and it's that instruction that creates the error |
15:53:27 | FromGitter | <GULPF> `int(getTime())` will no longer work, because `Time` is no longer `distinct int64` |
15:54:05 | FromGitter | <GULPF> toUnix(getTime()) should be used instead |
15:54:12 | skelett | Thanks! |
15:54:41 | FromGitter | <alehander42> yeah I used |
15:54:44 | FromGitter | <alehander42> toUinx today |
15:54:51 | FromGitter | <alehander42> for websocket.nim maybe I should PR |
15:55:04 | dom96 | Might want to use the same version of Nim on your RPi and system :) |
15:55:33 | FromDiscord | <treeform> Any one seeing this error "lib/core/macros.nim(210, 81) Error: list of key:value pairs expected" when `import json` ? |
15:55:56 | dom96 | rebootstrap |
15:56:13 | skelett | Interesting ^^ Yeah I thought that I use the same version, but obviously not :D |
15:56:23 | dom96 | I'm guessing you `git pull`'ed and your Nim compiler is now out of date |
15:56:43 | * | yglukhov joined #nim |
15:57:09 | skelett | yes. On the pi I pulled from git, and on my system, I'm using the AUR package. |
15:57:22 | skelett | s/git/github/ |
15:57:47 | krux02 | well I wrote that line :D |
15:58:05 | krux02 | well it is an issue I also discussed with Araq |
15:58:34 | krux02 | the deprecation annotation is a new one |
15:59:05 | krux02 | you should be able to just deleted the entire deprecation expression and build |
15:59:16 | krux02 | and then bootstrapping should work |
15:59:45 | krux02 | but you need a 0.18 compiler to compile the devel branch |
16:00:26 | krux02 | so it should also work to checkout 0.18, build that and with that compile the devel branch |
16:00:57 | * | yglukhov quit (Ping timeout: 240 seconds) |
16:04:23 | FromDiscord | <treeform> dom96, yes rebootstrap worked |
16:04:30 | FromDiscord | <treeform> thanks! |
16:04:40 | FromGitter | <alehander42> @dom96 do you plan on supporting websockets.nim in jester somehow |
16:05:01 | dom96 | yes |
16:05:39 | dom96 | Might write my own websocket implementation |
16:05:53 | dom96 | or at least improve websockets.nim significantly |
16:06:03 | FromGitter | <alehander42> does it have perf problems |
16:06:06 | dom96 | Specifically the API |
16:06:20 | dom96 | not from what I've seen |
16:06:20 | FromDiscord | <treeform> I have written 90% of my own websocket implementation but then got lazy. I would feel more comfortable with yours. |
16:06:24 | dom96 | but I never benchmarked it |
16:06:41 | miran | skelett: so you copy your source file(s) on RPi and compile it there? have you tried cross-compiling? (i would like to use nim with my RPi in the future, so i'm interesed in best/easiest way to do it) |
16:08:08 | skelett | Not yet. That would be the easiest way ofc, but I wanted to get this finished before playing around, as someone's waiting for me before he can continue. |
16:10:10 | dom96 | btw if you want Jester and websockets you can already set it up fairly easily using nginx |
16:10:21 | dom96 | Just run jester on a different port to websockets |
16:12:41 | * | girvo quit (Quit: Ping timeout (120 seconds)) |
16:12:55 | FromGitter | <alehander42> nah, for now I just need it for a small prototype, it's like a chess multiplayer with weird versions of chess |
16:13:06 | FromGitter | <alehander42> I'll just keep everything in memory |
16:13:09 | * | girvo joined #nim |
16:14:41 | FromGitter | <alehander42> but sooner or later I'll try the combo yeah |
16:15:18 | FromGitter | <alehander42> I can also rewrite one football "beer bet" chat bot before the world cup in nim :D |
16:16:02 | krux02 | 7:1 |
16:16:27 | FromDiscord | <claude> whats wrong with websocket.nim |
16:17:15 | dom96 | https://github.com/niv/websocket.nim/issues/1 |
16:18:20 | FromGitter | <alehander42> @krux02 nobody got this one then :D |
16:20:59 | FromDiscord | <claude> thats easy, just add send for AsyncWebSocket in client |
16:22:14 | FromDiscord | <claude> oh |
16:23:45 | FromDiscord | <claude> i never looked at the server module |
16:29:13 | miran | re(gex) module worked differently in previous versions (ignoring whitspace, IIRC), is there a way to enable that old behaviour? |
16:30:20 | miran | oh, `rex` instead of `re` |
16:33:07 | krux02 | any votes against this change in system.nim https://github.com/nim-lang/Nim/pull/7617? |
16:34:54 | miran | thumb up from me |
16:37:22 | krux02 | yay |
16:45:17 | FromDiscord | <treeform> I have updated my chrono library, https://github.com/treeform/chrono |
16:45:22 | FromDiscord | <treeform> Works in c as well as in javascript! All calendar manipulations! Include only the timezones and years you need! |
16:49:39 | Yardanico | @treeform - strings used to format and parse timestamps look very, very nice! |
16:51:14 | FromGitter | <alehander42> nice @treeform, I like when libs work on both backends! |
16:52:37 | FromDiscord | <treeform> Yardanico, thank you I wanted to do some thing different then DD-MM-YY or is it %D-%M-%Y or is it %d-%m-%y ... I wanted some thing more clear then the regex like things people normally do. |
16:53:01 | FromDiscord | <treeform> alehander42, JS backend is nice, works for the stuff I needed to work for. |
16:54:21 | * | SenasOzys quit (Ping timeout: 256 seconds) |
16:54:34 | dom96 | treeform: Nice! The format strings are nice indeed. |
16:54:36 | FromDiscord | <treeform> `%D-%M-%Y` is acctually kind of ok, its the `%a-%p-%U` that is hard to read. |
16:57:00 | * | dom96 fixes zip's package structure |
16:57:28 | FromDiscord | <treeform> dom96, can you include the windows 64 bit dll that is need for it? |
16:57:43 | FromDiscord | <treeform> I got stuck with the zip packadge for like 2 hours and just gave up. |
16:58:00 | dom96 | I don't use Windows so no |
16:58:11 | FromDiscord | <treeform> I think on windows you need to #define WINDOWS some thing and headers are different so its not ABI compatible with windows dll |
16:58:16 | dom96 | Plus, commiting binaries is bad |
16:59:02 | FromDiscord | <treeform> I think the zip packadge is broken on win64 and I am not smart enought to figure it out and fix it. |
17:00:41 | FromDiscord | <treeform> I am not 100% sure but I think this structure: https://github.com/nim-lang/zip/blob/master/zip/libzip.nim#L67 on windows is different it uses 32 bit ints vs 64 bit ints or some thing like that. |
17:01:07 | * | xkapastel joined #nim |
17:03:10 | FromDiscord | <treeform> https://webcache.googleusercontent.com/search?q=cache:SmBdPQq-RQAJ:https://zlib.net/DLL_FAQ.txt+&cd=3&hl=en&ct=clnk&gl=us |
17:11:24 | Araq | so ... I have Ubuntu in a VM and cannot get gcc-3 |
17:11:39 | Araq | any ideas? |
17:11:59 | Araq | this is your time to pinch your favourite distro |
17:12:05 | Araq | *pitch ? |
17:12:24 | FromDiscord | <treeform> Mac OS X? |
17:12:26 | Araq | it needs to have gcc-3 so that I can test this thing |
17:12:29 | krux02 | I have arch |
17:12:43 | Araq | osx maps gcc to clang afaik |
17:12:47 | krux02 | but I would recommend Manjaro |
17:12:56 | Yardanico | krux02, for a newcomer into arch world, yeah |
17:12:56 | krux02 | but I have not checkout how to get gcc 4 |
17:13:01 | Yardanico | but maybe Antergos ;) |
17:13:02 | krux02 | gcc 3 |
17:13:05 | krux02 | sorry typo |
17:13:37 | krux02 | Manjaro is the advantages of Arch, but it actually very installable |
17:13:45 | Yardanico | there's mipsel gcc 3 in AUR lol |
17:14:34 | krux02 | this system already has Arch installed, so I would not switch, but if I would have to do a reinstall, Manjaro is my rocommendation. I used Ubuntu for years, but I had a lot of frustration that I could not get new software and system upgrades to a new release always broke stuff |
17:14:53 | dom96 | Araq: Maybe there is a PPA that offer gcc 3? |
17:15:02 | dom96 | *offers |
17:15:08 | Yardanico | there is |
17:15:26 | Araq | dom96, yeah but my package manager says my system is bonkers anyway |
17:15:40 | Araq | and typing the random commands it tells me doesn't change things |
17:15:56 | dom96 | so ask #ubuntu instead of spending days reinstalling and relearning a new distro |
17:16:01 | Yardanico | Araq, wait |
17:16:09 | Yardanico | Araq, there's gcc-3.3 in ubuntu |
17:16:17 | krux02 | is the system just for developing and testing stuff? |
17:16:28 | Araq | krux02, yeah. |
17:16:42 | Yardanico | but it's source only |
17:16:53 | krux02 | A good friend of mine uses nixOS, this is 100% declarative |
17:17:11 | krux02 | meaning you can specify" I want this package this version, etc for this environment |
17:17:12 | Yardanico | krux02, honestly I mostly use arch because of the wiki and AUR :) |
17:17:23 | Araq | this is also 100% irrelevant. the only relevant thing is: can I install gcc-3 in one hour on it or not. |
17:17:28 | krux02 | and you can switch and install arbitrary versions |
17:17:31 | krux02 | without conflicts |
17:17:55 | Yardanico | Araq, http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/gcc-3.3_3.3.6-15ubuntu6_i386.deb |
17:18:04 | Yardanico | maybe it can help |
17:18:18 | dom96 | alternatively you can probably join the Docker hype |
17:18:25 | dom96 | and grab a gcc-3 docker container |
17:18:26 | Yardanico | and then "sudo dpkg -i file.deb" |
17:18:45 | krux02 | I can't say anything else but from years of using ubuntu I have to say that it is a hacky horrible mess that is nice in the beginning, but after some time it really starts to smell. |
17:18:46 | dom96 | You can probably do that on macOS in fact |
17:18:54 | FromDiscord | <treeform> 😃 |
17:18:59 | dom96 | krux02: isn't that all Linux? :P |
17:19:17 | krux02 | dom96: no |
17:19:35 | Yardanico | I still didn't have any need to install ANY program without package manager |
17:19:44 | Yardanico | I always can find it in official repos or in aur :D |
17:20:40 | krux02 | Yardanico, the good thing is that the package creation process is so simple that even if you only have a "make install" script, you can trivially transform it into a packa, automate it and put it up on AUR |
17:20:53 | krux02 | and that is the reason that almost everything exists as an Arch package |
17:21:22 | * | SenasOzys joined #nim |
17:22:11 | FromGitter | <Varriount> Araq: I really like the additional information you added to the manual. :D |
17:22:37 | Yardanico | there's even `aporia-git` in AUR! |
17:23:10 | krux02 | everything is in AUR |
17:23:38 | krux02 | a friend of mine made a zsh prompt, I made an AUR package for it |
17:23:51 | * | hal joined #nim |
17:24:03 | krux02 | I have it installed as package, he has it installed on /usr/local/ unmanaged, because no pacaman. |
17:24:10 | * | hal is now known as Guest22644 |
17:24:45 | krux02 | but put that aside, I think manjaro is a great os when you want to have all recent software and a nice experience in general without much frustration. |
17:25:28 | Yardanico | krux02, why not antergos? :) |
17:25:38 | krux02 | und nixos should be an experimont, because it basically solves the problem that choosenim tries to solve for you for everything |
17:25:55 | Yardanico | krux02, just look a this :D https://github.com/manjaro/packages-core/blob/master/manjaro-system/manjaro-update-system.sh |
17:25:57 | krux02 | Yardanico: I have no opinion about antergos. I can't know every distro |
17:27:32 | Yardanico | antergos is closer to arch, so it can't be installed offline (but it has full-blown gui installer) |
17:27:37 | krux02 | it is just that practically I used Manjaro at work and the experience was really good and without the frustration I had when I installed Arch. |
17:27:48 | Araq | Yardanico, the "Ubuntu Software" program hangs when opening this .deb file |
17:28:00 | Yardanico | Araq, try in console - `sudo dpkg -i file.deb` |
17:28:44 | krux02 | I think all these different commands on ubutu very confusing "dpkg,apt-get,apt-chache,aptitude" I never know which one to choose |
17:29:02 | Yardanico | krux02, you shouldn't use apt-get or apt-cache or aptitude |
17:29:04 | Yardanico | just use `apt` |
17:29:09 | krux02 | pacman unifies them all, very nice |
17:29:18 | Araq | krux02, that's just the top of the iceberg |
17:29:28 | Yardanico | apt combines different apt-* utilities |
17:29:29 | krux02 | Araq: I know |
17:29:30 | Araq | Yardanico, error processing dependencies |
17:30:04 | Yardanico | Araq, well... try `sudo apt install -f` |
17:30:15 | Araq | Yardanico, did that |
17:30:20 | Yardanico | oh, IDK then |
17:30:51 | Araq | Sub-process /usr/bin/dpkg returned an error code (1) |
17:31:03 | FromDiscord | <geckojsc> oh apt is the right one? I always used apt-get |
17:31:57 | Yardanico | @geckojsc yeah, it combines apt-get, apt-cache and more |
17:34:27 | krux02 | I wish I could help with ubuntu, but your problems are the reasons I gave up on Ubuntu. |
17:35:01 | Araq | krux02, oh you can be of help |
17:35:57 | Araq | https://github.com/nim-lang/Nim/issues/7301 fix this please |
17:36:03 | Araq | that's what I'm trying to do... |
17:36:37 | Araq | you need to patch lib/system/atomics to use the older __sync stuff from GCC |
17:38:49 | Araq | so ... time is up for my ubu session. it was a *much* worse experience than the one in 2010. we need to watch out these things don't happen to Nim. |
17:40:40 | FromGitter | <Varriount> Araq: So I think I've tracked down my problem with open arrays. This line - https://github.com/nim-lang/Nim/blob/devel/compiler/ccgcalls.nim#L100 - produces a check that errors when a string has a length of 0, and someone does `toOpenArray(emptyString, 0, -1)` |
17:43:23 | FromGitter | <Varriount> `if (0 >= emptyStringLen_0) #raiseIndexError();$n` |
17:44:31 | FromGitter | <Varriount> I'd fix it, only I can't think of an elegant way to handle the special case of getting a zero-length slice from a zero-length string. |
17:45:44 | * | yglukhov joined #nim |
17:46:08 | krux02 | Araq: I can see that from AUR I can install the NIX package manager, maybe that allows me to create an environment where I have gcc3 |
17:46:13 | krux02 | as the default gcc |
17:46:34 | Araq | you only need to install it somehow, it doesn't have to be the default |
17:46:42 | Araq | you can change your nim.cfg to use it |
17:47:21 | krux02 | nim.cfg always confused me |
17:47:35 | krux02 | I looked at some and all I saw was linenoise |
17:48:03 | krux02 | you recommended me several times to change stuff in there, but I never know how to do it |
17:49:00 | krux02 | I think mipsel is the wrong package |
17:50:10 | Guest22644 | dom96: Good evening. Sorry I was not able to look at the PR for the last days. I just pushed a commit that should make the tests pass again after the merge of the devel branch. |
17:50:52 | Araq | arm.linux.gcc.exe = "arm-linux-gnueabihf-gcc" |
17:50:52 | Araq | arm.linux.gcc.linkerexe = "arm-linux-gnueabihf-gcc" |
17:51:06 | * | Guest22644 is now known as hal1 |
17:51:08 | Araq | s/arm/amd64 |
17:51:10 | Araq | or |
17:51:19 | Araq | s/arm/i386 |
17:51:39 | Araq | and the stuff in the "quotes" is the binary it should use |
17:51:57 | Araq | # is a comment |
17:52:07 | dom96 | hal1: Hrm, great. I think it was Araq that may have performed the conflict resolution incorrectly. |
17:52:15 | dom96 | Nice that you've fixed it though |
17:52:27 | dom96 | I already accepted it so it's in Araq's hands now |
17:52:43 | hal1 | dom96: what I don't know is how to best add tests for the new procs |
17:52:48 | Araq | well it was a -1 from me, dom96 and data-man gave a +1 |
17:52:56 | Araq | and so it's accepted |
17:53:34 | dom96 | Araq: Not necessarily, but you never explained why you gave a -1 |
17:54:04 | * | couven92 quit (Quit: Client disconnecting) |
17:54:17 | Araq | I did. I consider it a niché case |
17:54:26 | dom96 | hal1: maybe create a file in `getTempDir()`, set its mod time, then check that it was set correctly. |
17:54:29 | krux02 | the oldest gcc I can find is gcc43 |
17:54:35 | krux02 | is that old enough? |
17:54:38 | Araq | and stdlib bloat is effecting every Nim user. |
17:54:39 | dom96 | hal1: You should be able to find a good place for the test in tests/stdlib/ |
17:54:57 | Araq | krux02, check the bug report. maybe. |
17:56:45 | hal1 | dom96: do the different smaller procs like toFILETIME in winlean and toWinTime in times need their own tests? |
17:57:22 | hal1 | Maybe I should wait for a decision before I add to the PR? |
17:57:30 | dom96 | hal1: Up to you, we don't usually go that crazy with tests. |
17:57:53 | krux02 | Araq: I did a PR today, will you merge it? |
17:57:55 | krux02 | https://github.com/nim-lang/Nim/pull/7617 |
18:00:06 | Araq | krux02, maybe I should give you write access |
18:00:53 | Araq | "This is not bad, but since rawExecute is already really long (!), it should be extracted into a helper proc." |
18:00:58 | Araq | https://github.com/nim-lang/Nim/pull/7585/files |
18:01:12 | Araq | have you seen my remark? |
18:02:16 | krux02 | oh no, I didn't. Thank you for pointing it out. |
18:02:48 | krux02 | but I am not convinced that a helper proc would improve readability in any way. |
18:03:10 | Araq | you even introduce 'let' bindings that would become parameters... |
18:03:14 | krux02 | it would just add a layer of indirection to the code |
18:03:38 | Araq | in theory it is fine either way. in practice this thing exists in a context |
18:03:49 | Araq | and the context is a big hairy mess of control flow |
18:04:06 | Araq | so shorter code in control flow section is better code. |
18:04:07 | * | Lord_Nightmare quit (Excess Flood) |
18:04:19 | Araq | it's not about the code you added. |
18:04:27 | Araq | it's about all the other code around it. |
18:05:23 | Araq | should probably have use a macro here... |
18:05:27 | Araq | *used |
18:05:47 | krux02 | yea, that is what I thought too when I first looked into that file |
18:05:51 | * | Lord_Nightmare joined #nim |
18:06:18 | * | nsf quit (Quit: WeeChat 2.0.1) |
18:07:25 | krux02 | something like `proc eqIdent(a,b: NimNode): bool {.vmproc.} = a.node.ident.s ... |
18:07:36 | Araq | remember, when I wrote this code it was the new foundation for Nim's macro system |
18:07:41 | Araq | :P |
18:07:48 | krux02 | and then all the magics and opc values and the proc stup in macros get generated |
18:08:06 | Araq | can't use macros to write a macro system. |
18:08:08 | krux02 | yea you are right |
18:08:15 | krux02 | well with bootstrapping you can |
18:08:42 | krux02 | but I can't use the ast pattern matching macro to write ast pattern matching |
18:08:46 | Araq | true but I didn't trust the old VM. |
18:08:58 | krux02 | now you do? |
18:09:04 | Araq | yeah. |
18:09:17 | Araq | I know its edge cases and they are not hard to avoid |
18:09:38 | Araq | have looked into producing errors instead of crashing. with mild success. |
18:09:42 | krux02 | Well when I started I was a bit frustrated about some bugs in the vm |
18:09:52 | krux02 | for example tables didn't work |
18:10:00 | krux02 | but now I think the VM is ok |
18:10:20 | Araq | "ok" is the right word, still not "great", but "ok". :-) |
18:10:43 | krux02 | I can use it to get stuff done |
18:11:13 | krux02 | but I am still a bit confused at times where things are implemented. |
18:11:50 | krux02 | there are so many different ways to write the implementation for the different ways nim compiles |
18:12:35 | krux02 | the vm magics I now really understand and why they are like they are |
18:12:58 | krux02 | but often I see some pragmas and I think, hmm, what does this mean? |
18:16:14 | krux02 | Araq: when you give me write access to Nim, astmacros will become part of the standard library :P |
18:16:50 | krux02 | I mean ast pattern matching |
18:18:26 | Araq | is that a threat or a promise? |
18:19:52 | krux02 | I don't know |
18:19:55 | krux02 | both? |
18:21:24 | Araq | well ast pattern matching is pretty important |
18:22:14 | krux02 | that means I have a chance of ``of pattern(...) if a > b:`` to become valid syntax? |
18:22:37 | Araq | sure |
18:22:48 | krux02 | I don't need it to have any meaning in the Nim language, but it should be some ast |
18:22:55 | krux02 | that is cool |
18:23:39 | krux02 | the pattern that I use for matching look almost identical to the `astspec.txt` |
18:23:48 | miran | idiomatic way to convert a string to seq of chars? |
18:24:23 | krux02 | miran: cast :P |
18:24:51 | krux02 | let myseq: seq[char] = cast[seq[char]](mystring) |
18:24:57 | krux02 | it works |
18:25:41 | krux02 | but it is very unsafe, it could break in the future |
18:26:07 | FromGitter | <alehander42> please please if you add pattern matching to upstream Nim, make sure it's useful for all kinds of object , not just ast |
18:26:44 | dom96 | miran: And why do you want to convert a string to seq of chars? |
18:26:53 | krux02 | alehander42: I start with ast, and then I will introduce a way to make it more general |
18:27:04 | krux02 | but I have to start with something |
18:27:26 | miran | dom96: so i can do `mySeq.map(parseInt)` :D |
18:27:31 | FromGitter | <alehander42> I am just not sure what is ast specific about it now |
18:27:43 | dom96 | miran: :'( |
18:27:49 | FromGitter | <alehander42> what would stop me from using it with my own variant object |
18:27:51 | dom96 | map should work on strings |
18:27:55 | Araq | you know we just got for-loop macros |
18:28:16 | dom96 | krux02: just because you have write access doesn't mean you can just add random stdlib modules :P |
18:28:16 | Araq | here is a secret: that's a new language design pattern. |
18:28:34 | krux02 | alehander42: well I don't know, maybe it will just work |
18:28:37 | hal1 | I came across another thing I was not able to find in the standard lib: converting a relative path or just one containing .. to an absolute path. There is a posix and windows function for this though. Is a proc that does this something that could be added to ospaths (or the apropriate module) or would it fall in the stdlib bloat category? |
18:28:50 | FromGitter | <alehander42> i'll try to play with it actually, good idea |
18:28:52 | Araq | macro patternMatch(obj: MyAst; body: CaseStmt) |
18:28:58 | dom96 | hal1: pretty sure that exists, expandPath or something? |
18:29:03 | Araq | case obj |
18:29:07 | Araq | of pattern: ... |
18:29:22 | Araq | # calls patterMatch(obj, <full-case-stmt>) |
18:29:43 | krux02 | as long as you have a kind member, a `len` field and `[]` operator to access the children |
18:29:53 | * | PMunch joined #nim |
18:30:19 | miran | dom96: just tried `let b = "12343".map(parseInt)` and i get type mismatch |
18:30:39 | Araq | hal1, os.expandFilename |
18:30:52 | dom96 | miran: By "should" I mean "it might not work now, but a PR should be created to make it work" |
18:31:01 | krux02 | I also want to extract arbitrary values in single assignments |
18:31:17 | miran | dom96: ok, agreed on that 'should' :) |
18:31:34 | dom96 | If you ever need to use seq[char] then you're doing something wrong |
18:31:44 | krux02 | let pattern(`val1`, `val2`, ...) = something |
18:31:47 | dom96 | I think I will make NimBot shout at people for writing seq[char] :P |
18:31:50 | krux02 | and then val1 and val2 is declared |
18:32:04 | krux02 | dom96: what is wrong with seq[char]? |
18:32:33 | dom96 | It's a waste, there is no point to it |
18:32:36 | dom96 | string is the same |
18:32:42 | krux02 | seq[char] and string are technically equivalent, but semantically very different |
18:32:51 | dom96 | converting back and forth just leads to inefficiency |
18:32:55 | miran | nah, seq[int] is what i need. seq[char] was a step in that direction, because `map` doesn't work on strings |
18:33:00 | krux02 | seq[char] is just data and string is a string |
18:33:15 | hal1 | Araq: Thanks! I missed that one |
18:34:04 | FromGitter | <alehander42> @Araq this might make sense, but on the other hand it would be so confusing if the same pattern acts differently for different variant types |
18:34:57 | krux02 | dom96: you really should stop telling people to use string for data |
18:34:58 | Araq | alehander42: maybe. |
18:35:13 | FromGitter | <alehander42> Instead of this I think we should have "matchers" which can return something compatible with the standard matchers |
18:35:26 | Araq | krux02, data would be seq[byte] though :P |
18:35:27 | FromGitter | <alehander42> and you can define your custom pattern , e.g. MyPattern(MyType) |
18:35:36 | krux02 | Araq: yea, true |
18:35:38 | FromGitter | <alehander42> or ~~@(MyValue) |
18:36:10 | dom96 | krux02: I stand by what I said, seq[char] is an anti-pattern :) |
18:36:23 | FromGitter | <alehander42> but standard match syntax should be always consistent, otherwise it will be like regexes with overloadable `*` :D |
18:36:25 | Araq | alehander42: well we'll see how for-loop macros are received |
18:36:28 | krux02 | alehander42: just look at what works https://github.com/krux02/ast-pattern-matching |
18:37:15 | Araq | I probably got the design wrong but the implementation was really simple :-) |
18:38:28 | Araq | alehander42: the 'of' for custom macros are just a weirdo though |
18:38:47 | Araq | overloading 'case' seem much more sexy and can simplify the grammar further. |
18:38:50 | krux02 | Araq: a very useful weirdo |
18:38:57 | krux02 | but it confuses my emacs a lot |
18:39:07 | FromGitter | <alehander42> @Arq ah, I was talking about patternMatch overloading |
18:39:13 | krux02 | it really wants to fuck up indentation every time i use it |
18:39:27 | FromGitter | <alehander42> otherwise what is the goal of for loop macros, dealing with the lack of high level iterators? |
18:39:29 | Araq | krux02, well it was invented for your purposes |
18:39:34 | Araq | no wonder you find it useful ;-) |
18:40:02 | krux02 | alehander42: that is a solved problem, I know how ast pattern matching works in scala, it just needs to be implemented, and maybe a bit simplifiled, because nim doesn't require singletons |
18:40:10 | Araq | alehander42: in the very long run they make iterators obsolete if we do things right |
18:41:13 | krux02 | Araq: I like the iterators nim has at the moment a lot |
18:41:20 | krux02 | they are very easy to write and very flexible |
18:41:48 | Araq | iterator it ... would introduce hasNext() and next() operations and a for-loop macro would rewrite the for loop to use hasNext and next |
18:42:04 | FromGitter | <alehander42> @Araq overloading case yeah, I thoiught overloading of |
18:42:05 | krux02 | jut some code that emits from time to time. I don't need to be "functional" and use flatmap an concat |
18:42:34 | FromGitter | <alehander42> but still, I wouldn't want somebody except the compiler to overload case |
18:42:48 | FromGitter | <alehander42> because I expect it to work the same for each *shape* (not just type) |
18:43:00 | FromGitter | <alehander42> e.g. for objects or seq-s |
18:43:00 | krux02 | alehander: that is not a problem that is that local to solve |
18:43:10 | miran | next() coming to iterators? woohoo!! |
18:44:13 | krux02 | miran: I already implementad a macro so you could call next on iterators |
18:44:33 | miran | krux02: but it is not in the stdlib, right? ;) |
18:45:00 | krux02 | right |
18:45:08 | krux02 | → |
18:45:36 | Araq | krux02, inline iterators are not a first class thing and .closure iterators are more inefficient than they need to be |
18:46:30 | krux02 | Araq: the real problem I have with the two different iterators is that it is an either or thing. |
18:46:56 | Araq | inline iterators are cool for v1, closure iterators are an accident |
18:47:00 | krux02 | either it is an inline iterator or a closure iterator. AFAIK You can't write an iterator that works in both words |
18:47:02 | * | couven92 joined #nim |
18:47:28 | Araq | and then there is this weird overloading thing |
18:47:42 | Araq | where in a type() operator we prefer iterators over procs |
18:47:57 | dom96 | I feel like I need context here |
18:48:05 | Araq | and iter.toSeq() cannot work because 'iter' is not a "routine" |
18:48:06 | dom96 | AST pattern matching? For loop macros? |
18:48:12 | Araq | etc etc. |
18:48:37 | dom96 | Maybe we should start by adding some nice AST accessors? |
18:48:42 | Araq | so yeah, eventually we will have something better |
18:48:47 | dom96 | so that we can stop writing [0][2][1][2] everywhere |
18:48:56 | dom96 | (in macro code) |
18:49:12 | Araq | dom96, krux02 has the more general solution |
18:49:14 | * | nsf joined #nim |
18:49:26 | krux02 | Araq: I think it would be fun to have "collect: yield 1; yield 2; ..." and this is then an expression of seq[int]. But a macro should be able to do it. |
18:49:54 | * | sz0 joined #nim |
18:50:51 | krux02 | Araq: there is one thing that I also don't like about iterators, and that is how it extracts tuples. |
18:50:57 | FromGitter | <alehander42> @dom96 ast pattern matching is just the first usecase, it's supposed to be general |
18:52:07 | Araq | krux02, that one I do like. |
18:52:32 | krux02 | I think ``for i, x in something`` should explicitly ask for an iterator with keys, and ``for (i, x) in something`` should explicitly ask for the normal items iterator, that returns pairs. |
18:52:39 | dom96 | whatever you guys are creating, please do it as a nimble package first |
18:54:11 | miran | offtopic: i have a proc with `s: var string`, and i want to call it recursively with a slice of that string (`myProc(s[1 .. 5]`), but it is a type mismatch |
18:54:51 | krux02 | and ``for i, (x1, x2, x3) in zip(s1, s2, s3)`` should append an index, even when zip doesn't provide one. |
18:55:14 | krux02 | miran: that is not offtopic, this is still the nim channel |
18:55:34 | miran | krux02: offtopic when the topic are iterators :) |
18:55:44 | krux02 | the topic is Nim |
18:55:54 | krux02 | the current subject is iterators |
18:55:57 | krux02 | or better was |
18:56:02 | krux02 | I said what I wanted to say |
18:57:11 | krux02 | but I don't know anything about your problem |
18:58:32 | miran | :) |
18:58:42 | krux02 | miran: var tmp: string = s[1..5]; myProc(tmp) |
18:58:53 | krux02 | be aware, slicing copies |
18:59:17 | miran | oh, if it is a copy, it won't be of much use.... |
18:59:25 | miran | i'm figuring out the other way |
18:59:38 | Araq | it's also not an lvalue |
18:59:41 | * | Lord_Nightmare quit (Ping timeout: 265 seconds) |
18:59:48 | Araq | and so cannot be passed to a 'var T' |
18:59:50 | krux02 | if you want to pass a slice of a string, pass the slice and the string |
19:00:01 | krux02 | myProc(s, 1..5) |
19:00:03 | Araq | or use openArray and toOpenArray ;-) |
19:00:13 | Araq | which is the new zero copy slicing |
19:00:42 | krux02 | Araq: does openArray work to get any subslice of a string? |
19:00:49 | krux02 | without copying |
19:00:50 | krux02 | ? |
19:01:13 | Araq | well variount found a bug, but sure. |
19:01:23 | krux02 | then how is the syntax |
19:01:45 | Araq | foo(toOpenArray("abc", start, end)) |
19:01:56 | Araq | yeah, I know the syntax still sucks |
19:02:24 | Araq | will eventually optimize x[a..b] to toOpenarray() |
19:02:28 | krux02 | well it would help if I can use the ..< operator like I am used ot |
19:02:51 | krux02 | foo(toOpenArray("abc", 0 ..< i)) |
19:03:53 | dom96 | openarray becomes ever more confusing for newbies |
19:03:56 | krux02 | Araq: gcc is still building |
19:04:06 | dom96 | now we're abusing it for slices too? :) |
19:04:26 | krux02 | well isn't that what they are supposed to be? |
19:04:47 | * | Lord_Nightmare joined #nim |
19:11:44 | Araq | dom96, openArray is (ptr to array, length) pair in contexts where we can assure memory safety |
19:11:57 | Araq | as such it's the natural candidate for giving us zero-copy slices |
19:12:15 | dom96 | great, so perhaps it shouldn't be named openarray anymore? |
19:12:32 | Araq | and it's still a (ptr, length) pair so I don't see how it becomes "ever more confusing" :-) |
19:12:49 | krux02 | dom96: I would call it slice, but that name is taken |
19:12:49 | Araq | dom96, if you know a better name |
19:13:33 | dom96 | I was going to say 'slice' :) |
19:14:10 | dom96 | Maybe openSlice? |
19:15:07 | krux02 | openarray is fine |
19:15:59 | dom96 | FWIW I never thought of `openarray` as a `slice` |
19:16:17 | dom96 | It was always a magical type that means `seq[T] | array[T] {.unchecked.}` to me |
19:16:18 | miran | multifunctionalArray :P |
19:17:07 | miran | magicalMultifunctionalSlicingArray |
19:17:25 | krux02 | I mean you could also add "stride" to the openarry, so you can get an openarray[int] from seq[tuple[a: string, b:int, c: float] |
19:20:14 | Araq | so ... can we extract io.nim from system.nim, never mind, canon, I remembered |
19:23:07 | FromDiscord | <claude> could the playground code be -d:release'd? |
19:23:16 | FromDiscord | <claude> <https://play.nim-lang.org/src/nimcache/app.js> |
19:23:51 | dom96 | Is it slow? |
19:24:29 | FromDiscord | <claude> i was just looking at it and it seemed cluttered |
19:24:38 | Yardanico | claude: are you sure it's with -d:release? |
19:25:09 | Yardanico | *without |
19:25:16 | Yardanico | it looks fine to me |
19:26:24 | Yardanico | hmm, wait, yeah |
19:26:49 | Yardanico | @claude you're actually right |
19:26:58 | Yardanico | var F={procname:"system.reprEnum",prev:framePtr,filename:"lib/system/reprjs.nim",line:0}; |
19:27:22 | dom96 | https://picheta.me/snake/snake.js |
19:27:31 | dom96 | I never bothered to -d:release my snake game either |
19:27:34 | dom96 | Also wow, 0.16.1 |
19:28:17 | Yardanico | dom96, yeah, V8 is probably good at optimizing JS anyway |
19:28:28 | FromDiscord | <claude> im on firefox |
19:28:29 | Yardanico | but if you want best results, you should do -d:release and then run closure compiler on your JS |
19:28:41 | Yardanico | @claude: nim playground wasn't slow for me on firefox |
19:28:48 | FromGitter | <data-man> @claude: https://github.com/zacharycarter/nim-playground/issues/3 |
19:28:49 | dom96 | Yeah. Don't assume V8 :) |
19:29:11 | dom96 | data-man: That's a different issue |
19:29:30 | FromGitter | <data-man> No :) |
19:33:18 | FromGitter | <alehander42> oh I really have to optimize my checkmate detection |
19:33:38 | FromGitter | <alehander42> but still having the same validation in Nim be used in js browser and native server is amazing |
19:34:13 | Yardanico | @data-man: https://github.com/zacharycarter/nim-playground/issues/3 |
19:34:26 | FromGitter | <alehander42> this ability to reuse code have to be marketed in the nim web frameworks, currently mostly js and clojure people have it |
19:34:29 | Yardanico | also, why don't you use IRC? :) it would be easier to tab your nickname :) |
19:35:33 | Araq | Yardanico: you promised to remove deprecated stuff. now is the time, I think. |
19:36:15 | dom96 | alehander42: That's what I tried to do via the snake game |
19:36:20 | dom96 | It really is amazing |
19:36:38 | Yardanico | Araq, old deprecated stuff? |
19:36:52 | Araq | that's the original idea behind the JS codegen. |
19:37:40 | Yardanico | like stuff that was deprecated 6 months ago or older? |
19:38:03 | Araq | Yardanico: stuff deprecated in 0.16 or lower |
19:38:04 | dom96 | Stuff that was deprecated pre-0.18.0 (or maybe 0.17.2) |
19:38:10 | dom96 | lol |
19:38:15 | dom96 | Araq is more conservative here |
19:38:25 | Yardanico | Araq, ok |
19:38:47 | Yardanico | so 0.16 was released in january of 2017, ok |
19:38:52 | * | hal1 quit (Quit: WeeChat 1.4) |
19:40:17 | dom96 | Most deprecations should mention the version |
19:40:29 | dom96 | so you won't need to run `blame` much |
19:41:23 | Yardanico | dom96, I have an extension in vscode which provides info when specific line was changed |
19:41:29 | Yardanico | (for git repos) |
19:41:43 | Araq | Yardanico: what is its name? |
19:42:51 | Yardanico | Araq, GitLens |
19:43:23 | FromGitter | <data-man> https://github.com/nim-lang/website/issues/80 :-D |
19:43:46 | Yardanico | there's also much more features in that extension besides blame-like functionality of course |
19:44:21 | Yardanico | @data-man: lol |
19:44:52 | FromGitter | <data-man> Good idea! |
19:45:35 | FromGitter | <data-man> And other langs too. |
19:45:47 | * | rokups quit (Quit: Connection closed for inactivity) |
19:59:03 | krux02 | obviously just russion is important |
20:02:14 | Yardanico | krux02, russion? :D |
20:02:39 | Yardanico | but yeah, we can easily add russian/german/*insert your native language* |
20:02:45 | krux02 | well that is the issue. |
20:02:53 | FromGitter | <data-man> russioff :) |
20:03:08 | FromDiscord | <claude> most people who use nim are european anyway |
20:03:22 | krux02 | it's not, please add support for other languages on the website for example russian, it is "Please add russin!" |
20:03:59 | * | Trustable joined #nim |
20:05:17 | Yardanico | claude: hmmm, this is probably true |
20:06:41 | * | Trustable quit (Remote host closed the connection) |
20:08:19 | FromGitter | <data-man> And multilingual docs & forum - just dreams |
20:10:35 | Yardanico | it is |
20:10:54 | Yardanico | *they are. I mean almost no language has multilingual docs :) |
20:14:45 | * | Lord_Nightmare quit (Ping timeout: 264 seconds) |
20:15:07 | * | Vladar quit (Quit: Leaving) |
20:19:21 | * | Lord_Nightmare joined #nim |
20:20:51 | miran | is array of bools any faster than array of ints (containing just 0 and 1)? |
20:21:26 | miran | faster and/or less memory? |
20:21:46 | Yardanico | miran, most probably less memory, can't tell about speed |
20:21:50 | krux02 | bool is one byte, int is 8 byte |
20:22:10 | skelett | If it's according to c, then ints are per definition the fastest types |
20:22:11 | FromGitter | <tim-st> Do other programming languages also save the object field names as strings inside the generated binary file? |
20:22:15 | skelett | don't know about nim though |
20:23:16 | krux02 | tim-st that is called reflection, and Go and Java does it |
20:23:32 | krux02 | runtime reflection |
20:23:43 | miran | argh, in nim there's no implicit true=1 and false=0 :( |
20:23:59 | krux02 | miran: you can write a converter proc |
20:24:07 | Yardanico | krux02, wouldn't const do it? |
20:24:11 | krux02 | ``converter toBool(arg: int): bool = arg != 0 |
20:24:16 | krux02 | and you are good |
20:24:17 | FromGitter | <tim-st> yes, I know what reflection is, but if I dont use it isnt that bad regarding peformance? |
20:25:14 | krux02 | well maybe there is a compiler flag to disable it |
20:25:48 | Yardanico | krux02, miran probably talks about const true = 1; const false = 0? |
20:25:56 | Yardanico | or IDK |
20:26:05 | Yardanico | ah, sorry, misunderstood his question, you're right |
20:26:07 | FromGitter | <tim-st> @ krux02 ok, thanks |
20:27:03 | Yardanico | @tim-st: does nim do that? |
20:27:11 | miran | just converted to array of bools - slightly faster (0.5 vs 0.6 sec), noticeably less memory (1.1 Mb vs 1.8 Mb) |
20:27:31 | krux02 | I don't know about runtime reflection in Nim |
20:27:37 | FromGitter | <tim-st> @Yardanico yes, I compiled in release version and it does |
20:27:46 | Yardanico | ah, you mean things like "TM_hNO9c5XDtIbe4m20FGQ9bN2Q_0[34].name = "ids";" |
20:29:57 | FromGitter | <tim-st> But why is this inside my binary if never want this to be shown? Someone can sees many of the program logic on the first look using debugger only through strings |
20:31:53 | krux02 | tim-st: check in the compiler options list |
20:31:59 | krux02 | I haven't checkit that |
20:32:06 | krux02 | but maybe you can disable it |
20:32:06 | FromGitter | <tim-st> ok, I will try it |
20:32:11 | Araq | yeah, need to fix that |
20:33:19 | Yardanico | Araq, it can be fixed? |
20:33:50 | FromGitter | <tim-st> I think the idea is to print some information about variables on exception |
20:34:09 | Araq | it's old-school RTTI |
20:34:14 | Araq | marshal.nim uses it |
20:34:26 | Araq | otherwise it would be dead simple to avoid it |
20:34:46 | krux02 | couldn't marshal use macros instead? |
20:35:24 | Araq | yeah well, legacy |
20:37:49 | Araq | also repr uses it... |
20:38:33 | FromGitter | <tim-st> My file is quite small my only idea is that variant object uses it |
20:38:47 | PMunch | Does anyone know the name of the font used in the Nim logo? |
20:42:20 | * | miran quit (Quit: Konversation terminated!) |
20:43:43 | FromGitter | <mratsim> @miran converters are a trap |
20:44:12 | Araq | in what sense? |
20:44:17 | FromGitter | <mratsim> Also: what is fastest depends on word size and cache. |
20:44:41 | FromGitter | <mratsim> sometimes converters pull the flying carpet under you and you fall flat on your face :P |
20:48:00 | PMunch | Is it even a font? Or was it just drawn for just the Nim logo? |
20:48:03 | FromGitter | <mratsim> Also regarding iterators, I like the current yield design. I do use “next” iterators for Arraymancer though. |
20:49:26 | * | sz0 quit (Quit: Connection closed for inactivity) |
20:51:54 | dom96 | PMunch: IIRC it's not a font |
20:52:23 | Araq | it's NimFont |
20:54:31 | PMunch | Ah, so it's only those three letters? |
20:54:35 | PMunch | Not a full font? |
20:55:19 | krux02 | installing gcc4 failed :/ |
20:55:36 | Araq | PMunch: yeah. |
20:56:44 | Araq | krux02: why? |
20:56:54 | dom96 | PMunch: Indeed. |
20:57:19 | PMunch | Hmm, maybe I should try to make a font :P |
20:57:40 | dom96 | But why? |
20:58:00 | PMunch | I'm making a presentation on Nim, and wanted to use the same font for the headers to keep it looking like a cohesive theme :) |
20:58:44 | dom96 | You can probably find a similar font |
20:58:50 | dom96 | but reusing this everywhere will look odd IMO |
21:00:13 | Araq | no, let him create NimFont |
21:00:40 | krux02 | what will nimfont be? |
21:00:55 | Araq | will use it in NimEdit |
21:01:06 | Araq | running on NimOS. |
21:01:13 | krux02 | a specific font for the nim programming language? a font for the website? or a font rendering engine in nim |
21:01:33 | Araq | running on my NimCPU that I designed with Nim |
21:01:44 | krux02 | when will Nim 2 be a thing |
21:01:49 | krux02 | Nim 2, Programmieren ind |
21:01:59 | krux02 | Nim 2, Programmieren und Naschen |
21:02:09 | Araq | lol |
21:02:13 | PMunch | dom96, it would only be used for headers |
21:03:43 | dom96 | PMunch: What are you using for your slides? |
21:03:50 | krux02 | for those who don't get the context: https://www.youtube.com/watch?v=gowiGoHooFQ |
21:06:15 | PMunch | dom96, to create them? |
21:06:18 | PMunch | Inkscape |
21:06:38 | FromDiscord | <claude> i thought you said "designed with my Nim" |
21:06:48 | * | nsf quit (Quit: WeeChat 2.0.1) |
21:09:00 | FromGitter | <alehander42> i am scared of this |
21:15:57 | FromGitter | <diegogub> haha gues, quick question..how do I solve this: Error: The .nimble-link file is pointing to a missing file: /Users/diegogub/Projects/nim/evento_cli/evento_cli.nimble ? |
21:24:43 | dom96 | rm -r ~/.nimble/pkgs/evento_cli-#head |
21:25:48 | FromGitter | <diegogub> @dom96 thank you! |
21:29:14 | FromDiscord | <treeform> krux02, my font rendering engine in nim is almost done. |
21:29:36 | krux02 | what types of fonts can it load, render? |
21:29:43 | krux02 | and how does it render fon? |
21:29:48 | FromDiscord | <treeform> svg, ttf and otf. |
21:30:27 | krux02 | svg is a font? |
21:31:03 | krux02 | for games, font rendering should be done into an array of bytes |
21:31:20 | krux02 | so rasterization |
21:31:49 | FromDiscord | <treeform> Some comparisons between font renderers: |
21:31:51 | FromDiscord | <treeform> |
21:31:51 | FromDiscord | <treeform> https://cdn.discordapp.com/attachments/371759389889003532/435190543572664320/unknown.png |
21:32:04 | FromDiscord | <treeform> typorgraphy renderer, 1st one is mine |
21:32:46 | FromDiscord | <treeform> krux02, svg fonts are the best fonts, very easy to parse and read and reason about. |
21:32:48 | federico3 | there is os.isHidden but no portable way to create hidden files, right? https://nim-lang.org/docs/os.html#isHidden,string |
21:33:01 | krux02 | the clear type looks like it has sub pixel anti aliasing |
21:33:41 | krux02 | federico3: on unix like systems, hidden files are just files with a name that starts with a '.' |
21:33:47 | FromDiscord | <treeform> The ttf and otf sux as file format 20 years of baggage. File format feels like they did not know you can just use zlib, so they made their own stupid compression method. |
21:33:50 | krux02 | I think that is very ugly. |
21:34:17 | FromDiscord | <treeform> My thoughts on subpixeling: |
21:34:19 | FromDiscord | <treeform> |
21:34:19 | FromDiscord | <treeform> https://cdn.discordapp.com/attachments/371759389889003532/435191164401090561/unknown.png |
21:34:50 | federico3 | krux02: I'm not sure how that answers my question |
21:35:09 | * | jaco60 quit (Quit: Textual IRC Client: www.textualapp.com) |
21:36:31 | krux02 | federico3: add a dot in front of the file, and it is hidden |
21:36:42 | krux02 | (on unix systems) |
21:36:53 | federico3 | I know that but I'm asking about a portable solution |
21:36:55 | krux02 | in other words there is no porable way to do that |
21:37:26 | krux02 | and hidden files in general are dirty |
21:37:37 | krux02 | make a visible folder for all your files |
21:37:45 | krux02 | put the stuff in there, visible |
21:37:55 | krux02 | but don't create invisible files |
21:38:09 | krux02 | I don't want invisible files on my system |
21:38:28 | krux02 | I can't get rid of them, but I can at least advertise to people to to make more of them |
21:38:54 | FromDiscord | <treeform> krux02, for games you can render fonts in to ways to pixel buffer, or to a texture atlas, then you draw quads with the atlas. I want to support both methods. Right now only pixel buffer is supported. |
21:39:39 | FromDiscord | <treeform> krux02, svg fonts are really nice and simple: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_fonts |
21:42:10 | krux02 | treeform: for the font atlas, all I would like is for each character a region into that atlas, then I can render it. |
21:42:27 | krux02 | so you don't need to provide any rendering, just provide an atlas and a mapping |
21:42:42 | krux02 | then I can do do the rendering on my own |
21:42:57 | * | couven92 quit (Quit: Client Disconnecting) |
21:43:43 | * | PMunch quit (Quit: leaving) |
21:44:00 | FromDiscord | <treeform> yeah the contract there becomes a bit blurred. |
21:44:13 | krux02 | but it should be a texture atlas in just like "here is an array of pixels, with this stride and this size" |
21:44:26 | FromDiscord | <treeform> Then the typesetting becomes hard as you need to know by how far to move letters and when they wrap. |
21:44:52 | FromGitter | <Varriount> @zacharycarter Are you around? |
21:45:24 | krux02 | well yea, it is a simple way to render fonts, but it can be rendered very fast |
21:45:38 | krux02 | it would not support ligatures or something like that |
21:46:03 | FromDiscord | <treeform> krux02, also there are so many letters in Chinese you might want to generate the atlas at run time. |
21:46:29 | krux02 | yes I want to generate it at runtime |
21:46:46 | krux02 | I did not say anything about offline |
21:46:55 | FromDiscord | <treeform> krux02, also fonts bello < 20px need subpixeled positions to look great. |
21:47:04 | FromDiscord | <treeform> so you need like 10 images per letter |
21:47:15 | FromDiscord | <treeform> well that is what I plan on doing |
21:47:35 | krux02 | treeform: well I like pixel fonts with fixed size :P |
21:47:49 | FromDiscord | <treeform> ah then all that pretty much does not matter |
21:48:12 | krux02 | but subpixel precision is not really a problem at all, when you specify offsets, just make them non-integers |
21:48:38 | FromDiscord | <treeform> it does matter if you cache the glyphs (which you should do) |
21:48:43 | krux02 | normal texture coordinates are in the range [0,1] |
21:49:56 | krux02 | so subpixel coordinates and sizes should not be a problem |
21:51:32 | krux02 | but why 10 images per letter? |
21:52:19 | FromDiscord | <Generic> is there a way to prevent a template with no parameters from evaluating, when passing them to a macro, without changing the parameter type to untyped? |
21:52:30 | FromGitter | <data-man> @miran: Try bitsets from the compiler dir. |
21:53:10 | FromDiscord | <treeform> krux02, for me it was just easy to do 0.0, 0.1, 0.2 ... 0.9, 1.0 shifted versions of glyphs. |
21:53:39 | krux02 | ah I get it |
21:54:13 | FromDiscord | <treeform> I will add an example of subpixel shifted glyphs and without. |
21:54:25 | krux02 | but my binary obsission would prefer 0.125 0.25 0.375 etc :D |
21:54:26 | FromDiscord | <treeform> to the docs, it looks like i have broken it. |
21:55:10 | krux02 | but I think it wouldn't make a difference |
21:55:20 | FromDiscord | <treeform> I think the number of subpixel glyphs should be a setting, its a quality vs memory tradeoff. |
21:55:34 | krux02 | yes |
21:55:45 | krux02 | that would be cool |
21:57:05 | krux02 | it is just very important that i can map a string to a seq of positions and render it in one draw call |
21:57:11 | krux02 | then it's fast |
22:04:21 | FromDiscord | <treeform> I hope the system would be fast enough and flexible enough for you to use in the way you want. |
22:13:08 | Araq | treeform: nimx or one of its dependencies has a subpixel font rendering engine |
22:13:35 | Araq | which yglukhov claims to be better than the stuff OSX uses iirc. |
22:14:18 | Araq | maybe extract his code and clean it up, maybe look at it for inspiration. the Nim community needs to work together better IMO. |
22:16:31 | FromDiscord | <claude> you mean like how theres too many different libraries for the same thing? |
22:21:35 | Araq | no I mean many start with their own thing unaware of what already exists |
22:22:03 | FromGitter | <data-man> https://github.com/memononen/nanovg - small antialiased vector graphics rendering library for OpenGL. Can to use FreeType for font rendering. |
22:23:47 | FromDiscord | <treeform> Araq, nimix uses stb_ttf which is fine. |
22:23:56 | FromDiscord | <treeform> its a C lib I did look at. |
22:24:34 | FromDiscord | <treeform> I really want to understand deeply how fonts work. |
22:24:37 | Araq | huh? I don't think nimx uses stb_ttf |
22:24:49 | FromDiscord | <treeform> https://github.com/yglukhov/nimx/blob/master/nimx/font.nim#L10 |
22:25:41 | FromDiscord | <treeform> It does DistanceField field stuff on top of that which is cool. |
22:27:41 | FromDiscord | <treeform> maybe he would be able to replace stb code with my code eventually |
22:28:50 | * | SitiSchu joined #nim |
22:28:55 | * | SitiSchu quit (Remote host closed the connection) |
22:29:25 | Araq | https://github.com/yglukhov/nimx/blob/master/nimx/private/text_drawing.nim ? |
22:29:28 | * | SitiSchu joined #nim |
22:29:57 | FromDiscord | <treeform> Yes this is distance field related stuff. |
22:30:06 | FromDiscord | <treeform> He still needs to get the shapes from some place |
22:30:14 | FromDiscord | <treeform> he gets them from stb_ttf |
22:30:53 | Araq | hmmm maybe. |
22:31:04 | krux02 | the distance field stuff is really just for foonts you want to zoom in dynamically |
22:31:15 | krux02 | or look at from different directions |
22:31:20 | FromDiscord | <treeform> Distance fields are great for drawing text in 3d, probably also work great in 2d, but to me it feels like a bit of an overkill? |
22:31:38 | krux02 | but as long as it's for 2D ui it really is not the way to go |
22:32:14 | FromDiscord | <treeform> Android I think uses distance fields for 2d, so I would not reject it out right. |
22:32:33 | FromDiscord | <treeform> original distance fields paper: http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf |
22:32:47 | krux02 | I once tried to implement the distance field. it is not that clean as it sounds |
22:33:20 | FromDiscord | <treeform> https://medium.com/@romainguy/androids-font-renderer-c368bbde87d9 |
22:33:47 | FromDiscord | <treeform> No it does not use it, "I’ve also looked into signed distance fields but"... |
22:33:52 | FromDiscord | <treeform> I was wrong it does not use it. |
22:34:16 | FromDiscord | <treeform> Then no one from the big companies use distance fields for 2d text. |
22:35:01 | dom96 | Attempting to use nimCEF, and my first thought is to write my own wrapper :( |
22:35:06 | krux02 | yea I even think it's not the best result for 2d text |
22:35:28 | FromDiscord | <treeform> My goal is the finish this "reference" implementation that is simple and work on CPU. Then when I work on optimizing it with different approaches or not if its fast enough. |
22:35:28 | FromDiscord | <claude> is playground not working for anyone else |
22:35:53 | FromDiscord | <treeform> krux02, you might be right. I don't know if its good or bad, just feels like an overkill. |
22:36:05 | dom96 | claude: yep, looks like it's down. |
22:36:16 | dom96 | @zacharycarter ^ |
22:36:57 | FromDiscord | <treeform> I have a bug in the OTF renderer: |
22:36:58 | FromDiscord | <treeform> |
22:36:58 | FromDiscord | <treeform> https://cdn.discordapp.com/attachments/371759389889003532/435206930479317002/unknown.png |
22:37:02 | krux02 | I know what it is good for, but your subpixel approach seems much better suitable |
22:37:06 | FromDiscord | <treeform> Its hard to find bugs like this, it could be anything! |
22:37:46 | krux02 | and with the distance field, you would need much bigger texture atlas that you would like to render in. |
22:38:10 | FromDiscord | <treeform> krux02, yes there are other approaches too. |
22:38:36 | FromDiscord | <treeform> this guy is amazing: http://wdobbie.com/post/gpu-text-rendering-with-vector-textures/ |
22:38:55 | FromDiscord | <treeform> warning huge webGL demo: http://wdobbie.com/pdf/ |
22:44:59 | * | xet7 quit (Ping timeout: 276 seconds) |
22:46:51 | krux02 | yea it's interesting. But I don't want to spend too much time on text rendering |
22:46:58 | krux02 | I want a solution that works simply. |
22:47:48 | krux02 | and is fast |
22:49:42 | krux02 | I want to stop worrying. That is the most important |
22:49:57 | FromGitter | <data-man> https://github.com/jangko/nimAGG - Nim port of Anti Grain Geometry |
22:51:11 | FromDiscord | <treeform> how does this compare to cairo? |
22:51:16 | krux02 | I have my own rendering engine |
22:51:57 | krux02 | this is for real time graphcis and cairo is for offline image transformations (AFAIK) |
23:01:21 | FromDiscord | <treeform> I got cairo going at 144fps to almost a 4K texture. Its not the best method but it works? |
23:03:44 | krux02 | treeform: I just looked up cairo, and it seems it supports an experimental opengl backend. |
23:03:59 | krux02 | but the focus for cairo seems clearly quality over performance |
23:04:15 | krux02 | meaning it is probably not the right tool, when you want to render complex scenes |
23:05:52 | krux02 | but the way the api looks like, seems to be that it is impossible to be very performant |
23:06:26 | krux02 | but that is just a rough quick quess |
23:06:28 | krux02 | guess |
23:06:31 | FromDiscord | <treeform> For the things I want to draw even javascript works... |
23:07:12 | FromDiscord | <treeform> this is my game: http://store.steampowered.com/app/449140/Istrolid/ |
23:08:09 | krux02 | and you did that with cairo? |
23:09:25 | krux02 | it reminds be of a flash game that I once played, where you could attach parts from enemies that you killed |
23:09:25 | FromDiscord | <treeform> nope, HTML+webGL |
23:09:52 | FromDiscord | <treeform> flash game probably was http://www.captainforever.com/captainforever.php |
23:10:16 | krux02 | yes exactly that game |
23:10:35 | FromDiscord | <treeform> mine is an RTS game though |
23:10:38 | FromDiscord | <claude> youre making a game in nim? |
23:10:43 | FromDiscord | <treeform> yes I am |
23:10:45 | FromGitter | <alehander42> I argued for an hour with a guy who defined programming languages as "something that can be represented as AST which can be described by formal rules" |
23:10:53 | FromDiscord | <treeform> as well as other non game things |
23:10:57 | FromGitter | <alehander42> am I drunk, or this is just a horrid definition |
23:12:17 | FromDiscord | <treeform> I think Wikipedia defines it well. |
23:12:37 | FromDiscord | <treeform> "Source code of a simple computer program written in the C programming language, which will output the "Hello, world!" message when compiled and run. |
23:12:37 | FromDiscord | <treeform> A programming language is a formal language that specifies a set of instructions that can be used to produce various kinds of output." |
23:12:53 | FromDiscord | <treeform> "A programming language is a formal language that specifies a set of instructions that can be used to produce various kinds of output." |
23:12:55 | krux02 | well that is weird |
23:13:08 | FromDiscord | <treeform> oops grabbed the image |
23:13:41 | krux02 | treeform: well it is a bit more complicated than that. |
23:13:52 | krux02 | it completely ignores the compilation part |
23:14:08 | FromDiscord | <treeform> many languages don't compile? |
23:14:17 | FromGitter | <alehander42> the problem with his definition is, you can describe everything that way, I can represent a text file as an AST with PARENT => all chars and rules "you just show each letter on the screen" |
23:14:18 | FromDiscord | <treeform> some are even graphical |
23:14:43 | krux02 | well you can also say, everything is a graph |
23:14:44 | FromGitter | <alehander42> yeah, compilation is an impl detail |
23:14:58 | FromGitter | <alehander42> well, that would be a more valid sentence :D |
23:15:00 | krux02 | and you would be correct about it, but it is also not very helpful either |
23:15:27 | FromGitter | <alehander42> ok, but for real you can say that emails or phone numbers or music sheets are programming langs |
23:15:31 | FromGitter | <alehander42> with that definition |
23:15:35 | FromGitter | <alehander42> (I think) |
23:15:48 | FromGitter | <alehander42> with the "ast + formal rules" def |
23:15:53 | krux02 | alehander42: I don't think that compilation is an impl detail. It is often the essential component that decides if the language can be used for the task, or not. |
23:15:57 | * | noonien quit (Quit: Connection closed for inactivity) |
23:15:58 | FromGitter | <alehander42> the wiki one seems more blurry, but nice |
23:16:09 | FromGitter | <alehander42> no no, the question is "definition of a programming language" |
23:17:13 | krux02 | I would say a programming language is a language that can be translated (compiled) into a set of instructions for a computer to do a certain task. |
23:17:26 | FromGitter | <alehander42> it can be interpreted |
23:17:36 | FromGitter | <alehander42> it can exist in an universe where there are no computers |
23:17:39 | krux02 | and interpreters are just an on-the-fly way of doing this translation |
23:17:49 | FromGitter | <alehander42> and you interpret it with your daily routine |
23:18:43 | FromGitter | <alehander42> I was more looking for something that describes the notion of "notation" + "rules to interpret/run this notation" + "programmability, not just reproduction of input" |
23:20:42 | krux02 | does this matter? |
23:21:59 | krux02 | well a programming language is something that can accurately implement the turing machine. |
23:22:20 | krux02 | or λ-calculus if you prefer that |
23:23:37 | krux02 | you need to be sure to exclude "html" from programming language. |
23:28:59 | * | arecaceae quit (Remote host closed the connection) |
23:29:23 | * | arecaceae joined #nim |
23:38:38 | FromDiscord | <claude> is there a pragma like `unusable` to disable unused warnings for just 1 declaration? |
23:39:22 | krux02 | well I don't know how to use it, but there is some push and pop pragams and then you can disable warnings |
23:39:38 | FromDiscord | <claude> they wouldnt work for my case |
23:39:51 | krux02 | it is used in the sourcecode of nim itself a lot, but you have to look it up how it is used |
23:40:35 | krux02 | well you can export the declaration, then the unused warning goes away |
23:40:43 | krux02 | but I think that is not what you want to do |
23:44:13 | FromDiscord | <claude> this is what my use case looks like <https://gist.github.com/hlaaftana/f253178044636b11fdd374ec08a15b45> |
23:44:44 | FromDiscord | <claude> it's fine if `arg` is unused, but if i comment out the push/pop pragmas it says invalid pragma |
23:47:17 | FromDiscord | <claude> oh wait its hint not warning |
23:48:22 | FromDiscord | <claude> now its a valid pragma but still gives the unused warning even if i put the pop after the body |