00:48:09 | nohusuro | Is there a way in nim to get a Process reference by pid? |
00:50:08 | FromGitter | <ftsf> skyrylar i made one i can share with you |
00:52:06 | * | arnetheduck_ joined #nim |
00:52:06 | * | arnetheduck quit (Read error: Connection reset by peer) |
00:55:10 | * | couven92 quit (Quit: Client Disconnecting) |
01:00:56 | * | skrylar joined #nim |
01:01:02 | skrylar | welp. compilers crazy |
01:01:50 | skrylar | if you have something like proc thing(func: callback) it will tell you that it expected '(', instead of either A) using that as a parameter name or B) noticing the parse is entirely wrong and saying such |
01:03:17 | FromGitter | <zacharycarter> ftsf: are you putting conditional logic into nico to tell when things are running under the js compiler? Or are you going to have a totally separate codebase for JS? I'm kind of leaning towards the latter with FRAG atm |
01:03:41 | FromGitter | <zacharycarter> skrylar: mind putting up a snippet / glot.io ? |
01:06:06 | skrylar | @zacharycarter https://glot.io/snippets/epwa37n44q |
01:07:28 | FromGitter | <zacharycarter> ah I see what you mean |
01:07:38 | FromGitter | <zacharycarter> didn't know func was a reserved keyword |
01:10:31 | skrylar | i think it used to mean something in ages past |
01:10:45 | FromGitter | <zacharycarter> probably |
01:11:10 | skrylar | well old nim{rod} used to be pretty pascal-y so i think func returned values and proc didn't, but i might just be inventing stories now |
01:11:27 | FromGitter | <zacharycarter> ahh okay that makes sense |
01:11:43 | FromGitter | <zacharycarter> I'm glad that's no longer the case :P |
01:12:05 | skrylar | ah no. func is reserved for sugar |
01:12:16 | skrylar | its listed under the noSideEffect pragma |
01:12:35 | FromGitter | <zacharycarter> ah okay |
01:16:08 | FromGitter | <zacharycarter> @dom96: I'm going to try to reserve some time for play.nim-lang.org this weekend and add snippets etc |
01:17:26 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
01:19:49 | * | chemist69 quit (Ping timeout: 246 seconds) |
01:44:40 | skrylar | you know, i've had some ponderings about those immediate mode guis people seem to like |
01:45:02 | skrylar | i think people just like them because they *look* like there's less boilerplate |
01:45:08 | skrylar | you could probably do the same thing with just macros |
01:45:26 | skrylar | but have it create a scene graph with callbacks instead |
01:45:41 | skrylar | so people got their pretty if(button("stuff")){clicky} |
01:47:32 | ftsf | skrylar, https://github.com/ftsf/nimsynth/tree/master/src/jack is what i use for jack |
01:47:38 | ftsf | feel free to copy it |
01:48:17 | ftsf | zacharycarter, currently it's a separate codebase, but i want to split it to a lower level codebase with all platform specific stuff and then a higher level interface which is common |
01:52:59 | skrylar | ftsf, but i already hand-ported 70% of it .-. |
01:53:36 | skrylar | ah cute pixel art tho |
01:53:38 | ftsf | skrylar, ahh |
01:54:08 | skrylar | i have part of a sequencer written in straight c with EFL |
01:54:23 | ftsf | EFL? |
01:54:25 | skrylar | earlier today got it to where it will do forward stepping |
01:54:28 | skrylar | enlightenment foundation libraries |
01:54:52 | skrylar | https://www.enlightenment.org/ |
01:55:16 | skrylar | they're interesting. got a bunch of sponsorships from the embedded community because its all super light |
02:01:06 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:06:41 | skrylar | ftsf, the most difficult think about building a sequencer so far (unless you've gotten this far a nd already know :X) is making sure to store notes in like, a sorted array |
02:07:42 | ftsf | skrylar, i use a grid sequencer |
02:07:59 | skrylar | the drummachine kind? |
02:08:05 | ftsf | the tracker kind |
02:08:08 | skrylar | ah. |
02:08:22 | skrylar | i tried to get in to those. couldn't mentate the letters to sound in my head |
02:08:38 | skrylar | yeah your job is a lot easier with a tracker |
02:08:48 | skrylar | unless you go tickless. some people have |
02:10:10 | * | rauss joined #nim |
02:10:11 | skrylar | i have an array that stores the 'notes' and those have pointers to the note on and note off events, and all events get sorted on insertion to a big list of pattern events, so it always has the ability to iterate forward to the next immediate midi event and then calculate the offsets in JACK. 'cause JACK just calls you and says i need this many samples worth of data, so some midi notes might be off by a few samples |
02:10:32 | skrylar | it doesn't perfectly step from one tick to another |
02:10:43 | skrylar | it steps at whatever the user set the buffer size to :b |
02:17:43 | * | chemist69 joined #nim |
02:43:10 | * | yglukhov joined #nim |
02:48:45 | * | yglukhov quit (Ping timeout: 272 seconds) |
02:49:53 | * | def-pri-pub joined #nim |
03:11:09 | ftsf | dom96, does choosenim have an update mechanism? |
03:11:13 | ftsf | (for itself rather than nim) |
03:32:35 | ftsf | hmm deadCodeElim:off seems broken, when using it I sometimes get undefined references when linking. |
03:46:13 | * | def-pri-pub quit (Quit: leaving) |
04:00:50 | * | rauss quit (Quit: WeeChat 1.7.1) |
04:29:23 | * | BennyElg quit (Remote host closed the connection) |
04:34:42 | skrylar | hrmmm. |
04:35:04 | skrylar | on one hand i kinda want to play with nanovg. on the other hand rendering vectors to polygon 20+ times per second seems incredibly wasteful |
04:36:11 | ftsf | if it works then who cares? =) |
04:36:22 | skrylar | i have idiosynchricies that need managing :3 |
04:36:45 | skrylar | although i could just do what Godot does and only re-bake the geometry if something on the screen changes |
04:38:11 | skrylar | in the case of music software it sorta is eeh. i mean if you can offload the UX stuff to GPU, then you can just do some really basic dirty bit checks and that does free the CPU up for more plugins |
04:39:13 | ftsf | make it first, then optimise |
04:39:24 | ftsf | if you need to |
04:40:42 | skrylar | heh. i have one that sorta works right now |
04:40:47 | skrylar | its bitmap graphics tho |
04:41:02 | ftsf | mine too :3 |
04:41:09 | skrylar | turbonerds with those super hd monitors get uppity when you give them little pixel interfaces lol |
04:41:28 | ftsf | people seem to like my pixely interfaces |
04:41:33 | skrylar | not going to overhaul it until i have some idea what it should look like |
04:41:41 | ftsf | just scale up with nearest neighbour |
04:41:43 | skrylar | pixel interfaces are fine just make sure you have a 2x scale yeah |
04:41:47 | skrylar | see LMMS doesn't do that |
04:41:53 | ftsf | LMMS? |
04:42:01 | skrylar | it has a little pixel interface from like '97 and they don't have a scale option |
04:42:11 | ftsf | ahh |
04:42:13 | ftsf | i'll check it out |
04:42:22 | skrylar | its ok |
04:42:29 | skrylar | i just want fl studio's piano roll on my linux |
04:42:42 | ftsf | add a pianoroll to nimsynth =) |
04:42:51 | skrylar | i wrote one in C |
04:43:09 | ftsf | i am planning on making one at some point |
04:43:22 | ftsf | but kinda wanna make it a vertical piano roll |
04:43:33 | skrylar | that was why i originally used the name trackensail |
04:43:41 | skrylar | because "why is there no tracker and piano roll in the same thing?" |
04:43:58 | skrylar | and then i found i didn't get the tracker mindset |
04:44:18 | skrylar | but piano rolls aren't too hard |
04:44:33 | skrylar | just need some basic geometry collision code and some culling |
04:45:14 | ftsf | hmm using piano rolls is hard... need to be accurate with the mouse |
04:45:37 | skrylar | well you know the most annoying thing? none of the open source piano rolls delete notes easy |
04:45:53 | skrylar | in fruityloops its just right click and drag. |
04:45:53 | ftsf | hmm lmms seems ok, just right click to delete |
04:45:58 | skrylar | yea |
04:46:03 | skrylar | but no ghost notes. or routing. bleh |
04:46:32 | * | yglukhov joined #nim |
04:46:57 | skrylar | might port it to nim. depends |
04:47:08 | skrylar | trackensail, not lmms |
04:48:30 | skrylar | i did miss all these zero cost abstractions though |
04:50:41 | * | yglukhov quit (Ping timeout: 240 seconds) |
05:09:04 | * | vendethiel quit (Ping timeout: 246 seconds) |
05:17:16 | ftsf | hmm a C function takes a const char* argument, I assume in the nim wrapper I just use cstring type? |
05:18:47 | * | Trioxin joined #nim |
05:26:54 | ftsf | getting a crash (only on windows) from the c function when reading the const char* passed from nim, I can print it in nim fine, but printf from C causes a segfault |
05:29:53 | skrylar | i think you're supposed to use the $ operator to convert a cstring back to a nim string |
05:30:06 | skrylar | oh. also |
05:30:12 | skrylar | is your windows build unicode? |
05:30:21 | ftsf | it's crashing in the C code after passing a cstring, i never get it back from cstring. |
05:30:33 | ftsf | hmm, i'm not sure how to tell |
05:30:34 | skrylar | -DUNICODE does some fky things like replaces all char*s in winapi calls with short*'s |
05:30:51 | skrylar | because they thought 16-bit chars would escape unicode hell and they were wrong |
05:30:53 | ftsf | not using any winapi, just basic printf fopen etc |
05:30:55 | skrylar | but now they must live with that sin |
05:32:36 | skrylar | ftsf, is this GCC on windows? |
05:32:44 | ftsf | gcc on linux targeting windows |
05:32:48 | skrylar | ohlawd. |
05:33:01 | skrylar | i don't have a cross compiler set up to check |
05:33:21 | ftsf | hmm maybe i'll try a windows compile and see if i get the same problem |
05:33:34 | ftsf | if i can get it working on windows |
05:33:44 | * | gokr joined #nim |
05:33:46 | skrylar | i used to run clang on mingw. |
05:33:51 | skrylar | surprised the urho devs lol |
05:34:08 | skrylar | "someone actually uses clang on windows like that?" "turns out all you have to do is just run the cmake." |
05:34:43 | ftsf | hmm maybe i should try clang... |
05:34:53 | ftsf | using clang for my osx build |
05:35:00 | skrylar | worth a try. haven't done a cross compile with clang |
05:35:15 | skrylar | wish muscl worked on windows |
05:40:09 | skrylar | wonder if nimrod is smart enough to share generics of pointer types |
05:40:26 | skrylar | C++ isnt |
05:48:15 | * | xet7 quit (Quit: Leaving) |
05:53:37 | * | ephja joined #nim |
05:56:20 | * | xet7 joined #nim |
05:59:12 | * | chrisheller quit (Remote host closed the connection) |
06:00:32 | * | chrisheller joined #nim |
06:00:56 | * | chrisheller quit (Remote host closed the connection) |
06:00:58 | skrylar | ftsf, yey, finished all the binding. i think. |
06:04:55 | ftsf | awesome, jack you mean? |
06:05:06 | skrylar | yes |
06:05:14 | skrylar | it's not tested to see if it blows up horribly but well |
06:05:35 | ftsf | what could go wrong =) |
06:05:50 | ftsf | i am successfully using jack from nim, but only a subset |
06:06:05 | skrylar | yeh. no reason it won't work. |
06:06:14 | skrylar | you only need like 12 functions for most cases |
06:06:19 | ephja | skrylar: what do you mean by sharing generics? |
06:06:30 | skrylar | https://halls-of-valhalla.org/beta/articles/functional-options-pattern-in-go,54/ wonder how well this works in nim |
06:07:15 | skrylar | tl;dr they're using closures to apply settings and then having functions return closures, so you have APIs that are like makething(port(500), thingdoer(true)) and the api is stable even with new parameters. its neat. |
06:07:39 | skrylar | ephja, a shared generic understands that two pointers that are never dereferenced are essentially the same so it only makes one instance |
06:08:11 | skrylar | so if you have a generic container for a foo* and bar* it doesn't make two copies like C++ templates do |
06:08:35 | skrylar | straight C people often do this because they just use void* and typecast and pray |
06:09:11 | skrylar | ftsf, it can get obnoxious to do by hand but nim is great at abstracting over simple bindings |
06:09:34 | skrylar | since it translates foo.bar to bar(foo) you just need to name the methods right and you already get almost-oo |
06:10:41 | ftsf | yeah |
06:11:06 | skrylar | curious if templates work with get/set |
06:14:17 | skrylar | seems they do |
06:14:47 | skrylar | neat. so its entirely possible to cover up those gnarly set_option(SOMEOPT, SOMEVALS) |
06:26:48 | Araq | skrylar: last time I checked C++ template body deduplication is a linker feature and works |
06:30:11 | ftsf | so i have _another_ really weird problem =( i have a C function new_gif(const char *fname) wrapped by a nim proc newGIF(fname: cstring), calling it via newGIF(filename) and it crashes inside the new_gif C function in windows but not linux. trying to print the fname from C crashes it. |
06:30:22 | ftsf | I can print the address of it, but not index it. |
06:32:34 | * | nsf joined #nim |
06:33:07 | ephja | cdecl? |
06:33:59 | ftsf | oooh |
06:34:09 | ftsf | is that something i need to add to importc procs? |
06:34:34 | ftsf | omg it fixes it! |
06:34:44 | ftsf | thanks!! |
06:39:58 | * | Vladar joined #nim |
06:41:25 | * | chrisheller joined #nim |
06:42:24 | * | BennyElg joined #nim |
06:42:42 | ephja | good |
06:42:42 | * | BennyElg quit (Read error: Connection reset by peer) |
06:43:09 | * | BennyElg joined #nim |
06:47:22 | skrylar | Araq, i haven't been paying attention to the post c++0x stuff :\ |
06:47:35 | ftsf | ok now i think it's breaking because my filename has : in it, which I guess is invalid on windows |
06:47:55 | skrylar | files only have :'s in the name on amigas lol |
06:48:19 | * | yglukhov joined #nim |
06:48:26 | ftsf | works fine on linux =p |
06:48:47 | ftsf | i was putting getClockStr() in the filename |
06:52:56 | * | yglukhov quit (Ping timeout: 260 seconds) |
06:56:03 | ephja | skrylar: does the Elementary API seem nice compared to other widget libs? |
07:02:55 | ephja | I'm still waiting for them to get EO to a usable state so that porting EFL to Nim won't be too painful |
07:09:32 | * | yglukhov joined #nim |
07:11:25 | skrylar | ephja, mm well it was as pleasant as one can expect from straight C |
07:11:41 | skrylar | i do appreciate how its layered |
07:12:02 | skrylar | theres a set of just foundational crap like lists and then evas is a 2d canvas manager and the guis are on top of that one |
07:13:03 | skrylar | ah good there exists an sdl2 binding |
07:13:47 | * | yglukhov quit (Remote host closed the connection) |
07:16:51 | skrylar | i donno if nim will like it but i have a thing that might be fun. mostly involving setting a posix condition and having the UI thread block to that, so when an event happens it can kick the condition and let all the "immediate mode"-esque rendering happen then |
07:17:37 | skrylar | probably not necessary tho |
07:21:20 | ephja | yeah. concepts will come in handy when interfacing with those containers |
07:24:12 | * | yglukhov joined #nim |
07:27:49 | * | yglukhov quit (Remote host closed the connection) |
07:36:10 | * | Arrrr joined #nim |
07:50:42 | Arrrr | "6. Developers’ sourcecode and project files (.php, .java, .cpp, .pas, .asm)." |
07:50:57 | Arrrr | Nim for now is a safe language against ransoms |
07:51:20 | * | Andris_zbx joined #nim |
07:52:54 | flyx | that's a strange selector. |
07:55:52 | ephja | skrylar: https://nim-lang.org/docs/channels.html#recv,Channel[TMsg] |
07:55:59 | ephja | does that achieve what you want? |
08:14:35 | * | yglukhov joined #nim |
08:39:06 | * | vlad1777d joined #nim |
08:45:04 | skrylar | ephja, heh, a baby version of go channels? :) |
08:45:15 | skrylar | eeh i'll probably just use an atomic flag or something. |
08:45:28 | skrylar | depends on if its safe to push sdl events from realtime threads |
08:46:46 | gokr | skrylar: Using Urho3D? Just saw you mentioned urho |
08:47:03 | skrylar | gokr, sadly no. never ended up doing the project i set it up for |
08:47:23 | gokr | The Atomic engine is really going places. |
08:47:28 | skrylar | is it? |
08:47:42 | skrylar | i remember installing it from the AUR and it segfaulted on launch, so i tossed it and went back to godot |
08:47:47 | gokr | It seems to have a lot of buzz. |
08:48:08 | gokr | atomicgameengine.com |
08:48:18 | gokr | And its all MIT now. |
08:48:32 | skrylar | it was when i tried it too. but it segfaulted on launch on nix |
08:49:07 | gokr | Hum, well, what I can see (movies, articles, their forum) - it's very active. Much more than upstream Urho3D it seems. |
08:49:25 | skrylar | having funding does wonders |
08:49:38 | gokr | Well, not sure they have much funding actually. |
08:49:47 | * | sz0 joined #nim |
08:49:53 | skrylar | isn't the guy who maintains it some ex from a big studio? |
08:50:54 | gokr | I am not entirely sure, but he sure does seem to know his stuff :) |
08:51:00 | gokr | Their blog is quite impressive. |
08:51:02 | skrylar | i know the godot guys did a great job. they get a lot of unfair flak because people are like "oh it has gdscript thats bad" |
08:51:27 | gokr | Araq helped us doing a wrapper of Urho3D as you may know. |
08:51:38 | skrylar | i think i heard of that being worked on before i lef |
08:52:42 | gokr | We used it in integrating Urho3D in Terf (3dicc.com) - but we couldn't finish it due to other reasons. But it was working fine. |
08:53:04 | skrylar | Urho is a nice engine |
08:53:11 | gokr | And we will hopefully come back to it later, although I am not working currently at 3dicc. |
08:53:19 | gokr | Yeah, very much. |
08:53:39 | skrylar | i wish the guys who did godot would just meld with them a little bit |
08:53:50 | skrylar | the tooling is really nice in GD. but the 3d is way better in Urho |
08:54:03 | gokr | I think Atomic adds a great deal of tooling. |
08:54:04 | * | vlad1777d quit (Remote host closed the connection) |
08:54:16 | skrylar | It also adds crashes :) |
08:54:21 | skrylar | And javascript. blegh |
08:55:07 | gokr | And C#. |
08:55:14 | skrylar | my mind boggles at people who hate on custom languages only to then use dialected versions of javascript or such |
08:55:17 | gokr | Which one may of course either like or not :) |
08:55:23 | skrylar | well mono is mit now too |
08:56:32 | gokr | The feature reel here is IMHO kinda impressive: https://atomicgameengine.com/blog/atomic-build-1/ |
08:57:40 | skrylar | I'd hope so. |
08:57:46 | * | PMunch joined #nim |
08:57:48 | skrylar | Urho is pretty complete and they aped it. lol |
08:58:24 | gokr | Well, they are quite open with the fact they build on Urho3D - and they appreciate it. |
08:59:17 | skrylar | i might see if they fixed the aur package some time |
08:59:31 | skrylar | its a long build tho. |
09:01:14 | skrylar | always thought it funny how freepascal, delphi and d could build these monsterous codebases in under a minute |
09:01:33 | skrylar | nim does it too |
09:01:55 | FromGitter | <andreaferretti> does anyone know how to handle declarations such as this in c2nim? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I would like to be able to correctly translate these declarations. For similar ones, I used to just skip the whole `#ifndef` section, but I am not sure whether skipping the whole `__attribute__` can lead to issues [https://gitter.im/nim-lang/Nim?at=591ac003c4d73f445ab02983] |
09:02:31 | skrylar | gcc attributes mean nothing to nim IIRC. |
09:02:57 | skrylar | since nims just going to output C code and then gcc will deal with the attributes there |
09:03:26 | FromGitter | <Araq> ===def CUFFTAPI=== |
09:03:44 | Araq | #def CUFFTAPI |
09:06:41 | PMunch | Araq, ref: https://github.com/nim-lang/Nim/pull/5778 what kind of test do you want? I'm looking at the dumpTree test and it's not much: https://github.com/nim-lang/Nim/blob/devel/tests/macros/tdumptree.nim |
09:08:28 | * | bjz joined #nim |
09:09:10 | * | bjz quit (Client Quit) |
09:10:50 | FromGitter | <andreaferretti> thank you Araq, I am trying `#def`. The only issue I have is that using `#def` changes the symbol seen by c2nim itself - so that then I have to skip a section with a strange guard such as `__attribute__ ((visibility ("default")))` |
09:11:30 | Araq | well you implemented #skip |
09:11:37 | Araq | I don't understand your problem |
09:12:42 | * | bjz joined #nim |
09:13:10 | FromGitter | <andreaferretti> well, you are right :-) but the problem is the following: the token I get from the parser is already transformed by the `#def` rules |
09:13:31 | FromGitter | <andreaferretti> so it not always easy to skip it |
09:15:34 | FromGitter | <andreaferretti> I would be happy to implement something better, but first I have to understand where to get the token *before* the transformation |
09:16:14 | FromGitter | <andreaferretti> I'll see what I can do |
09:32:20 | FromGitter | <andreaferretti> @Araq it seems to work with `rawGetTok`, I think it makes sense to consider the raw token in processing ifdefs. If you agree, I am pushing a small change from `getTok` to `getRawTok` in `parseIfdef` and `parseIfndef` |
09:33:01 | Araq | not sure, will review your code instead |
09:34:15 | FromGitter | <andreaferretti> ok, I am pushing |
09:35:24 | dom96 | ftsf: no way for choosenim to update itself yet |
09:40:06 | FromGitter | <andreaferretti> another thing I am considering is a constant folding preprocessing step. For instance, consider a typical header guard such as ⏎ ⏎ ```when not defined(GUARD): ⏎ const ⏎ GUARD* = true ⏎ ⏎ # code here``` ⏎ ⏎ which works (at least if GUARD is a rare enough name), but it is a little annoying - I'd rather recognize this pattern and remove the `when` check and the extraneous constant |
09:40:06 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=591ac8f633e9ee771cb06302] |
09:42:36 | Araq | I wanted to add a pattern matching preprocessor once |
09:44:00 | Araq | #pattern { #ifndef X #define X Y #endif } Y |
09:44:19 | FromGitter | <andreaferretti> yeah, it would make sense, but I saw that a postprocessor is already in place :-P |
09:44:32 | FromGitter | <andreaferretti> maybe it would be easier to tweak that |
09:44:42 | Araq | yeah, postprocessing is usually way easier |
09:45:25 | FromGitter | <andreaferretti> also, it would catch both `#ifdef` and `#if defined()` in a single rule |
09:45:38 | FromGitter | <andreaferretti> because they become equal after processing |
09:45:54 | Araq | for your case, yes. preprocessing is usually much more flexible though |
09:46:07 | FromGitter | <andreaferretti> I guess so |
10:04:28 | * | bjz quit (Ping timeout: 246 seconds) |
10:04:55 | * | bjz joined #nim |
10:17:04 | PMunch | Why doesn't the stream module have Uint versions? |
10:17:18 | PMunch | Or rather, is there a reason? |
10:19:19 | * | bjz_ joined #nim |
10:19:35 | * | bjz quit (Ping timeout: 240 seconds) |
10:22:09 | * | Vladar quit (Remote host closed the connection) |
10:33:15 | * | bjz joined #nim |
10:34:27 | * | bjz_ quit (Ping timeout: 240 seconds) |
10:40:54 | FromGitter | <andreaferretti> @how does nim handle alignment directives? I have types defined like ⏎ ⏎ ```struct __device_builtin__ __declspec(align(2)) uchar2 ⏎ { ⏎ unsigned char x, y; ⏎ };``` ⏎ ⏎ I would like to parse them with c2nim, but I am not even sure what nim code should be generated for that [https://gitter.im/nim-lang/Nim?at=591ad73683cb5db073378e5e] |
10:42:24 | PMunch | What's the difference in implementation between a seq and an openArray? |
10:49:06 | * | couven92 joined #nim |
10:50:46 | Araq | PMunch: seq is like vector in C++, openarray is ptr, length pair |
10:52:21 | PMunch | Ah right |
10:52:31 | PMunch | But openarray can't be returned? |
10:52:55 | ftsf | openarray is not really a thing |
10:53:01 | ftsf | from what i understand? |
10:53:07 | ftsf | input only |
10:53:28 | ftsf | kind of like a generic sequence type |
10:53:54 | ftsf | that would be generated as either a seq or array code path depending on how it's used |
10:54:36 | PMunch | Hmm, but can I create a seq using newSeq and then get the .addr to read from a stream into it? |
10:55:29 | couven92 | PMunch, as I was told a couple of days ago: `myOpenArray[0].addr` gives a C-like array pointer |
10:55:55 | PMunch | Yeah, I know |
10:56:18 | PMunch | But since I can't return an openArray I was looking into returning a seq |
10:57:03 | couven92 | You can probably return an openarray, but I bet you can create an instance of one? |
10:57:20 | couven92 | s/can/can't |
10:58:00 | * | Tiberium joined #nim |
10:58:03 | PMunch | I'm not too sure, according to the doc: "Note: Openarrays can only be used for parameters." |
10:58:55 | couven92 | PMunch, true, I just tried |
10:59:41 | couven92 | The compiler issues: `openarray[int]: invalid type in this context` |
11:01:45 | PMunch | Yeah, that's what I thought.. |
11:02:21 | * | Sembei joined #nim |
11:02:21 | * | vlad1777d joined #nim |
11:02:40 | * | Snircle joined #nim |
11:04:32 | * | aedigix quit (Remote host closed the connection) |
11:07:04 | * | aedigix joined #nim |
11:09:20 | FromGitter | <mratsim> You can get the addr or unsafeAddr of a seq. I use something like this in my array lib ⏎ ⏎ ```template get_data_ptr[T](s: seq[T]): ptr T = unsafeAddr(t[0])``` ⏎ ⏎ If `addr`works for your case use it instead of `unsafeAddr` [https://gitter.im/nim-lang/Nim?at=591adde083cb5db07337b138] |
11:19:44 | * | bjz_ joined #nim |
11:22:03 | * | bjz quit (Ping timeout: 240 seconds) |
11:25:48 | PMunch | Hmm, the stream module should also really include a way to do byte ordering |
11:36:54 | Araq | why? we have endians.nim for that |
11:37:47 | FromGitter | <ephja> it could be done mostly implicitly though |
11:39:02 | FromGitter | <ephja> but it wouldn't require much effort with high level procs in the endians module |
11:40:16 | FromGitter | <ephja> I started working on that some time ago. I should finish it |
11:41:21 | PMunch | Oh, I tried searching for nim endian and couldn't find it :) |
11:46:21 | * | Vladar joined #nim |
11:46:27 | PMunch | ephja, what do you mean implicitly? I have a file that writes a 32bit magic number. Depending on this the byte ordering is identified and the rest of the file should be read with that byte ordering. |
12:00:03 | ephja | I meant by specifying the byte order upon construction rather than for each read or write. you can't do that yet but it would be nice I think |
12:04:03 | * | krux02 joined #nim |
12:07:30 | ephja | I'm working on a binary format atm so I'll probably want to implement such improvements soon |
12:11:34 | * | Arrrr quit (Ping timeout: 268 seconds) |
12:14:59 | ephja | something like messagepack but with both heterogeneous and homogeneous containers, and format specifiers that take up whole bytes, cus, jump tables! |
12:15:24 | PMunch | Ah right, that sounds useful :) |
12:18:27 | ephja | I can't say I have looked at particularly many formats, and such space and speed optimizations probably won't matter for most users though |
12:34:20 | PMunch | Hmm, the fromSeconds from the times module seems to be doing weird stuff |
12:35:12 | PMunch | Or rather the timeToTimeInfo |
12:35:53 | PMunch | I get 2017-05-16T12:23:00+02:00 when I echo the time object, but 2017-05-16T11:23:00+00:00 when I echo the TimeInfo object.. |
12:59:33 | * | fredrik92 joined #nim |
13:03:13 | * | couven92 quit (Ping timeout: 255 seconds) |
13:09:25 | Sentreen | I am dealing with such a weird bug; the following line ` cmm = addr lmm.memory[t.cont]` (where cmm is a var that is nil up to this point, and lmm.memory is a table) will cause a string in a completely different piece of memory to change.... |
13:09:58 | Sentreen | I actually modify the thing that pointer points to later, but it's fetching the address and assigning it that causes the bug... |
13:10:22 | ftsf | anyone know how i can make Windows open a folder in explore from my nim program? |
13:11:42 | * | kunev quit (Ping timeout: 240 seconds) |
13:12:16 | dom96 | ftsf: IIRC you just execute explorer.exe with an argument pointing to the path of the folder. |
13:13:43 | ftsf | ahh that sounds like it should work =) good thinking! |
13:14:05 | Araq | ftsf: import browsers; openDefaultBrowser("myfilehere.txt") |
13:14:14 | * | kunev joined #nim |
13:14:54 | ftsf | Araq, oh nice, that sounds good being cross platform too |
13:15:05 | ftsf | although browser might not be ideal |
13:15:48 | ftsf | hmm on linux xdg-open should probably come before gnome and kde, people are likely to have gnome and kde installed even if they're not using them. |
13:16:09 | * | fredrik92 is now known as couven92 |
13:20:00 | * | krux02- joined #nim |
13:20:00 | * | krux02 quit (Disconnected by services) |
13:20:09 | * | krux02 joined #nim |
13:21:37 | * | krux02- quit (Remote host closed the connection) |
13:26:26 | FromGitter | <andreaferretti> is there something in nim such as a forward declaration of a type? analogue to the following C ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ If I parse these files using c2nim, I get a cyclic dependency between modules, and I am not sure what would be the best way to resolve it [https://gitter.im/nim-lang/Nim?at=591afe0233e9ee771cb17b63] |
13:28:34 | dom96 | You'll need to put the types in the same module |
13:29:12 | FromGitter | <andreaferretti> even if I somehow manage to do this, is there a way to have them in different type sections? |
13:29:48 | FromGitter | <andreaferretti> because actually getting a single type section would require extensive modification of the original headers |
13:29:55 | FromGitter | <andreaferretti> which I am trying to avoid |
13:33:17 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:42:29 | dom96 | not as far as I'm aware. |
13:42:52 | FromGitter | <andreaferretti> uhm... I'll see what I manage to do |
13:45:16 | Araq | C only allows it for pointers anyway, workaround, use 'pointer' or a distinct pointer or something |
14:01:48 | FromGitter | <andreaferretti> thank you, I will try the workaround! |
14:01:56 | FromGitter | <andreaferretti> you are giving me a lot of help :-) |
14:02:24 | FromGitter | <andreaferretti> thank you |
14:09:04 | * | rauss joined #nim |
14:32:38 | * | Tiberium_ joined #nim |
14:35:13 | * | Tiberium quit (Read error: Connection reset by peer) |
14:41:00 | * | BennyElg quit (Remote host closed the connection) |
14:43:34 | * | yglukhov_ joined #nim |
14:44:44 | yglukhov_ | Araq: how can i know if i'm compiled with --threads:on or off? |
14:45:02 | Araq | when compileOption("threads") |
14:45:12 | yglukhov_ | thanks! |
14:45:15 | Araq | or maybe when compileOption("threads", "on") |
14:45:40 | * | yglukhov quit (Ping timeout: 240 seconds) |
15:09:56 | * | yglukhov_ quit (Remote host closed the connection) |
15:10:53 | ftsf | aww stack overflow when running the profiler |
15:11:32 | ftsf | https://gist.github.com/ftsf/eb363b445547cac00ccab74ecaad3de8 |
15:13:39 | * | rauss quit (Ping timeout: 260 seconds) |
15:14:25 | * | rauss joined #nim |
15:20:11 | * | yglukhov joined #nim |
15:21:36 | * | Arrrr joined #nim |
15:24:09 | ephja | I don't think that has been reported |
15:24:22 | * | yglukhov quit (Ping timeout: 246 seconds) |
15:25:36 | dom96 | ftsf: please report it |
15:25:51 | ftsf | shall do |
15:29:31 | ftsf | actually, looks like it might be related to memory corruption on my part |
15:29:44 | ftsf | will fix that and see if it still happens |
15:34:05 | * | nsf quit (Quit: WeeChat 1.7.1) |
15:39:03 | * | couven92 quit (Quit: Client disconnecting) |
15:42:28 | * | gokr quit (Ping timeout: 268 seconds) |
15:59:11 | * | Andris_zbx quit (Remote host closed the connection) |
16:07:07 | FromGitter | <Varriount> Hm. What are the various ways to pass in a value at compile time? For instance, a path to a header file? |
16:09:27 | ldlework | Like in a variable to a macro? |
16:09:51 | ldlework | If its just to a compile time function there's no difference right? |
16:12:25 | * | gokr joined #nim |
16:12:56 | * | gokr quit (Client Quit) |
16:12:58 | * | gokr1 joined #nim |
16:13:00 | FromGitter | <Varriount> I mean, from compiler invokation |
16:13:34 | FromGitter | <Varriount> Sorry, what I meant was, how do I pass a value from the command line/compiler invocation to the program? |
16:14:05 | FromGitter | <Varriount> I know about '-d' and '--define', however those only define a symbol as present (a boolean condition) |
16:17:37 | * | gokr1 quit (Remote host closed the connection) |
16:18:18 | FromGitter | <stisa> @Varriount maybe these https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-time-define-pragmas ? |
16:19:17 | FromGitter | <Varriount> Hrm, that seems like a really oddly designed mechanism |
16:20:07 | FromGitter | <Varriount> @stisa I'm mainly asking, as I'm wondering if there is too much fragmentation in how to get various compile-time values |
16:20:28 | FromGitter | <Varriount> There's defines, compile time options, platforms, etc |
16:22:58 | * | couven92 joined #nim |
16:23:58 | krux02 | today I went back to find out what was wrong with my offsetof implementation of packed types |
16:24:34 | krux02 | aparently my code was correct, the code that is wrong is the generated C code that does not properly pack the type |
16:24:49 | * | BennyElg joined #nim |
16:25:22 | FromGitter | <stisa> @Varriount I think it's fine as long as it's documented properly. I mostly use `-d:<something>` as bool though, never had the need to pass strings etc (yet) |
16:28:14 | FromGitter | <Varriount> Yes, but I think it would be better to have just two retrieval functions, 'defined', and something like 'compileOption' |
16:30:32 | * | nsf joined #nim |
16:36:49 | * | Trustable joined #nim |
16:40:36 | * | yglukhov joined #nim |
16:44:52 | * | yglukhov quit (Ping timeout: 246 seconds) |
16:55:46 | FromGitter | <nordborn> Hi guys ⏎ ⏎ I need help ⏎ ⏎ The aim is to compile nim file with musl support and include mysqlclient into the output binary (linux x86-64). ... [https://gitter.im/nim-lang/Nim?at=591b2f1133e9ee771cb28479] |
16:58:18 | dom96 | Try adding --dynlibOverride:libmysql.so (or whatever the .so name is) |
16:58:46 | Tiberium_ | dom96, a suggestion for choosenim - can it use "git" if it's installed on user system? I think it's faster to update nim devel repo using git than download it from scratch :) |
17:00:12 | dom96 | Tiberium_: Already requested: https://github.com/dom96/choosenim/issues/12 |
17:00:20 | Tiberium_ | dom96, ah, thanks :) |
17:03:25 | Tiberium_ | but maybe you can make an optional switch for this? |
17:16:27 | FromGitter | <nordborn> dom96: "Try adding --dynlibOverride" failed. not linked |
17:24:53 | Araq | that's the point. |
17:25:04 | Araq | you need to add the static link command on your own then |
17:26:06 | krux02 | Araq: did you see my newest issue I made? |
17:26:43 | krux02 | aparently the packed types need to emit more __packed__ attributes so that the generated type is actually packed |
17:27:13 | krux02 | but I don't know where in the code generation process I need to address this |
17:27:24 | krux02 | I don't know the codebase for code generation |
17:28:19 | Araq | packed structs are stupid shit IMO. if you need a packed layout use an array of bytes and do the unaligned accesses on your own |
17:28:49 | Araq | but the code to touch is compiler/cggtypes.nim |
17:29:48 | krux02 | well if you should use it or not doesn't really matter in my case, because I need it to work in order to be able to implement the offsetof correctly |
17:30:18 | * | Sembei quit (Ping timeout: 260 seconds) |
17:46:33 | krux02 | Araq: Well for now I don't understand that codebase, and I have to go soon. it would be nice if you could give me a hint on how to implement this. I am willing to it if you accept that change. |
17:48:17 | FromGitter | <mratsim> Did I hit a bug ? I’m trying to use _ as a wildcard in a macro for multidimensional array slicing however whether it’s working or not depends on the argument order. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=591b3b61c4d73f445ab2a94f] |
17:48:52 | FromGitter | <Varriount> @mratsim 't' must be untyped |
17:49:36 | FromGitter | <Varriount> Only untyped parameters will accept undeclared/unbound identifiers |
17:51:57 | FromGitter | <mratsim> I still get the same error. @Varriount |
17:52:17 | dom96 | zacharycarter: is play.nim-lang.org ready for action? i.e. can it be advertised on nim-lang.org? |
17:53:47 | Arrrr | I'd like to be able to share nim snippets with play.nim |
17:55:55 | Arrrr | (As a suggestion) |
17:57:21 | krux02 | I just tested play.nim-lang.org the first time. The size of the nim crows constantly changed |
17:57:50 | krux02 | I don't know the cause, but it was very distracting. |
17:58:13 | krux02 | anyway I have to go, bye have a nice evening/day/night |
17:58:15 | krux02 | exit |
17:58:16 | * | krux02 quit (Remote host closed the connection) |
17:59:44 | * | nsf quit (Quit: WeeChat 1.7.1) |
18:01:19 | * | themagician joined #nim |
18:01:34 | FromGitter | <Varriount> @mratsim Could you post the full code? |
18:01:36 | FromGitter | <mratsim> @Varriount I probably have to do something similar to this bug report: use a template inside a macro - https://github.com/nim-lang/Nim/issues/4669 |
18:01:44 | FromGitter | <ephja> it seems as though "proc p[T:C; U:C]" where C is (Foo|Bar) doesn't work if T and U aren't both instantiated with Foo or Bar |
18:02:15 | FromGitter | <Varriount> @ephja: 'C' must be the same type. |
18:05:31 | * | yglukhov joined #nim |
18:05:40 | FromGitter | <mratsim> @Varriount There is probably some unforeseen interference/scoping/whatever issue, I’ve created a clean file (without my custom type) and I can get the AST, so bug hunting time. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=591b3f749f4f4ab05bce72b3] |
18:05:56 | FromGitter | <ephja> p[Foo, Bar] fails that is, while p[Foo, Foo] doesn't |
18:06:37 | FromGitter | <mratsim> I’ve already reported this @ephja |
18:07:07 | * | yglukhov quit (Remote host closed the connection) |
18:07:19 | FromGitter | <mratsim> Here: https://github.com/nim-lang/Nim/issues/5641 I think it’s the same |
18:08:25 | FromGitter | <ephja> Oh I see. Could it be another concept branch regression? |
18:09:04 | FromGitter | <mratsim> it was already there before concept branch was merged |
18:10:09 | FromGitter | <ephja> you're right |
18:13:19 | * | PMunch quit (Quit: leaving) |
18:17:41 | * | couven92 quit (Ping timeout: 255 seconds) |
18:19:15 | * | Tiberium_ quit (Remote host closed the connection) |
18:28:36 | FromGitter | <mratsim> @Varriount I reproduced with `seq` I believe it’s because seq and my custom type already defines a `[]` operation. However I don’t understand why one order works and display the AST tree and the other use the other operation: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=591b44d48a05641b118b9390] |
18:30:58 | * | rauss quit (Ping timeout: 260 seconds) |
18:32:45 | * | rauss joined #nim |
18:35:29 | * | rauss quit (Client Quit) |
18:35:42 | FromGitter | <ephja> will type AST introspection allow for the implementation of a typedesc set construct? |
18:38:02 | * | dddddd joined #nim |
18:44:49 | * | skrylar quit (Remote host closed the connection) |
18:45:10 | * | skrylar joined #nim |
18:48:21 | * | smt joined #nim |
18:51:27 | * | smt_ quit (Ping timeout: 240 seconds) |
18:53:59 | FromGitter | <Varriount> typedescs aren't enumerable |
18:56:18 | * | Arrrr quit (Read error: Connection reset by peer) |
18:57:03 | * | Ven joined #nim |
18:57:27 | * | Ven is now known as Guest52168 |
19:02:39 | * | Vladar quit (Quit: Leaving) |
19:06:57 | * | nsf joined #nim |
19:09:17 | * | smt_ joined #nim |
19:10:45 | * | Trustable quit (Read error: Connection reset by peer) |
19:11:01 | * | Trustable joined #nim |
19:12:14 | * | planhths joined #nim |
19:13:22 | * | smt quit (Ping timeout: 268 seconds) |
19:16:45 | * | rauss joined #nim |
19:18:18 | * | Matthias247 joined #nim |
19:20:17 | * | libman joined #nim |
19:21:48 | * | rauss quit (Ping timeout: 272 seconds) |
19:26:18 | * | smt joined #nim |
19:27:07 | * | Sembei joined #nim |
19:30:01 | * | smt_ quit (Ping timeout: 268 seconds) |
19:39:11 | * | Guest52168 quit (Ping timeout: 260 seconds) |
19:42:23 | FromGitter | <ephja> @Varriount yes that's right, so you would need a separate set implementation that operates on ASTs. |
19:42:52 | * | Ven_ joined #nim |
19:43:16 | * | Sembei quit (Read error: Connection reset by peer) |
19:43:25 | * | yglukhov joined #nim |
19:44:31 | * | Sembei joined #nim |
19:47:49 | * | skrylar quit (Remote host closed the connection) |
19:47:58 | * | Ven_ quit (Ping timeout: 260 seconds) |
19:48:15 | * | skrylar joined #nim |
19:48:48 | FromGitter | <zacharycarter> @dom96: someone mentioned it on reddit a couple of weeks ago so I don't see why not. Although if we want to add more features first, like snippets I can work on that this weekend. |
19:55:28 | * | Jesin quit (Quit: Leaving) |
19:58:34 | * | Ven joined #nim |
19:58:58 | * | Ven is now known as Guest60500 |
19:59:35 | * | couven92 joined #nim |
20:09:53 | * | Jesin joined #nim |
20:13:01 | * | gokr joined #nim |
20:25:15 | * | Sembei quit (Read error: Connection reset by peer) |
20:25:28 | * | Matthias247 quit (Read error: Connection reset by peer) |
20:25:40 | * | Guest60500 quit (Ping timeout: 240 seconds) |
20:27:05 | * | Ven_ joined #nim |
20:28:27 | * | Sembei joined #nim |
20:32:05 | * | rauss joined #nim |
20:34:17 | * | m712 quit (Changing host) |
20:34:17 | * | m712 joined #nim |
20:41:09 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:48:49 | * | Ven_ joined #nim |
20:48:51 | * | bjz joined #nim |
20:49:40 | * | couven92 quit (Ping timeout: 240 seconds) |
20:51:16 | * | ephja quit (Read error: Connection reset by peer) |
20:51:50 | * | couven92 joined #nim |
21:02:49 | * | skrylar quit (Remote host closed the connection) |
21:03:12 | * | skrylar joined #nim |
21:06:26 | * | Sembei quit (Quit: WeeChat 1.9-dev) |
21:06:45 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:10:28 | * | Matthias247 joined #nim |
21:36:10 | * | rauss quit (Ping timeout: 240 seconds) |
21:37:31 | * | rauss joined #nim |
21:44:09 | * | Trustable quit (Remote host closed the connection) |
21:46:40 | * | rauss quit (Quit: WeeChat 1.8) |
21:47:25 | * | planhths quit (Quit: Konversation terminated!) |
21:49:22 | bozaloshtsh | Is there a way to tell the compiler to ignore a "defined but unused" hint for a particular proc that I've defined? |
21:51:58 | bozaloshtsh | discard <proc name> just gives me an error (statement returns no value that can be discarded) |
21:52:13 | * | nsf quit (Quit: WeeChat 1.7.1) |
21:56:06 | FromGitter | <ephja> {.hint[XDeclaredButNotUsed]: off.} ? |
22:03:58 | Araq | proc foo() {.used.} |
22:21:34 | bozaloshtsh | cool thanks |
22:24:35 | * | yglukhov quit (Remote host closed the connection) |
22:28:20 | * | Trioxin quit (Read error: Connection reset by peer) |
22:28:26 | * | Trioxin2 joined #nim |
22:36:45 | FromGitter | <ephja> new shortcut, is it? |
23:00:49 | * | themagician quit () |
23:02:25 | bozaloshtsh | Araq: that doesn't work (using latest devel) |
23:14:29 | * | gokr quit (Ping timeout: 268 seconds) |
23:19:42 | * | dddddd quit (Read error: Connection reset by peer) |
23:21:01 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:28:43 | * | Jesin quit (Quit: Leaving) |
23:37:02 | * | Jesin joined #nim |
23:42:04 | * | pilne joined #nim |
23:51:20 | * | skrylar quit (Remote host closed the connection) |
23:51:47 | * | skrylar joined #nim |