00:13:35 | * | Ven`` quit (Ping timeout: 240 seconds) |
00:13:44 | * | Ven`` joined #nim |
00:15:35 | * | relax joined #nim |
00:25:19 | vivus | I have the following proc: https://www.zerobin.net/?aaf22e333a38812a#xVb8q45+jTkLfEk4I3mYcEbqwJ6qRNY9TCggaJNF634= . This code is code I found online. Can someone explain to me what 'type' is todoItems.add TodoItem(...) ? |
00:26:28 | FromGitter | <Varriount> @genotrance Looks like a function pointer maybe? |
00:27:11 | FromGitter | <Varriount> Our possibly a pointer to a function that returns a pointer to a function |
00:29:06 | vivus | @Varriount seeing as you are the only other person awake, care to take a look at that code? :) |
00:29:17 | vivus | (if it's not too much trouble) |
00:31:19 | FromGitter | <Varriount> vivus: todoItems looks like a global variable that is a sequence, that's having an item of type |
00:31:40 | FromGitter | <Varriount> TodoItem added |
00:32:07 | FromGitter | <genotrance> @Varriount looks like GCC is happy with it but I'm not sure how to translate it for Nim |
00:33:04 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
00:34:01 | FromGitter | <Varriount> @genotrance Is BIO_meth_get_write a macro? |
00:35:55 | FromGitter | <zacharycarter> @genotrance maybe run it through the GCC preprocessor first and see what it spits out |
00:37:21 | vivus | @Varriount what is the simplest way to convert this sequence into JSON? |
00:38:25 | * | relax quit (Ping timeout: 248 seconds) |
00:40:57 | FromGitter | <zacharycarter> vivus: https://play.nim-lang.org/?gist=655b51166dd6238e2998a348a0c0d8b6 |
00:42:09 | vivus | @zacharycarter you are the best, thank you! |
00:43:12 | FromGitter | <zacharycarter> np |
00:49:32 | FromGitter | <zacharycarter> yay selection boxes work |
00:49:43 | FromGitter | <zacharycarter> now for picking |
00:50:37 | FromGitter | <zacharycarter> https://imgur.com/a/Bhjaf |
00:52:06 | vivus | what alternate type can I use, instead of a sequence, for key-value items? |
00:54:35 | FromGitter | <zacharycarter> table |
00:54:47 | FromGitter | <zacharycarter> but it's not a built in type |
00:54:52 | FromGitter | <zacharycarter> just FYI |
00:59:48 | vivus | @zacharycarter : This is what I am trying to do: https://play.nim-lang.org/?gist=a0feb234b7ab74cc113513f22f23e758 |
01:00:42 | FromGitter | <genotrance> @zacharycarter : that code is what the preprocessor spits out |
01:00:51 | FromGitter | <zacharycarter> oh :/ |
01:01:49 | FromGitter | <genotrance> @Varriount : ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59d6d5fc177fb9fe7e445e89] |
01:02:08 | FromGitter | <zacharycarter> vivus: fixed - https://play.nim-lang.org?gist=2f19fc28b3fec499e52d73c06b1cd46d |
01:04:23 | vivus | wow, that is verbose. @zacharycarter why did todoItems.id & todoItems.description not work? (is it because the size of the sequence is unknown?) |
01:05:03 | FromGitter | <zacharycarter> you had todoitems[0] and todoitems[1] |
01:05:11 | FromGitter | <zacharycarter> you should just have todoitems[0] and todoitems[0] |
01:06:08 | vivus | but why not todoItems.id ? I tried that and it failed |
01:06:44 | vivus | oh I see it now. each TodoItem object is stored as 1 entry in the sequence |
01:06:58 | * | chemist69 quit (Ping timeout: 258 seconds) |
01:07:17 | FromGitter | <zacharycarter> yes |
01:08:40 | FromGitter | <zacharycarter> def-pri-pub: you around by any chance? |
01:08:53 | vivus | getting used to other peoples code requires a bit of introspection XD |
01:10:37 | * | def-pri-pub joined #nim |
01:10:50 | def-pri-pub | zacharycarter: heyas, you here? |
01:11:09 | FromGitter | <zacharycarter> yup |
01:11:52 | def-pri-pub | I saw your comment, but I was away on a business trip. And I'm starting to get a cold |
01:12:01 | FromGitter | <zacharycarter> ah okay no worries |
01:12:03 | def-pri-pub | So I'm not sure how much I can talk to you about the camera thing |
01:12:07 | def-pri-pub | My brain is a tad fried |
01:12:14 | FromGitter | <zacharycarter> it's all good |
01:12:22 | FromGitter | <zacharycarter> hope you start feeling better soon |
01:17:12 | vivus | @zacharycarter is there a special proc in the JSON module that allows saving to a file? |
01:18:18 | FromGitter | <zacharycarter> no - modules hopefully only contain functionality related to the purpose of the module |
01:18:24 | FromGitter | <zacharycarter> so json is only for working with json |
01:18:34 | FromGitter | <zacharycarter> you'd find something like that in system or some io module |
01:18:54 | FromGitter | <zacharycarter> https://nim-lang.org/docs/system.html#writeFile,string,string_2 would probably work for your use case |
01:20:30 | * | chemist69 joined #nim |
01:21:03 | FromGitter | <Varriount> @genotrance https://stackoverflow.com/questions/20617067/returning-function-pointer-type |
01:21:26 | * | ipjk quit (Read error: Connection reset by peer) |
01:21:49 | vivus | interesting. it would be useful to have a save_as_json though |
01:22:18 | FromGitter | <zacharycarter> I don't think that's going to happen vivus |
01:22:31 | vivus | me neither :P |
01:22:54 | * | libman joined #nim |
01:25:21 | * | byte512 quit (Ping timeout: 240 seconds) |
01:25:41 | * | kunev quit (Ping timeout: 240 seconds) |
01:27:43 | * | byte512 joined #nim |
01:28:22 | * | francisl joined #nim |
01:28:27 | * | kunev joined #nim |
01:32:48 | FromGitter | <Varriount> C type declarations are a headache |
01:36:39 | FromGitter | <genotrance> @Varriount I'm not sure how that helps :( |
01:39:18 | FromGitter | <Varriount> BIO_meth_get_write is a function that takes a pointer to a BIO_METHOD, and returns a function that takes a pointer to a BIO, a pointer to a char, and an integer |
01:40:31 | FromGitter | <Varriount> @genotrance You could rewrite the C code to split the return type into a typedef |
01:42:04 | FromGitter | <Varriount> Or do the same thing in Nim |
01:42:18 | vivus | in writeFile(), how do I specify a specific folder? eg. data |
01:42:36 | vivus | eg. writeFile("data/test.txt", "somestring") |
01:44:08 | * | endragor joined #nim |
01:44:34 | adam12 | vivus: does that not work? |
01:44:49 | vivus | adam12: nope |
01:45:01 | vivus | Error: identifier expected, but found '"data/"' |
01:45:01 | adam12 | Hm. Maybe you need to prefix it with the cwd |
01:45:37 | * | endragor_ joined #nim |
01:46:07 | adam12 | vivus: That quote looks funny |
01:46:10 | adam12 | at start of string |
01:47:06 | adam12 | Anyways, it definitely works. Check your double quotes - one looks like awfully different. |
01:47:43 | vivus | adam12: this is how I construct the filename: var myfile = "data" & intToStr(todoItems[0].id) & ".json" and then I pass myfile to writeFile() |
01:48:23 | * | endragor quit (Read error: Connection reset by peer) |
01:49:02 | adam12 | vivus: I'm presuming you want: var myfile = "data" / intToStr(todoItems[0].id) & ".json" |
01:49:42 | FromGitter | <genotrance> @Varriount thanks! makes sense - I'll try that out. |
01:49:45 | vivus | adam12: should it be "data/" instead of "data" / ? |
01:50:05 | adam12 | vivus: the / instead of & will do the concat for you properly. |
01:50:51 | adam12 | vivus: Actually, I might be wrong with that.. |
01:51:03 | adam12 | vivus: It does work, but maybe not when concatting two strings. |
01:51:14 | vivus | thanks adam12 . will test both out |
01:54:10 | adam12 | vivus: So, using / does work to concat strings - I just forgot that ospaths module needs to be imported :) Anyways. Good luck. |
01:57:11 | * | vivus quit (Quit: Leaving) |
02:04:33 | * | endragor joined #nim |
02:05:46 | * | huonw quit (Ping timeout: 255 seconds) |
02:06:40 | * | pydsigner quit (Ping timeout: 255 seconds) |
02:07:48 | * | endragor_ quit (Ping timeout: 240 seconds) |
02:10:15 | * | MightyJoe joined #nim |
02:10:53 | * | user0__ joined #nim |
02:11:39 | * | huonw joined #nim |
02:12:37 | * | cyraxjoe quit (Quit: No Ping reply in 180 seconds.) |
02:12:37 | * | user0_ quit (Remote host closed the connection) |
02:12:38 | * | EastByte quit (Ping timeout: 255 seconds) |
02:13:22 | * | pydsigner joined #nim |
02:14:14 | * | endragor quit (Remote host closed the connection) |
02:15:12 | * | mwbrown quit (Ping timeout: 260 seconds) |
02:17:37 | * | mwbrown joined #nim |
02:19:56 | * | Demos quit (Quit: Demos) |
02:20:15 | * | Demos joined #nim |
02:30:21 | * | def-pri-pub quit (Quit: Leaving.) |
02:31:38 | * | Demos quit (Quit: Demos) |
02:35:20 | * | Demos joined #nim |
02:36:09 | * | thmslld_ joined #nim |
02:37:15 | * | EastByte joined #nim |
02:48:53 | * | relax joined #nim |
02:58:53 | * | dddddd quit (Remote host closed the connection) |
03:00:52 | * | francisl quit (Quit: francisl) |
03:02:21 | * | smt quit (Ping timeout: 258 seconds) |
03:12:30 | * | Senketsu joined #nim |
03:15:47 | * | endragor joined #nim |
03:22:41 | * | relax quit (Ping timeout: 248 seconds) |
03:29:11 | * | francisl joined #nim |
03:34:27 | * | Kingsquee joined #nim |
03:40:18 | libman | Go, D, and Swift all down this month on https://www.tiobe.com/tiobe-index/ ::schadenfreude:: ;-) |
03:41:23 | libman | Julia, Rust, and Crystal are up. |
03:45:20 | * | francisl quit (Quit: francisl) |
03:47:40 | * | Demos quit (Quit: Demos) |
03:48:02 | * | thmslld_ quit (Remote host closed the connection) |
03:48:19 | * | thmslld_ joined #nim |
04:04:01 | * | def-pri-pub joined #nim |
04:04:01 | * | def-pri-pub quit (Client Quit) |
04:12:04 | * | Demos_ joined #nim |
04:44:36 | * | Demos_ quit (Quit: Demos_) |
04:44:55 | * | Demos_ joined #nim |
04:47:35 | * | RushPL joined #nim |
04:49:05 | * | Demos_ quit (Client Quit) |
04:49:23 | * | Demos_ joined #nim |
04:50:43 | * | thmslld_ quit (Remote host closed the connection) |
05:04:08 | * | skrylar joined #nim |
05:05:57 | * | Demos_ quit (Quit: Demos_) |
05:06:17 | * | Demos_ joined #nim |
05:06:23 | * | Demos_ quit (Client Quit) |
05:06:40 | * | Demos_ joined #nim |
05:08:08 | skrylar | zacharycarter: as it turns out, you can apparently make distance fields out of bit planes of textures |
05:08:41 | skrylar | i saw someone tried it on cartoonish graphics and it works, although getting extremely close has a couple artifacts |
05:08:55 | skrylar | would be curious to see how it worked on "real" textures |
05:10:50 | FromGitter | <zacharycarter> sounds interesting |
05:11:49 | skrylar | https://gpuhacks.wordpress.com/2013/07/08/signed-distance-field-rendering-of-color-bit-planes/ |
05:12:45 | skrylar | also finally figured out how smart textures worked. although thats sorta meh |
05:13:08 | skrylar | Pretty hard to learn but not hard to understand. basically just dot products on normals and basic stuff :\ |
05:27:01 | * | miran joined #nim |
06:00:12 | FromGitter | <Varriount> skrylar: What are smart textures? |
06:00:20 | * | Demos_ quit (Quit: Demos_) |
06:00:37 | * | Demos_ joined #nim |
06:08:02 | skrylar | varriount: its a brand name from 3d coat |
06:08:20 | skrylar | but basically its what 3dcoat/substance/qixel do for those "magic" textures that just throw edge wear and stuff on models |
06:08:49 | skrylar | well, substance just does a pipeline of operations. 3d coat simplified it to a layer system with "conditions" like "more inside" or "more exposed" |
06:08:57 | skrylar | which basically just means more exposed = part of the AO map |
06:17:02 | * | miran quit (Ping timeout: 240 seconds) |
06:18:20 | * | Demos_ quit (Quit: Demos_) |
06:18:39 | * | Demos_ joined #nim |
06:26:41 | * | nsf joined #nim |
06:35:02 | * | endragor quit (Remote host closed the connection) |
06:35:40 | * | Vladar joined #nim |
06:37:21 | * | gokr joined #nim |
06:37:54 | * | Arrrr joined #nim |
06:37:54 | * | Arrrr quit (Changing host) |
06:37:54 | * | Arrrr joined #nim |
06:43:02 | * | PMunch joined #nim |
06:46:13 | FromGitter | <Grabli66> waitFor is evil :) It uses timeout 500 milliseconds. |
06:48:49 | FromGitter | <mohamedmoussa89> import math ⏎ echo 0.5^2Type mismatch?? |
06:49:35 | FromGitter | <mohamedmoussa89> But in math library I can find ' proc `^`T (x: T; y: Natural): T '. Whats going on? |
06:50:15 | FromGitter | <mohamedmoussa89> Gah need to learn how to format code properly |
06:50:58 | FromGitter | <mohamedmoussa89> Let me try again. I can see `proc `^`T (x: T; y: Natural): T` in the math library, but `0.5^2` gives me a type mismatch |
06:52:44 | * | yglukhov joined #nim |
06:54:40 | * | Demos_ quit (Quit: Demos_) |
06:54:59 | * | Demos_ joined #nim |
07:02:13 | Araq | works for me. wrong Nim version? |
07:02:20 | Araq | what does 'nim -v' say? |
07:10:49 | * | Demos_ quit (Quit: Demos_) |
07:11:05 | * | Demos_ joined #nim |
07:11:19 | FromGitter | <mohamedmoussa89> nim 0.17 |
07:14:09 | PMunch | It works for you Araq? |
07:14:20 | Araq | yes |
07:15:13 | FromGitter | <mohamedmoussa89> just took whatever binary was on the website |
07:15:20 | PMunch | http://ix.io/AQp/ |
07:15:25 | PMunch | That works for you? |
07:19:58 | PMunch | mohamedmoussa89, try with 0.5.pow(2) |
07:22:48 | PMunch | @mohamedmoussa89 ^ |
07:23:04 | * | sz0 joined #nim |
07:23:11 | PMunch | Is that how you higlight someone over the Gitter bridge? |
07:24:28 | * | claudiuinberlin joined #nim |
07:28:14 | * | PMunch_ joined #nim |
07:29:32 | * | PMunch quit (Disconnected by services) |
07:29:48 | * | PMunch_ is now known as PMunch |
07:30:18 | * | endragor joined #nim |
07:39:25 | FromGitter | <mohamedmoussa89> pow works |
07:39:52 | FromGitter | <mohamedmoussa89> Thats what Im using at the moment |
07:43:59 | Araq | PMunch: that is what works for me, yes. why wouldn't it work? |
07:44:32 | * | chaosdav quit (Ping timeout: 240 seconds) |
07:48:59 | * | Demos_ quit (Quit: Demos_) |
07:51:25 | * | Demos_ joined #nim |
07:55:47 | skrylar | https://imgur.com/a/I33Fg whee |
08:03:34 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:03:37 | * | Arrrr quit (Read error: Connection reset by peer) |
08:03:57 | skrylar | before the topic police go off, yes thats a nim program |
08:04:03 | skrylar | its painting distance field brushes |
08:11:27 | * | vlad1777d joined #nim |
08:12:07 | * | chaosdav joined #nim |
08:17:42 | skrylar | another +1 for distinct types |
08:22:03 | * | Demos_ quit (Quit: Demos_) |
08:22:22 | * | Demos_ joined #nim |
08:37:25 | PMunch | Araq, here it throws a type error saying that it can't do an "and" between a float and an int literal(1) |
08:38:48 | Araq | y is not a float |
08:42:04 | PMunch | lib/pure/math.nim(418, 11) Error: type mismatch: got (float64, int literal(1)) |
08:42:14 | PMunch | On 0.17.0 |
08:43:16 | * | Demos_ quit (Quit: Demos_) |
08:43:32 | * | Demos_ joined #nim |
08:47:55 | Araq | 0.17.2 has been released |
08:48:52 | * | claudiuinberlin joined #nim |
08:49:11 | PMunch | Oh yeah, this machine is not kept on the bleeding edge |
08:57:57 | FromGitter | <mohamedmoussa89> just tried again at home and it works fine in 0.17.2 - sorry about that. I have 0.17.0 installed on my work machine. |
09:03:16 | gokr | Hum. I just tested compressing the whole c_code tree from csources. It's unpacked about 370Mb. Using xz it's 26Mb. Using this lrzip thing it's ... 1.4Mb. |
09:03:20 | * | Demos_ quit (Quit: Demos_) |
09:03:36 | gokr | 1.4Mb - that's... insane. :) |
09:03:40 | * | Demos_ joined #nim |
09:03:58 | gokr | I had to unpack it just to see it actually is true. |
09:04:58 | skrylar | hrm. wonder if antialiasing is important when upsampling is involved |
09:05:12 | skrylar | i would guess 'no' because the valve paper doesn't do it |
09:06:43 | PMunch | gokr, thats actually pretty wild. 370Mb -> 1.4Mb |
09:07:04 | gokr | yeah! |
09:07:59 | skrylar | trzip? |
09:08:05 | gokr | lrzip |
09:08:20 | gokr | I stumbled on it here: https://unix.stackexchange.com/questions/78262/which-file-compression-software-for-linux-offers-the-highest-size-reduction |
09:08:48 | skrylar | looking at it on wikipedia |
09:08:58 | skrylar | i remember rad game tools has this cute thing, although they charge a pretty penny |
09:09:14 | skrylar | afaict they just ripped lz4 and use a fixed dictionary |
09:09:25 | gokr | I haven't played with niminst - but it would be slick if we could make "autoconf lookalikes" that sortof do the "./configure && make && make install" dance. |
09:10:06 | PMunch | There is a tool called nake |
09:10:17 | gokr | (distributing c code, just like csources) |
09:10:27 | PMunch | Oh |
09:10:29 | skrylar | gokr, ah. rzip is basically just doing what borg and others do; take the rsync algorithm and use it to dedup |
09:10:33 | skrylar | apparently |
09:10:35 | gokr | Well, the idea is to only use "Unix tools" so to speak. |
09:12:13 | Araq | I avoid ./configure fwiw, it's a big security problem |
09:12:48 | Araq | thousands of lines of cryptic shell script code that could send my $HOME's content to google |
09:13:24 | gokr | Yeah, I was more after a "configure lookalike". As in not generated by autoconf. |
09:14:00 | Araq | yay, but it cannot install device drivers, what a completely outdated concept of security... |
09:14:23 | gokr | It would just make a Makefile for proper CPU/arch typically. So... I presume Niminst already produce scripts that... kinda does this. |
09:14:43 | Araq | gokr: niminst indeed can also produce makefiles iirc |
09:14:49 | gokr | Aha, cool. |
09:15:41 | Araq | but it is not tested regularly and I don't want to maintain more ways of doing the same thing |
09:16:15 | gokr | Of course, it doesn't make your Nim program "Debian proper-ish" since they don't generally accept generated C code IIRC. But it would be a fairly neat distribution form. |
09:16:56 | gokr | I hear ya. You should focus on the important stuff |
09:17:43 | Araq | the current way: - makes updating easy |
09:17:52 | Araq | - doesn't require root rigths |
09:18:13 | gokr | Note - I am not talking about Nim itself. I like the way it works now. |
09:18:16 | Araq | - is well documented and works on a plethora of OSes |
09:18:28 | gokr | I am talking about something I write in Nim. |
09:18:43 | Araq | oh sorry |
09:18:44 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:18:49 | Araq | completely misunderstood you. |
09:19:26 | gokr | The idea being - here is a cool utility I wrote in Nim. "coolutil-1.2.tar.gz". Just do the dance. No need to install Nim. |
09:19:40 | Araq | I see, niminst was made for this indeed |
09:19:44 | gokr | Exact |
09:20:03 | gokr | I am going to look at it |
09:20:24 | Araq | note that the niminst nimble package is outdated and the one in $nim is used |
09:20:38 | Araq | but it's also more specific to Nim's needs, so ... not sure |
09:20:47 | gokr | gotcha |
09:20:52 | Araq | I suppose we should remove the nimble package again |
09:21:00 | Araq | sometimes splits don't work well |
09:21:30 | Araq | ./configure could just be empty I think :-) |
09:21:47 | gokr | Hehe, wouldn't it at least detect CPU/arch or something? |
09:22:10 | Araq | I think that's done in the generated makefile |
09:22:17 | gokr | Ah, ok, I will look at it. |
09:22:26 | * | libman quit (Quit: Connection closed for inactivity) |
09:23:04 | gokr | Btw, the arduinobot I am writing (MQTT, Jester, threadpool, Channels, calling out to run executables) runs great on an Rpi. |
09:23:33 | gokr | Nim is ... really nice! ;) |
09:24:32 | PMunch | Nice, what are you using it for? |
09:25:25 | gokr | It's a part we are doing in https://project.ecraft2learn.eu |
09:26:08 | gokr | The concept is simply to turn an Rpi into an "Arduino compiler and flasher". That can be operated over MQTT/REST. |
09:26:17 | PMunch | Oh cool |
09:26:26 | PMunch | Oh well, lunch time |
09:26:41 | gokr | So that kids can hack using Snap/Scratch and actaully partly also program Arduinos. |
09:28:17 | * | claudiuinberlin joined #nim |
09:29:14 | * | PMunch_ joined #nim |
09:31:45 | * | PMunch quit (Ping timeout: 248 seconds) |
09:37:31 | * | Demos_ quit (Quit: Demos_) |
09:37:47 | * | Demos_ joined #nim |
09:41:44 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:44:20 | * | AndChat20400 joined #nim |
09:46:28 | * | claudiuinberlin joined #nim |
09:48:35 | crem | With cdecl, all registers except eax, ecx and edx should be intact after a function call, right? |
09:55:48 | * | Demos_ quit (Quit: Demos_) |
09:56:04 | * | Demos_ joined #nim |
10:03:34 | FromGitter | <ephja> I think so |
10:03:43 | * | PMunch_ is now known as PMunch |
10:03:58 | skrylar | hm. |
10:04:10 | skrylar | well i did the things in the distance field paper, but i don't get the smooth edges they do |
10:04:21 | PMunch | gokr, wait is Scratch code Android compatible? |
10:04:57 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
10:05:12 | gokr | Ehm, Android? |
10:07:44 | gokr | The idea is to enhance Snap (reimplementation of Scratch) to also produce partly code for Arduinos. |
10:07:46 | PMunch | Err, Arduino |
10:08:24 | gokr | Yes, there are such enhancements already - though I havent looked yet at them. In fact... its funny, I know one of the guys that apparently makes this, huh. |
10:08:28 | gokr | http://snap4arduino.rocks |
10:08:31 | gokr | (for example) |
10:10:08 | PMunch | I guess it's similar to how microbit does it? |
10:11:06 | gokr | Seems to use firmata. |
10:18:08 | * | AndChat20400 quit (Ping timeout: 240 seconds) |
10:23:30 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
10:31:47 | * | Demos_ quit (Quit: Demos_) |
10:32:05 | * | Demos_ joined #nim |
10:32:49 | * | salewski joined #nim |
10:34:31 | salewski | I assume that Anonymous Procs can not be passed as typed parameters to macros? |
10:34:45 | salewski | I tried button.connect("clicked", proc (b: Button): void = echo "moo") |
10:35:12 | PMunch | Wouldn't that pass the entire thing as type? |
10:35:13 | salewski | That gives the funny error: lib/core/macros.nim(370, 3) Error: undeclared identifier: 'scs' |
10:35:15 | PMunch | typed* |
10:36:21 | salewski | PMunch: I really don't know. I just tried it as some people may like anon procs. |
10:36:58 | PMunch | Do you need to accept any proc into that spot? |
10:39:02 | salewski | Yes, the procs can have different parameter list, depending on signal name. |
10:39:30 | PMunch | Hmm |
10:40:00 | salewski | But well, no real problem for me. I think anon procs make sense only for toy apps. |
10:40:18 | PMunch | Well, with typed you will get an STMT that starts with a lambda |
10:40:33 | PMunch | I guess you would be able to make that work |
10:40:34 | salewski | Just for fun I tried this example https://github.com/StefanSalewski/gintro/blob/master/examples/button.nim |
10:40:50 | salewski | with use of an anon proc. |
10:41:32 | PMunch | And? |
10:41:37 | PMunch | It didn't work? |
10:42:25 | salewski | No, it gaves the lib/core/macros.nim(370, 3) Error: undeclared identifier: 'scs' |
10:42:36 | PMunch | https://play.nim-lang.org/?gist=b82044bda50ac6e451560362d4caaf42 |
10:42:38 | PMunch | Oh rgiht |
10:42:51 | salewski | No idea where scs come from. Not from my code. |
10:42:56 | PMunch | That's an example of getting in an untyped proc |
10:45:00 | salewski | https://github.com/StefanSalewski/gintro/blob/master/gintro/gimpl.nim |
10:45:37 | salewski | I have to pass the proc typed, as I investigate the proc parameter list i macro. |
10:46:13 | salewski | Well, for this general macro anonn procs seems not to work. |
10:47:07 | salewski | Maybe I can later add a simpler connect macro/template for toy cases. |
10:47:08 | FromGitter | <mohamedmoussa89> I expected both `proc` definitions here to be identical, but they are not. Am I misusing templates here? ⏎ ⏎ ```0 ⏎ 1``` [https://gitter.im/nim-lang/Nim?at=59d75f2bf7299e8f53b57865] |
10:47:58 | Araq | salewski: told you your 'connect' is wrong ;-) |
10:48:16 | * | Demos_ quit (Quit: Demos_) |
10:48:28 | salewski | Yes, but works fine for now! |
10:48:34 | * | Demos_ joined #nim |
10:48:41 | Araq | for a start get rid of the string literals, stringly typed code is not "extensible", it's ugly and error prone |
10:49:13 | PMunch | For the signal names? |
10:49:31 | salewski | Yes, I will convert it to AST API as you told me when I have some more free time. |
10:49:44 | Araq | PMunch: yes |
10:50:21 | Araq | mohamedmoussa89: I would expect it to work, but 'typedesc' is a clusterfuck in the compiler |
10:50:37 | salewski | GTK people expect string signal names! All wrappers of other languages I have seen use this notation! |
10:51:02 | salewski | Ruby, Python, many more. |
10:52:06 | salewski | J. Mansour who started the gobject-introspection coding used strings too! |
10:53:04 | PMunch | But why though? |
10:53:06 | salewski | When I learned GTK long time ago I wondered myself why string were used for signal names. |
10:53:17 | PMunch | In this case they could just as well by an enum couldn't they? |
10:53:36 | salewski | Maybe to allow easy extensions? |
10:54:09 | PMunch | To create your own custom signals to go across the GTK signals bus? |
10:54:27 | PMunch | Don't think I've ever seen anyone do that.. |
10:54:28 | salewski | When I would do all very different, then now one would know how to use it. |
10:54:45 | PMunch | Yeah, that's the issue with wrappers |
10:54:58 | PMunch | You normally want them to be close to the orgiinal so examples are easy to port |
10:55:51 | salewski | Yes, I have used Ruby GTK in the past, and I tried do do it similar. |
10:56:13 | PMunch | :q |
10:56:17 | PMunch | Woops |
10:56:24 | salewski | Ruby GTK was not bad, I think it was similar to Python GTK bindings. |
10:57:15 | * | couven92 joined #nim |
10:57:39 | salewski | From the user experience. Of course the glue code is very different. |
11:02:08 | Araq | it doesn't matter if all the others do it when it's wrong. |
11:02:14 | * | PMunch_ joined #nim |
11:02:21 | * | Snircle joined #nim |
11:03:37 | * | PMunch quit (Disconnected by services) |
11:03:45 | * | PMunch_ is now known as PMunch |
11:08:30 | * | claudiuinberlin joined #nim |
11:08:31 | salewski | Rust wrapper uses strings too: http://gtk-rs.org/ |
11:09:05 | FromGitter | <zacharycarter> Araq: did you see my gif from last night? |
11:09:12 | salewski | But I will ask on gtk mailing list for the reason, maybe someone can still remember :-) |
11:10:36 | salewski | Bye. |
11:12:26 | * | salewski quit (Quit: WeeChat 1.9.1) |
11:13:39 | FromGitter | <Bennyelg> @dom96 how to I point to some directory in my project to get static files such images, csss? |
11:13:45 | FromGitter | <Bennyelg> i tried: ⏎ http://localhost:5000/statics/forum_id1.png |
11:13:51 | FromGitter | <Bennyelg> but it's not reatchable |
11:16:27 | FromGitter | <zacharycarter> https://github.com/dom96/jester#static-files |
11:16:44 | FromGitter | <zacharycarter> @Bennyelg ^ |
11:18:47 | FromGitter | <Bennyelg> @zacharycarter Thanks |
11:18:54 | FromGitter | <Bennyelg> Looks amaizing |
11:19:51 | FromGitter | <Bennyelg> I cant share images here? |
11:20:20 | FromGitter | <couven92> @Bennyelg if you post a link to an image, in Gitter it will show up |
11:20:38 | couven92 | in IRC however, it will just show the link |
11:22:16 | crem | There's no nimbook version for kindle? |
11:26:04 | * | Demos_ quit (Quit: Demos_) |
11:26:09 | couven92 | Araq, does the Nim lexer/parser read the source code line-by-line? |
11:26:23 | * | Demos_ joined #nim |
11:27:27 | Araq | no. |
11:27:59 | Araq | it's a stream of bytes, premature splitting at newlines is harmful for most parsing needs |
11:28:16 | couven92 | oh? okay... |
11:29:03 | couven92 | I have a proprieatary grammar here... I was wondering of how to best deal with it... |
11:29:36 | FromGitter | <Bennyelg> I created Forums using jester & Nim |
11:29:42 | FromGitter | <Bennyelg> Looks pretty nice |
11:30:41 | FromGitter | <Bennyelg> Including migration service, pretty nice, still under heavy work but I'll publish it later |
11:34:31 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:39:44 | * | claudiuinberlin joined #nim |
11:49:21 | * | Trioxin joined #nim |
11:51:25 | FromGitter | <zacharycarter> grr I can't get opengl stencil buffer working to save my life |
11:59:31 | * | Demos_ quit (Quit: Demos_) |
11:59:50 | * | Demos_ joined #nim |
12:04:07 | skrylar | heh. |
12:04:16 | skrylar | i didn't have any luck with the signed distance field objects |
12:04:27 | skrylar | even compared it to some webgl code |
12:04:48 | skrylar | the odd thing is that version worked, so i guess its a broken distance field? |
12:06:18 | skrylar | tried being cheeky and pre-computing the distance field for a brush, then painting that on to pixels and trying to use the shader magic so if you zoomed in th brush would remain smooth; if it worked for tf2, it should work for brushes? but apparently not |
12:06:34 | skrylar | yet hardcoding a single SDF sphere works just fine |
12:07:09 | skrylar | guessing those weird adaptively sampled fields work because you can combine many spheres and they never leave the real-number space |
12:08:30 | * | dddddd joined #nim |
12:09:11 | FromGitter | <zacharycarter> I've gotten sdf to work for font rendering |
12:09:13 | FromGitter | <zacharycarter> but that's it |
12:13:39 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59d77373b59d55b8237da584] |
12:13:43 | FromGitter | <zacharycarter> why do I see the stupid rectangle???? |
12:14:10 | FromGitter | <zacharycarter> yes depth test and stencil testing are enabled |
12:14:16 | FromGitter | <zacharycarter> I set sdl create stencil buffer size to 8 bits |
12:14:39 | skrylar | this may sound silly but have you set the stencil clear value |
12:15:00 | skrylar | i know with the depth and color buffers you have to set those |
12:15:11 | FromGitter | <zacharycarter> yeah I clear it before I do any of that |
12:15:59 | FromGitter | <zacharycarter> good question not silly |
12:16:17 | skrylar | https://www.talisman.org/opengl-1.1/Reference/glClearStencil.html ? |
12:16:35 | skrylar | you haven't set the stencil value in your snippet |
12:16:45 | FromGitter | <zacharycarter> that looks super old |
12:16:47 | skrylar | you cleared it but not told it what to clear it to |
12:17:28 | skrylar | its also in the android docs for GLES1 and GLES2 |
12:18:23 | FromGitter | <zacharycarter> hrm - tried that still not working |
12:18:57 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59d774b0177fb9fe7e47199e] |
12:20:21 | * | Demos_ quit (Quit: Demos_) |
12:20:41 | * | Demos_ joined #nim |
12:21:03 | skrylar | unfortunately i haven't really used the stencil buffer, so i can only guess that it's configured backwards or something silly like that |
12:21:24 | FromGitter | <zacharycarter> yeah :/ |
12:21:28 | FromGitter | <zacharycarter> this is going to drive me bonkers |
12:21:37 | FromGitter | <zacharycarter> I need a good place to ask for opengl help |
12:21:49 | FromGitter | <zacharycarter> or maybe krux02 |
12:22:20 | skrylar | gamedev forums used to be a good place for it |
12:22:38 | FromGitter | <zacharycarter> I'm hoping for something more interactive and speedy :P but I may have to resort to that |
12:22:51 | skrylar | i seem to have butchered this code to the point where there are black spots around the brushes |
12:30:06 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:34:13 | FromGitter | <zacharycarter> when I try to call - glGetIntegerv(GL_STENCIL_BITS, addr stencilBits) I get a INVALID_ENUM error :O |
12:37:02 | FromGitter | <zacharycarter> ah that's old |
12:37:05 | FromGitter | <Yardanico> Is there a way to create an iterator-like async proc to use it like this: ⏎ "for event in listen(): do stuff" where "listen" can do async stuff (with await or yield) |
12:37:08 | FromGitter | <Yardanico> ? |
12:37:21 | * | claudiuinberlin joined #nim |
12:40:46 | * | Demos_ quit (Quit: Demos_) |
12:41:02 | * | Demos_ joined #nim |
12:44:46 | * | ShalokShalom_ joined #nim |
12:47:32 | * | ShalokShalom quit (Ping timeout: 240 seconds) |
12:49:05 | * | Demos_ quit (Quit: Demos_) |
12:49:24 | * | Demos_ joined #nim |
12:51:11 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:53:14 | * | Ven`` quit (Quit: q+) |
12:55:02 | * | claudiuinberlin joined #nim |
12:57:39 | * | Jesin quit (Quit: Leaving) |
13:02:21 | * | relax joined #nim |
13:06:06 | * | Ven`` joined #nim |
13:12:41 | FromGitter | <exts> How come this code example is the introduction to ref/pointers in nim? https://nim-lang.org/docs/tut1.html#advanced-types-reference-and-pointer-types it's trying to use objects as an example before actually introducing the user to objects. which actually happens at the start of part 2. |
13:13:59 | * | Arrrr joined #nim |
13:13:59 | * | Arrrr quit (Changing host) |
13:13:59 | * | Arrrr joined #nim |
13:14:33 | * | Demos_ quit (Quit: Demos_) |
13:14:40 | * | PMunch quit (Read error: Connection reset by peer) |
13:14:48 | * | PMunch joined #nim |
13:14:49 | * | Demos_ joined #nim |
13:14:55 | * | Demos_ quit (Client Quit) |
13:15:14 | * | Demos_ joined #nim |
13:26:10 | gokr | If I just need to share a string or two between threads, what's the most lightweight solution? A sharedtable using manually allocated things? Using some lock? |
13:36:04 | * | relax quit (Ping timeout: 255 seconds) |
13:39:23 | Araq | exts: good point, this needs to be fixed. |
13:39:42 | Araq | gokr: protect/dispose the string |
13:40:12 | gokr | ehm |
13:44:02 | euantor | gokr: https://nim-lang.org/docs/system.html#protect,pointer |
13:44:12 | gokr | oki |
13:51:04 | * | jivank_ joined #nim |
13:54:04 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:54:18 | FromGitter | <exts> glad I could help :) |
13:54:21 | * | claudiuinberlin joined #nim |
14:00:16 | * | libman joined #nim |
14:00:44 | * | PMunch_ joined #nim |
14:01:01 | * | kier quit (Ping timeout: 240 seconds) |
14:01:06 | * | PMunch quit (Disconnected by services) |
14:01:12 | * | PMunch_ is now known as PMunch |
14:03:57 | * | endragor quit (Remote host closed the connection) |
14:03:58 | libman | Re earlier discussion: last I checked, PPM blows xz out of the water when it comes to text compression. |
14:08:53 | * | Demos_ quit (Quit: Demos_) |
14:09:08 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:09:12 | * | Demos_ joined #nim |
14:09:25 | * | claudiuinberlin joined #nim |
14:09:44 | * | Arrrr quit (Ping timeout: 258 seconds) |
14:09:49 | PMunch | Araq, in Karax how often is the renderer callback called? |
14:10:09 | * | Arrrr joined #nim |
14:10:09 | * | Arrrr quit (Changing host) |
14:10:09 | * | Arrrr joined #nim |
14:10:33 | Araq | PMunch: after every event, more or less |
14:10:51 | PMunch | Aah ok :) |
14:11:29 | PMunch | That's what I assumed |
14:13:30 | * | kier joined #nim |
14:15:58 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:16:15 | * | claudiuinberlin joined #nim |
14:17:30 | * | claudiuinberlin quit (Client Quit) |
14:19:23 | * | claudiuinberlin joined #nim |
14:19:55 | FromGitter | <ephja> @zacharycarter what's zgl? |
14:20:47 | FromGitter | <ephja> are you checking for errors after every call? |
14:23:42 | FromGitter | <Bennyelg> https://imgur.com/a/WmkDW |
14:24:06 | FromGitter | <Bennyelg> simple forums system using nim+jester ⏎ https://imgur.com/a/WmkDW :D |
14:24:20 | skrylar | hrmmh. awesomebump is using gl 330 |
14:24:28 | * | endragor joined #nim |
14:24:37 | skrylar | there is little reason to use that version for what they do, but shrug |
14:24:42 | * | PMunch quit (Quit: Leaving) |
14:25:40 | * | Jesin joined #nim |
14:25:44 | * | Demos_ quit (Quit: Demos_) |
14:27:08 | FromGitter | <zacharycarter> epjha I am |
14:27:12 | FromGitter | <zacharycarter> zgl is my opengl wrapper |
14:28:12 | * | Demos_ joined #nim |
14:29:10 | * | endragor quit (Ping timeout: 255 seconds) |
14:30:37 | * | TjYoco joined #nim |
14:31:14 | skrylar | hm |
14:32:01 | skrylar | i guess everyone just does interior vision checks with portals these days |
14:32:40 | skrylar | i was just pondering about the raymarching stuff and if you could use it to more efficiently make those vision trees by just tossing a ball in each 'cell' and have them throw a handful of traces out |
14:33:02 | skrylar | instead of having every face try to trace every other face |
14:33:21 | skrylar | shrug. sleep needed probs |
14:34:01 | * | vlad1777d quit (Remote host closed the connection) |
14:34:48 | * | vivus joined #nim |
14:41:28 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:42:41 | * | sz0 quit (Quit: Connection closed for inactivity) |
14:45:41 | * | francisl joined #nim |
14:51:23 | FromGitter | <genotrance> @zacharycarter - nice work with https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f, looks like it needs more work |
14:52:05 | * | francisl quit (Quit: francisl) |
14:53:38 | FromGitter | <zacharycarter> it does |
14:53:39 | FromGitter | <zacharycarter> I enver finished it |
14:53:52 | FromGitter | <zacharycarter> never* |
14:53:53 | FromGitter | <zacharycarter> I guess I should |
14:56:54 | FromGitter | <zacharycarter> ugh I really need to figure out this stencil buffer issue it's driving me up the wall |
14:57:35 | * | claudiuinberlin joined #nim |
15:00:59 | * | endragor joined #nim |
15:01:31 | * | elrood joined #nim |
15:01:55 | * | claudiuinberlin quit (Client Quit) |
15:02:12 | * | claudiuinberlin joined #nim |
15:03:10 | * | Demos_ quit (Quit: Demos_) |
15:03:28 | * | claudiuinberlin quit (Client Quit) |
15:03:29 | * | Demos_ joined #nim |
15:05:18 | FromGitter | <ephja> looks good |
15:05:23 | * | endragor quit (Ping timeout: 246 seconds) |
15:06:56 | * | relax joined #nim |
15:12:21 | * | claudiuinberlin joined #nim |
15:14:07 | * | skrylar quit (Remote host closed the connection) |
15:14:16 | FromGitter | <zacharycarter> @here has anyone ever tested stencil buffer with sdl2 / opengl bindings and Nim |
15:14:23 | FromGitter | <zacharycarter> I don't see any code on github testing this - I'm wondering if it's working at all |
15:15:35 | * | francisl joined #nim |
15:16:00 | FromGitter | <genotrance> @zacharycarter - most wrapping examples for Nim are to bind with the shared lib, that makes sense most of the time. But I'm interested in building libs in statically so that there's no external dependencies. |
15:16:35 | * | relax quit (Ping timeout: 240 seconds) |
15:16:42 | FromGitter | <zacharycarter> I could add a section for that to the guilde |
15:16:48 | FromGitter | <zacharycarter> it's relatively simple with dynlibOverride |
15:19:37 | * | francisl quit (Client Quit) |
15:21:26 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:25:04 | * | claudiuinberlin joined #nim |
15:25:55 | * | Trustable joined #nim |
15:27:09 | FromGitter | <genotrance> thanks |
15:27:58 | * | smt joined #nim |
15:28:34 | * | Jesin quit (Quit: Leaving) |
15:36:52 | * | endragor joined #nim |
15:36:58 | * | Demos_ quit (Quit: Demos_) |
15:37:16 | * | Demos_ joined #nim |
15:40:08 | * | Jesin joined #nim |
15:40:45 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:41:21 | * | endragor quit (Ping timeout: 248 seconds) |
15:41:22 | * | yglukhov quit (Remote host closed the connection) |
15:45:27 | FromGitter | <zacharycarter> okay finally got stencil buffers to work sweet |
15:48:15 | * | claudiuinberlin joined #nim |
15:52:24 | * | claudiuinberlin quit (Client Quit) |
15:56:28 | FromGitter | <mratsim> In devel, this `include ./tensors/test_init.nim` is understood as this `include ./tensors/test_init/nim` is that intended? |
15:57:28 | * | Demos_ quit (Quit: Demos_) |
15:57:46 | * | Demos_ joined #nim |
15:58:54 | * | claudiuinberlin joined #nim |
15:59:38 | Araq | mratsim: yes but IMO dots should be deprecated |
15:59:58 | Araq | to get the interpretation you're after use quotes |
16:00:38 | FromGitter | <mratsim> no problem, it was actually unintended on my part and was left for months |
16:01:41 | * | claudiuinberlin quit (Client Quit) |
16:02:38 | FromGitter | <mratsim> btw, edubart reworked the whole iterators/closures stuff in Arraymancer and we gained x4 speed so iterators issues are not the most important anymore. |
16:02:43 | * | claudiuinberlin joined #nim |
16:03:47 | FromGitter | <mratsim> The next issue for which we have no workaround at all would be “assignment overloading” so I can implement value semantics for GPU arrays, but with optimized “move” operations https://github.com/nim-lang/Nim/issues/6348 |
16:12:26 | * | endragor joined #nim |
16:14:53 | * | smt` joined #nim |
16:15:14 | * | smt` quit (Remote host closed the connection) |
16:16:12 | FromGitter | <Varriount> Araq: What's the solution to the problem outlined in https://forum.nim-lang.org/t/3207#20288 ? |
16:17:03 | * | endragor quit (Ping timeout: 248 seconds) |
16:18:02 | Araq | Use different names for different modules. I don't see a problem here. |
16:18:09 | * | smt quit (Ping timeout: 258 seconds) |
16:18:13 | * | Demos_ quit (Quit: Demos_) |
16:18:24 | Araq | they only have to be unique per Nimble package |
16:18:32 | * | Demos_ joined #nim |
16:19:04 | Araq | "I want to follow the directory structure of Python networkx." yes and I don't want you to follow Python's structure. |
16:20:03 | Araq | these names are essentially impossible to talk about ... "open file simple.nim -- no, not that one, the one in "shortest_paths"" |
16:28:02 | * | Demos_ quit (Ping timeout: 260 seconds) |
16:28:23 | * | Demos_ joined #nim |
16:31:21 | * | couven92 quit (Quit: Client disconnecting) |
16:32:13 | * | Jesin quit (Quit: Leaving) |
16:32:39 | * | Demos_ quit (Client Quit) |
16:32:55 | * | Demos_ joined #nim |
16:37:41 | dom96 | Damn. The NimData package is pretty freaking awesome. Nice job @bluenote10 :) |
16:39:31 | * | salewski joined #nim |
16:41:40 | salewski | Araq, there are some reasons for why strings are used for signal identifier. Extensible is indeed one: |
16:41:44 | salewski | https://mail.gnome.org/archives/gtk-list/2017-October/msg00014.html |
16:41:46 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
16:42:15 | salewski | Maybe later I will implement another better interface. Bye. |
16:42:46 | * | Demos_ quit (Quit: Demos_) |
16:43:44 | * | nsf quit (Quit: WeeChat 1.9) |
16:45:23 | * | salewski quit (Quit: WeeChat 1.9.1) |
16:50:50 | * | miran joined #nim |
16:51:22 | * | TjYoco quit (Ping timeout: 260 seconds) |
16:55:31 | FromGitter | <alehander42> is there a way to stop nim from initializing with zeroes my arrays? |
16:55:43 | FromGitter | <alehander42> unchecked doesn't do this too |
16:59:12 | FromGitter | <edubart> @alehander42 for static array you can use `var myarray {.noInit.}: array[10, int]` |
17:06:36 | * | couven92 joined #nim |
17:15:05 | * | Arrrr quit (Ping timeout: 240 seconds) |
17:16:15 | * | francisl joined #nim |
17:18:52 | * | Sembei joined #nim |
17:20:06 | * | francisl quit (Client Quit) |
17:20:38 | * | Pisuke quit (Ping timeout: 258 seconds) |
17:21:30 | * | Arrrr joined #nim |
17:21:30 | * | Arrrr quit (Changing host) |
17:21:30 | * | Arrrr joined #nim |
17:26:44 | * | Demos_ joined #nim |
17:28:16 | FromGitter | <alehander42> thanks ! |
17:31:29 | * | Demos_ quit (Client Quit) |
17:36:36 | * | ipjk joined #nim |
17:40:17 | * | PMunch joined #nim |
17:42:55 | * | endragor joined #nim |
17:44:56 | * | zachk joined #nim |
17:46:56 | * | francisl joined #nim |
17:47:46 | * | Jesin joined #nim |
17:47:59 | * | endragor quit (Ping timeout: 255 seconds) |
17:49:48 | * | Jesin quit (Max SendQ exceeded) |
17:50:13 | * | Jesin joined #nim |
17:52:27 | * | ShalokShalom_ is now known as ShalokShalom |
17:58:16 | * | Jesin quit (Quit: Leaving) |
18:04:33 | FromGitter | <genotrance> @Varriount thanks to your input, I'm able to handle those function pointers |
18:07:15 | * | claudiuinberlin joined #nim |
18:14:03 | * | Jesin joined #nim |
18:19:53 | * | endragor joined #nim |
18:20:51 | PMunch | Hmm, it's really annoying that you can't have a type that reuses the same name for two types of the same kind.. |
18:21:02 | * | Demos joined #nim |
18:24:01 | * | endragor quit (Ping timeout: 240 seconds) |
18:26:03 | FromGitter | <Yardanico> wat? |
18:26:33 | PMunch | Yardanico, when using kind. |
18:26:36 | PMunch | Hold os |
18:26:51 | PMunch | http://ix.io/AS6 |
18:26:56 | PMunch | That's what I was trying to do |
18:27:48 | FromGitter | <Yardanico> ah |
18:27:52 | FromGitter | <Yardanico> I know, yeah |
18:28:01 | * | MyMind joined #nim |
18:28:11 | FromGitter | <Yardanico> but as always I think this would be hard to implement in the compiler :P |
18:28:58 | PMunch | Probably yeah.. |
18:29:34 | PMunch | I guess I could implement it as three objects inheriting from an empty base class |
18:29:55 | * | Sembei quit (Ping timeout: 255 seconds) |
18:30:02 | PMunch | Would that work? |
18:31:32 | FromGitter | <Yardanico> yeah, but do you really need this ? :) it's actually not that hard to use different field names :) |
18:32:22 | PMunch | It's just a bit annoying |
18:32:39 | PMunch | Seeing how the "edit" and "show" kinds are basically the same |
18:33:05 | PMunch | It's only the call which is completely different |
18:33:23 | FromGitter | <Yardanico> btw |
18:33:32 | FromGitter | <Yardanico> you don't need separate fields for NimNode |
18:33:49 | FromGitter | <Yardanico> you can just store kind here as a third field |
18:34:01 | FromGitter | <Yardanico> are you doing some GUI framework? |
18:34:03 | PMunch | ? |
18:34:15 | PMunch | Not quite sure what you mean |
18:34:26 | FromGitter | <Yardanico> you have NimNode here http://ix.io/AS6 |
18:34:27 | PMunch | And yeah, I'm dabbling with an idea for a GUI framework |
18:34:40 | FromGitter | <Yardanico> so you can just store 3 fields |
18:35:14 | FromGitter | <Yardanico> sorry, 4 fields ⏎ kind: UIKind ⏎ variableType: NimNode ⏎ variableSym: NimNode ⏎ callback: NimNode [https://gitter.im/nim-lang/Nim?at=59d7cce2210ac26920b63fbd] |
18:35:18 | PMunch | And just null the ones I don't need? |
18:35:23 | FromGitter | <Yardanico> yeah |
18:35:38 | PMunch | Yeah I guess that's one approach |
18:35:43 | FromGitter | <Yardanico> however this trick wouldn't work with some actual types like "int" :) |
18:36:05 | PMunch | That's true, but the logic would be the same |
18:36:24 | PMunch | "Don't access field Y when kind == X" |
18:36:29 | * | Jesin quit (Quit: Leaving) |
18:36:42 | PMunch | Which is explicitly not allowed when using the "case kind" trick |
18:36:50 | PMunch | As the compiler will complain |
18:37:41 | FromGitter | <Yardanico> well yeah that would be a very cool feature for object variants |
18:39:19 | * | francisl quit (Quit: francisl) |
18:40:10 | * | francisl joined #nim |
18:46:31 | * | Demos quit (Quit: Demos) |
18:46:47 | * | Demos joined #nim |
18:47:57 | dom96 | Well that's disappointing :\ https://github.com/bluenote10/NimData/issues/21 |
18:48:05 | dom96 | Anyone got any dataframe packages that would let me do this? |
18:48:29 | FromGitter | <Yardanico> are you sure it can't be implemented? |
18:48:43 | dom96 | it probably can |
18:48:49 | dom96 | But it requires far too much macro magic |
18:51:32 | * | nsf joined #nim |
18:51:42 | FromGitter | <Yardanico> ehm wait |
18:52:28 | FromGitter | <Yardanico> it has "mean", but this is not what you want, right? |
18:52:41 | FromGitter | <Yardanico> well |
18:52:55 | FromGitter | <Yardanico> you can just sum all values in each column |
18:53:16 | dom96 | it is... |
18:53:34 | dom96 | I want it done for each column though |
18:54:26 | FromGitter | <Yardanico> then you can do that I think |
18:54:30 | FromGitter | <Yardanico> https://github.com/bluenote10/NimData/blob/master/examples/example_01.nim#L34 |
18:54:33 | dom96 | I can do it for a single column fine, but doing it for all of them isn't easy |
18:54:36 | FromGitter | <Yardanico> so if you define a schema |
18:55:05 | * | Vladar quit (Quit: Leaving) |
18:55:38 | FromGitter | <Yardanico> ah, you want to get a single row, hmm |
18:55:43 | FromGitter | <Yardanico> why not try parsecsv ? :P |
18:55:53 | dom96 | because that sucks |
18:55:58 | dom96 | I'll need to reimplement all these operations |
18:56:13 | dom96 | I might be able to somehow get each of the fields inside the tuple generates by the schema |
18:56:19 | dom96 | *generated |
18:56:56 | dom96 | or I could copy and paste 30 of `let mean = df.map(item => item[i]).mean()`... :) |
18:57:02 | dom96 | replacing `i` with the number |
18:57:29 | FromGitter | <Yardanico> for x in 0..30 ? :) |
18:57:31 | dom96 | hrm, thinking about it another way, is there an easy way to iterate from 0 .. 30 at compile time? |
18:57:42 | FromGitter | <Yardanico> ah, you mean generate 30 variables? |
18:57:50 | dom96 | sort of |
18:58:09 | dom96 | Nim complains about `i` not being available at compile-time if I use a for loop |
18:58:39 | FromGitter | <Yardanico> simple macro probably, you can't generate variables with just "for" loop |
18:59:08 | dom96 | So much magic D: |
18:59:25 | dom96 | This is for a Uni assignment, my lecturer will freak out lol |
18:59:53 | Araq | put the for loop into a 'static'? |
19:00:15 | dom96 | tried that |
19:00:17 | dom96 | doesn't change a thing |
19:00:27 | FromGitter | <Yardanico> well he wants to generate the code to run at run-time AFAIK |
19:00:31 | * | couven92 quit (Ping timeout: 240 seconds) |
19:00:42 | FromGitter | <Yardanico> these "map" are macros it seems |
19:02:18 | dom96 | The annoying thing here is that NimData uses tuples to model rows |
19:02:38 | dom96 | Which makes it type safe but handling these numbers is a PITA |
19:06:07 | * | gangstacat quit (Quit: Ĝis!) |
19:09:46 | * | gangstacat joined #nim |
19:09:51 | * | Demos quit (Ping timeout: 248 seconds) |
19:11:12 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
19:20:24 | * | endragor joined #nim |
19:24:49 | * | endragor quit (Ping timeout: 248 seconds) |
19:31:25 | * | ofelas joined #nim |
19:32:28 | FromGitter | <zacharycarter> I'm slowly getting there with unit selection... |
19:32:30 | FromGitter | <zacharycarter> (https://files.gitter.im/nim-lang/Nim/fLpw/Screen-Shot-2017-10-06-at-3.32.05-PM.png) |
19:32:33 | FromGitter | <zacharycarter> gaussian blur shaders are a pain |
19:34:43 | * | miran quit (Ping timeout: 255 seconds) |
19:36:24 | * | Demos joined #nim |
19:43:01 | * | Demos quit (Ping timeout: 240 seconds) |
19:43:16 | * | Arrrr quit (Read error: Connection reset by peer) |
19:46:28 | * | Snircle joined #nim |
19:48:40 | * | vlad1777d joined #nim |
19:48:45 | FromGitter | <genotrance> is it possible to call a function whose name is stored in a string - like Python eval |
19:51:18 | * | ipjk quit (Read error: Connection reset by peer) |
19:53:41 | * | nsf quit (Quit: WeeChat 1.9) |
20:00:29 | * | endragor joined #nim |
20:05:21 | * | endragor quit (Ping timeout: 248 seconds) |
20:06:28 | libman | genotrance: like Table[string,(proc(blah))] ? |
20:06:43 | * | endragor joined #nim |
20:11:05 | * | endragor quit (Ping timeout: 240 seconds) |
20:17:07 | * | endragor joined #nim |
20:17:07 | * | endragor quit (Remote host closed the connection) |
20:18:22 | * | endragor joined #nim |
20:18:33 | FromGitter | <genotrance> I found that thread on the forums, will need to see how to implement it |
20:22:07 | FromGitter | <genotrance> would be cool if the compiler built this table at startup by default, but ya |
20:22:16 | * | TjYoco joined #nim |
20:37:43 | FromGitter | <Yardanico> Yes, you can do that |
20:40:06 | FromGitter | <Yardanico> It's implemented as easy as you would expect :) |
20:41:14 | FromGitter | <adamrezich> how do you check which compiler backend is set as the default? |
20:43:59 | FromGitter | <adamrezich> oh is it `cc = gcc` in nim/config/nim.cfg? |
20:44:08 | FromGitter | <Yardanico> @genotrance https://tio.run/##PYo7CsAgEAX7PcVipZArpM8B0onFRiQuxA8qyfGNQkj15g0TOfTOIafSsNFxuQoANxUkXDG6Z59O11Y4ngvmkqxURiqAieNzbBtLNWJnfULhWQCQnmuG/IJfSdX7Cw |
20:45:12 | FromGitter | <Yardanico> I didn't use playground because I'm from the phone :) |
20:45:43 | FromGitter | <genotrance> @Yardanico wow thanks! I thought it had to be done at compile time, guess not |
20:47:02 | FromGitter | <Yardanico> Btw proc is implicitly converted to a closure here |
20:47:41 | * | Ven joined #nim |
20:48:06 | * | Ven is now known as Guest1102 |
20:49:42 | * | solitudesf joined #nim |
20:50:11 | FromGitter | <Bennyelg> any sample of ` put ` in jester |
20:56:53 | FromGitter | <Bennyelg> I have A post / put which send a json |
20:58:52 | * | endragor quit (Remote host closed the connection) |
20:59:25 | * | endragor joined #nim |
21:03:49 | * | endragor quit (Ping timeout: 255 seconds) |
21:06:31 | * | TjYoco quit (Quit: Leaving) |
21:09:08 | * | elrood quit (Quit: Leaving) |
21:11:01 | * | solitudesf quit (Ping timeout: 240 seconds) |
21:23:28 | * | nsf joined #nim |
21:30:00 | * | manjaro-kde5- quit (Remote host closed the connection) |
21:30:15 | * | Trustable quit (Remote host closed the connection) |
21:34:31 | * | francisl quit (Quit: francisl) |
21:45:57 | * | ofelas quit (Quit: shutdown -h now) |
21:52:17 | * | Demos_ joined #nim |
21:54:40 | * | Demos_ quit (Client Quit) |
21:54:54 | * | yglukhov joined #nim |
21:55:01 | * | gokr quit (Ping timeout: 240 seconds) |
21:55:08 | * | yglukhov quit (Remote host closed the connection) |
21:55:24 | * | yglukhov joined #nim |
21:57:23 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
22:03:44 | * | Guest1102 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:06:48 | dom96 | Damn, my stock notifier just gave me a notification. And... it was Amazon deciding to check if my app is a robot :) |
22:14:46 | * | JappleAck joined #nim |
22:15:08 | JappleAck | hey guys, what would be a right way to write a message to stderr? |
22:22:00 | JappleAck | i think i just realized it, it would be `write stderr, "blabla\n"`, pretty intuitive |
22:22:20 | JappleAck | just looking at the sources https://github.com/nim-lang/Nim/blob/master/lib/system.nim#L2878 |
22:23:02 | JappleAck | i see also `writeLine` that i should prefer in my case |
22:51:17 | * | def-pri-pub joined #nim |
22:51:57 | dom96 | JappleAck: You can also write: stderr.write("blabla\n") |
22:54:07 | JappleAck | cool |
22:59:31 | JappleAck | dom96, is this declared explicitly for oop-style or it's just by default `foo.bar x` interpreted as `bar foo x`? |
23:06:45 | dom96 | the latter |
23:06:58 | dom96 | foo(x) is equivalent to x.foo() |
23:07:00 | dom96 | good night |
23:07:14 | JappleAck | dom96, thanks, good night |
23:30:50 | * | zachk quit (Quit: zzz) |
23:37:21 | * | JappleAck quit (Quit: Leaving) |
23:39:38 | * | nsf quit (Quit: WeeChat 1.9) |
23:47:40 | * | couven92 joined #nim |
23:52:05 | * | couven92 quit (Ping timeout: 240 seconds) |