<< 14-11-2017 >>

00:00:31*jdhorwitz joined #nim
00:00:41FromGitter<data-man> One of the best Delphi libraries for work with InterBase/Firebird https://github.com/madorin/fibplus
00:01:05*marenz__ quit (Ping timeout: 240 seconds)
00:01:35*jjido joined #nim
00:02:45skrylardata-man: i'll put a star on it
00:04:47skrylarI've only used ActiveRecord and i think a very baby version of NHibernate, so I'm not too familiar with database CRUD
00:04:47*jdhorwitz quit (Ping timeout: 248 seconds)
00:06:20*yglukhov joined #nim
00:07:59FromGitter<data-man> @skrylar: I also did it. 
00:10:27*yglukhov quit (Ping timeout: 240 seconds)
00:11:01skrylarhaven't quite gotten to prepared statements and getting data back out
00:18:31*gokr quit (Ping timeout: 240 seconds)
00:35:58*yuken joined #nim
00:36:01yukenHm.
00:36:14yukenShould I run Nim in a Linux VM just for a fresh environment, or just run it in Windows?
00:37:20zolk3rior install linux and run nim there
00:37:29yukenew no ;)
00:37:37zolk3ri:p
00:37:40zolk3ribsd?
00:37:47yukenNah. Dislike Linux for desktop use.
00:37:48*jdhorwitz joined #nim
00:46:38*SenasOzys_ quit (Read error: Connection reset by peer)
00:47:10*SenasOzys_ joined #nim
01:07:11*Calinou quit (Ping timeout: 248 seconds)
01:07:15*jinshil joined #nim
01:11:40*Calinou joined #nim
01:13:26*yglukhov joined #nim
01:18:28*yglukhov quit (Ping timeout: 268 seconds)
01:23:11skrylarso there are two calls, and the difference is whether memory is freed up automatically or not. i collapsed these in to the same call on nim's side, with an "autofree: bool = true"
01:23:22skrylarI'm hoping this isn't considered a sin
01:28:57*SenasOzys_ quit (Ping timeout: 240 seconds)
01:29:36*vlad1777d_ quit (Ping timeout: 248 seconds)
01:34:45FromGitter<Varriount> skrylar: Why wouldn't you want the memory freed automatically
01:38:19*zolk3ri quit (Remote host closed the connection)
01:40:04skrylarVarriount: I don't know. Historical reasons? I have it set to use that method automatically.
01:40:44*kalkin--- joined #nim
01:44:01*kalkin-- quit (Ping timeout: 248 seconds)
01:49:51skrylarhttps://github.com/Skrylar/firebird tossed it on the githubs
02:01:01FromGitter<ntdef> Hi friends, quick question about the C FFI; I'm on a mac trying to link to the GNU Sci LIbrary. I'm getting an error when I try to wrap C code with a `const` in the function signature
02:01:34FromGitter<ntdef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a0a4e7e505b630c05dc83fc]
02:01:43FromGitter<ntdef> anyone know how I can make these types match
02:02:41*couven92 quit (Ping timeout: 248 seconds)
02:07:29FromGitter<Varriount> @ntdef Could you Allie is the wrapper code?
02:07:44FromGitter<Varriount> *show
02:07:56FromGitter<ntdef> ``````
02:08:41FromGitter<ntdef> @Varriount here you go^
02:09:07FromGitter<Varriount> @ntdef First try making the calling convention the same - use the cdecl pragma
02:09:35FromGitter<Varriount> Or whatever calling convention the C function uses.
02:09:40skrylarntdef nim doesn't have a const :<
02:09:40FromGitter<ntdef> What does cdecl do? I tried looking it up in the docs, but it's not documented
02:09:58skrylarcdecl is supposed to specify C calling conventions.
02:10:07FromGitter<ntdef> So can nim not call functions with const?
02:10:17skrylarAs opposed to say, nimcall. Although nim's default is *often* also cdecl, it's not required to be
02:10:34skrylaryou can, you just have to remove the 'const' declarations and pinky promise not to modify the values
02:10:49skrylaror rather, const going IN to a function says THAT FUNCTION won't modify it, so losing the declaration is fine
02:11:08FromGitter<ntdef> hmm. adding cdecl didn't change anything
02:11:11skrylarif you are binding callbacks and losing const, well. pray.
02:11:44FromGitter<Varriount> @ntdef https://nim-lang.org/docs/manual.html#types-procedural-type
02:11:59FromGitter<Varriount> What about importcpp?
02:12:15FromGitter<Varriount> skrylar: ^
02:12:50FromGitter<ntdef> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a0a5122df09362e67059890]
02:13:04FromGitter<ntdef> I thought the GSL was in C anyway
02:13:50skrylarvarriount: what about it?
02:15:05FromGitter<ntdef> skrylar how do I sidestep the const argument then?
02:15:15FromGitter<ntdef> supposing I pinky promise
02:16:36skrylaryou just leave it out of the nim declaration, and call it like normal
02:16:52FromGitter<ntdef> the compiler won't let me leave it out :(
02:17:08FromGitter<ntdef> gsl_vector_printf is a function from a library I didn't write
02:18:28skrylarthat error sounds like what happens if you tried to bind the const and non-const version of the same function
02:19:21FromGitter<ntdef> I've only got one bindign
02:20:26skrylari couldn't say more without seeing the module.
02:21:24skrylarit shouldn't say NIMCALL in C wrapper stuff though. you might want to make sure there is a header pragma to tell nim where to find the method
02:21:42skrylari don't know what happens with importc and no header declaration
02:22:00skrylari think if nim thinks there isn't one it will try to emit one, which can collide with the actual definition from C
02:22:22skrylarbecause importc tells it to use a specific nonmangled name, and the lack of a header pragma leaves it ignorant that its supposed to be there
02:22:30*yglukhov joined #nim
02:25:33FromGitter<ntdef> oh crap you're right I think it was the header pragma
02:25:52FromGitter<ntdef> I'm able to compile now, although I get a runtime erroer
02:26:35*yglukhov quit (Ping timeout: 240 seconds)
02:30:46*Snircle_ quit (Quit: Textual IRC Client: www.textualapp.com)
02:30:57*BitPuffin|osx quit (Ping timeout: 240 seconds)
02:31:03FromGitter<ntdef> skyrlar, thanks for your help
02:47:26skrylarthere seems to be a lot of weird stuff in here. no idea how important those are
02:47:35skrylarconverting dates between date objects and sql
02:48:02skrylartheir initial example files are using sprintf and concatting queries, but the engine seems to support placeholders just fine
02:48:37skrylarIf I just had to field a guess, and was trying to make an actually user-friendly system, i'd probably just nimize some of the Clipper APIs
02:49:22skrylarthey're not actually that far off from activerecord et all
02:49:41*jdhorwitz quit (Ping timeout: 240 seconds)
02:52:15FromGitter<Varriount> skrylar: Still making that Firebase module?
02:57:01*endragor joined #nim
03:01:21*jjido quit (Ping timeout: 248 seconds)
03:01:48*chemist69 quit (Ping timeout: 240 seconds)
03:12:55*jdhorwitz joined #nim
03:15:36*chemist69 joined #nim
03:42:19skrylarVarriount: yup. taking a while
03:42:40skrylarhave to cross reference the headers with other docs and piece through examples to figure out how this works
03:56:54*mr_yogurt joined #nim
03:58:24*rauss joined #nim
04:07:44*yglukhov joined #nim
04:12:17*yglukhov quit (Ping timeout: 260 seconds)
04:12:30*dddddd quit (Remote host closed the connection)
04:17:32*jdhorwitz quit (Ping timeout: 260 seconds)
04:50:35*bkerin joined #nim
04:51:47bkerinI notice static:\n var foo = "testvar"\necho foo generates non-buildable C code, is this a known issue?
04:52:48bkerinI had hoped to use some data structures built up at compile time to do some corresponding run-time work but now I don't see how to pass them along... going through AST gen to do it seems crazed
04:55:26skrylarthat looks like it should be legal, although just print something to the compiler's stdout
04:56:07skrylaryou do need to go through the AST to do it safely, although depending on your needs it is possible to use a system such as `quote` to generate the AST for you
04:56:21skrylar(assuming quote works this week *prods dom96*)
04:57:48*yglukhov joined #nim
05:02:23bkerinhmm I just made forum post showing the non-building C problem
05:02:25*yglukhov quit (Ping timeout: 248 seconds)
05:03:14bkerinhmm
05:09:32skrylarVarriount: these examples make me cry. they are using constant numbers for error code ._.
05:28:06bkerinhmm I can sort of get what I want by introducing a const e.g. const tablesConst = tables but there's no way to bind the const to the end of compile time, except putting it at the end of the program :(
05:28:10bkerinas far as I can see
05:29:25FromGitter<Varriount> skrylar: You mean, just plain integers - not attached to consts or anything?
05:29:50FromGitter<Varriount> bkerin: Can't a const be modified by compile time code?
05:31:40bkerino
05:31:42bkerinmaybe
05:32:58FromGitter<Varriount> bkerin: Hm, nope
05:33:49skrylarVarriount: yes. raw sqlcodes
05:34:02skrylar"if [..] == -695"
05:34:18FromGitter<Varriount> skrylar: Oh gosh, you must be in such pain.
05:34:38bkerinit would be sort of confusing for const to have that odd different meaning in compile-time code anyway
05:35:05skrylarVarriount: well, getting data back out is strange.
05:35:10FromGitter<Varriount> bkerin: What are you aiming to do?
05:35:38bkerinwell I made a dbbclass macro starting from the OOP macro in the nim by example
05:35:57bkerinit generates database-backed classes mostly automagically
05:36:17bkerinbut now I need to make sure the backing tables are there at run time
05:36:59bkerini have all the field lists for each class built up in a compile-time var and I want to transmit it to the run-time
05:40:25skrylartrying to show a file made me wonder how well ipfs works for file sharing. hrm
05:41:39skrylarVarriount: this is the part that also takes up quite a bit of time https://www.dropbox.com/s/8kud6sh3jgh9dv5/firebird3.pdf?dl=0
05:42:30FromGitter<Varriount> skrylar: What are you using to generate/write that PDF?
05:43:02bkerinlooks like there are some reports/pull requests fot this sort of stuff: #6041, #6050
05:43:31skrylarVarriount: texinfo
05:43:48FromGitter<Varriount> bkerin: Have you looked at ormin? https://github.com/Araq/ormin
05:45:36bkerinhmm interesting... I had wondered about prepared statements and gave it up as too hard for now
05:46:19skrylarThey actually aren't bad once you understand them
05:46:35FromGitter<Varriount> Also, apparently Nim has a parsesql module
05:47:06skrylaryou just tell it you want to prepare something like 'INSERT INTO posts VALUES (spam=?)' and then you tell it that ?#1 is "birdseed!!"
05:47:42skrylarso theres no injection attacks possible
05:47:53FromGitter<Varriount> I wouldn't quite call it an ORM, to me it's something a bit lighter than that, but w/e
05:48:11skrylari looked in to ormin very slightly
05:48:44bkerinskrylar: yah I've used them from perl, but they make ORM type stuff harder
05:49:41bkerinskrylar: and in my case I want to implement undo via the database using triggers which also makes prepared seem a bit harder
05:49:55bkerinI'm not seeing how araqs thing works yet
05:50:03skrylartheres no real obligation to keep prepared statements for long
05:50:13skrylarthe exec_immediate routines create/prepare/drop them in one go
05:50:22FromGitter<Varriount> bkerin: That's because you haven't found the invisible documentation yet. :P
05:50:38skrylarwell in skrycode.. the very visible documentation 8)
05:50:51skrylarexcept maybe rfc3339 is poorly documented
05:50:54FromGitter<Varriount> bkerin: So, you first create an SQL file with a bunch of "create table" statements.
05:51:05bkerinah it goes from that
05:51:12FromGitter<Varriount> You use an "importModel" macro to "import" the table structures
05:51:14bkerinother way around I was suspecting that
05:52:00FromGitter<Varriount> Then you use the orm/queries module to create prepared statements.
05:52:18skrylarwell it just depends on your code
05:52:24skrylarthey don't use ORMs in huge database stuff afaik
05:52:41skrylaractiverecord and stuff breaks down when you are dealing with more than just CRUD on a handful at a time
05:52:56bkerinmine is a little more class-friendly in that it builds up the tables for descendent types for you
05:53:22bkerinskrylar: I believe it
05:53:39FromGitter<Varriount> I'm used to more "object"-oriented ORMs, where you define the obejcts, and how they relate to the table
05:53:40skrylarthere is a saying.. there is no middleware when you become giant
05:53:48skrylarevery problem becomes a company specific problem
05:54:15bkerinyou too can be a cog in the machine of a giant software company
05:54:17bkerinfun
05:54:26skrylarpff. i'm unhirable
05:54:39bkerinnice
05:54:51skrylarnot that nice. poverty sucks
05:55:10FromGitter<Varriount> skrylar: What makes you unhirable?
05:55:32bkerinhmm, maybe move to alaska live in cabin like me?
05:56:26FromGitter<Varriount> bkerin: Do you end up having to fight bears for internet access. :P
05:56:44bkerinall the time
05:57:08*kier quit (Quit: No Ping reply in 180 seconds.)
05:58:16bkerinthough I'm in seattle at the moment and if I could afford I'd live here in winter
05:58:46FromGitter<Varriount> I live on the east coast. Housing prices vary quite a bit depending on the area
05:59:46bkerinyeah I'm sure there's affordable stuff in states I just only end up visiting these crazy expensive places and never find other options
06:00:25FromGitter<Varriount> bkerin: You could always try hitting one of us up, if it's for a few days.
06:01:46bkerinhmm that would be really nice, and nim-oriented airBnB alternative ty :)
06:02:31*kier joined #nim
06:03:43bkerinI'm in fairbanks if you ever want try Alaska, could have nim conference
06:04:06FromGitter<Varriount> We could do what the Pypy team does, and host sprints
06:05:56bkerinmm nim is more exciting than python those people should also switch to nim sprints
06:06:12*endragor quit (Remote host closed the connection)
06:07:34*mr_yogurt quit (Ping timeout: 260 seconds)
06:08:40bkerinwell bed time for me, night gents
06:09:04*bkerin quit (Quit: Confucius say: Man who Farts in Church sits in own pew.)
06:17:46*endragor joined #nim
06:25:19*yglukhov joined #nim
06:29:27*yglukhov quit (Ping timeout: 240 seconds)
06:36:37skrylarthe yak shaving list is so long
06:40:06*nsf joined #nim
07:02:24*couven92 joined #nim
07:18:16*yglukhov joined #nim
07:19:27*rauss quit (Ping timeout: 240 seconds)
07:22:55*yglukhov quit (Ping timeout: 268 seconds)
07:23:36*SenasOzys_ joined #nim
07:24:59skrylarVarriount: you must use the proper datatype based on this enum, but the enum->datatype is only indirectly documented :D
07:29:04*kobi7 joined #nim
07:29:16kobi7hi guys, do you get intellisense in vscode?
07:29:37*rauss joined #nim
07:30:21kobi7it doesn't work here. is it just a wrong setup of paths or something, or simply not available yet?
07:31:02skrylari don't personally use vscode
07:31:35skrylartrying to remember who here does
07:32:03kobi7oh, do I need to run nimsuggest?
07:33:12skrylarnimsuggest needs to be installed, yes.
07:33:25kobi7it's installed, but not sure it runs
07:33:54kobi7I assume the vscode nim extension makes sure to run it -- but doesn't seem to work here.
07:34:09skrylaryglukhov uses it, don't know that he's awake
07:35:56kobi7I actually just try to figure out the api of nimx, without delving into source codes. it's not easy to find free time here :-)
07:36:37couven92kobi7, yes, the VS Code nim plugin has issues from time to time. We do not really know what is causing them
07:37:13kobi7I reinstalled. let's see...
07:37:52couven92In my experience, opening up `.vscode/settings.json` in your workspace folder and adding the `"nim.projects"` key helps
07:39:00couven92though then you will not get IntelliSense for any random nim file you open, but rather IntelliSense for all files that are directly or indirectly included for your project
07:45:39*vlad1777d_ joined #nim
07:53:41*vlad1777d_ quit (Ping timeout: 240 seconds)
07:56:23*Arrrr joined #nim
07:56:23*Arrrr quit (Changing host)
07:56:23*Arrrr joined #nim
08:00:11kobi7couven92: where does vscode store its global settings.json file?
08:01:06*gokr joined #nim
08:01:07couven92in `%APPDATA%\Code\User\settings.json`, but that's not where you want to add nim project files to the `nim.projects` setting!
08:01:51kobi7where would that be in linux?
08:02:22couven92No idea, but why do you want to edit the gloabl settings?????
08:02:28couven92DON'T do that!
08:03:02kobi7it has some error, packages that added the same key.
08:03:15couven92???
08:03:35kobi7Duplicate object key
08:04:24couven92What are you talking about, you have completely lost me now
08:05:42kobi7I thought, perhaps the extension isn't working, due to some local failure - I saw this warning, when opening the Settings window. but it's on the left side - the un-editable, system settings.
08:06:20couven92I still have no idea what you are talking about, start from the beginning please
08:06:45kobi7nevermind.
08:07:41kobi7tried to discover an api, through an ide. didn't work, so wanted to see if I can easily fix it. guess not.
08:15:29*PMunch joined #nim
08:24:19*claudiuinberlin joined #nim
08:43:55hohlerdeI am getting this with latest devel on x86 and x64: .nimble\pkgs\oldwinapi-2.0.0\oldwinapi\windows.nim(22905, 10) Error: type mismatch: got (int) but expected 'int32'
08:45:02Arrrryou have to convert your int to int32, for example: int32(123), int32(myInt)
08:45:18hohlerdefixing it seems obvious, but I wonder if I am the only one getting it :-)
08:46:10Arrrrnim is very loudy with these things
08:48:28hohlerdeyes, I am just a bit surprised that this is in windows.nim
08:48:38*jjido joined #nim
08:50:47*kobi7 quit (Quit: Leaving)
08:51:31*yglukhov joined #nim
08:52:20*yglukhov quit (Read error: Connection reset by peer)
08:52:33*yglukhov joined #nim
08:53:21*yglukhov quit (Remote host closed the connection)
08:53:34*yglukhov joined #nim
08:59:10def-hohlerde: it's gotten more strict recently. I see this error in quite a few of my code as well
09:01:14*xkapastel quit (Quit: Connection closed for inactivity)
09:03:02*miran joined #nim
09:06:17hohlerdeI see
09:07:07hohlerdeI am trying to port an old program to run with the latest compiler ... seems quite a bit of work
09:07:44*kier quit (Ping timeout: 248 seconds)
09:08:33*jinshil quit (Quit: Good-bye!)
09:25:07FromGitter<mratsim> Would love to get some sprints in Nim. Like a weekend per month we do as a community: bug squashing, documentation, small features, PR reviews whatever is needed but would be made more fun by not doing it alone.
09:27:12*kier joined #nim
09:28:03FromGitter<mratsim> I just stumbled upon this: :O https://nim-lang.org/docs/apis.html
09:30:48*jjido quit (Ping timeout: 240 seconds)
09:34:21skrylari do find it boring that you have to constantly put '.int32' everywhere.
09:35:02skrylari suppose its there so you don't make weird expectations like "i can always assign an int to a uint and it will work out!" well sure, it will work out until you try to assign a negative to that uint, then it won't work at all.
09:35:29euantoryou can do `'i32` too
09:35:43euantor`let a = 5'i32` which is slightly shorter
09:37:16skrylari've mostly been burying those details inside of calls. ex in the date module you just pass in an int, which is asserted at runtime in debug builds and cast to the right tyepe
09:37:29skrylaralthough i didn't know about range types when i wrote that, or i'd have done that instead
09:50:58*skrylar quit (Remote host closed the connection)
09:51:54*willcdot joined #nim
09:53:03*willc quit (Ping timeout: 248 seconds)
09:56:32*Vladar joined #nim
09:57:13*floppydh joined #nim
10:03:19floppydhI guess you cant ever modify an "index-variable" in a for stmt? - like "for x in 0..10: if x == 2: x+=2"
10:04:12Araquse a while loop instead, 'for' is for "structured" looping (no infinite loops)
10:05:03floppydhI'm trying to skip some elements in a 'for', but I guess it amounts to the same thing?
10:06:34floppydhwould it be possible to get a reference to an iterator inside a for loop and advancing/discarding a value? :>
10:08:56miranfloppydh: "I'm trying to skip some elements in a 'for'" - use `continue`?
10:09:26floppydhmiran: don't want to reset the loop, so basically just discard iterator.pop() :>
10:10:19floppydhI mean all my issues could easily be solved with nims meta-programming features, just thinking out loud
10:23:58*ShalokShalom_ joined #nim
10:26:21*ShalokShalom quit (Ping timeout: 240 seconds)
10:44:14floppydhstrutil's % doesnt format numbers right? - just does string interpolation
10:45:59def-floppydh: correct, you can use formatFloat() separately or use strfmt
10:46:16floppydhdef-: strfmt is external dep?
10:46:19def-yes
10:46:37floppydhtrying to formatint 2 -> 002
10:46:40floppydhno such thing tho
10:46:42def-https://lyro.bitbucket.io/strfmt/
10:46:43floppydhguess I'll get strfmt
10:47:59def-floppydh: or strutils.align($myNumber, 3, '0')
10:48:07floppydhdef-: beautiful
10:48:55floppydhmaybe it's just me but % formatting is misleading, seems to take from python? but pythons % does more
10:49:15def- with strfmt: echo interp"My number is ${myNumber:03}"
10:49:16floppydhnot like really an issue, but led me astray a bit
10:49:46def-and I think I saw something strfmt like coming to Nim standard lib
10:50:01floppydh<3
10:51:16def-https://github.com/nim-lang/Nim/pull/6507
10:51:31def-But I found strfmt nice to use and powerful enough
10:55:52*sz0 joined #nim
10:59:47FromGitter<mratsim> Is there a wiki or a post with "wanted" modules for the stdlib?
10:59:53floppydhhmmm... I can't stop json module from escaping my strings or can I?
11:01:35floppydhI don't think escaping umlauts in json is mandatory for json?
11:01:54floppydhactually json requires to be utf8 by default?
11:02:31floppydhlets see if nimyaml offers a way to unset this
11:06:46floppydhye, nimyaml by default doesn't escape umlauts
11:07:05floppydhdoes it make sense to open an issue proposing to add a way to disable umlaut-escaping from stdlib json outputs?
11:07:32floppydhIIRC python has such an option with ensure_ascii
11:08:38FromGitter<alehander42> @mratsim we had an idea for wiki / issue repo with "wanted" stuff for the ecosystem and stdlib several weeks ago somewhere in the chat
11:09:24FromGitter<mratsim> A bit like rust_rfcs repo?
11:09:56FromGitter<mratsim> Or in a nim-lang wiki?
11:15:47Araqfloppydh: iirc that was changed in nim devel...
11:16:51floppydhAraq: oh thanks, just checked on GH and yeah it looks better
11:16:58floppydhtime to update I guess
11:19:07FromGitter<data-man> @mratsim: What the users want  https://nim-lang.org/blog/2017/10/01/community-survey-results-2017.html#what-critical-libraries-are-missing-in-the-nim-ecosystem
11:22:09FromGitter<alehander42> @mratsim rfcs-s / pep-s are changes specifical for the language, nim lang repo is good for that
11:22:28FromGitter<alehander42> more of something like https://github.com/crystal-community/crystal-libraries-needed/issues (just an example of the format)
11:22:39FromGitter<alehander42> araq seemed to prefer a wiki, so probably a wiki
11:23:07AraqI can create a repo for you
11:23:11Araqjust a sec
11:23:40FromGitter<mratsim> Wiki is good to present an overview but a repo with issues is better for vote/discussion
11:23:52FromGitter<alehander42> exactly
11:24:37dom96oh, are we making an rfcs and "libraries needed" repos?
11:25:42Araqhttps://github.com/nim-lang/needed-libraries
11:25:42FromGitter<alehander42> seems useful to me
11:26:11dom96Nice :)
11:26:12FromGitter<alehander42> awesome!
11:26:16AraqI would probably misuse the issue tracker for nim-lang/packages but here you go
11:26:44FromGitter<mratsim> Rfcs works fine today no? Unless the current 1000+ issues are too much
11:27:11dom96If we want an RFC repo then we should come up with a good RFC structure that all RFCs should follow
11:28:00FromGitter<alehander42> so probably the next step is to add the ideas from https://nim-lang.org/blog/2017/10/01/community-survey-results-2017.html#what-critical-libraries-are-missing-in-the-nim-ecosystem for now as issues
11:28:39FromGitter<alehander42> I can write a script to do that later
11:36:57Araqdom96: just copy Python's PEPs
11:41:25Araqmratsim: they are too much.
11:41:42AraqI mean ok, I don't look at them without filters but still
11:49:19*arnetheduck joined #nim
12:02:58euantor`This repository contains a list a needed libraries.` -> `This repository contains a list of needed libraries.`
12:05:30floppydhdevel is supposed to work no? - so when a lib I'm using breaks on devel I'm free to demand things from the guy making it?
12:06:10*Snircle joined #nim
12:06:32dom96hah, "demand" is a bit strong :)
12:07:05dom96-> "This repository contains a list of libraries that are missing in Nim's package ecosystem"
12:07:13dom96Also, anyone want to write a readme for that repo?
12:09:20hohlerdewow, 0.17.3 totally broke my driver. getting a lot of gcunsafe compiler errors, whereas with 0.15.x it worked
12:10:37hohlerdeit seems my main problem is, I use a asynchttpserver on a thread (which is needed, as this is a windows service).
12:13:09FromGitter<mratsim> “I demand a trial by combat"
12:14:14dom96if you're using global vars then they need to be thread local
12:14:21*dddddd joined #nim
12:14:27dom96if not then you can mark your procs with {.gcsafe.}
12:15:15hohlerdeas far as I can see all globals I use are marked with {.threadvar.} ... and it worked before
12:17:17hohlerdeall my procedures, which work on data passed as arguments are marked as gcunsafe by the compiler
12:18:23hohlerdeI am not blaming, I am just a bit surprised
12:19:52dom96weird
12:21:04hohlerdeis there a way to tell the compiler to print out information about what it thinks is unsafe?
12:23:18Arrrr140 beings in this channel, it is breaking records.
12:28:17Araqrecord is at 146 iirc
12:40:46*pwntus joined #nim
12:41:15*pwntus quit (Changing host)
12:41:15*pwntus joined #nim
12:59:14FromGitter<alehander42> @dom96 I can try to write a README and prepare the initial issues based on the report later today
12:59:54dom96alehander42: brilliant :)
13:00:03dom96Record is in the IRC topic: git.io/gHZGCg
13:00:04dom96170
13:08:33*arecaceae quit (Remote host closed the connection)
13:08:53*arecaceae joined #nim
13:24:02*nsf quit (Quit: WeeChat 1.9.1)
13:30:27*PMunch quit (Ping timeout: 240 seconds)
13:31:42*SenasOzys_ quit (Ping timeout: 260 seconds)
13:39:43*PMunch joined #nim
13:40:12*SenasOzys_ joined #nim
13:41:34*elrood joined #nim
13:42:38FromGitter<Varriount> dom96: What about those of us who are only in Gitter?
13:53:29FromGitter<mratsim> "Why Zig when D, Rust, C, C++ exist": https://www.reddit.com/r/programming/comments/7cumiy/why_use_zig_when_c_d_and_rust_exist/
13:58:45floppydhhttps://github.com/nim-lang/Nim/commit/8cc268876a214d164899b0d0a0ccdcb98a861b1b did capturing in non-closure inner procs never work at all or does it work in some cases?
13:58:56*gokr quit (Ping timeout: 248 seconds)
14:00:46Araqmratsim: "because the existing languages are too 'complex' and so I'm reinventing things adding required features until the result is as complex but it took a decade to get there"
14:04:09FromGitter<mratsim> Well I'm also guilty of that with Arraymancer w.r.t. Numpy, Julia, Matlab, etc. I just say that the unofficial reason I'm doing Arraymancer is that it's fun :p.
14:06:37flyxdid the {.inline.} semantics recently change to not allow captures? context: NimYAML breaks on devel https://github.com/flyx/NimYAML/issues/49
14:17:46floppydhflyx: flyx https://github.com/nim-lang/Nim/commit/8cc268876a214d164899b0d0a0ccdcb98a861b1b
14:19:38Araqflyx: .inline is not .closure so can't capture anything. before that commit the compiler quietly changed the calling convention from inline to closure
14:20:16Araqmratsim: I thought the reason was to push Nim forward :-)
14:27:37FromGitter<alehander42> @dom96 I wrote some kind of initial README https://github.com/nim-lang/needed-libraries/pull/1
14:27:41FromGitter<mratsim> That's one of the official reasons ;)
14:29:23federico3alehander42 I recommend renaming the repo to include other ideas as well
14:38:52FromGitter<alehander42> can you suggest a better name ?
14:39:10FromGitter<alehander42> ecosystem-wishlist maybe ?
14:40:08FromGitter<alehander42> I think this name is good enough(people wouldn't hesitate to add a wish for better debugger just because it's "libraries")
14:40:50federico3even just idea-bank
14:41:08*endragor quit (Remote host closed the connection)
14:43:47*endragor joined #nim
14:44:13*Jesin quit (Quit: Leaving)
14:46:57flyxthanks floppydh, Araq
14:47:13floppydhflyx: I thank you for fixing NimYAML :)
14:47:59*endragor quit (Ping timeout: 248 seconds)
14:53:10*sz0 quit (Quit: Connection closed for inactivity)
14:55:59*nsf joined #nim
14:59:21FromGitter<mratsim> Btw @flyx I saw your comments on Reddit, you're one of YAML core devs?
14:59:40flyxmratsim: currently I am.
15:00:30*Jesin joined #nim
15:01:17FromGitter<mratsim> Currently? Like it happened by accident because you were doing Nim bindings?
15:01:44flyxyeah, that's kind-of the story.
15:03:42FromGitter<mratsim> Fun :)
15:03:42flyxI have not co-authored of any of the released specs, but two of the authors do not have the intention to further work on it, and the third one asked me if I was interested in helping him advance the language since I was pretty active on #yaml while implementing NimYAML, so I joined
15:09:26*floppydh quit (Quit: WeeChat 1.9.1)
15:10:04*floppydh joined #nim
15:10:10*floppydh quit (Client Quit)
15:10:32*floppydh joined #nim
15:10:43*jdhorwitz joined #nim
15:12:31*willcdot quit (Ping timeout: 248 seconds)
15:12:35*floppydh quit (Client Quit)
15:12:51*floppydh joined #nim
15:14:40FromGitter<krux02> I have an Ast that is partially typechecked
15:14:54FromGitter<krux02> now I transformed it and generated a new AST
15:15:13*jdhorwitz quit (Ping timeout: 248 seconds)
15:15:58FromGitter<krux02> I passed this new ast to a macro with a ``typed`` argument, but for some reason, I cannot get the type of the nodes
15:16:16FromGitter<krux02> the ast does not have more type information than before
15:16:35*sz0 joined #nim
15:20:42*miran quit (Quit: Page closed)
15:20:55Araqkrux02: I need a snippet to see for myself
15:22:58*PMunch quit (Quit: Leaving)
15:28:07*jdhorwitz joined #nim
15:39:42*rauss quit (Quit: WeeChat 1.9.1)
15:39:59*m0o joined #nim
15:40:54*rauss joined #nim
15:41:21*SenasOzys_ quit (Ping timeout: 248 seconds)
15:42:28*chemist69 quit (Ping timeout: 240 seconds)
15:42:51*chemist69 joined #nim
15:47:30*SenasOzys joined #nim
15:52:03*Jesin quit (Quit: Leaving)
15:54:20*jsgrant quit (Remote host closed the connection)
15:55:22*Jesin joined #nim
15:56:43*xet7bot joined #nim
15:57:59*xet7bot quit (Client Quit)
16:05:12FromGitter<krux02> Araq: I am starting now to write a compiler from Nim to glsl
16:05:47FromGitter<krux02> I write it in a macro
16:05:53FromGitter<krux02> I would like to map glm functions/type to glsl builtins
16:06:03FromGitter<krux02> but there are things that are a bit weird
16:06:37FromGitter<krux02> for example, from type to time, getTypeInst returns a Symbol "Vec4f" and sometimes it is a bracket expression Vec[4, float32]
16:06:48FromGitter<krux02> semantically it is the same
16:07:08FromGitter<krux02> Vec4f is just an alias for that, but in the ast I don.t get a normalized representation
16:09:55FromGitter<krux02> Araq: would you recommend to implement this instead of with macros as a branch in the compiler?
16:12:41Araqhmm not sure
16:14:05flyxwouldn't you lose almost all semantic checks the compiler makes when implementing it as macro?
16:14:15FromGitter<krux02> it is pretty much tied to the glm implementation
16:15:14FromGitter<krux02> Araq: I do some ast transformations, for example the macro expects only a single block of code in a do notation and the macro then spits that block of code into fragment- and vertex-shader
16:16:17FromGitter<krux02> I have a transformation to an ssa (single static assignment) list
16:16:41FromGitter<krux02> after this transformation I would like to update the typechecker, but for some reasons this fails
16:16:44FromGitter<krux02> I don't know why
16:17:14*endragor joined #nim
16:17:50Araqwhat do you mean "update the typechecker"?
16:22:02*endragor quit (Ping timeout: 260 seconds)
16:22:23FromGitter<krux02> Araq: I have a type ast. Then I transform this ast into SSA form (single static assignment). And this SSA form has now nodes of let expressions.
16:23:01FromGitter<krux02> eg: let a = bar(foo(b)) ~-> let tmp = foo(b); let a = bar(tmp)
16:23:17FromGitter<krux02> list statementlist I would like to typecheck again
16:23:36FromGitter<krux02> but for some reason it just goes through the typechecker without any modifications
16:23:56FromGitter<krux02> nodes don't have types
16:25:14Araqyeah well, partial type checking is a pita to support
16:25:36FromGitter<krux02> http://ix.io/CfZ
16:26:02GitDisc<treeform> I was very surprised when I saw this project https://github.com/yglukhov/nimsl doing a nim to GLSL translation in 500 lines of code. I never though some thing like this would be possible as a DSL, and here it is.
16:26:21FromGitter<krux02> treeform: I know that project
16:26:29FromGitter<krux02> I do something similar yet a bit different
16:26:31GitDisc<treeform> krux02, Do you have yours some place?
16:26:39FromGitter<krux02> yes of course
16:26:39GitDisc<treeform> What are the differences?
16:26:46FromGitter<krux02> but mine doesn't work yet
16:27:04FromGitter<krux02> the difference is, that I want to support more of OpenGL
16:27:27GitDisc<treeform> ok. Then my mind was blown that he had an emulator for GLSL as well, so that you can write tests etc...
16:27:35GitDisc<treeform> Will you also have an emulator?
16:27:52FromGitter<krux02> I want to support Framebuffers and arbitrary attributes and automatic sepration of FragmentShader/VertexShader
16:28:07FromGitter<krux02> the other project is more a proof of concept nothing you would really want to use in practice
16:28:47GitDisc<treeform> Well I like that it maps 1:1 to GLSL.
16:28:54GitDisc<treeform> But yes I have not used it in production yet.
16:28:58FromGitter<krux02> treeform: not an emulator, but the code that is used in the shader should be possible on the CPU as well
16:29:02FromGitter<krux02> meaning you should be able to share code on the CPU and the shader
16:29:09FromGitter<krux02> but that is technically not emulation
16:29:19GitDisc<treeform> yeah sorry, cross compiler
16:29:34FromGitter<krux02> when the glsl compiler has a bug it might happen thet the CPU code works but the GPU code just doesn't
16:29:37GitDisc<treeform> the repo calls it emulation but we know what we mean
16:29:51FromGitter<krux02> i wouldn't call it emulation
16:29:54GitDisc<treeform> Sure but that is a GLSL but, and we know how to deal with it.
16:30:00FromGitter<krux02> I just call it compilation
16:30:24FromGitter<krux02> I am thinking of compiling to SPIR-V instead of GLSL
16:30:40GitDisc<treeform> I like that you can unit test GLSL code and put print statments inside it.
16:30:46FromGitter<krux02> But I have little knowledge about SPIR-V so I don't start with that
16:31:06GitDisc<treeform> can you use SPIR-V in openGL or us vk?
16:31:13GitDisc<treeform> just*
16:31:29FromGitter<krux02> yes that is what I will support, but you won't be able to cross compile texture lookup statements
16:31:47GitDisc<treeform> why no texture lookup?
16:31:56FromGitter<krux02> yes you can just use SPIR-V in OpenGL
16:32:02FromGitter<krux02> no vulkan required
16:32:10FromGitter<krux02> it is opengl 4.6 I think
16:32:17GitDisc<treeform> will you support cross compiling dx and dy functions?
16:32:22FromGitter<krux02> and with ARB extensions also in older versions
16:32:31FromGitter<krux02> nope
16:33:17FromGitter<krux02> as I told you, there is no rasterization on the CPU side and I won't reimplement a software rasterizer just for debugging purpose
16:33:20Araqkrux02: there are multiple ways to do something like that. a "Production quality" solution seems to be to write types and operations that support the "DSL" you want and then add a Nim backend that outputs GLSL
16:33:45federico3is there a dashboard with the Travis CI build logs?
16:35:18FromGitter<krux02> Araq: the types and operations that are supported in the DSL are already implemented
16:35:25FromGitter<krux02> it is the glm package
16:37:52*m0o left #nim ("Leaving")
16:39:00GitDisc<treeform> Got my first packadge merge into the nimble list of packages https://treeform.github.io/chrono/ So I have that going for me.
16:42:06*miran joined #nim
16:42:23*hohlerde sent a long message: hohlerde_2017-11-14_16:42:22.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/gtkNdXovXuhaBcMVkiuxlGZn>
16:44:43GitDisc<treeform> fmAppend?
16:44:47GitDisc<treeform> you probalby wnat read?
16:46:41Araqkrux02: ok, so would the compiler patch only be a backend?
16:49:38FromGitter<krux02> Araq: I found a solution for now, when I do tha SSA transformation I can just keep the type inforamtion in the let expression
16:50:01Araqok
16:50:12GitDisc<treeform> So your GLSL will be a seperate compiler target, not just macros?
16:50:19FromGitter<krux02> and yes it would only be a backend
16:50:38FromGitter<krux02> but it is not a complete backend that is a new compilation target
16:50:49FromGitter<krux02> like "nim cpp file.nim"
16:51:10GitDisc<treeform> `nim glsl file.nim`
16:51:12FromGitter<krux02> the main backend would still be the C backend it would be only for the part that runs on the GPU
16:51:25FromGitter<krux02> treeform: exactly that is not what I am doing
16:51:30GitDisc<treeform> ok
16:51:39GitDisc<treeform> i am still interested to see what you will be doing
16:51:47*Trustable joined #nim
16:52:15FromGitter<krux02> well you can get an idea here: https://github.com/krux02/opengl-sandbox
16:52:42FromGitter<krux02> that is my project and up until now I used strings for thet part that runs on the GPU
16:52:55FromGitter<krux02> from now on I would like to replace the strings with pure nim code
16:53:01FromGitter<krux02> that eventually runs on the GPU
16:53:08FromGitter<krux02> so it is mixed CPU and GPU code
16:53:27FromGitter<krux02> and still there is full control of what runs on the CPU and what runs on the GPU
16:55:14GitDisc<treeform> yeah that would be cool. I was working on this project in nim:
16:55:16GitDisc<treeform>
16:55:16GitDisc<treeform> https://cdn.discordapp.com/attachments/371759389889003532/380037983782436867/unknown.png
16:55:23GitDisc<treeform> I was working on shaders for the planets.
16:57:05GitDisc<treeform> I need to switch to a nim shader based solution.
16:58:12*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
16:58:24FromGitter<krux02> what do you mean?
16:59:16GitDisc<treeform> it would be cool to use him instead of stupid strings
16:59:22GitDisc<treeform> with GLSL in them.
16:59:36GitDisc<treeform> got to go to work.
16:59:45GitDisc<treeform> slowly trying to use nim there as well.
16:59:56FromGitter<krux02> well I found out, that not strings are the problem, but that strings are not really embedded in the language
17:00:30FromGitter<krux02> you have to do a lot of stull to define the interface between GLSL and the Nim code (or c++ if you work in that language"
17:01:10FromGitter<krux02> I fixed the intraface problem
17:10:46*NimBot joined #nim
17:11:01*jdhorwitz quit (Ping timeout: 240 seconds)
17:19:23hohlerdetreeform: I want to append to a file
17:23:03*gokr joined #nim
17:23:10*sz0 quit (Quit: Connection closed for inactivity)
17:30:13hohlerdetreeform: almost the same happens in the logging module when you want to append to an already existing log file. found it on github: https://github.com/nim-lang/Nim/issues/6141
17:44:48*ShalokShalom_ quit (Ping timeout: 240 seconds)
17:48:16FromGitter<krux02> hohlerde: well I suggest you open the file, append to it and then close it again.
17:48:50*gokr quit (Ping timeout: 268 seconds)
17:51:29*SenasOzys quit (Ping timeout: 248 seconds)
17:56:17*fredrik92 joined #nim
17:56:25*SenasOzys joined #nim
18:05:18*floppydh quit (Quit: WeeChat 1.9.1)
18:06:49*claudiuinberlin joined #nim
18:15:06*xkapastel joined #nim
18:21:08*yglukhov quit (Remote host closed the connection)
18:30:32*Jesin quit (Quit: Leaving)
18:31:28*nsf quit (Quit: WeeChat 1.9.1)
18:31:46*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:34:10*claudiuinberlin joined #nim
18:54:24*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:56:39*claudiuinberlin joined #nim
18:57:17*PMunch joined #nim
18:59:59FromGitter<Varriount> @dom96 https://forum.nim-lang.org/t/3332
19:00:20*marenz__ joined #nim
19:01:37dom96I guess Araq removed it :)
19:01:39dom96I made him a spammer
19:03:02FromGitter<ntdef> hey how do I call `std::cout << someCppVar` from nim, or overload it to echo?
19:03:45FromGitter<ntdef> I'm importing a type from a library that prints to stdout, but it's not clear from the docs how to import the method
19:04:35*miran quit (Quit: Konversation terminated!)
19:05:26dom96You could just {.emit: """std::cout << someCppVar""".}
19:05:33dom96Not sure if there is a better way
19:05:44FromGitter<ntdef> is that the best/recommended way?
19:06:30FromGitter<Varriount> importcpp might have a way to do it
19:07:25*JappleAck joined #nim
19:07:27FromGitter<Varriount> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma
19:08:40FromGitter<Varriount> @ntdef Is there a way to call the '<<' operator like a regular function in C++?
19:08:50FromGitter<Varriount> (I can't remember)
19:09:11FromGitter<ntdef> no idea; I'm trying to wrap a cpp lib so I don't have to write cpp xD
19:09:51FromGitter<ntdef> `std::cout << someVar` is pretty common in cpp though... might want to add a pragma for it
19:10:38hohlerdemhm, I guess it was the wrong decision to use nim for production
19:10:41FromGitter<Varriount> @ntdef https://stackoverflow.com/questions/3398825/how-do-i-call-operator-directly
19:11:14*yglukhov joined #nim
19:12:17FromGitter<Varriount> @ntdef So you could try `importcpp: "#.operator<<(@)"`
19:12:29FromGitter<Varriount> Of course, then the first argument would need to be the stdout object
19:12:37FromGitter<ntdef> right
19:12:38FromGitter<ntdef> let me try it
19:14:35FromGitter<Varriount> hohlerde: C++ is not the easiest language to interface with.
19:15:02FromGitter<Varriount> I honestly don't know of many languages that even try to interface with C++.
19:15:15FromGitter<ntdef> yeah. I mean it's on the Nim homepage as an example
19:15:17*SenasOzys quit (Ping timeout: 255 seconds)
19:15:45*yglukhov quit (Ping timeout: 248 seconds)
19:16:59FromGitter<ntdef> I didn't think it would be *this* difficult
19:17:29FromGitter<Varriount> Well, what difficulties have you run into so far?
19:17:41*yglukhov joined #nim
19:18:21FromGitter<ntdef> there aren't very many examples about how to do things
19:18:36FromGitter<ntdef> about how to use the pragma specifically
19:19:07FromGitter<ntdef> in addition the c2nim install is straight up broken
19:19:12hohlerdevarriount: it's not C++ ... I wrote an ATM driver in nim using libusb. it provided a REST interface and events via websocket and worked pretty well, compiled with nim 0.14.x and 0.15.x. now i wanted to fix some things and used the latest devel and it seems it is broken. i used basic OO a lot, asynchttpserver and threads, because the driver is also capable of running as a windows service (windows service callbacks etc.).
19:19:13hohlerdecompiling works, but running results in a crash.
19:20:12FromGitter<ntdef> I tried installing c2nim on both my mac and a clean ubuntu env and I got errors both times
19:20:20FromGitter<ntdef> even when trying to compile from source
19:22:40FromGitter<Varriount> I don't know about Ubuntu, but on Mac I just install Nim + C2Nim using `brew install nim --HEAD`
19:23:20FromGitter<Varriount> On Windows I just download it, and dump it in C:/Nim/
19:23:40FromGitter<Varriount> How did you install it on Ubuntu?
19:24:38FromGitter<Varriount> hohlerde: Sounds like a memory corruption issue. Do you get any traceback with a program compiled in debug mode?
19:26:12*SenasOzys joined #nim
19:28:46hohlerdevarriount: no traceback, just a crash, probably because of freeing memory through libusb. using libusb's get version function returns some memory garbage. however, the point is it worked perfectly when compiled with an older nim version. I already wrote a smal test program with libusb and that works with the latest devel of nim.
19:29:44FromGitter<Varriount> hohlerde: It likely only worked with an earlier version of Nim due to how the underlying C++ code was generated.
19:29:52*yglukhov quit (Read error: Connection reset by peer)
19:30:02hohlerdeI use the default C backend
19:30:11FromGitter<Varriount> Well, C code then.
19:30:28*yglukhov joined #nim
19:32:16hohlerdevarriount: most probably yes. I think it is just too much work to find the culprit. rewriting from scratch might be easier.
19:32:33hohlerdeI am just a bit disappointed
19:32:44FromGitter<Varriount> hohlerde: What should the developers have done then?
19:34:13hohlerdevarriount: I am not blaming developers or the community. It was my fault. Nim is still evolving and I ignored that fact.
19:35:15dom96How did you solve the gc safety issues?
19:35:41hohlerdeI had to put {.gcsafe.} on a lot of procs and methods
19:36:14dom96It's possible that your code was never gcsafe and that the newer compiler found the bug.
19:36:26dom96Which you just told the compiler to ignore by adding {.gcsafe.} :)
19:36:45FromGitter<Varriount> We could take a look at it
19:36:47hohlerdeyes, maybe
19:36:51*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:36:56dom96Please don't give up on Nim :(
19:37:27*claudiuinberlin joined #nim
19:38:56hohlerdevarriount: that's a nice offer, but I can't hand out the code due to company policies. it's a driver for ATMs you'l find all around the world
19:41:54FromGitter<Varriount> Ah, I understand
19:42:28FromGitter<Varriount> hohlerde: I myself work in a sensitive industry too. It can be quite maddening.
19:43:14hohlerdevarriount: indeed :-)
19:43:20FromGitter<Varriount> We can't use X service or Y product or Z library because it doesn't have the certifications.
19:43:30FromGitter<Varriount> *right certifications
19:49:05FromGitter<Varriount> @ntdef Any luck?
19:49:44dom96ATMs running web servers? Isn't that a bit unsafe? :)
19:51:30FromGitter<Varriount> dom96: Probably safer than ATMs running Windows XP
19:51:45FromGitter<Varriount> They have to connect to the backend anyway.
19:53:59hohlerdedom96: not all, but some 
19:55:00dom96hohlerde: if you're up for some investigation you could bisect the compiler to find the commit that breaks things, might be a bit painful though (0.15 is a while back) but it's doable and would help us out
19:57:24FromGitter<Varriount> hohlerde: How about you hook up your stuff to ffmpeg. We could all be watching movies while we withdraw money from our accounts.
19:58:14*TjYoco joined #nim
19:58:50hohlerdevarriount: you already have that :-) have you never seen kind of advertising on the ATM screens ?
19:59:44hohlerdedom96: i can try, but not sure when I have the time for that
20:00:39hohlerdewait, some of my colleagues used an ATM for a demo
20:01:17*vlad1777d_ joined #nim
20:01:36hohlerdethere it is: https://www.youtube.com/watch?v=GynWoDcjE-4
20:02:26*Amun_Ra quit (Quit: WeeChat 1.6)
20:02:33dom96omg, I've used the exact same ATM
20:02:35hohlerdeit's a bit old, though
20:03:15dom96Isn't that a tad illegal? :O
20:03:22*Amun_Ra joined #nim
20:03:43*JappleAck quit (Ping timeout: 248 seconds)
20:03:47dom96I'm genuinely wondering
20:04:09dom96oh, he even takes out lots of money at the end
20:04:11dom96definitely illegal
20:04:20FromGitter<Varriount> I need to visit Europe again someday. Then I can meet up with Araq and all the other developers that live there.
20:04:50FromGitter<Varriount> That looks like it took place in Germany, or some place where German is a common language.
20:04:55dom96There might be an opportunity for that
20:04:58hohlerdedom96: the demo is really running on the ATM, but in the lab. the video is edited.
20:05:00dom96I applied to have a stand at FOSDEM
20:05:10dom96hohlerde: ahh
20:05:36hohlerdevarriount: yep, germany
20:06:32dom96I've used the same ATMs in Switzerland
20:06:47dom96Could have sworn the card was from UBS as well.
20:07:07FromGitter<Varriount> dom96: Nice to know the money from those monthly donations is being used for something.
20:07:26FromGitter<Varriount> I keep getting an image of it just laying around in a bank account somewhere.
20:08:02dom96well, it is mostly laying around
20:08:12dom96to be honest
20:08:24dom96but if we do get a stand we'll use some of it for that
20:08:59FromGitter<Varriount> If nothing else, it should be invested.
20:09:20FromGitter<Varriount> At least it will get some interest that way
20:10:16dom96That would require some significant effort and many decisions to be made
20:10:16*gokr joined #nim
20:10:24dom96It's easier to pay people like zahary via bountysource
20:12:32*Trustable quit (Remote host closed the connection)
20:16:32*JappleAck joined #nim
20:19:41hohlerdedom96: I am initializing libusb on a thread and when calling echo repr(libusbGetVersion()) I get the following: https://privatebin.tarakis.de/?a1840bd59109a7ed#5OJ8mlpPOG9fjYS0nDivqCSGXTmBTap7sojKF++2HN0=
20:20:15hohlerdedom96: I can't explain where the garbage comes from
20:20:41hohlerdedom96: at the bottom you'll see the actual structure returned
20:21:13dom96Do you get the same outcome with -d:release and without?
20:23:21hohlerdedom96: with -d:release I don't get the garbage
20:24:44hohlerdedom96: but still the program crashes, so it seems something is wrong with memory allocation
20:25:25dom96that would suggest to me that your stack is getting corrupted
20:26:01dom96another approach to finding the culprit is to strip your program in stages until the problem disappears
20:26:07*gokr quit (Ping timeout: 248 seconds)
20:28:13hohlerdedom96: yeah, already doing that, but it takes quite a long time
20:34:14*objection joined #nim
20:36:25hohlerdedom96: it runs with the 64bit version of libusb. with the 32bit version I get the garbage. program of course compiled with correct version of nim (64/32bit). one small step, but I am afraid the pain starts now.
20:37:19*JappleAck quit (Ping timeout: 248 seconds)
20:41:53*Jesin joined #nim
20:42:56*nsf joined #nim
20:45:49*objection quit (Quit: WeeChat 1.9.1)
20:49:10*Arrrr quit (Read error: Connection reset by peer)
20:49:34*JappleAck joined #nim
21:04:22*Vladar quit (Quit: Leaving)
21:16:25*fredrik92 quit (Quit: Client Disconnecting)
21:20:00*shodan45 quit (Remote host closed the connection)
21:20:29*shodan45 joined #nim
21:20:30*salewski joined #nim
21:22:46salewskiDo we already have something like Ruby's splash operator, which generates single values from an array or tuple?
21:22:50salewskiconst Color = [0.2, 0,5, 0.0]; setCol(context, Color[0], Color[1], Color[2]) # ==> setCol(context, *Color)
21:23:13dom96no
21:23:32dom96I wanted to implement it via macros but it's not possible
21:24:32salewskiOK, thanks. It is not too important, but would be nice.
21:27:30*salewski quit (Quit: WeeChat 1.9.1)
21:29:38Araqdom96: huh? impossible with macros?
21:30:01dom96I asked you this, can't you remember?
21:30:07dom96You can't do it with that syntax
21:30:42Araqwhy not?
21:31:00Araqit's possible now with getType, I think
21:31:05*r4vi quit (Ping timeout: 250 seconds)
21:31:10Araqand when you asked we didn't have getType
21:31:23dom96ehh, I don't think that has anything to do with this.
21:31:43dom96*Color -> Color[0], Color[1], Color[2] # What's the AST node here?
21:31:49*r4vi joined #nim
21:34:27*yglukhov quit (Remote host closed the connection)
21:36:15Araqah yes, but so what
21:36:19FromGitter<mratsim> Splat* not splash, it's quite useful in Python as well
21:36:36FromGitter<mratsim> But varargs covers my use cases
21:37:39AraqexpandArgs setCol(context), Color
21:37:45Araqis possible
21:38:19dom96Yes, but that's lame
21:38:49Araqit's consistent with how Nim works, that's not lame at all
21:39:21dom96The Python way is also consistent
21:39:52Araqin Python it's builtin magic
21:40:32*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:40:37Araqyou can't implement it in Python yourself, you cannot even overload this 'star' iirc
21:41:25FromGitter<Varriount> What do you mean, overload?
21:41:32Araqit's as special as it can become in Python, it's not "consistent" with anything
21:41:45Araqdef __unpackstar__() # does not exist
21:42:02FromGitter<Varriount> The star can be overridden by objects that implement the iterator methods
21:42:13*claudiuinberlin joined #nim
21:43:10FromGitter<Varriount> Araq: https://stackoverflow.com/questions/26293751/properly-implementing-python-star-operator-for-a-custom-class
21:43:22Araq:-) nice
21:44:15*JappleAck quit (Read error: Connection reset by peer)
21:44:49Araqnever would have thought of overloading __getitem__ or __iter__ for that, but ok
21:45:18FromGitter<Varriount> Double star is a bit less obvious: https://stackoverflow.com/questions/33402220/custom-double-star-operator-for-a-class
21:45:55Araqbut the unpacking itself still can't be done in the language for the same reason Nim can't do it ;-)
21:48:45FromGitter<Varriount> Araq: What do you mean by "in the language"?
21:49:25FromGitter<Varriount> As in, magically grab the requested data from the structure?
21:49:29Araqdo the expansion in your head
21:49:57Araqf(*a) becomes f(a[0], a[1])
21:50:09Araqbut what does * itself do? produce a tuple?
21:50:25Araqthen f(*a) becomes f((a[0], a[1]))
21:50:29Araqnot what we want
21:50:47Araqit needs to produce an "inline argument list"
21:51:03AraqNim has some super minor support for it named nkArgList
21:51:16AraqPython has no such thing.
21:51:55Araq(Nim's support doesn't suffice to make such a macro possible)
21:52:40FromGitter<Varriount> I don't follow. I thought it became f(a[0], a[1])
21:52:46dom96well meh
21:52:52dom96let's just implement it in the language then
21:53:16dom96it's a useful feature
21:53:29FromGitter<Varriount> Like, a compile-time 'expandArgs' macro?
21:53:39dom96Also, if I got a penny for the amount of times I had to write the equivalent of: Person(name: name, age: age) I would be a millionaire
21:53:42dom96We need syntax sugar for that
21:54:56FromGitter<Varriount> I think I would rather current efforts go towards 1.0, and/or improving the stdlib, not minor language enhancements
21:55:27Araqvarriount: I don't know how else I could explain it. f(*a) is not "apply star to a and then pass it to f", it's a special case
21:56:48*dmi0 joined #nim
21:59:38Araqit looks at the surrounding 'f' in order to do its work.
21:59:38Araqthat's not how anything else in Python's syntax works afaict
21:59:38Araqf(a + b) # can the '+' see the 'f'? no, it can't
21:59:38FromGitter<Varriount> Oh, I see what you're saying. It's not just another operator.
21:59:38Araqexactly.
22:00:21FromGitter<Varriount> Though, a term-rewriting macro could almost do it
22:02:56Araqdom96: we did some similar special casing for '^'. it was hard to implement and did bite us, the new implementation is without compiler support
22:03:01*Jesin quit (Quit: Leaving)
22:03:29dom96oh well, I agree with Varriount, we should focus on more important things
22:04:55*JappleAck joined #nim
22:05:01*Jesin joined #nim
22:08:31*TjYoco quit (Quit: Leaving)
22:11:22Araqindeed. we need to decide what the lookup rules should be for non-overloadable names clashing with overloadable names
22:11:41*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
22:12:08Araqhttps://github.com/nim-lang/Nim/issues/6726
22:12:38Araqcurrently I'm leaning towards "just look for a type in a generic T[] context"
22:13:45Araqbut strictly speaking it should be "ambiguous symbol: did you mean system.string or gdk2.string?"
22:13:59dom96is gdk2.string a type?
22:14:28dom96I guess not
22:15:08dom96can a `string` type even be defined?
22:15:19Araqsure
22:15:39*nsf quit (Quit: WeeChat 1.9.1)
22:26:36*yglukhov joined #nim
22:31:02*yglukhov quit (Ping timeout: 255 seconds)
22:35:11*dmi0 quit (Ping timeout: 240 seconds)
22:45:13FromGitter<Varriount> I prefer the ambiguity error
22:46:16FromGitter<Varriount> If it's ambiguous to the compiler, it is probably ambiguous to the reader
22:51:48GitDisc<treeform> I feel like because nim has method overloading the fun(*list) is less useful.
22:53:07GitDisc<treeform> dom96, thank you for adding my chrono package.
22:58:17*PMunch quit (Quit: leaving)
22:58:42*demian joined #nim
22:58:55FromGitter<Varriount> treeform: "include chrono/timestamps" should be "import chrono/timestamps" in the documentation?
23:00:35FromGitter<Varriount> Also, did you give any thought to making "minute", "hour", etc types so that one can do "calender + 1.minute"?
23:02:48*elrood quit (Quit: Leaving)
23:03:33dom96treeform: np
23:03:59dom96I think I'm leaning towards the ambiguity error as well ^^
23:08:00*jdhorwitz joined #nim
23:22:37*jdhorwitz quit (Ping timeout: 260 seconds)
23:34:57*demian quit (Ping timeout: 248 seconds)
23:42:22*endragor joined #nim
23:46:39*endragor quit (Ping timeout: 248 seconds)
23:53:57*Chuang-Tzu joined #nim