00:00:54 | * | ftsf quit (Remote host closed the connection) |
00:02:38 | SusWombat | task* |
00:03:11 | ftsf_ | https://nim-lang.org/docs/osproc.html#terminate,Process ? |
00:04:02 | SusWombat | ftsf_, can i use that on a spawned task? |
00:04:15 | ftsf_ | what do you mean by a "spawned task" ? |
00:04:23 | SusWombat | ftsf_, i mean on code like "input = spawn readline(stdin)" |
00:05:00 | ftsf_ | ahh threadpool stuff, i'm not sure |
00:06:28 | SusWombat | ftsf_, thanks anyway! |
00:06:55 | * | arnetheduck joined #nim |
00:16:09 | * | rauss joined #nim |
00:25:11 | * | zachcarter quit (Read error: Connection reset by peer) |
00:25:28 | * | zachcarter joined #nim |
00:30:04 | * | def-pri-pub joined #nim |
00:39:07 | * | yglukhov joined #nim |
00:42:34 | * | user0___ quit (Quit: user0___) |
00:43:29 | * | yglukhov quit (Ping timeout: 240 seconds) |
00:56:47 | * | roygbiv quit (Quit: ™) |
01:06:29 | * | vivus quit (Quit: Leaving) |
01:37:37 | * | chemist69 quit (Ping timeout: 260 seconds) |
01:51:03 | * | chemist69 joined #nim |
02:17:47 | * | Serenit0r joined #nim |
02:21:09 | * | Serenitor quit (Ping timeout: 240 seconds) |
02:23:49 | * | Serenit0r quit (Quit: Leaving) |
02:41:58 | zachcarter | bleh once again in C / Nim interop hell |
02:42:49 | ftsf_ | zachcarter, what's the problem? |
02:43:42 | zachcarter | it’s complicated as usual |
02:43:49 | ftsf_ | oh dear |
02:44:01 | zachcarter | I’m trying to integrate with the Spine C Runtime |
02:44:08 | zachcarter | http://esotericsoftware.com/spine-in-depth |
02:44:09 | zachcarter | is spine |
02:44:21 | ftsf_ | ahh |
02:44:29 | zachcarter | their C runtime is here : https://github.com/EsotericSoftware/spine-runtimes |
02:44:39 | zachcarter | in the folder spine-c |
02:44:44 | zachcarter | I’ve already wrapped it |
02:44:53 | zachcarter | bindings are working and all that |
02:45:19 | zachcarter | the author of the C runtime did this funky thing, where he allowed you to write your own methods and he stores them in a vtable |
02:45:37 | zachcarter | essentially allowing for you to write your own implementations for some methods |
02:45:42 | zachcarter | so here’s an example of that: |
02:45:51 | zachcarter | https://github.com/EsotericSoftware/spine-runtimes/blob/c0fdc454a2fb8df095aa47c252c20961a8059257/spine-cocos2dx/src/spine/Cocos2dAttachmentLoader.cpp |
02:45:55 | zachcarter | is the coscos2d attachment loader |
02:46:20 | zachcarter | which supplies custom implementations called here : https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-c/spine-c/src/spine/AttachmentLoader.c |
02:47:14 | zachcarter | I’ve created my own attachment loader: https://gist.github.com/zacharycarter/cd34f6c93ac2755ca464f763ba2b8e48 |
02:47:58 | zachcarter | but when I try to use it ala: https://github.com/EsotericSoftware/spine-runtimes/blob/c0fdc454a2fb8df095aa47c252c20961a8059257/spine-cocos2dx/example/Classes/BatchingExample.cpp#L50-L59 |
02:48:03 | zachcarter | I get EXC BAD ACCESS exceptions :/ |
02:48:05 | def-pri-pub | is frag right now trying to target the C backend or C++ one by default? |
02:48:10 | zachcarter | the C backend |
02:48:27 | zachcarter | never C++ for frag |
02:48:27 | def-pri-pub | ah, good |
02:48:40 | def-pri-pub | whatabout JS? |
02:48:44 | zachcarter | I get those exceptions specifically on this line |
02:48:58 | def-pri-pub | I don't really like writing JS, but I'd rather hav things that compile to it. |
02:49:03 | zachcarter | https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-c/spine-c/src/spine/AttachmentLoader.c#L74 |
02:49:20 | zachcarter | I’m guessing because the whole vtable thing isn’t working / being populated correctly |
02:49:22 | zachcarter | I’m not really sure |
02:49:36 | zachcarter | def-pri-pub: JS is a possibility |
02:49:54 | zachcarter | I haven’t explored web targets too much but it’s on my radar |
02:50:03 | def-pri-pub | there is always the emscripten target, but that SDL dep makes a bit of an issue right now |
02:50:22 | def-pri-pub | Working with emscripten can also be a bit of a pain in the but |
02:50:29 | zachcarter | yeah I can potentially replace that with something else that’s web friendly |
02:50:30 | ftsf_ | def-pri-pub, SDL works on emscripten, but it's a pain with the GC |
02:50:50 | def-pri-pub | ftsf_: What about SDL_mixer, SDL_image, SDL_ttf |
02:51:07 | ftsf_ | *shrug* they're external to SDL |
02:51:11 | def-pri-pub | You know, those other libraries that if your using SDL, you might as well use anwyways? |
02:51:27 | ftsf_ | none of them are required |
02:51:39 | def-pri-pub | But they make your life easier if you're writing and SDL app |
02:52:09 | ftsf_ | they're all pretty unmaintained afaict, easier to use stb libraries for image + fonts. |
02:52:24 | ftsf_ | mixer is more difficult to replace, but not that hard to do your own mixing with SDL's audio |
02:53:21 | def-pri-pub | Has anyone made an stb ttf wrapper yet? |
02:53:58 | zachcarter | only thing I’ve done with TTF is with opengl and whatever that font loading lib is |
02:54:15 | zachcarter | wel lthat’s a lie I’ve also done bitmap fonts and signed distance field fonts |
02:54:25 | zachcarter | but those weren’t TTF fonts |
02:54:45 | ftsf_ | def-pri-pub, not sure, but they're very easy to wrap |
02:55:30 | def-pri-pub | well, I did one of them :] |
02:55:46 | def-pri-pub | I've paid my nimble dues |
02:55:51 | ftsf_ | =) |
02:57:06 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) |
02:57:25 | zachcarter | this gd spine C runtime code is an abomination |
02:57:29 | zachcarter | good thing araq isn’t here right now |
02:57:39 | def-pri-pub | show me |
02:57:52 | zachcarter | https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-c/spine-c/src/spine/AttachmentLoader.c#L74 |
02:58:07 | zachcarter | all those gd function pointers |
02:58:55 | zachcarter | might as well have just used C++ and said you’re screwed if you’re using C |
02:59:07 | zachcarter | because I’m pretty much screwed trying to integrate with this |
02:59:10 | zachcarter | :D |
02:59:17 | def-pri-pub | http://i0.kym-cdn.com/photos/images/newsfeed/000/648/220/67b.jpg |
02:59:26 | zachcarter | hahaha |
03:01:04 | * | libman quit (Quit: Connection closed for inactivity) |
03:05:01 | FromGitter | <Varriount> zachcarter: You might be able to do something with tempalates. |
03:05:04 | FromGitter | <Varriount> *templates |
03:05:22 | FromGitter | <Varriount> Nim can handle function pointers though. |
03:05:43 | zachcarter | yeah I don’t think it’s a problem with Nim |
03:05:53 | zachcarter | I’m not sure where the problem lies to be honest |
03:06:31 | zachcarter | I just know that on that line I shared when he tries to do the vtable lookup to the function I passed into the init - an exc bad access exception gets thrown |
03:06:41 | zachcarter | trying to debug in lldb but not getting anywhere really |
03:06:56 | FromGitter | <Varriount> zachcarter: Make sure that the calling convention matches up. |
03:07:12 | zachcarter | okay I’ll double check that |
03:07:36 | zachcarter | I’m wondering if it doesn’t have to do with the fact that I’m using a ref and not a ptr |
03:07:42 | zachcarter | even though a ref is just a GC’d pointer |
03:07:53 | zachcarter | and I’m trying to cast a ref into a ptr |
03:08:43 | FromGitter | <Varriount> You can try inspecting the generated C code. It's not that bad to look at. |
03:13:04 | * | krux02 quit (Remote host closed the connection) |
03:13:28 | * | gsingh93 quit (Ping timeout: 240 seconds) |
03:14:16 | * | Jesin joined #nim |
03:15:59 | * | gsingh93 joined #nim |
03:18:46 | FromGitter | <Varriount> zachcarter: Any other questions? |
03:18:57 | zachcarter | I don’t think so, thank you Varriount |
03:20:44 | * | yglukhov joined #nim |
03:21:31 | FromGitter | <Varriount> I don't really have any other ideas on what could be the problem. You would need to see where exactly the bad access was coming from - the vtable access, or the function call |
03:21:57 | FromGitter | <Varriount> zachcarter: You might also try marking the function table with the '{.pure.}' pragma |
03:22:21 | FromGitter | <Varriount> Just in case the type information Nim adds is interfering. |
03:22:38 | zachcarter | hmm okay |
03:25:25 | * | yglukhov quit (Ping timeout: 258 seconds) |
03:25:34 | FromGitter | <Varriount> zachcarter: Is this a C binding to a C++ library? If so, ensure that everything has been compiled with the same compiler. |
03:25:52 | zachcarter | nope it’s just a C lib I’m binding to |
03:27:24 | ftsf_ | c lib with vtables? |
03:40:23 | FromGitter | <Varriount> ftsf_: Ever used COM? |
03:40:38 | ftsf_ | Varriount, fortunately not |
03:42:06 | * | ftsf_ quit (Quit: :q!) |
03:43:46 | FromGitter | <Varriount> ftsf: Essentially, every COM object is a structure full of vtables. |
03:47:18 | * | hcorion quit (Quit: Konversation terminated!) |
03:48:13 | * | def-pri-pub quit (Quit: leaving) |
05:21:14 | cheatfate | COM object is structure of functions or 1 vtable but not many |
05:21:21 | cheatfate | vtables |
05:54:43 | * | windows quit (Ping timeout: 245 seconds) |
05:56:50 | * | SunDwarf joined #nim |
06:22:16 | * | nsf joined #nim |
06:22:45 | * | Jesin quit (Ping timeout: 260 seconds) |
06:44:20 | * | yglukhov joined #nim |
06:49:28 | * | rokups joined #nim |
06:54:25 | * | rauss quit (Quit: WeeChat 1.7) |
07:09:59 | * | Tiberium joined #nim |
07:17:25 | Tiberium | stisa, just found your tutorial - http://stisa.space/articles/compile-nim-on-android/ . Maybe you can translate this tutorial into termux package? |
07:37:19 | * | bjz joined #nim |
07:39:42 | FromGitter | <stisa> Tiberium : I will look into it, I also need to rewrite that tutorial as it has become a bit of a mess |
07:42:17 | * | vlad1777d joined #nim |
07:55:55 | * | Arrrr joined #nim |
07:55:58 | * | Arrrr quit (Changing host) |
07:55:58 | * | Arrrr joined #nim |
08:20:02 | * | Vladar joined #nim |
09:11:12 | * | couven92 joined #nim |
09:11:29 | * | couven92 quit (Client Quit) |
09:27:02 | Tiberium | can I pass an arbitrary GCC compiler to nim c -cc? like nim c --cc:i686-pc-toaru-gcc --os:standalone hellotoaru.nim |
09:27:58 | def- | Tiberium: --cc:gcc --gcc.exe:i686-pc-toaru-gcc |
09:28:17 | def- | and --gcc.linkerexe:i686-pc-toaru-gcc |
09:28:44 | Tiberium | def-, thanks |
09:31:49 | Tiberium | what can be the reason of "Error: system module needs 'nimFrame' " ? |
09:32:21 | def- | your os:standalone |
09:33:21 | Tiberium | so there's no way? |
09:33:29 | Tiberium | to compile it if this error happens |
09:33:32 | def- | i don't know |
09:36:58 | Araq | --stackTrace: off |
09:37:27 | FromGitter | <Varriount> Tiberium: If you use --os:standalone, you need to implement certain structures yourself |
09:37:42 | Tiberium | dom96, and one more question about rate limiting: what if two api calls happens almost in one time? they will both sleep sadly. I want to limit it to something like: do 3req/s as fast as you can, and then sleep for 1 sec |
09:38:01 | Tiberium | Varriount: thanks about pointing it out |
09:38:25 | Araq | Tiberium: I've seen no such support in any language's stdlib |
09:38:34 | Araq | you need to write this logic on your own. |
09:41:21 | Araq | you can also use an external proxy for this |
09:41:29 | Araq | and don't write anything. |
09:42:50 | Tiberium | Araq, no, I don't want to have many external dependencies, so I'll write it on my own |
09:44:41 | Araq | good boy. |
09:52:38 | Tiberium | can I have a `data` proc so I can do this: var info = data{"message":"Test", "peer_id": "123"} ? |
09:52:55 | Tiberium | I want to wrap it around strtabs |
09:53:08 | Tiberium | ah |
09:53:31 | Tiberium | works |
09:53:34 | Tiberium | "var d = {"message":"Привет, лох", "peer_id": "123"}.api" |
09:54:45 | FromGitter | <Varriount> Russian? |
09:54:50 | Tiberium | sorry |
09:54:59 | Tiberium | it's like a bad word, but not swear word |
09:55:01 | Tiberium | Varriount: yes |
09:55:27 | FromGitter | <Varriount> No, it's fine. I find it interesting. |
10:12:55 | * | couven92 joined #nim |
10:36:52 | Araq | today is the day. 900 open bugs. |
10:37:03 | FromGitter | <vegansk> Guys, could you check this please, is it reproduceable? If so, then threadpool couldn't be used with channels https://github.com/nim-lang/Nim/issues/5626 |
10:37:25 | Araq | threadpool shouldn't be used with channels indeed. |
10:39:14 | FromGitter | <vegansk> @Araq, but why? |
10:39:36 | Araq | because it's about parallelism, channels are about concurrency |
10:39:58 | Araq | proc run(f: proc(): int {.gcsafe.}): proc() = |
10:39:59 | Araq | let r = spawn f() |
10:39:59 | Araq | return proc() = await(r) |
10:40:07 | Araq | anyway, I think this is a horrible idea |
10:41:45 | FromGitter | <vegansk> Why I can't handle the channel inside the thread from the threadpool only when the values in channel are present? |
10:42:06 | FromGitter | <vegansk> That's what about the example from the issue |
10:42:23 | cheatfate | Araq, channels is your between threads communication, channels is not about concurrency |
10:43:10 | Araq | thread communication is concurrency. |
10:43:13 | FromGitter | <vegansk> Here is an example from scala: https://github.com/scalaz/scalaz/blob/series/7.3.x/concurrent/src/main/scala/scalaz/concurrent/Strategy.scala#L71-L81 |
10:44:22 | Araq | yeah, I am aware scala uses the most convoluted code everywhere and then they wonder they never get any speed out of it |
10:46:01 | FromGitter | <vegansk> @Araq, I don't want to have the thread started and waiting for the message in the empty channel. This thread can be used to handle another tasks. That's why I want to use threadpool for all of my actors. |
10:48:41 | Araq | once we fixed your bug it'll still be slow. seems like a waste of time with these actor based designs |
10:52:29 | FromGitter | <vegansk> Then the channels module must be marked as deprecated, because it uses message passing, like the actors? |
10:52:49 | * | nhywyll joined #nim |
10:56:53 | FromGitter | <vegansk> @Araq, The problem began when I started to test the system under high load. In normal mode it was ok with the speed. But the system crashes when there are many requests, and not just working slow. And I think that it's a bug. |
10:59:02 | Araq | it could be a bug indeed. but it's just the symptom of an undebuggable design. sorry, I don't believe in the actor framework. I only use message passing when it's unavoidable not because it's cool. |
11:02:28 | Araq | and if I am after a scalable system I would implement the disruptor pattern |
11:05:38 | Araq | what happens when you send a message to a dead actor? exception? silent message delivery failure? either way, you replaced something that cannot fail (aka plain old function call) with something that can fail |
11:06:12 | Araq | do that often enough and it's as reliable as you think it would be. not. at. all. |
11:09:34 | Tiberium | zielmicha_, hi, about your reactor.nim library: await request(newHttpRequest(httpMethod="GET", url = $url).get) doesn't check if url is "https" |
11:12:32 | * | vendethiel quit (Ping timeout: 256 seconds) |
11:13:22 | * | Andris_zbx joined #nim |
11:13:29 | * | vendethiel joined #nim |
11:20:57 | * | nhywyll_ joined #nim |
11:20:58 | * | nhywyll quit (Ping timeout: 240 seconds) |
11:23:08 | * | PMunch joined #nim |
11:23:41 | * | bjz_ joined #nim |
11:24:24 | Tiberium | zielmicha_, https://github.com/zielmicha/reactor.nim/issues/12 |
11:25:38 | * | bjz quit (Ping timeout: 268 seconds) |
11:27:26 | Araq | vegansk: I can reproduce and it looks like a threadpool bug indeed |
11:36:15 | * | PMunch_ joined #nim |
11:36:15 | * | PMunch_ quit (Remote host closed the connection) |
11:44:14 | * | nhywyll_ quit (Quit: nhywyll_) |
12:02:59 | * | yglukhov_ joined #nim |
12:02:59 | * | yglukhov quit (Read error: Connection reset by peer) |
12:05:04 | * | BitPuffin|osx joined #nim |
12:09:42 | * | yglukhov_ quit (Remote host closed the connection) |
12:22:11 | FromGitter | <dom96> Channels are about concurrency? I don't recall needing to use them for async... |
12:22:35 | * | yglukhov joined #nim |
12:22:58 | FromGitter | <dom96> Tiberium: why the switch to reactor.nim's http client? |
12:25:03 | Tiberium | dom96 I experiment with it :) |
12:35:09 | * | yglukhov quit (Remote host closed the connection) |
12:36:14 | * | yglukhov joined #nim |
12:36:15 | * | yglukhov quit (Remote host closed the connection) |
12:37:49 | FromGitter | <vegansk> @Araq, scalaz actors can't be dead. They are not like an Akka actors |
12:38:13 | * | krux02 joined #nim |
12:40:10 | * | yglukhov joined #nim |
12:43:15 | FromGitter | <vegansk> They are lightweight an even used as a synchronization primitive in some parts of scalaz library |
13:04:00 | zachcarter | does Nim have anything like golang’s JSON serialization? |
13:04:24 | zachcarter | where you can map structs to a JSON doc |
13:04:24 | * | yglukhov quit (Read error: Connection reset by peer) |
13:04:30 | zachcarter | like this : |
13:04:48 | zachcarter | https://github.com/ajhager/spine/blob/master/spine.go#L16-L32 |
13:05:24 | * | yglukhov joined #nim |
13:06:56 | FromGitter | <Varriount> Well, the marshal module does automatic conversion of structs to json, however the structure format is subject to change. |
13:08:14 | FromGitter | <Varriount> You might look at NimYAML, since I think that can output json too. |
13:08:28 | zachcarter | I’m more interested in the reverse process |
13:08:41 | zachcarter | json > nim struct |
13:09:04 | FromGitter | <Varriount> Both modules do unserialization |
13:09:24 | zachcarter | alright thanks |
13:10:25 | zachcarter | going to give nimyaml a run since you’ve been bumping it so much Varriount :P |
13:10:36 | zachcarter | I’m working on an unoffiical spine runtime for Nim |
13:11:18 | FromGitter | <Varriount> It's an excellent module. |
13:13:57 | * | bjz_ quit (Quit: Textual IRC Client: www.textualapp.com) |
13:19:39 | * | gangstacat joined #nim |
13:22:01 | * | Tiberium quit (Remote host closed the connection) |
13:22:03 | PMunch | Hmm, are there any documentation on how to use Nim without the garbage collector? I know it can be turned off but then you would need to manage memory yourself right? |
13:22:19 | zachcarter | correct PMunch |
13:22:22 | * | Tiberium joined #nim |
13:22:25 | zachcarter | you’d have to use alloc dealloc |
13:22:30 | zachcarter | in system.nim I think |
13:22:43 | zachcarter | Hrm I’m struggling a bit early on with Nim yaml |
13:22:55 | zachcarter | The JSON deserialization example doesn’t seem to work |
13:23:16 | cheatfate | PMunch, dont use any ref objects (e.g. strings, sequences and whole stdlib), use ptr everywhere |
13:24:01 | zachcarter | ah nevermind I figured out why |
13:24:11 | PMunch | Hmm, doesn't that make it a bit inconvenient? |
13:24:18 | Araq | PMunch, create a thread, call GC_disable in the thread, the thread dies, everything is freed |
13:24:38 | PMunch | Hmm, well that is one way of doing it :P |
13:25:02 | * | bjz joined #nim |
13:25:12 | Tiberium | hmm, my command bot takes longer time to respond with Nim (I firstly started rewriting it from my Python version), and it takes a bit more time to respond. may be some issue in my code, since application almost fully network-bound. How can I find such places in my code? |
13:25:27 | Tiberium | a bit longer, but still |
13:25:42 | Tiberium | both nim and python are written in async way |
13:26:41 | PMunch | Araq, does that apply to pthreads as well as Windows threads? |
13:26:56 | PMunch | Since pthreads doesn't by default clean up after themselves |
13:27:14 | Araq | our threads wrapper does it, so yes |
13:28:03 | PMunch | Okay, nice :) |
13:28:15 | SusWombat | WHen i disable gc and create new object after it and enable it againt does it clean uo that objects then? |
13:28:53 | Araq | SusWombat: yes |
13:29:01 | SusWombat | ok thanks! |
13:29:03 | PMunch | cheatfate, so there's no way to tell those to use allocated memory instead? |
13:29:20 | zachcarter | hrmm Varriount: Nim yaml is working great so far, but first struggle I’ve encountered is optional fields in my json |
13:29:26 | PMunch | I was just thinking of stuff like satelites and rovers were this stuff is actually super important |
13:30:06 | zachcarter | ah I see it has a thing for optional fields |
13:34:34 | Araq | PMunch: when the stuff is super important, you don't just throw away the GC. you throw away heap allocation and malloc/free |
13:34:52 | Araq | so that you get bounded memory usage by construction. |
13:35:07 | zachcarter | flyx: just opened https://github.com/flyx/NimYAML/issues/37 |
13:37:02 | PMunch | Araq, yeah. But wouldn't that have to be done by manually? Can Nim ensure bounded memory usage? |
13:37:27 | couven92 | Is there an environment variable you can set insteadt of setting the --nimcache option for the nim compiler? |
13:39:22 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:40:49 | flyx | zachcarter: heh, that's what I get for writing a state machine manually, I guess. fixed in devel. |
13:41:11 | zachcarter | flyx: thanks |
13:41:15 | Tiberium | ah bad, this http request for web api takes like 0.2 sec :( bad web api |
13:41:38 | Tiberium | привет |
13:41:39 | Tiberium | привет |
13:41:43 | Tiberium | oh sorry, wrong window |
13:43:00 | Araq | PMunch: no systems programming language can do that |
13:43:25 | Araq | couven92: Nim doesn't use envvars, you can set it in your global nim.cfg though |
13:43:39 | zachcarter | flyx: fix looks good to me thank you again for that, was so quick! :D |
13:43:46 | couven92 | Araq, thanks... That's what I figured out as well :P |
13:45:51 | FromGitter | <Varriount> zachcarter: If you just need to dump data structures, marshal may be |
13:46:01 | FromGitter | <Varriount> more suitable |
13:46:16 | zachcarter | I need to deserialize a bunch of json into a huge nim data structure |
13:46:45 | flyx | zachcarter: well, it was a trivial bug ;) |
13:46:49 | krux02 | zachcarter: I wrote my own option type for optional fields |
13:46:56 | krux02 | then I could handle optional fields well |
13:47:07 | zachcarter | for NimYaml krux? |
13:47:21 | krux02 | nope, for my own binary serializer |
13:47:27 | zachcarter | I’m doing the whole - setDefaultValue(Bone, length, 0.0) |
13:47:30 | zachcarter | ahh gotcha |
13:47:37 | krux02 | I mostly did it for initialization optimization |
13:47:46 | zachcarter | right |
13:47:51 | krux02 | I had I big XML file I needed to read on every startup |
13:47:51 | flyx | zachcarter: you can also use implicit variant objects |
13:48:11 | krux02 | I wrote my own binary dump serializer |
13:48:22 | krux02 | did not handle endianness at all |
13:48:23 | couven92 | why does `koch nimble` build nimble as a Debug Build? |
13:48:24 | krux02 | but did not care |
13:48:26 | zachcarter | flyx: saw that now |
13:48:49 | flyx | zachcarter: or define some type Optional[T] and write a custom deserializer for it |
13:49:03 | krux02 | flyx, that is what I just said |
13:49:09 | krux02 | or better meant |
13:49:21 | zachcarter | well I think flyx means for his lbi |
13:49:23 | flyx | krux02: I mean in the context of NimYAML |
13:49:27 | FromGitter | <Varriount> zachcarter: Did you figure out that vtable issue? |
13:49:28 | zachcarter | lib* |
13:49:42 | zachcarter | Varriount: no :( the C code is a mess that’s where the vtable is |
13:50:10 | flyx | krux02: NimYAML allows adding custom deserializer procs to types so that they can be properly loaded. its different from writing the whole deserializer |
13:50:12 | zachcarter | I’m at a proverbial fork in the road |
13:50:47 | zachcarter | Varriount: What I’m working on is support for : http://esotericsoftware.com/spine-in-depth#What-is-Spine |
13:50:50 | zachcarter | for Frag / Nim in general |
13:51:05 | zachcarter | They have a C runtime, which I generated bindings to |
13:51:27 | zachcarter | but the author of the C runtime, because he can’t ditch OOP, decided to implement his own vtable in C |
13:51:43 | zachcarter | so that you can provide your own functions to extend the runtime if you will |
13:51:51 | krux02 | I just entered the conversation, for what is the serialization for |
13:52:00 | krux02 | is it big data, so rather small configuration files? |
13:52:15 | zachcarter | I can give you an example of the JSON I’m going to be deserializing |
13:52:16 | zachcarter | one sec |
13:52:49 | zachcarter | https://gist.github.com/zacharycarter/d6cf47d87c4f24b720ee3d9c7a50506a |
13:52:55 | zachcarter | it’s essentially 2d skeletal animation data |
13:53:13 | zachcarter | so the fork in the road I’ve hit is this - |
13:53:28 | zachcarter | A) I can continue trying to struggle with interoping with the C runtime and this vtable crap |
13:53:35 | zachcarter | or B) I can write a pure Nim runtime for spine |
13:53:38 | zachcarter | B ) |
13:53:45 | * | ibk joined #nim |
13:53:59 | zachcarter | the whole deserialization effort is moving towards B |
13:56:17 | zachcarter | Most languages have their own generic runtime, so I figure making one for Nim wouldn’t be the worst thing in the world |
13:56:31 | zachcarter | and it would be a lot friendlier to use than binding to the C runtime for a few reasons |
13:58:59 | zachcarter | mostly avoiding the abhorrent license that comes with using the official runtimes |
13:59:18 | * | xet7 quit (Quit: Leaving) |
14:06:58 | FromGitter | <Varriount> zachcarter: What's the license? |
14:07:03 | zachcarter | one sec |
14:07:10 | zachcarter | https://github.com/EsotericSoftware/spine-runtimes/blob/master/LICENSE |
14:09:06 | FromGitter | <Varriount> Hm. Certainly non-standard, but what's so bad about it? |
14:10:08 | zachcarter | well from my understanding : if I were to bind to their runtime any project that includes my bindings would have to include that license |
14:10:27 | zachcarter | and I believe a license to use their runtimes is at the least $300 |
14:10:36 | * | xet7 joined #nim |
14:10:47 | zachcarter | I’m not sure if I get around that fee by providing my own custom runtime - I doubt it |
14:10:53 | zachcarter | but at least users wont’ have to include their license |
14:11:14 | zachcarter | I’m just trying to avoid users having to include additional licenses if possible |
14:11:21 | FromGitter | <Varriount> How difficult would the runtime be to implement? |
14:11:28 | zachcarter | I don’t think it’s going to be too bad |
14:11:42 | zachcarter | once I get through the deserialization bit I should be in the home stretch |
14:11:51 | FromGitter | <Varriount> Really? |
14:11:59 | zachcarter | yeah that’s the majority of the work |
14:12:04 | FromGitter | <Varriount> Whay about all the math for calculations and such? |
14:12:05 | zachcarter | parsing all the texture atlas / json data |
14:12:09 | zachcarter | those are pretty easy |
14:12:47 | zachcarter | https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-c/spine-c/src/spine/Animation.c |
14:12:49 | zachcarter | most of the math is in there |
14:13:12 | zachcarter | 1300 LOC shouldn’t be too bad to port |
14:13:14 | FromGitter | <Varriount> Hm. |
14:13:42 | zachcarter | I think I can have something working pretty quickly, maybe in a couple of days |
14:14:01 | zachcarter | might be being optimistic, but I’m going to give it a go I think |
14:14:53 | * | Varriount|Mobile joined #nim |
14:17:36 | * | yglukhov quit (Remote host closed the connection) |
14:19:53 | * | yglukhov joined #nim |
14:20:44 | Araq | couple of days? c2nim it |
14:20:54 | zachcarter | haha truth |
14:20:56 | Araq | and it should be one day |
14:21:01 | zachcarter | agreed |
14:21:12 | Araq | c2nim can translate C proc bodies |
14:21:13 | zachcarter | just the json deserialization is a headache atm |
14:21:19 | zachcarter | yeah I’ve done that before with it |
14:22:00 | zachcarter | without c2nim / the productivity of Nim I don’t think I would have been able to build something like frag in the amount of time I have built it in |
14:22:14 | zachcarter | I’d still be trying to find a decent build solution for C++ |
14:22:30 | zachcarter | or fighting with Rust |
14:23:49 | * | yglukhov quit (Ping timeout: 240 seconds) |
14:34:38 | * | djellemah_ quit (Quit: Leaving) |
14:34:59 | * | djellemah joined #nim |
14:37:39 | zachcarter | flyx: another bug |
14:37:47 | zachcarter | Cannot construct to float: "0" |
14:38:12 | zachcarter | I know technically it should be 0.0 |
14:38:15 | zachcarter | err 0 . 0 |
14:38:25 | zachcarter | but I think the parser should be able to handle a 0 as well? |
14:39:37 | FromGitter | <dom96> zachcarter: consider writing a JSON deserializer for our stdlib. |
14:39:52 | FromGitter | <dom96> By looking at how marshal is implemented you should be able to get pretty far. |
14:40:13 | flyx | zachcarter: I commited a fix |
14:40:17 | zachcarter | thanks flyx |
14:40:30 | zachcarter | dom96: going to mean less progress on frag / spine runtime etc |
14:40:33 | flyx | I'm surprised this has not been discovered earlier |
14:40:41 | flyx | my tests seem to be lacking |
14:41:04 | zachcarter | I think your tests are exceptional but I’m putting your lib through the ringer atm |
14:41:18 | flyx | fun fact: these two bugs were a regression from implementing date parsing |
14:41:21 | FromGitter | <Varriount> There's no better test than real-world use. |
14:41:38 | zachcarter | dom96: are you guys still doing the summer of stdlib? |
14:41:50 | zachcarter | if so I may tackle a project for it to contribute, and that could be one I could do |
14:42:24 | zachcarter | I’m trying to get frag to a v0.1 public alpha by like May / June |
14:43:16 | zachcarter | flyx: fix tested and working :D |
14:48:35 | FromGitter | <dom96> Summer of stdlib? Is that a thing I'm not aware of? |
14:49:06 | FromGitter | <dom96> I'd love to do that though :) |
14:49:30 | zachcarter | I dunno I heard talk about it months ago |
14:49:41 | zachcarter | something like this sumemr the stdlib was going to get love |
14:49:45 | zachcarter | summer |
14:50:00 | zachcarter | I think it’d be a cool community project to do - figure out weak areas of the stdlib and improve them collectively over a given time frame |
14:50:13 | zachcarter | could set up projects in github since github now supports them |
14:50:18 | zachcarter | like kanban style boards |
14:51:59 | FromGitter | <Varriount> Pick a python stdlib module, port it over to Nim. :D |
14:53:56 | couven92 | I have a importcpp proc in nim here... The C++ code returns a (const char*), the nim proc says that it returns a cstring... Because of the const, I get the "Conversion loses qualifiers" compiler error message from the C++ compiler... How do I import the C++ proc correctly? |
14:54:14 | * | rauss joined #nim |
14:54:56 | FromGitter | <dom96> zachcarter: ooh, good idea on setting up projects on github |
14:55:08 | FromGitter | <dom96> In any case, I will have two months of time starting in May |
14:55:26 | zachcarter | that’d be a good time to start I think |
14:55:33 | FromGitter | <dom96> And my plan has been to use that time to give the stdlib some love |
14:55:36 | zachcarter | I’m trying to wrap up frag alpha by then |
14:55:45 | zachcarter | awesome :D I will try to do the same |
14:55:48 | FromGitter | <dom96> cool! |
14:57:49 | PMunch | Araq, I'm having a weird issue with the genui macro |
14:57:55 | PMunch | It won't build under 0.16.0 |
14:58:03 | PMunch | But it works fine under 0.16.1 |
14:58:24 | PMunch | The problem is that all parents are suddenly nil when run with 0.16.0 |
14:58:43 | PMunch | But I've added an echo were they are assigned and that works fine |
14:58:56 | PMunch | So widget.identifier = genSym(nskVar) get's called |
14:59:03 | PMunch | But it is still later evaluated to nil |
14:59:24 | PMunch | Did 0.16.0 -> 0.16.1 change something about pass by value/pass by reference? |
15:01:54 | SusWombat | zachcarter, how usable is frag yet? |
15:02:13 | zachcarter | SusWombat : I’d wait for docu / website to be ready |
15:02:21 | zachcarter | It’s usable but you have to know what you’re doing |
15:02:27 | Araq | PMunch: yes a couple of bugs were fixed |
15:02:42 | PMunch | Hmm |
15:02:44 | zachcarter | it’s also lacking in some key areas : no collision detection code atm, no tile map support, can only support texture atlases of our own internal format, etc... |
15:02:51 | SusWombat | zachcarter, Naaaah :D I just have to open a query to this zachcarter guy not? (just joking) |
15:03:14 | zachcarter | also shaders need love - right now the sprite batch operates with its own shader, ideally you’d be able to supply your own shader |
15:03:16 | zachcarter | :P |
15:03:29 | zachcarter | I mean if you want to have a go at it , by all means go ahead. I’m willing to answer any and all questions |
15:03:41 | zachcarter | but my recommendation would be to wait for a week or two |
15:03:46 | couven92 | basically, what type is a `const char*` in nim? |
15:04:00 | zachcarter | once I get spine integration going, I’m back to working on stabilizing the core of the framework |
15:04:14 | SusWombat | right now its a bit tricky as there are 2 engines in development O: so id need to test them bost anyways :/ |
15:04:27 | SusWombat | both* |
15:05:02 | FromGitter | <Varriount> couven92: Nim doesn't really have `const` like C++ does. |
15:05:25 | zachcarter | are you referring to Rod? |
15:05:31 | couven92 | @Varriount, so how do I get rid of my compiler error? |
15:05:32 | zachcarter | SusWombat ^ |
15:05:49 | SusWombat | zachcarter, frag and NimGame2 |
15:05:58 | FromGitter | <Varriount> couven92: What's the current importcpp pragma line you're using? |
15:06:03 | zachcarter | ah well I can break down the differences between all three game engines / frameworks right now that are in dev for nim |
15:06:33 | zachcarter | NimGame2 is the simplest of the three, but probably the most feature rich atm |
15:06:40 | FromGitter | <Varriount> couven92: If I recall correctly, you can tailor the importcpp pragma to the signature. |
15:06:55 | Araq | yup, that's about right |
15:07:07 | zachcarter | it uses SDL2 for rendering so you need to understand the intricacies of how SDL2 does drawing, but from a high level - no draw call batching and no texture atlas support |
15:07:11 | Araq | .importcpp: "(char*) Foo(...)" |
15:07:27 | zachcarter | no custom shaders |
15:07:34 | Araq | .importcpp: "(char*) #.Foo(@)" |
15:07:38 | SusWombat | zachcarter, well texture atlas support is easy to make yourself i think anyways |
15:07:51 | SusWombat | the shader thing is acutally really a advantage of frag |
15:08:09 | zachcarter | aye, frag is more complex but you get shaders, more rendering backends, potentially more targets |
15:08:23 | zachcarter | frag should be xbox one / ps4 / nintendo switch / iOS / android capable |
15:08:47 | SusWombat | zachcarter, oh also to be fair i think its not a very cool move to say "we support the switch" yet as that isnt a save thing at all isnt it? |
15:08:54 | zachcarter | it is |
15:09:00 | couven92 | @Varriount, Araq, ok so `proc foobar():cstring {.importcpp: "Foobar", header "foo.h".}` becomes `proc foobar():cstring {.importcpp: "(char*) Foobar", header "foo.h".}`? |
15:09:32 | zachcarter | I believe the switch is running on an nvidia tegra x1 |
15:09:43 | zachcarter | we can target that cpu / architecture |
15:09:57 | zachcarter | whatever rendering API it uses internally we can target |
15:10:06 | zachcarter | so frag should aim to support the switch |
15:10:28 | zachcarter | I’m not saying it does yet - that’s why I used the word should :P |
15:10:44 | zachcarter | obviously I have to buy a switch SDK and prototype things |
15:10:53 | SusWombat | zachcarter, games on a variety of platforms including - Windows, Linux, OSX, PS4, Xbox One, Nintendo Switch, Android, iOS, etc... |
15:10:54 | SusWombat | :D |
15:11:06 | SusWombat | oh wait ... |
15:11:16 | zachcarter | I think I make a side note that console support is to come later |
15:11:17 | SusWombat | im an idiot you did write "aim2 in that post im sry |
15:11:23 | SusWombat | "aim"* |
15:11:28 | zachcarter | ah np :) |
15:12:05 | zachcarter | one of the tricky things about targetting all these platforms is all the cross compilation you have to do for the various libraries frag depends on |
15:12:12 | zachcarter | so supporting all these targets will take time and testing |
15:12:29 | SusWombat | zachcarter, well rod seems to aim for a unity like editor worklfow so thats not that intresting for me right now |
15:12:49 | zachcarter | yeah I was going to get to rod :P Frag aims to be more like libgdx less like unity |
15:12:56 | zachcarter | Rod seems to be architected very much like Unity |
15:13:24 | FromGitter | <Varriount> I have a Switch. :D |
15:13:32 | SusWombat | If i want a engine with a editor id go for godot i think.(its very likely that you coudl maybe use nim there with a certain module) |
15:13:49 | zachcarter | Ahh Varriount: you may become my guinea pig if you volunteer :P |
15:14:10 | zachcarter | SusWombat: yeah I have some really bad feelings about godot but the editor is nice |
15:14:22 | SusWombat | ehy the bad feelings? |
15:14:34 | SusWombat | why* |
15:14:49 | zachcarter | mostly performance of GDScript |
15:15:08 | zachcarter | also I don’t think it does anything terribly well - I don’t think it handles cross platform 2d as well as other options |
15:15:14 | zachcarter | and I don’t think it handles cross platform 3d as well as other options |
15:15:27 | zachcarter | unity is better for cross platform 3d |
15:15:37 | SusWombat | well theres going to be c+ soon. And some guys are workling on a "dlscript" module where you could use shared librarys(they need c like symbold or something like that) |
15:15:41 | zachcarter | for cross platform 2d godot is overkill and slow |
15:15:43 | SusWombat | c#* |
15:15:57 | zachcarter | ah C# will be nice |
15:16:04 | FromGitter | <Varriount> zachcarter: You might need a special development edition of the Switch, unless someone finds a way to sideload binaries. |
15:16:06 | zachcarter | that might save that engine |
15:16:17 | zachcarter | Varriount: I’m guessing that’s the case I’m assuming a SDK will ship |
15:16:22 | Tiberium | zachcarter, they're doing c# support |
15:16:27 | Tiberium | and also there's python-godot |
15:16:34 | Tiberium | unofficial |
15:16:36 | zachcarter | https://developer.nintendo.com/ |
15:16:53 | zachcarter | I’d still stay away from something like godot unless you really are hurting for an editor |
15:17:04 | zachcarter | and just as a side note, I eventually plan to add an in game editor to FRAG for 2d |
15:17:11 | SusWombat | zachcarter, would frag be able to be used with nimsl? |
15:17:19 | zachcarter | negative |
15:17:24 | zachcarter | frag uses bgfx shaders |
15:17:41 | SusWombat | so they have a custom format? |
15:17:42 | zachcarter | you write your shaders in a language similar to GLSL and they compile to whatever rendering backend shader language you want |
15:17:59 | zachcarter | sec I’ll link you to a simple example of frag’s spritebatch shader |
15:18:10 | zachcarter | https://github.com/fragworks/frag/tree/master/assets/shaders/default/2d |
15:18:34 | FromGitter | <Varriount> That's actually what Unity does too. Many GPU shaders have implementation bugs |
15:18:48 | zachcarter | I use a shader tool that ships with bgfx |
15:18:49 | SusWombat | i thought nimsl compiles to glsl anyway O: |
15:19:00 | zachcarter | and shaders eventaully get embedded into Nim code |
15:19:05 | * | Andris_zbx quit (Remote host closed the connection) |
15:19:15 | zachcarter | https://github.com/fragworks/frag/tree/master/src/frag/graphics/two_d/gl |
15:19:20 | zachcarter | https://github.com/fragworks/frag/tree/master/src/frag/graphics/two_d/dx |
15:19:43 | * | yglukhov joined #nim |
15:20:10 | SusWombat | zachcarter, btw why do you dislike "nested" variable assignments? |
15:20:21 | zachcarter | example? |
15:20:36 | SusWombat | https://github.com/fragworks/frag/blob/master/examples/desktop/04-sprite-animation/main.nim#L31 |
15:20:53 | zachcarter | ah that’s just quick code |
15:21:04 | zachcarter | the examples are more like tests than anything |
15:21:28 | zachcarter | please ignore code quality in examples in other words :P |
15:22:01 | zachcarter | https://github.com/fragworks/frag-samples will eventually be where sample games using frag will reside |
15:22:08 | zachcarter | code there is also very WIP |
15:22:16 | SusWombat | id really like to try frag but id have to ask you alot :/ |
15:22:31 | * | yglukhov quit (Remote host closed the connection) |
15:22:34 | zachcarter | yeah if you give it another week or two we should have some docu I think |
15:22:41 | SusWombat | ok |
15:22:41 | zachcarter | other guy working on frag with me is supposed to be working on that |
15:27:17 | * | yglukhov joined #nim |
15:27:56 | SusWombat | zachcarter, so just to ensure, i could use your rendering api with shaders without a problem then right? i wouldnt need to do opengl code myself? |
15:28:26 | zachcarter | SusWombat: that’s correct, when the spritebatch supports it which will be soon - you’ll be able to pass a custom shader to it for 2d rendering |
15:28:35 | zachcarter | frag currently doesn’t support any 3d stuff so if you want 3d you’d have to write that yourself for now |
15:28:51 | zachcarter | eventually I’ll add some 3d capabilities but don’t expect it to get close to like UE4 or Unity in terms of support |
15:29:04 | zachcarter | I may eventually get to deferred rendering and PBR but that’s a long way away |
15:29:33 | zachcarter | also 3d will most likely get an editor |
15:29:57 | SusWombat | zachcarter, i dont care about 3d at all :D |
15:30:04 | zachcarter | well that’s good :) |
15:30:16 | zachcarter | so short answer is yes - once the sprite batch supports it which it will in the next weekish |
15:30:20 | zachcarter | once I finish spine stuff up |
15:30:25 | SusWombat | okay |
15:30:30 | SusWombat | nice to hear |
15:33:01 | * | Varriount|Phone joined #nim |
15:33:20 | Tiberium | Just curious: does JS backend support async/await features ? :D |
15:35:06 | * | Varriount|Mobile quit (Ping timeout: 240 seconds) |
15:59:42 | * | Trustable joined #nim |
16:02:58 | hohlerde | is there a libxml2 wrapper for nim or something similiar which is able to generate canonical xml? |
16:06:20 | * | ibk quit (Quit: Connection closed for inactivity) |
16:08:19 | * | vivus joined #nim |
16:11:23 | krux02 | How do I know, if an object type is packed? |
16:11:24 | * | Varriount|Phone quit (Read error: Connection reset by peer) |
16:11:46 | * | Varriount|Phone joined #nim |
16:12:43 | krux02 | Araq: is there a way from an object type to know weather a type has the packed pragma? |
16:13:08 | PMunch | Araq, these bugs are weird |
16:13:27 | PMunch | echo child.parent == widget |
16:13:35 | PMunch | false in 0.16.0, true in 0.16.1 |
16:15:01 | krux02 | PMunch, in what context? |
16:15:04 | FromGitter | <Varriount> krux02: An object is packed when the packed pragma is used |
16:15:42 | PMunch | krux02, the genui macro |
16:15:46 | krux02 | Varriount well yes, but how do I know if the packed pragma is used, (from a type symbol in a macro) |
16:15:56 | FromGitter | <Varriount> I believe there's a way to get the type definitions from an object using a procedure in the macros module |
16:16:12 | krux02 | PMunch, I think there was a bug fixed in the interpreter |
16:16:17 | PMunch | I call a function parseChildren which calls the function parseNode on all the children and sets their parent to the object passed to parseChildren |
16:16:22 | PMunch | Which is a reference type |
16:16:23 | krux02 | NimNodes are ref types, but often they were copied |
16:16:43 | PMunch | krux02, yeah. Araq already said there were some fixed errors |
16:17:11 | krux02 | I actually submitted the bug report |
16:18:39 | krux02 | PMunch, without context I can't help you |
16:18:49 | PMunch | I've found a workaround |
16:19:00 | PMunch | That "fixes" the problem |
16:19:08 | PMunch | https://github.com/PMunch/wxnim/commit/a23a212b5f39d87f955f450e0b4e290f7ad01dcc |
16:19:22 | cheatfate | krux02, getTypeImpl can help you to get type implementation which can have Pragma node |
16:19:26 | PMunch | Basically doing a check if the parent is not set correctly and set it |
16:19:44 | zachcarter | flyx: setDefaultValue seems to fail for enums |
16:19:44 | PMunch | child.parent and widget are not equal in that case, which is a problem |
16:20:04 | krux02 | well, the bug was fixed, so it was not a bug introduced, it might have happened that you based your implemenation on false behaviour (that happens easyly in nim because I found a lot of bugs and weird stuff) |
16:20:12 | zachcarter | flyx: Error: unhandled exception: false Invalid node kind nnkAccQuoted for macros.`$` |
16:20:13 | PMunch | Which is set here: https://github.com/PMunch/wxnim/blob/master/genui.nim#L34 |
16:20:41 | PMunch | Well it works in 0.16.1 but not in 0.16.0 |
16:20:53 | PMunch | So I'm assuming it's a bug in 0.16.0 that got fixed in 0.16.1 |
16:20:53 | flyx | zachcarter: hmm. this one will need investigation |
16:20:58 | zachcarter | okay |
16:21:14 | zachcarter | want a small example? |
16:21:19 | zachcarter | I can create one and an issue |
16:22:48 | dom96 | hi guys |
16:23:08 | zachcarter | o/ |
16:25:18 | Tiberium | dom96, hi |
16:25:44 | zachcarter | ahh flyx: I figured it out |
16:25:49 | zachcarter | wasn’t the enum |
16:25:51 | zachcarter | it was the backticks in the field name |
16:25:59 | * | vlad1777d quit (Remote host closed the connection) |
16:26:53 | flyx | zachcarter: yeah, this is currently not supported. but probably not hard to implement |
16:27:04 | zachcarter | gotcha I think I can live without it |
16:27:09 | zachcarter | but if not I’ll let you know |
16:27:31 | zachcarter | btw so far the lib is working great, everything Varriount has been espousing about it is true :P |
16:27:44 | PMunch | Uhm Araq, what is --app:gui doing on Linux? |
16:27:55 | * | vlad1777d joined #nim |
16:27:56 | zachcarter | err I used that word incorectly |
16:28:04 | dom96 | PMunch: Probably nothing |
16:28:13 | zachcarter | all of Varriounts espousing of the lib is well warranted. there :P |
16:28:18 | dom96 | It's only supported on Windows IIRC |
16:28:25 | PMunch | Well, it adds -mwindows as a compile flag :P |
16:28:35 | PMunch | Which the compiler obviously doesn't like.. |
16:29:18 | flyx | bunch of minimal examples work with backquoted fields, can you give me example code that breaks? |
16:29:33 | zachcarter | sure |
16:30:31 | zachcarter | flyx: https://gist.github.com/zacharycarter/9c86f947ca6f87531f1c8727443562d3 |
16:30:55 | zachcarter | specifically https://gist.github.com/zacharycarter/9c86f947ca6f87531f1c8727443562d3#file-example-nim-L127 |
16:32:07 | * | nsf quit (Quit: WeeChat 1.7) |
16:33:46 | zachcarter | hrm apparently I cannot live without the fix |
16:33:54 | zachcarter | unless there’s some way to alias fields |
16:34:47 | hohlerde | compiling libiconv on windows is a pain in the ass |
16:35:01 | hohlerde | sorry, fc |
16:39:00 | flyx | zachcarter: pushed a fix |
16:39:08 | zachcarter | awesome thank you |
16:39:53 | zachcarter | perfect thank you flyx |
16:41:14 | * | PMunch quit (Quit: leaving) |
16:41:31 | * | couven92 quit (Quit: Client disconnecting) |
16:51:10 | FromGitter | <Varriount> hohlerde: Is that the one with circular dependancies? |
16:51:44 | FromGitter | <Varriount> I know I've never been able to compile x64 GTK on Windows because GTK has a circular dependancy |
16:52:01 | hohlerde | don't know exactly, but it took me some time to get it compiling in msys2 |
16:58:48 | * | vlad1777d quit (Quit: Leaving) |
17:00:45 | zachcarter | hrm flyx: not sure how to handle this, I have a field in my json that could hold either a seq of floats or a string |
17:01:14 | zachcarter | I don’t really have a way of knowing which it will be at compile time |
17:01:22 | zachcarter | do I need a custom serializer for that case? |
17:01:48 | zachcarter | or deserializer I should say |
17:02:03 | flyx | zachcarter: well, unfortunately, the implicit variant object deserializer requires an explicit tag for the case of a non-scalar value (seq in this case) |
17:02:20 | flyx | zachcarter: so yes, you need to build a deserializer yourself |
17:02:34 | zachcarter | okay that’s what I figured, thank you |
17:03:47 | * | vlad1777d joined #nim |
17:09:29 | flyx | hmm, seems like the pointer type is not supported by the JS backend, can anybody confirm? |
17:17:49 | * | couven92 joined #nim |
17:18:23 | * | Trustable quit (Remote host closed the connection) |
17:38:54 | Tiberium | What's the best option to a config file, which users would change without source code? |
17:39:02 | Tiberium | *for a |
17:39:12 | Tiberium | just .txt? or there's better choices? |
17:39:24 | Tiberium | ah, parsecfg |
17:53:49 | Arrrr | and/or parseopt |
17:55:47 | dom96 | flyx: how could it be supported? |
17:56:34 | flyx | dom96: I dunno, I guess since JS is dynamically typed, a cast from `ref anything` to `pointer` should be a noop...? |
17:58:07 | FromGitter | <stisa> pointers kind of work in js, there are some problems in casting I think |
18:04:19 | * | elrood joined #nim |
18:05:41 | zachcarter | flyx: Is there a better way to do this than - |
18:05:47 | zachcarter | result.skeleton = Skeleton() |
18:05:48 | zachcarter | discard s.next() |
18:05:49 | zachcarter | discard s.next() |
18:05:49 | zachcarter | constructObject(s, c, result.skeleton.hash) |
18:06:09 | zachcarter | implementing my own deserializer |
18:06:17 | zachcarter | trying to parse a key value pair from my json |
18:06:35 | zachcarter | I have to do s.next s.next to get through the name and opening tag for the map |
18:07:53 | zachcarter | ah I think I know what to do |
18:10:56 | dom96 | Wait, how are you parsing json? |
18:11:05 | dom96 | What module are you using? |
18:11:07 | zachcarter | well now I”m having to do it with a custom serializer |
18:11:09 | zachcarter | nimyaml now |
18:11:19 | zachcarter | but I know what I’m doing wrong |
18:11:29 | zachcarter | I should be deserializing into an object not manually parsing like I am |
18:12:15 | dom96 | You can also do something like this: parseJson(jsonData)["key"]["key2"].getStr() |
18:12:34 | dom96 | You can either put each field that you're interested in into your own object |
18:12:40 | dom96 | or use this sort of syntax everywhere |
18:12:55 | zachcarter | gotcha, may give out the marshal / json modules a try i fi can’t get further with nimyaml |
18:13:01 | zachcarter | or nimyaml becomes just as much work as ^ |
18:13:07 | zachcarter | which it seems to be becoming |
18:26:27 | flyx | zachcarter: I'd need to see your json to understand what you're trying to do, but in general, always call constructChild(), not constructObject(), for handling child values |
18:26:41 | zachcarter | ah okay |
18:26:48 | zachcarter | child values like members of an object? |
18:26:52 | flyx | though in your case it wouldn't make a difference since json has no tags or anchors |
18:26:53 | flyx | yes |
18:26:58 | zachcarter | okay thanks |
18:28:56 | flyx | btw, I'd rather do `doAssert s.next().kind == yamlStartMap; doAssert s.next().kind == yamlScalar` |
18:29:13 | flyx | if you really only want to skip the mapping start and the first key |
18:29:45 | flyx | not checking the well-formed-ness of the input will otherwise fall on your feet later on |
18:35:18 | * | nhywyll joined #nim |
18:37:04 | * | Matthias247 joined #nim |
18:38:56 | * | zaquest quit (Remote host closed the connection) |
18:39:19 | * | zaquest joined #nim |
18:42:19 | flyx | hmm, what do these _Idx parameters in the generated JS code mean? |
18:42:38 | * | djellemah quit (Ping timeout: 246 seconds) |
18:43:07 | flyx | I think I found a bug in the code generator, since at one point, a function (generated from a nim proc) is called with one parameter less than specified (in JS); one of the _Idx values is missing |
18:43:21 | flyx | would be great if I got that into a minimal working example |
18:52:06 | * | yglukhov quit (Remote host closed the connection) |
18:53:41 | * | yglukhov joined #nim |
18:57:11 | zachcarter | flyx: https://gist.github.com/zacharycarter/af3ac7a1277f38594a35cbf2c6dd17ec |
18:57:37 | zachcarter | not sure how to parse that using my custom deserializer |
18:57:57 | zachcarter | I just get an initialized object, not an object with the values set to what’s in the json |
18:58:20 | * | yglukhov quit (Ping timeout: 256 seconds) |
19:08:29 | * | yglukhov joined #nim |
19:10:42 | * | yglukhov quit (Remote host closed the connection) |
19:24:17 | * | yglukhov joined #nim |
19:26:55 | * | yglukhov quit (Remote host closed the connection) |
19:30:38 | * | Arrrr quit (Quit: Leaving.) |
19:31:14 | * | nsf joined #nim |
19:35:53 | flyx | zachcarter: I see your problem. by implementing constructObject, you're hiding the default implementation and cannot dispatch to that anymore |
19:36:11 | zachcarter | ahh okay |
19:36:19 | zachcarter | I get it |
19:36:47 | zachcarter | thank you for that explanation |
19:36:54 | zachcarter | think I know what to do now |
19:38:15 | * | yglukhov joined #nim |
19:39:41 | * | yglukhov quit (Remote host closed the connection) |
19:40:15 | * | yglukhov joined #nim |
19:43:12 | flyx | zachcarter: I added a costructObjectDefault() proc which can be used for such cases |
19:43:20 | flyx | with current devel, you can do this: https://gist.github.com/flyx/9b9e0de0169f0ba3cea31960c844b0a1 |
19:43:53 | flyx | (assuming this is what you want) |
19:44:23 | flyx | if you wanted to have an actual SkeletonJson object, you wouldn't have needed the custom constructor at all |
19:44:48 | * | yglukhov quit (Ping timeout: 256 seconds) |
19:44:49 | flyx | er, drop the echo lines, I did some debugging ^^ |
19:45:07 | zachcarter | perfect thank you |
19:45:25 | zachcarter | just tested it out |
19:51:19 | * | bjz joined #nim |
19:52:03 | flyx | will be off until tomorrow, but feel free to drop me messages, my bouncer will conserve them |
19:52:17 | * | rokups quit (Quit: Connection closed for inactivity) |
19:52:57 | * | brson joined #nim |
19:54:01 | zachcarter | okay will do |
19:57:49 | * | vlad1777d quit (Remote host closed the connection) |
19:59:21 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:00:09 | * | brson quit (Ping timeout: 240 seconds) |
20:00:25 | * | Serenitor joined #nim |
20:01:25 | * | Senketsu quit (Quit: Leaving) |
20:07:26 | Tiberium | can this be possible? download file from one URL into memory (don't save it to FS), and then upload this file from memory to another URL via multipart data? |
20:08:50 | * | yglukhov joined #nim |
20:09:43 | FromGitter | <stisa> mmh so I keep getting warnings `cannot prove that <x> is initialized` , when `x` is an object with an enum field and the enum doesn't start at 0 |
20:09:47 | FromGitter | <stisa> any way around it? |
20:10:11 | * | Tiberium quit (Remote host closed the connection) |
20:10:23 | def- | stisa: object constructor or an explicit init proc |
20:11:46 | * | Trustable joined #nim |
20:12:52 | ldlework | def-: what you working on these days |
20:13:30 | * | yglukhov quit (Ping timeout: 268 seconds) |
20:13:37 | FromGitter | <stisa> thanks def- |
20:24:22 | FromGitter | <stisa> nope looks like I spoke too soon, I still have warnings, when I use the type in a Table. |
20:25:47 | * | nhywyll quit (Quit: nhywyll) |
20:29:03 | def- | stisa: hm, I seem to remember that I also had trouble removing all warnings of that kind |
20:29:27 | def- | and I decided to just ignore the warning until that's fixed in the compiler |
20:30:26 | def- | With warning[ProveInit]=off in a nim.cfg |
20:30:59 | FromGitter | <stisa> yeah, that's what I'm going to do too. Maybe I'll try looking at enum initialization though, I think if I fix that the rest should fix itself. |
20:31:21 | def- | ldlework: paid work, not much otherwise |
20:31:58 | ldlework | def-: what language do you do professionally |
20:36:12 | def- | C++, Python |
20:37:41 | ldlework | cool |
20:41:58 | onionhammer | { |
20:43:44 | * | Trustable quit (Remote host closed the connection) |
20:46:08 | * | bjz joined #nim |
20:51:03 | * | nsf quit (Quit: WeeChat 1.7) |
20:58:19 | * | couven92 quit (Quit: Client Disconnecting) |
21:00:52 | * | Nobabs27 joined #nim |
21:04:05 | * | babs_ joined #nim |
21:06:49 | * | Nobabs27 quit (Ping timeout: 240 seconds) |
21:10:46 | FromGitter | <Varriount> def-: I'm glad I don't have to use C++ at my job. |
21:13:08 | FromGitter | <Varriount> tiberium: Any solution to your problem yet? |
21:18:26 | * | Vladar quit (Quit: Leaving) |
21:18:40 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:19:15 | FromGitter | <TiberiumPY> What problem? About file uploading? |
21:24:18 | * | NimBot joined #nim |
21:25:41 | * | babs_ quit (Remote host closed the connection) |
21:26:03 | * | babs_ joined #nim |
21:28:19 | FromGitter | <TiberiumPY> @Varriount so what did you wanted to ask? |
21:31:12 | FromGitter | <Varriount> I was going to ask if you've discovered a solution to your problem yet. |
21:34:23 | FromGitter | <TiberiumPY> Ah, I'll u |
21:34:49 | FromGitter | <TiberiumPY> I'll try to do it after sleep (today). It's 0:34 for me now |
21:35:10 | * | bjz joined #nim |
21:37:10 | krux02 | Varriount: actually c++ can be pretty cool to use, but probly when you are, you are dealing with a horrible codebase that takes half an hour to compile and 10 minutes for incremental builds |
21:40:38 | FromGitter | <TiberiumPY> @Varriount i don't really know right now, but it may be possible just with getContent and then with newMultipartData as in second httpclient example |
21:41:11 | FromGitter | <TiberiumPY> If there wouldn't be any encoding/bytes issues |
21:41:24 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:46:30 | babs_ | string a = "foo" echo a "Error: undeclared identifier: 'a'" ?? |
21:46:36 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) |
21:47:56 | FromGitter | <TiberiumPY> Learn Nim please |
21:48:11 | FromGitter | <TiberiumPY> a = "foo" |
21:48:15 | FromGitter | <TiberiumPY> Sorry |
21:48:20 | babs_ | ? |
21:48:33 | FromGitter | <TiberiumPY> var a = "foo" |
21:48:35 | FromGitter | <TiberiumPY> Or |
21:48:47 | FromGitter | <TiberiumPY> var a: string = "foo" |
21:49:04 | babs_ | hmm ok |
21:49:11 | FromGitter | <TiberiumPY> And also use constants and let's where applicable |
21:49:44 | FromGitter | <TiberiumPY> (constants - if you know value of variable at compile time) |
21:49:50 | babs_ | ^ |
21:50:22 | FromGitter | <TiberiumPY> let - if you will not change variable after its definition |
21:51:58 | * | Varriount|Phone quit (Ping timeout: 260 seconds) |
21:52:29 | FromGitter | <TiberiumPY> But please read some tutorials and read some code :) It really helps |
21:53:57 | * | Varriount|Phone joined #nim |
21:56:36 | babs_ | I have, sometimes nothing beats a simplified description though :) |
21:57:27 | * | brson joined #nim |
22:03:03 | * | brson quit (Ping timeout: 260 seconds) |
22:03:03 | * | Varriount|Phone quit (Read error: Connection reset by peer) |
22:03:13 | * | Varriount|Phone joined #nim |
22:06:01 | * | Varriount|Phone quit (Read error: Connection reset by peer) |
22:06:15 | * | elrood quit (Quit: Leaving) |
22:06:57 | * | rauss quit (Quit: WeeChat 1.7) |
22:11:10 | vivus | how do I convert a row type to a string type from this statement: for x in fetchdb.rows(sql("select content_body from posts")): ... ? |
22:14:46 | * | Varriount|Phone joined #nim |
22:17:26 | babs_ | is there a paramStr that does not use TaintedString ? |
22:19:31 | FromGitter | <TiberiumPY> LOL |
22:19:32 | * | Varriount|Phone quit (Read error: Connection reset by peer) |
22:19:34 | FromGitter | <TiberiumPY> http://m.imgur.com/L8RqEf3 |
22:20:02 | FromGitter | <TiberiumPY> http://i.imgur.com/L8RqEf3.jpg |
22:23:43 | FromGitter | <Varriount> Yeesh. Talk about high goals. |
22:26:04 | FromGitter | <TiberiumPY> Oh wait |
22:26:12 | FromGitter | <TiberiumPY> It's a server side compiler lol |
22:26:22 | FromGitter | <TiberiumPY> And server side is closed source |
22:27:56 | FromGitter | <TiberiumPY> For example three days ago they gave a one-week access key to their compiler in their blog |
22:31:24 | * | Varriount|Phone joined #nim |
22:35:52 | * | def-pri-pub joined #nim |
22:35:52 | * | def-pri-pub quit (Changing host) |
22:35:52 | * | def-pri-pub joined #nim |
22:36:35 | babs_ | can you concatenate a TaintedString and a String to make it a String? |
22:36:51 | SusWombat | closed source server side compiler ... WTF |
22:36:57 | SusWombat | CAAS or whatß |
22:37:00 | SusWombat | ?* |
22:37:11 | ldlework | Does Nim completion work for emacs yet? |
22:38:00 | SusWombat | ldlework, i had some problems with the nim mode (i use vsc for nim) for now but autocompletion seemed to work |
22:38:16 | ldlework | what were the problems? |
22:38:22 | babs_ | there are two "nim-modes" for emacs? idk |
22:38:27 | babs_ | https://github.com/nim-lang/nim-mode |
22:38:31 | babs_ | https://github.com/reactormonk/nim-mode |
22:38:32 | def-pri-pub | What/where is this CAAS? |
22:38:44 | babs_ | oh one is up to date the other isnt nvm |
22:38:46 | SusWombat | couldnt get eldoc mode to work and i get instant errors from the syntax checker iirc |
22:39:16 | SusWombat | def-pri-pub, dont know if it exists (i hope not) but i just made fun of it CompilerAsAService |
22:40:44 | SusWombat | nvm ... it exists actually lol |
22:42:34 | vivus | how do I convert a sequence of strings into 1 string ? |
22:43:54 | babs_ | the & operator ? @virus |
22:44:07 | babs_ | @vivus I mean |
22:44:34 | def-pri-pub | SusWombat, funny you talk about that. i was actually thinking about making something like that this weekend to make Nim->Js development a little less painful. |
22:45:38 | * | smt quit (Ping timeout: 260 seconds) |
22:45:52 | vivus | I see this type is: Row = seq[string] . So I want to take this Row type and make it into 1 string |
22:51:26 | def-pri-pub | vivus: Do you mean you want to concat all of the strings that are in the Row? |
22:51:42 | vivus | def-pri-pub: yep, 100% |
22:52:20 | def-pri-pub | hold on, I think I know the proc for that... |
22:52:49 | vivus | because I am only fetching data from 1 column at a time: select content_body from posts |
22:53:38 | def-pri-pub | You should be able to use one of the fold*() procs: |
22:53:39 | def-pri-pub | https://nim-lang.org/docs/sequtils.html#foldl.t,untyped,untyped |
22:54:33 | def-pri-pub | Yeah, it would be: foldl(Row, a & b) |
22:55:06 | FromGitter | <TiberiumPY> Why not join? |
22:55:34 | def-pri-pub | Oh yeah, you could use join again |
22:55:39 | def-pri-pub | aswell* |
22:56:08 | def-pri-pub | Actually, join in strutils is probably a bit nicer |
22:56:10 | vivus | @TiberiumPY how? |
22:57:08 | FromGitter | <TiberiumPY> vivus: data = myRow.join(", ") |
22:57:16 | FromGitter | <TiberiumPY> *let data |
22:57:47 | FromGitter | <TiberiumPY> If you just want to concat then without comma, just use empty |
22:57:51 | vivus | @TiberiumPY and if I don't want them separated by a "," ? |
22:57:54 | vivus | oh |
22:57:57 | vivus | read my mind |
22:58:29 | FromGitter | <TiberiumPY> I don't remember if you can just myRow.join() without arguments |
23:00:22 | FromGitter | <TiberiumPY> @define-private-public |
23:00:39 | FromGitter | <TiberiumPY> CAAS -Ne |
23:00:45 | FromGitter | <TiberiumPY> Nectar JS |
23:01:01 | FromGitter | <TiberiumPY> They have closed source server side compiler |
23:02:10 | FromGitter | <TiberiumPY> And I actually believe that Crystal and Nim similar in at least one way: |
23:02:57 | FromGitter | <TiberiumPY> They are trying to give very good experience like in interpreted languages |
23:03:09 | ldlework | its fair |
23:12:42 | * | Varriount|Phone quit (Remote host closed the connection) |
23:12:59 | * | Varriount|Phone joined #nim |
23:17:11 | * | Varriount|Phone quit (Read error: Connection reset by peer) |
23:19:18 | * | Varriount|Phone joined #nim |
23:22:06 | * | Varriount|Phone quit (Remote host closed the connection) |
23:22:44 | * | Varriount|Phone joined #nim |
23:24:22 | vivus | which csv lib is recommended for parsing strings to a csv file and separating each entry as a newline ? |
23:39:17 | * | Senketsu joined #nim |
23:42:30 | * | Varriount|Phone quit (Read error: Connection reset by peer) |
23:47:32 | * | ftsf joined #nim |
23:48:46 | * | smt joined #nim |
23:50:10 | * | gokr quit (Ping timeout: 264 seconds) |
23:53:49 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:53:52 | * | sz0 joined #nim |