00:03:58 | * | user1101 quit (Read error: Connection reset by peer) |
00:04:08 | * | user1101 joined #nim |
00:11:43 | * | rbrt quit (Quit: Oíche mhaith) |
00:15:05 | * | vlad1777d joined #nim |
00:23:05 | * | leorize joined #nim |
00:32:00 | FromGitter | <krux02> how do I make a type pass by pointer by default? |
00:32:37 | leorize | krux02: {.byref.}? |
00:34:01 | FromGitter | <krux02> leorize, I will try it, thanks |
00:34:16 | FromGitter | <krux02> I think that was what I was looking for |
00:34:27 | FromGitter | <krux02> I just had it in my back of my brain, but forgot the name |
00:34:33 | FromGitter | <krux02> and did not know how to search for it |
00:37:15 | * | find0x90 joined #nim |
00:37:23 | FromGitter | <Varriount> @zacharycarter So, were you snowed in today? |
00:42:42 | FromGitter | <zacharycarter> @Varriount I did work from home - but I went out this evening after I finished shoveling - you? |
00:42:56 | FromGitter | <zacharycarter> @krux02 I've been playing with scopes - it's pretty sweet |
00:50:24 | * | find0x90 quit (Quit: find0x90) |
00:52:30 | FromGitter | <Varriount> @zacharycarter Stayed in my room all day, working and playing a new videogame. |
00:52:37 | FromGitter | <zacharycarter> :) which game? |
00:52:51 | FromGitter | <Varriount> Kirby Star Allies |
00:53:09 | FromGitter | <zacharycarter> nice :D |
00:53:16 | FromGitter | <zacharycarter> @Varriount - did you check out scopes? |
00:53:40 | FromGitter | <Varriount> No, what are/is scopes? |
00:53:53 | FromGitter | <zacharycarter> https://bitbucket.org/duangle/scopes/wiki/Home |
00:54:28 | FromGitter | <Varriount> @zacharycarter You might be interested in this: http://augeas.net/docs/index.html |
00:55:29 | FromGitter | <zacharycarter> ah cool - I'd never heard of that lib / tool - thanks! |
00:56:02 | FromGitter | <krux02> I try to do a bit of SIMD in Nim |
00:56:09 | FromGitter | <zacharycarter> how's that going? |
00:56:18 | FromGitter | <krux02> SIGILL: Illegal operation. |
00:56:27 | FromGitter | <Varriount> @zacharycarter No more long, complex pipelines with sed, awk and friends to manage configs. |
00:56:54 | FromGitter | <zacharycarter> @krux02 have you seen - https://github.com/jcosborn/qex/tree/master/src/simd ? |
00:56:58 | FromGitter | <krux02> well gcc has SIMD instrinsics that I can just use |
00:57:03 | FromGitter | <zacharycarter> @Varriount - yeah - this sounds heavenly |
00:57:06 | FromGitter | <zacharycarter> oh |
00:58:05 | FromGitter | <krux02> thanks, I was using a different wrapper. |
00:58:21 | FromGitter | <zacharycarter> np |
00:58:30 | FromGitter | <krux02> I am not sure if the wrapper is just broken, or if I am using it wrong, but currently I just have no results |
00:58:43 | FromGitter | <zacharycarter> :/ |
00:58:55 | FromGitter | <krux02> passing the m128 type already created the illegal instruction |
00:59:03 | FromGitter | <zacharycarter> yeah - I'd try that wrapper |
00:59:28 | FromGitter | <zacharycarter> here's the forum post related to it : https://forum.nim-lang.org/t/212 |
00:59:56 | FromGitter | <zacharycarter> that was the most up-to-date SIMD stuff I found related to Nim when searching last year |
01:06:24 | FromGitter | <krux02> @zacharycarter thanks a lot I only know this one here: https://github.com/bsegovia/x86_simd.nim |
01:06:53 | FromGitter | <krux02> nice thing was it is a repository just for SIMD. I don't need to download a framework that I just don't need for anything |
01:07:16 | FromGitter | <krux02> "Quantum EXpressions lattice field theory framework" I have no idea what that even is |
01:08:29 | FromGitter | <zacharycarter> me either |
01:08:33 | FromGitter | <krux02> @zacharycarter have you realized that most useful tools out there in the marked were created as a byproduct to produce something bigger? |
01:08:50 | FromGitter | <krux02> at least that is my impression |
01:09:58 | FromGitter | <zacharycarter> well large software problems generally involve multiple components / solutions working together |
01:10:25 | FromGitter | <krux02> when someone wants to make a tool as the main project, that tool often falls flat, because it was never tested on real projects, does some false assumptions about how it should be used and ends up totally useless, if not even harmful for productivity. |
01:10:26 | FromGitter | <zacharycarter> so I think it's fairly natural for a certain component to become useful enough that it gains adoption for whatever purpose, outside of the original solution it was intended for |
01:11:01 | FromGitter | <krux02> yes |
01:12:33 | * | athenot quit (Remote host closed the connection) |
01:12:56 | * | athenot joined #nim |
01:17:09 | * | gokr quit (Ping timeout: 264 seconds) |
01:17:21 | FromGitter | <zacharycarter> krux02: perfect example of this I found the other day - https://localstack.cloud/ - was a project by Atlassian for testing software against AWS, without AWS being available - so basically a giant service mock for AWS services. |
01:17:30 | FromGitter | <zacharycarter> now it seems to be its own company / product |
01:17:36 | FromGitter | <krux02> OK I created an issue asking nicely to put the SIMD stuff into a separate package. I hope we will get it eventually. |
01:18:03 | FromGitter | <zacharycarter> not sure they're active anymore but I agree - it'd be sweet! |
01:18:50 | FromGitter | <krux02> well asking nicely doesn't hurt. |
01:19:15 | FromGitter | <krux02> and this guy worked pretty long on the project, so meybe he is interested to not let everything die. |
01:19:32 | FromGitter | <zacharycarter> true |
01:19:40 | FromGitter | <krux02> the original author of nim-glm abandoned that project, but he was so nice to let me take that project ovor |
01:24:58 | * | MJCaley quit (Quit: MJCaley) |
01:28:22 | * | arecaceae quit (Remote host closed the connection) |
01:29:05 | * | arecaceae joined #nim |
01:35:52 | FromGitter | <Varriount> @zacharycarter I wonder if I can convince management to spring for the pro edition when it comes out. |
01:41:17 | * | mr_yogurt joined #nim |
01:43:25 | FromGitter | <krux02> @zacharycarter yay no illegal instruction anymore, thanks a lot |
01:44:01 | FromGitter | <krux02> I have honestly no idea about simd instructions yet. I never used those functions before. But I think they are quite useful |
01:44:26 | FromGitter | <krux02> I found mm_set_ps to set an sse type, but how do I load an sse type? |
01:44:53 | FromGitter | <zacharycarter> no idea - but if you find any useful use cases I'd love if you'd share them with me :D |
01:45:41 | FromGitter | <krux02> well at the moment I just cast the see type to an array |
01:45:43 | FromGitter | <krux02> it works |
01:46:14 | FromGitter | <krux02> pretty nice, gdb knows about the sse types and prints them nice by default |
01:46:21 | FromGitter | <krux02> nothing to configure |
01:49:51 | FromGitter | <zacharycarter> https://github.com/g-truc/glm/tree/master/glm/simd ¯\_(ツ)_/¯ |
01:55:30 | shashlick | @zacharycarter, referring to your aws lib discussion from earlier. Will be cool to make a rest wrapper to generate APIs for web services quickly |
01:55:32 | shashlick | Will that work for aws as well |
02:01:01 | FromGitter | <zacharycarter> hrm |
02:01:26 | FromGitter | <zacharycarter> well - AWS has a lot of specifics that make calling the API a rather specific tsk |
02:02:02 | FromGitter | <zacharycarter> I think the problem you'll run into there - is lots of APIs handling things like authentication / authorization in different ways - there's no real standard |
02:03:34 | FromGitter | <zacharycarter> the code Varriount worked on for AWS that I'm now working with - is very specific and I don't think you'd be able to use it w/ anything other than boto |
02:03:44 | shashlick | Do they have any structured format they publish at least? |
02:04:30 | FromGitter | <zacharycarter> not that I've been able to find - I mean there is the boto implementation in Python which you can look at, and implementations in other languages - but there's no real spec saying this is what you'll find in a service definition file |
02:04:39 | FromGitter | <zacharycarter> not that I've been able to find anyway |
02:05:07 | FromGitter | <zacharycarter> and regardless - no one else besides AWS is publishing API specs in the same format as boto |
02:05:10 | FromGitter | <zacharycarter> to my knowledge anyway |
02:06:44 | FromGitter | <zacharycarter> shashlick: are you looking for a lib to work on? |
02:07:00 | FromGitter | <zacharycarter> because I think there are a lot of opportunities for libs that will make Nim more attractive |
02:07:21 | FromGitter | <zacharycarter> I think generating RESTful APIs from a spec would be cool - but i'm not sure of any standard spec you could rely on |
02:07:45 | FromGitter | <zacharycarter> I think an even cooler project - would be providing GraphQL support for Nim ;) |
02:09:13 | shashlick | 😀 |
02:09:41 | FromGitter | <zacharycarter> that's not trivial at all either |
02:10:02 | FromGitter | <zacharycarter> something like - https://github.com/vektah/gqlgen - but written in Nim - would be amazing |
02:10:15 | FromGitter | <Varriount> @zacharycarter The most publically documented thing they have are the authentication procedures (the signing process) and the S3 API |
02:10:51 | FromGitter | <zacharycarter> @Varriount I really dislike AWS |
02:10:57 | FromGitter | <Varriount> :3 |
02:11:26 | FromGitter | <zacharycarter> @Varriount kubernetes will save us all |
02:12:37 | FromGitter | <zacharycarter> spent like 2-3 hours last night searching for a service definition spec |
02:13:20 | FromGitter | <zacharycarter> because I tried the dynamo service def out with your code and it blew up |
02:13:40 | FromGitter | <zacharycarter> so then I looked at rusoto and found fields in their parsing code that specified what fields were optional |
02:13:51 | FromGitter | <zacharycarter> but they didn't even consider all the fields in the JSON object |
02:14:07 | FromGitter | <zacharycarter> so it's just like one giant cluster F of a guessing game to figure out what you actually need to parse |
02:14:31 | FromGitter | <Varriount> Hm. |
02:14:55 | FromGitter | <Varriount> @zacharycarter You might try looking at the Java library. I think that one works off of XML. There might be a spec there. |
02:15:11 | FromGitter | <zacharycarter> ahhh okay good idea - thanks for the protip :) |
02:15:31 | FromGitter | <zacharycarter> @Varriount are you done with studies this year? |
02:15:52 | FromGitter | <Varriount> Nope. Spring 2019 is the anticipated date. :/ |
02:15:59 | FromGitter | <zacharycarter> ah okay |
02:16:08 | FromGitter | <zacharycarter> well, either way - it's getting close |
02:16:19 | FromGitter | <zacharycarter> once you graduate - we're starting some kind of company and we're going to write everything in Nim |
02:16:27 | FromGitter | <Varriount> :3 |
02:16:36 | FromGitter | <Varriount> We need product ideas first. |
02:17:22 | FromGitter | <zacharycarter> details... |
02:29:45 | FromGitter | <krux02> @zacharycarter I know about the original glm to have sse support, but no matter how I put it, I kind of don't like how it works |
02:30:05 | FromGitter | <krux02> a lot of implementations are nice to copy paste, but the branching really kills it. |
02:30:27 | FromGitter | <zacharycarter> gotcha |
02:30:48 | FromGitter | <krux02> either glm compiles to sse instructions that don't work on older hardware |
02:31:45 | FromGitter | <krux02> or there are a lot of low level braches that kill the performance |
02:33:20 | FromGitter | <krux02> I really see now the advantage of dynamic compiling on the target machine |
02:34:02 | FromGitter | <krux02> because then I could decide on the target hardware if I would generate sse instructions or not, depending on if they are there or not |
02:34:51 | * | dddddd quit (Remote host closed the connection) |
02:38:42 | shashlick | Sorry dinner time, ya I'm going to spend some time working on nimscript stuff |
02:38:53 | shashlick | Have a bunch of other ideas in the pipeline |
02:39:00 | FromGitter | <krux02> hmm a functions that uses a lot of glm functions should be generic over it's simd supportiveness. this supportiveness is then also forwarded to the glm functions wich then are eithe simd functions or not |
02:39:41 | FromGitter | <krux02> because generic functions are instanciated multiple times I can then branch on a very high level on the actual version |
02:39:55 | FromGitter | <krux02> but that really is a mess to use |
02:41:58 | shashlick | Need to pull out code from some of my apps and make them libs - mini ncurses alternative, acoustid lib and one other minor one |
02:44:27 | shashlick | Oh and make it easy to build with pcre static, and some nimgen enhancements |
02:52:53 | * | rockcavera joined #nim |
02:59:06 | * | S1tiSchu joined #nim |
03:03:07 | * | S1t1Schu quit (Ping timeout: 268 seconds) |
03:03:29 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
03:26:35 | * | find0x90 joined #nim |
03:35:18 | * | endragor joined #nim |
03:36:31 | FromGitter | <Varriount> @zacharycarter I'm looking into freeing up some time to develop the AWS library with you. Perhaps we could meet up and do a mini-sprint |
03:39:50 | * | find0x90_ joined #nim |
03:41:09 | * | find0x90 quit (Ping timeout: 265 seconds) |
03:53:40 | * | find0x90_ quit (Quit: find0x90_) |
04:00:23 | * | leorize quit (Remote host closed the connection) |
04:03:15 | * | jjido quit (Read error: No route to host) |
04:06:44 | * | leorize joined #nim |
04:27:05 | * | NimBot joined #nim |
04:55:40 | * | leorize quit (Remote host closed the connection) |
05:14:00 | FromGitter | <krux02> supporting simd in a general form like in glm is much harder than I thought |
05:14:34 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
05:14:49 | FromGitter | <krux02> the simd instructions are awesome, no question, but they also have weird restrictions that makes it pretty hard to use them |
05:17:30 | FromGitter | <krux02> for example the float simd type needs 16 byte alignment. Meaning iterating a seq[Vec3f] and doing operations on it would crash the program. |
05:41:50 | * | nsf joined #nim |
06:08:24 | * | kinkinkijkin joined #nim |
06:09:36 | kinkinkijkin | how would I receive messages from other processes? |
06:16:47 | * | arnetheduck joined #nim |
06:33:42 | * | leorize joined #nim |
06:37:04 | FromGitter | <survivorm> Oh, people. Pair of last pages look like 3 different dialogues, 2 of which are in fact, monologues. Looks really funny :) |
06:51:21 | * | arnetheduck quit (Ping timeout: 264 seconds) |
07:25:59 | * | athenot quit (*.net *.split) |
07:25:59 | * | user1101 quit (*.net *.split) |
07:26:00 | * | cspar quit (*.net *.split) |
07:26:00 | * | enthus1ast quit (*.net *.split) |
07:26:01 | * | derlafff quit (*.net *.split) |
07:26:11 | * | enthus1ast joined #nim |
07:26:13 | * | user1101 joined #nim |
07:26:21 | * | cspar joined #nim |
07:27:01 | * | athenot joined #nim |
07:27:36 | * | derlafff joined #nim |
07:28:44 | * | craigger quit (Ping timeout: 260 seconds) |
07:30:51 | * | craigger joined #nim |
07:32:41 | * | rokups joined #nim |
07:52:25 | * | gokr joined #nim |
07:53:42 | * | Yardanico quit (Ping timeout: 260 seconds) |
07:55:52 | * | skelett quit (Read error: Connection reset by peer) |
07:56:18 | * | skelett joined #nim |
07:57:51 | * | Yardanico joined #nim |
07:58:10 | * | derlafff quit (Quit: No Ping reply in 180 seconds.) |
07:59:58 | * | survivorm[m] quit (Ping timeout: 276 seconds) |
07:59:58 | * | macsek1911[m] quit (Ping timeout: 276 seconds) |
07:59:58 | * | shashlick quit (Ping timeout: 276 seconds) |
08:00:17 | * | derlafff joined #nim |
08:01:40 | * | survivorm[m] joined #nim |
08:08:49 | * | shashlick joined #nim |
08:09:05 | * | macsek1911[m] joined #nim |
08:17:09 | * | leorize quit (Remote host closed the connection) |
08:28:12 | * | leorize joined #nim |
08:36:57 | * | littleli quit (Ping timeout: 264 seconds) |
08:37:14 | * | littleli joined #nim |
08:44:47 | * | floppydh_ joined #nim |
08:53:35 | * | PMunch joined #nim |
10:01:18 | * | leorize quit (Quit: WeeChat 2.1) |
10:03:10 | * | user1101 quit (Remote host closed the connection) |
10:03:54 | * | user1101 joined #nim |
10:12:19 | FromGitter | <mratsim> @krux02 please vote: https://github.com/nim-lang/Nim/issues/1930 and https://github.com/nim-lang/Nim/issues/6696 I also need 64-bit alignment to entice GCC to produce AVX2 vector code ... |
10:13:39 | FromGitter | <mratsim> Rust made a lot of noise last year with their upcoming SIMD support as part of the core language: https://github.com/AdamNiederer/faster |
10:13:52 | FromGitter | <mratsim> and: https://github.com/rust-lang-nursery/simd |
10:14:21 | FromGitter | <Araq> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ab381fd27c509a7748f5acf] |
10:14:45 | FromGitter | <mratsim> doesn’t work in an object |
10:14:54 | FromGitter | <mratsim> or for a seq |
10:16:17 | FromGitter | <mratsim> forgot about this too: https://github.com/nim-lang/Nim/issues/5315 |
10:16:43 | FromGitter | <mratsim> @Araq ;) https://github.com/mratsim/Arraymancer/blob/9d1f799f31145da8a1bff778366874df4f1b1dfd/src/tensor/backend/memory_optimization_hints.nim#L22-L28 |
10:17:40 | FromGitter | <Araq> dunno then. alignment is stupid. "here have this CPU, the worst thing you can do is access memory. Now lose some bytes for alignment because we love exposing low level archaic bullshit to you" |
10:18:39 | FromGitter | <mratsim> I think this boat has sailed before we were even born, though AVX significantly improved unaligned loads |
10:21:05 | FromGitter | <Araq> yeah, use AVX. it's a tradeoff "more logic on the chip" vs "use more memory". and "more logic" always wins. |
10:21:48 | FromGitter | <mratsim> The thing is AVX2 introduced new optimisations, which requires 64-bit alignment ... |
10:22:19 | FromGitter | <Araq> wait for AVX3 then or maybe AVX4 if they skip the 3 because it's not aligned... |
10:22:20 | FromGitter | <mratsim> so I’m eagerly waiting for your `newSeq` which supports alignment ;) |
10:27:32 | * | yglukhov quit (Remote host closed the connection) |
10:28:05 | * | yglukhov joined #nim |
10:28:22 | Araq | yeah, with the new allocator we should have got an alloc that supports alignment |
11:02:45 | * | Snircle joined #nim |
11:10:24 | * | Senketsu quit (Ping timeout: 260 seconds) |
11:15:18 | * | Snircle quit (Read error: Connection reset by peer) |
11:15:22 | * | floppydh_ quit (Ping timeout: 264 seconds) |
11:15:55 | * | Snircle joined #nim |
11:16:11 | * | xet7 quit (Ping timeout: 256 seconds) |
11:18:09 | dom96 | Araq: I like your idea, but with a slight twist: https://github.com/nim-lang/Nim/issues/7250#issuecomment-375268313 |
11:18:41 | dom96 | If you're going to implement it though, please do it in a new branch |
11:18:43 | dom96 | I want to see it |
11:18:59 | Araq | ok |
11:20:17 | Araq | what do you mean by "local modules"? |
11:20:26 | * | dddddd joined #nim |
11:20:35 | Araq | import pkg / foo would not match ./foo either |
11:21:10 | dom96 | I thought it would |
11:21:14 | dom96 | You just excluded stdlib |
11:21:26 | dom96 | So what remains is --path and then local modules |
11:21:39 | dom96 | As far as I understood what you meant at least |
11:21:53 | Araq | local modules are always considered first |
11:22:10 | Araq | but you shouldn't have a directory 'pkg' in your project |
11:22:23 | Araq | and so it wouldn't match. |
11:23:04 | dom96 | No point in even trying to attempt it |
11:23:10 | Araq | ok |
11:23:17 | dom96 | Just look through --path |
11:23:25 | dom96 | Then there is no problem |
11:23:44 | dom96 | We can also improve the error message to explain what's going on when 'pkg' is used. |
11:23:51 | dom96 | (and a module is not found) |
11:25:29 | * | xet7 joined #nim |
11:28:02 | dom96 | Also, it should be possible to write `import ./pkg/foobar` |
11:42:14 | Araq | well it's not "look through --path", the stdlib itself is added via --path |
11:42:36 | Araq | but I might change that or make it work somehow |
11:44:01 | Araq | and I still think my "dollar thing" is superior but whatever, it's ok to not have that |
11:44:27 | PMunch | Did we ever get a Nim formatting tool? For formatting code? |
11:45:52 | federico3 | PMunch: there's been few attempt at it including https://github.com/FedericoCeratto/nimfmt |
11:47:29 | Araq | what? few attempts at including it? never seen it before :-) |
11:47:39 | Araq | how do you do it? based on the AST or token stream? |
11:47:41 | dom96 | Araq: Yes, stdlib should be added via some other flag |
11:48:13 | dom96 | bbl |
11:48:32 | federico3 | Araq: I mean: there's been few attempts at linting (including something from def- and dom96 IIRC) |
11:49:25 | Araq | oh it uses my broken renderer.nim :-( |
11:49:27 | Araq | pity. |
11:50:26 | federico3 | Araq: that was from 1y ago - if there's a better way to do so... |
11:53:51 | FromGitter | <alehander42> yeah, I think a formatter at least would be very useful (a linter would be perfect, but I guess a formatter should be easier? just a smarter and maybe configurable renderer.nim ?) |
11:55:12 | FromGitter | <alehander42> I can help with improving renderer.nim if that's what it takes (I've played a lot with it while working on py2nim) |
11:55:41 | Araq | it's tough, we lose non-doc comments in the AST |
11:56:15 | federico3 | indeed - I tried few hacks to get inject the non-doc comments back. It's ugly |
11:56:46 | Araq | biggest problem with it. other problem is "expressions as statements" came later and the logic in the renderer never really cared about it |
11:57:46 | FromGitter | <mratsim> is there a way to copy directories in a nimscript? |
11:58:06 | FromGitter | <mratsim> without recursively calling copyFile of course |
11:58:27 | * | floppydh_ joined #nim |
12:00:05 | FromGitter | <alehander42> well, we can just add the non-doc comments to the AST if a formatting flag is defined? |
12:01:02 | FromGitter | <alehander42> can you give an example where this expr vs stmt thing confuses renderer ? |
12:01:24 | Araq | let x = case foo |
12:01:28 | Araq | of bar: 4 |
12:01:31 | Araq | else: 4 |
12:01:42 | Araq | maybe it works by accident :P |
12:03:32 | FromGitter | <alehander42> so why is that confusing? :D at least from the dumpTree AST it seems unambigious |
12:05:02 | FromGitter | <dom96> Maybe it's time for an independent Nim parser implementation? :P |
12:05:32 | FromGitter | <dom96> I wonder how other linters/formatters work |
12:05:33 | FromGitter | <alehander42> I guess it visits the let group, if there is just one child, it renders `let <first> = <second>`, `<first>` is ok, `<second>` is gonna be `case ..:..` independently of the context, so it would be again x = case .. |
12:06:38 | FromGitter | <alehander42> I've worked on a ruby linter, and it had some checks that worked on token sequences and some which worked on the AST |
12:06:46 | * | leorize joined #nim |
12:07:01 | * | nsf quit (Quit: WeeChat 2.0.1) |
12:07:35 | * | SenasOzys_ quit (Ping timeout: 240 seconds) |
12:10:12 | FromGitter | <ChristianWitts> Go has a nice set of linters, which can be managed by a metalinter ⏎ https://github.com/alecthomas/gometalinter |
12:10:12 | * | Senketsu joined #nim |
12:10:19 | * | noonien joined #nim |
12:10:21 | FromGitter | <alehander42> most of the linters I've seen just use a standard lib to get a parse/lex function or a visitor subclass and build checks on top of that (e.g. rubocop with parser gem, go with go/ast etc) |
12:26:14 | * | user1101 quit (Quit: user1101) |
12:28:02 | * | user1101 joined #nim |
12:31:00 | * | user1101 quit (Client Quit) |
12:32:18 | * | smt quit (Ping timeout: 268 seconds) |
12:33:21 | * | user1101 joined #nim |
12:34:08 | * | vlad1777d quit (Ping timeout: 276 seconds) |
12:35:59 | * | blablabla joined #nim |
12:36:02 | * | user1101 quit (Read error: Connection reset by peer) |
12:36:16 | * | blablabla quit (Client Quit) |
12:48:03 | * | user1101 joined #nim |
12:50:57 | * | DarkArctic quit (Read error: Connection reset by peer) |
12:52:38 | * | user1101 quit (Read error: Connection reset by peer) |
12:56:58 | FromGitter | <mratsim> For those using vscode, if you create .nims file there is a potential of data loss due to nimsuggest or nim -check: https://github.com/pragmagic/vscode-nim/issues/84 |
13:07:43 | PMunch | Ouch, that's not good |
13:09:33 | * | nsf joined #nim |
13:16:37 | * | SenasOzys_ joined #nim |
13:22:46 | FromGitter | <zacharycarter> @Varriount working on the AWS sdk together sounds like an awesome idea and I am game - maybe we can discuss further this evening and figure out when a good time for us to meet up would be. |
13:30:59 | * | riidom quit (Ping timeout: 260 seconds) |
13:44:43 | * | floppydh quit (Remote host closed the connection) |
13:45:54 | * | floppydh joined #nim |
13:48:09 | * | jaco60 joined #nim |
13:48:24 | dom96 | hmmm, seems to me that nimsuggest shouldn't be executing code like that... |
13:52:56 | Araq | why not? it needs to do that in order to know the search paths etc |
13:55:33 | * | leorize quit (Remote host closed the connection) |
13:55:54 | dom96 | I thought the issue was about running nimsuggest on a .nims file |
13:56:12 | dom96 | If Nimsuggest executes these .nims files anyway, then how does what mratsim suggests solve the problem? |
13:56:57 | dom96 | What is a bigger question is why you'd even execute things in your .nims files that can change your data? |
14:01:23 | Araq | you can use |
14:01:32 | Araq | when not defined(nimsuggest) in your .nims file |
14:01:40 | Araq | to prevent bad stuff from happening |
14:01:51 | Araq | but that shouldn't be necessary :-) |
14:04:22 | * | noonien quit (Ping timeout: 256 seconds) |
14:06:06 | * | noonien joined #nim |
14:09:47 | * | DarkArctic joined #nim |
14:10:01 | * | leorize joined #nim |
14:10:59 | * | DarkArctic quit (Client Quit) |
14:11:17 | * | DarkArctic joined #nim |
14:12:05 | * | DarkArctic_ joined #nim |
14:12:11 | * | DarkArctic quit (Client Quit) |
14:12:12 | * | DarkArctic_ quit (Client Quit) |
14:12:30 | * | DarkArctic joined #nim |
14:14:27 | FromGitter | <mratsim> @dom96 I need to be able to move files, create temp file, concatenate files, remove temp files. Currently if on windows I need powershell or the windows shell, if on UNIX I need bash/zsh/ksh ... |
14:15:10 | dom96 | Why do you need to do that in .nims? |
14:15:23 | dom96 | And I assume at the "top-level"? |
14:15:28 | Araq | @mratsim certainly but don't do that in the .nims file at the top level. but maybe in a task |
14:15:36 | dom96 | If it's in a 'task' then there is no reason nimsuggest should evaluate it |
14:15:40 | Araq | or in the .nimble file |
14:15:51 | Araq | dom96, agreed |
14:16:29 | FromGitter | <mratsim> I’m trying to wrap a C library, I needed to run a ./configure and I noticed that when I tried to copy stuff I always had new file popping (due to a copy command). |
14:18:50 | * | xet7 quit (Quit: Leaving) |
14:18:50 | FromGitter | <mratsim> Still, this is completely unexpected and due to the potential of data loss, and either putting executable commands at top level should be disallowed in .nims (people will try to use nimsuggest as a replacement for bash if you promote it like that) or nimsuggest should just ignore the IOEffect command or not run at all for .nims files |
14:20:42 | Araq | nimsuggest does not cause the data loss |
14:20:49 | Araq | that's all done by your code |
14:21:02 | Araq | as far as I understood your problem. |
14:21:14 | dom96 | I still don't understand why you're putting executable commands at the top level |
14:21:21 | * | yglukhov quit (Ping timeout: 264 seconds) |
14:22:09 | * | arnetheduck joined #nim |
14:22:38 | Araq | me neither. it's like saying "I ran the Nim compiler and it executed my nimScript" |
14:22:43 | Araq | well yes. |
14:22:48 | Araq | that's what it does. |
14:23:10 | FromGitter | <mratsim> When using bash, people put executable commands at top level. "NimScript can also be used directly as a portable replacement for Bash and Batch files.” —> People will expect to put executable command at top level. |
14:24:14 | Araq | exactly. |
14:24:39 | Araq | and like Bash, it really runs your commands. |
14:25:21 | Araq | foo.nim # main file |
14:25:27 | Araq | foo.nims # config file for foo.nim |
14:25:34 | Araq | nim c foo.nim # nim runs foo.nims |
14:25:46 | Araq | nimsuggest foo.nim # nimsuggest runs foo.nims |
14:26:28 | Araq | why are some commands fine for 'nim c' but not for 'nimsuggest' ? |
14:26:41 | Araq | should I be careful with 'nim c' too in your setup? |
14:26:54 | Araq | or do we blame only nimsuggest here, and if so, why? |
14:27:35 | FromGitter | <mratsim> Because vscode plugins, vim plugins and other (atom, etc …) will probably all make this mistake |
14:27:45 | Araq | which mistake? |
14:27:50 | federico3 | huh? Why is nimsuggest executing stuff? |
14:27:52 | FromGitter | <mratsim> Also I raised the issue on vscode-nim tracker |
14:27:57 | Araq | I still don't understand the problem. |
14:28:06 | FromGitter | <mratsim> the mistake of executing nimsuggest on .nims file |
14:28:17 | FromGitter | <mratsim> the problem is data loss |
14:28:46 | FromGitter | <mratsim> nimsuggest is called silently on .nim and .nims file |
14:29:02 | Araq | ok, so we're not talking about 'nimsuggest foo.nim' but about 'nimsuggest foo.nims' |
14:29:11 | FromGitter | <mratsim> yes |
14:29:21 | Araq | now we're getting somewhere |
14:29:29 | Araq | ok, I can make nimsuggest ignore such requests |
14:29:44 | Araq | but then people don't have auto-completion for their nims files :P |
14:29:55 | FromGitter | <mratsim> I thought I was clear that I was talking about nimscript and .nims file |
14:30:00 | Araq | federico3, because foo.nims has --path options? |
14:31:14 | federico3 | path options? |
14:31:39 | Araq | the point of a foo.nims file is configuration. nimsuggest needs to know about the configuration |
14:31:51 | Araq | otherwise it cannot check your semantics etc etc |
14:32:21 | FromGitter | <mratsim> I though we had nim.cfg for config and foo.nims for scripting? |
14:32:26 | FromGitter | <mratsim> thought* |
14:32:26 | federico3 | looks like there's some confusion on the purpose of nims |
14:32:45 | Araq | you can write any crap in the .nims file though just like you can do 'rm -rf /' in a makefile |
14:33:23 | FromGitter | <mratsim> but VScode doesn’t silently execute make when doing highlighting or suggestions |
14:33:36 | federico3 | +1 mratsim |
14:33:43 | Araq | right, you need to run ./configure first |
14:34:05 | Araq | I can write a VSCode plugin that runs the makefile |
14:34:11 | Araq | silly remarks. |
14:35:02 | Araq | especially considering that the typical configure script is 4K loc of generated unreadable code |
14:35:29 | federico3 | no: you don't write tools that quietly run all targets in makefiles behind the user's back |
14:35:48 | shashlick | hold - if nims is a script and nimsuggest is for code completion, nimsuggest shouldn't be executing the nims |
14:36:03 | shashlick | it should be examining the file and making suggestions - why is it executing the code? |
14:36:45 | * | athenot quit (Read error: Connection reset by peer) |
14:37:00 | * | athenot joined #nim |
14:37:54 | Araq | not sure :-) |
14:38:30 | Araq | I still don't understand the problem completely. |
14:38:33 | federico3 | https://nim-lang.org/docs/nims.html the manual describes nimscript as configuration files and a build tool using "task <foo>" |
14:39:09 | FromGitter | <coffeepots> Is this just a simple mistake in the VSCode plugin? Doesn't sound like it should be doing that |
14:39:43 | FromGitter | <survivorm> For me it's certanly a dark point, if not a bug. Why should the file be executed for completion and stuff? |
14:40:01 | Araq | I'm not sure that's the case |
14:40:02 | FromGitter | <survivorm> It's not something expected |
14:40:40 | federico3 | it is the case: create foo.nim with echo "hi" in it and run "nimsuggest foo.nims" |
14:40:57 | FromGitter | <survivorm> That's more of "don't do it in any case" stuff, than anything else |
14:41:52 | FromGitter | <survivorm> Anything program does shouldn't bother the suggest. It is executed then it's run, why should it be at any other time? |
14:42:03 | federico3 | this is clearly unexpected and surprising to the user |
14:42:05 | shashlick | calling a nims file a configuration file flies in the face of all Nim can do in the VM and our efforts to expand that - it's much more than that |
14:42:12 | FromGitter | <survivorm> It's hardly the expected behaviour |
14:42:24 | Araq | ok, here is the code |
14:42:26 | Araq | if fileExists(scriptFile): |
14:42:26 | Araq | runNimScript(cache, scriptFile, freshDefines=false, config) |
14:42:27 | Araq | # 'nim foo.nims' means to just run the NimScript file and do nothing more: |
14:42:29 | Araq | if scriptFile == gProjectFull: return |
14:43:22 | FromGitter | <survivorm> And what is your point? |
14:43:28 | Araq | it was done on purpose so that 'nimsuggest' behaves like 'nim'. but it's bullshit indeed, let me fix it. |
14:43:44 | FromGitter | <mratsim> Assuming .cfg are for configuration, .nims are for configuration, what is the extension for “bash script” ? |
14:44:07 | FromGitter | <survivorm> Good question |
14:44:35 | Araq | .cfg are deprecated, .nims is the new config system. |
14:44:53 | Araq | that can also replace your bash scripts |
14:44:58 | Araq | but then |
14:45:07 | Araq | you should really have the stuff in a 'task' |
14:45:12 | FromGitter | <mratsim> Also nimscript documentation needs a big warning saying “This is a replacement for bash, but don’t put your commands at the top level, create a proc instead. Warning, they will be executed when Nim is doing autocompletion" |
14:45:15 | shashlick | from the nimscript site: "...you can use a myproject.nims file that simply contains Nim code controlling the compilation process" - this means it is a script and not a configuration file |
14:45:21 | Araq | and probably should do it in a Nimble task instead |
14:45:28 | federico3 | besides, "nimsuggest foo.nims" executed the nims file and then exited without entering the nimsuggest shell |
14:46:21 | Araq | well 'nimsuggest foo.nims' is ... strange |
14:46:34 | federico3 | how so? |
14:46:35 | Araq | mratsim: we don't need to fix the docs, I'm fixing nimsuggest instead |
14:46:38 | FromGitter | <mratsim> Regarding extensions, maybe .nimsh and .nimcfg would be better to communicate the intent? |
14:46:50 | Araq | no, just no. |
14:46:56 | Araq | we don't need more file extensions |
14:49:52 | dom96 | okay, so I thought you had foo.nim and a foo.nims (intended to configure the compilation of foo.nim) and for some reason you were executing commands in this configuration nims file |
14:50:14 | dom96 | Offtopic: I still use .nim.cfg and I don't think it should be deprecated |
14:50:36 | dom96 | It's a nice and easy way to put flags into a file and call it a day |
14:50:41 | dom96 | why can't we have both? |
14:51:42 | shashlick | I agree, unless you can put nim flags into app.nims and it does the same thing |
14:51:58 | dom96 | you can, but it doesn't always work |
14:52:36 | Araq | it does work. once you understand it. |
14:52:49 | dom96 | It works if you change the syntax |
14:53:01 | dom96 | what doesn't work is "being able to place flags from the command line as-is" |
14:53:21 | Araq | no, it uses Nim syntax. |
14:53:57 | dom96 | yes, which isn't compatible with command line syntax |
14:54:21 | Araq | ok, I won't deprecate .cfg files then *shrugs* |
14:55:23 | dom96 | great |
14:55:35 | Araq | but one day I'll throw the config system away |
14:55:46 | Araq | for Nim v3. |
14:56:00 | Araq | :P |
14:59:37 | shashlick | so what's the equivalent syntax for --path:".." in .cfg? Using switch("path, "..")? |
14:59:55 | dom96 | you mean in .nims? |
15:00:03 | dom96 | that will work fine in .cfg |
15:00:55 | shashlick | ya i mean in nims |
15:01:23 | Araq | the syntax in nims is --path:".." |
15:06:22 | dom96 | There are cases where you need to use `switch(...)` though |
15:07:03 | shashlick | so just renaming a .cfg to .nims is good enough? |
15:08:29 | * | r3d9u11 joined #nim |
15:08:52 | * | crem quit (Ping timeout: 265 seconds) |
15:09:27 | * | leorize quit (Ping timeout: 260 seconds) |
15:10:28 | * | xet7 joined #nim |
15:11:35 | * | crem joined #nim |
15:17:08 | * | nsf quit (Quit: WeeChat 2.0.1) |
15:19:36 | * | endragor quit (Remote host closed the connection) |
15:20:04 | * | endragor joined #nim |
15:25:05 | * | endragor quit (Ping timeout: 276 seconds) |
15:27:16 | * | krux02 joined #nim |
15:38:11 | * | athenot quit (Ping timeout: 276 seconds) |
15:40:07 | * | athenot joined #nim |
15:49:09 | * | kuzyn joined #nim |
15:50:20 | * | kuzyn left #nim ("WeeChat 2.1") |
15:53:53 | * | rbrt joined #nim |
16:03:32 | * | crem quit (Remote host closed the connection) |
16:03:54 | * | crem joined #nim |
16:06:38 | * | miran joined #nim |
16:11:10 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:17:10 | * | rbrt quit (Quit: Slán agat) |
16:17:25 | * | jrbrt joined #nim |
16:17:58 | * | yglukhov joined #nim |
16:24:31 | * | jrbrt is now known as jrbrt_ |
16:25:11 | * | jrbrt_ is now known as jrbrt |
16:27:57 | * | gokr quit (Ping timeout: 240 seconds) |
16:29:33 | * | Trustable joined #nim |
16:30:04 | * | xet7 quit (Ping timeout: 260 seconds) |
16:44:51 | * | xet7 joined #nim |
16:50:30 | shashlick | Adeohluwa: looks like twilio does have a swagger/openapi spec we could leverage: https://github.com/APIs-guru/openapi-directory/blob/master/APIs/twilio.com/2010-04-01/swagger.yaml |
16:51:13 | shashlick | likewise for AWS @Varriount @zacharycarter: https://github.com/APIs-guru/openapi-directory/tree/master/APIs/amazonaws.com |
16:55:56 | * | PMunch quit (Quit: Leaving) |
17:00:31 | * | Vladar joined #nim |
17:06:10 | * | athenot joined #nim |
17:07:11 | shashlick | we basically need nim codegen templates: https://swagger.io/swagger-codegen/ |
17:08:07 | shashlick | https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen/src/main/resources |
17:10:27 | * | athenot quit (Ping timeout: 252 seconds) |
17:16:03 | * | athenot joined #nim |
17:27:51 | FromGitter | <AjBreidenbach> is there any reason a proc declared in a template should require an explicit return |
17:31:57 | * | floppydh_ quit (Ping timeout: 240 seconds) |
17:38:17 | * | tiorock joined #nim |
17:38:17 | * | tiorock quit (Changing host) |
17:38:17 | * | tiorock joined #nim |
17:38:17 | * | rockcavera quit (Killed (wilhelm.freenode.net (Nickname regained by services))) |
17:38:17 | * | tiorock is now known as rockcavera |
17:39:20 | miran | i'm trying to have a proc which would accept any number of seqs. i have declared it with `proc foo[T](xs: varargs[seq[T]]) ...` |
17:39:55 | miran | when i try to call it with `foo(@[1, 2, 3, 4], @[5, 4, 3])`, i get " Error: illegal capture 'xs' " |
17:40:40 | miran | what am i doing wrong? |
17:45:01 | shashlick | works for me miran |
17:45:28 | miran | shashlick: are you on 0.18.0, or develop? |
17:46:01 | shashlick | develop, last synced few days ago |
17:46:15 | miran | i'm on 0.18.0, that might be it |
17:47:14 | shashlick | i'm installing 0.18.0, let's see |
17:48:32 | * | jrbrt quit (Quit: Slán agat) |
17:51:40 | * | r3d9u11 quit (Remote host closed the connection) |
17:52:42 | * | r3d9u11 joined #nim |
17:53:48 | * | nsf joined #nim |
17:56:35 | * | xet7 quit (Quit: Leaving) |
17:56:48 | * | smt joined #nim |
17:58:09 | shashlick | worked on 0.18.0 too |
17:58:26 | shashlick | proc foo[T](xs: varargs[seq[T]]) = |
17:58:27 | shashlick | discard |
17:58:28 | shashlick | foo(@[1,2], @[3,4]) |
18:00:58 | dom96 | maybe try using 'xs'? |
18:03:58 | miran | shashlick: can you add to your proc something like `for x in xs: for i in x: echo i` and test it? |
18:04:40 | shashlick | trying |
18:05:14 | miran | i have just updated devel and i get " Error: illegal capture 'xs' of type <varargs[seq[int]]> " |
18:05:31 | miran | so, a bit more verbose message, but error is still the same |
18:06:13 | shashlick | proc foo[T](xs: varargs[seq[T]]) = |
18:06:14 | shashlick | for i in xs: echo i |
18:06:14 | shashlick | foo(@[1, 2], @[3, 4]) |
18:06:15 | shashlick | that worked too |
18:07:17 | * | shashlick sent a long message: shashlick_2018-03-22_18:07:17.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/hRHXRkjaiVuvslgQycMrENLa> |
18:07:18 | shashlick | that worked too |
18:08:13 | FromGitter | <Vindaar> Works fine here, too. I run this on devel from about a week ago: http://ix.io/110Q |
18:09:09 | miran | hmmm, now i did it like i said in last message (just echoing it) and it works |
18:09:40 | miran | i guess the error might be something else, as i'm calling an iterator from that proc.... |
18:11:13 | miran | i'll post a gist shortly |
18:12:11 | miran | (is nim playground down again?) |
18:12:47 | * | rockcavera is now known as Guest2783 |
18:12:47 | * | tiorock joined #nim |
18:12:47 | * | Guest2783 quit (Killed (adams.freenode.net (Nickname regained by services))) |
18:12:47 | * | tiorock is now known as rockcavera |
18:13:05 | miran | https://gist.github.com/narimiran/1af51ba1cecab11b8f3a27fdcc9d0eed (cc @dom96) |
18:13:44 | dom96 | !eval echo("hello") |
18:13:47 | NimBot | hello |
18:14:31 | dom96 | yeah, in that case the error seems correct. |
18:14:51 | dom96 | You can probably create a seq in the body of the proc and capture that |
18:16:13 | miran | i don't understand what you mean, sorry |
18:22:33 | * | DarkArctic quit (Ping timeout: 264 seconds) |
18:25:32 | * | xet7 joined #nim |
18:27:35 | dom96 | var foo = xs |
18:27:38 | * | r3d9u11 quit (Remote host closed the connection) |
18:27:55 | dom96 | well, var foo: seq[seq[T]] = @[] |
18:28:08 | dom96 | for x in xs: foo.add(x) |
18:28:12 | dom96 | then use 'foo' in your iterator? |
18:28:47 | miran | oh! i'll try that, thanks |
18:29:41 | * | byte512 quit (Ping timeout: 256 seconds) |
18:29:55 | FromGitter | <abijahm> when using asyncnet how do i know that the client is still listening ⏎ example if i close my browser window this will continue until the whole file is read ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ab3f623c3c5f8b90da18362] |
18:30:41 | * | mrwonko joined #nim |
18:31:00 | miran | it works!! |
18:32:39 | dom96 | abijahm: I assume there is a good reason you're not using the httpclient module. |
18:33:19 | mrwonko | Is it possible to have a single compilation step that compiles one module as JS and embeds the resulting script as a string in another module that is compiled natively? (i.e. automatically embed the frontend in a server with a single build step) |
18:33:35 | dom96 | or I should say asynchttpserver heh |
18:34:09 | dom96 | The only way to know is to recv from the client and check the length |
18:34:22 | dom96 | You may also get an OSError from 'send' |
18:35:08 | dom96 | (but this is suppressed by the SafeDisconn flag which is passed to 'send' by default |
18:35:09 | dom96 | ) |
18:35:31 | FromGitter | <abijahm> @dom96 am using it am using this to serve huge files |
18:36:06 | dom96 | asynchttpserver should work, no? |
18:37:26 | * | byte512 joined #nim |
18:39:15 | * | krux02 quit (Ping timeout: 246 seconds) |
18:41:37 | FromGitter | <abijahm> no,the code above am using asynchttpserver |
18:42:02 | FromGitter | <bluenote10> Somehow I can't `koch boot -d:release` on devel anymore. It fails with `nimblecmd.nim(104, 38) Error: attempting to call undeclared routine: 'walkPattern'`. Any ideas what could be the cause? |
18:42:22 | FromGitter | <abijahm> what flag should i use for send proc |
18:42:51 | dom96 | abijahm: oh, I see. You can try ...send(read, flags={}) |
18:43:06 | dom96 | But there is absolutely no guarantee you will get a notification |
18:43:13 | dom96 | sometimes a client times out without the other side knowing |
18:45:05 | * | byte512 quit (Ping timeout: 240 seconds) |
18:46:25 | * | DarkArctic joined #nim |
18:48:32 | kinkinkijkin | how do I do cross-process messaging, and specifically how do I do it in nim? I want to run a process as a daemon and make helpers to make the daemon actually do things |
18:49:17 | * | byte512 joined #nim |
18:50:03 | FromGitter | <mratsim> What is the best way to test 32/64 bit at compile-time? There are information here: https://github.com/nim-lang/Nim/wiki/Consts-defined-by-the-compiler, and in system: https://nim-lang.org/docs/system.html#hostCPU, but `define(x86)` and `define(x86_64)` also exist. (I need to test for 32/64 bit ARM) |
18:50:38 | FromGitter | <abijahm> @dom96 another example am using asynchttpserver for byte serving a video ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ if the user makes multiple seeks and closes the browser the app will still read the whole file the multiple times he seeked ... [https://gitter.im/nim-lang/Nim?at=5ab3fafdbb1018b37a14451c] |
18:51:33 | * | xet7 quit (Quit: Leaving) |
18:53:07 | dom96 | abijahm: does setting the flags not help? |
18:53:57 | dom96 | kinkinkijkin: Same way you'd do it other languages, via one of many available IPC approaches. |
18:53:59 | dom96 | *it in |
18:54:19 | kinkinkijkin | thing is, I don't quite know how to do that, and googling has found me nothing on this |
18:54:35 | kinkinkijkin | it just seems to be something people to expect you to dig out of a manual |
18:55:06 | dom96 | I think daemons in particular are usually controlled via signals |
18:55:27 | dom96 | Wikipedia has a nice list of approaches: https://en.wikipedia.org/wiki/Inter-process_communication |
18:55:39 | kinkinkijkin | thank you |
19:03:39 | FromGitter | <abijahm> @dom96 even withthout the flag no exception is raised, shouldnt the asyncnet send() return bytes written ? |
19:04:19 | dom96 | no, it always writes everything you give it |
19:04:40 | dom96 | are you sure the browser closes the connection? |
19:07:01 | mrwonko | I have a repo containing three nimble packages, a frontend, a backend, and a shared library. Is there some way I can link them together besides doing `nimble develop` in the shared library? |
19:07:38 | mrwonko | and what does `nimble develop` do in the first place, and how can I undo it? |
19:09:22 | mrwonko | okay, the latter I can answer myself, apparently it creates a link in ~/.nimble/pkgs/ |
19:09:49 | dom96 | The Nimble readme explains almost everything: https://github.com/nim-lang/nimble#nimble-develop |
19:10:35 | miran | if only other nim projects had this kind of readme.... |
19:11:19 | dom96 | mrwonko: If they're all in the same repo then you can probably just import them as normal Nim modules |
19:27:12 | * | natrys joined #nim |
19:27:22 | * | byte512 quit (Ping timeout: 264 seconds) |
19:28:55 | mrwonko | The nimble readme describes using a nim.cfg to adjust the path for tests but nimble init creates a test1.nims file instead. Is the latter module-specific but otherwise identical? |
19:30:47 | dom96 | yes |
19:30:57 | dom96 | test1.nim.cfg works too though |
19:31:03 | dom96 | .nims is a new configuration format |
19:36:08 | * | byte512 joined #nim |
19:42:40 | * | athenot quit (Remote host closed the connection) |
19:43:22 | mrwonko | Okay, thanks, I got it to build. Does this look like a sensible project setup to you? https://github.com/mrwonko/assistant |
19:43:38 | * | athenot joined #nim |
19:45:29 | dom96 | hrm, that depends on what your plan is |
19:45:56 | dom96 | I assume this won't really be installed by people via Nimble |
19:46:14 | dom96 | so I would just have assistant/{backend, frontend, shared} |
19:47:01 | mrwonko | right, I don't currently plan to publish this using nimble, but it's convenient to be able to build it using nimble build and test it with nimble test |
19:47:26 | mrwonko | and as far as I can tell I can only have one .nimble file per directory and need one .nimble file per backend (c/js) |
19:47:28 | dom96 | Right, I'd say you don't even need three separate Nimble packages for this |
19:48:24 | mrwonko | hmm right, I'll play around some more |
19:48:28 | dom96 | Keep it simple |
19:48:40 | dom96 | You can always fall back on 'nimble c file.nim' |
19:48:47 | dom96 | and 'nimble js file.nim' should work as well |
19:49:01 | dom96 | You can override the default 'test' task to do whatever you want |
19:49:33 | dom96 | Here is a simple example: https://github.com/nim-lang/nimble/blob/master/nimble.nimble#L32 |
19:54:21 | * | kunev quit (Ping timeout: 264 seconds) |
19:54:43 | * | kunev joined #nim |
19:54:53 | miran | semi-related question about nimble packages - last couple of projects/packages i've seen are using apache license - is there any recommendation which licenses should (not) be used for nim(ble) packages? |
19:55:13 | * | xet7 joined #nim |
19:55:48 | dom96 | nope, up to you |
19:56:21 | * | icebattl1 quit (Quit: leaving) |
19:56:29 | miran | ok |
19:58:12 | * | arecaceae quit (Remote host closed the connection) |
19:58:31 | * | arecaceae joined #nim |
20:19:58 | * | Vladar quit (Quit: Leaving) |
20:20:43 | * | endragor joined #nim |
20:25:33 | * | endragor quit (Ping timeout: 264 seconds) |
20:30:12 | mrwonko | I want to execute a shell command at compile time, but it looks like I can't use `os.execShell` and `osproc.execProcess` in static blocks and I can't overwrite the build task in my nimble file… how can I embed the result of running a different process in my source code at compile time? |
20:31:27 | * | littleli quit (Ping timeout: 240 seconds) |
20:32:11 | dom96 | staticExec |
20:32:24 | * | littleli joined #nim |
20:44:30 | FromGitter | <abijahm> @dom96 the browser send a finalize tcp packet node js uses it to end connections, how do i listen for this packets in nim? |
20:45:09 | dom96 | no idea, how does node listen for it? |
20:53:28 | mrwonko | thanks, staticExec works beautifully |
20:53:53 | mrwonko | can I indent a string directly inside a `&` format expression? |
20:53:58 | mrwonko | (it contains newlines) |
20:54:06 | FromGitter | <abijahm> dont know how saw it on their documentation ⏎ node js (https://nodejs.org/api/net.html#net_event_end) |
20:56:54 | * | nsf quit (Quit: WeeChat 2.0.1) |
20:57:05 | * | rokups quit (Quit: Connection closed for inactivity) |
20:58:47 | dom96 | abijahm: I tracked it down to here: https://github.com/indutny/node/blob/master/lib/net.js#L546 |
20:59:14 | dom96 | i.e. you will probably need to read from the socket |
21:01:43 | Yardanico | new case statements are awesome - https://github.com/Yardanico/nim-mathexpr/commit/86d9ea314096edb9ee6f56850a82f085d0d7cf9d |
21:02:41 | mrwonko | how can I control where the result of `nim js` goes? currently it ends up in a nimcache directory, but I'm not sure if I can or should rely on that |
21:07:58 | FromGitter | <BontaVlad> `-o:FILE, --out:FILE set the output filename` filename can also be a path |
21:09:12 | Yardanico | BontaVlad: does that work for js? |
21:09:30 | Yardanico | oh, yes, it does |
21:11:57 | mrwonko | Okay, Nim has thoroughly impressed me. When my backend is compiled, I can recursively execute the compiler to compile my frontend and store the resulting JS code in a constant so that I don't need any file reads at runtime. This made my project structure a good deal simpler, too, although I need some nim.cfg files to properly resolve module paths. https://github.com/mrwonko/assistant |
21:13:10 | * | miran quit (Quit: Konversation terminated!) |
21:19:28 | kinkinkijkin | what is the difference between reading and peeking from a stream? |
21:20:56 | FromGitter | <BontaVlad> by reading you "move" the position, by peeking you don't |
21:21:04 | kinkinkijkin | ah oki |
21:21:05 | kinkinkijkin | thanks |
21:22:01 | * | mrwonko quit (Quit: mrwonko) |
21:26:47 | * | Trustable quit (Remote host closed the connection) |
21:51:19 | FromGitter | <zacharycarter> shashlick: I think it'd be better to use boto for AWS |
21:53:05 | * | xet7 quit (Ping timeout: 248 seconds) |
21:54:00 | * | xet7 joined #nim |
21:54:05 | shashlick | from initial searches, boto is python right? |
21:55:28 | * | xet7 quit (Remote host closed the connection) |
21:55:54 | * | xet7 joined #nim |
21:56:31 | FromGitter | <zacharycarter> botocore is the core python library |
21:56:41 | FromGitter | <zacharycarter> https://github.com/boto/botocore |
21:57:03 | FromGitter | <zacharycarter> but it has all these different specs - https://github.com/boto/botocore/tree/develop/botocore/data |
21:57:26 | FromGitter | <zacharycarter> which is what SDKs that are using codgen use, to generate their clients |
21:58:35 | FromGitter | <zacharycarter> mrwonko: are you doing server side rendering? or are you just rendering HTML when an endpoint is hit on your webserver? |
22:00:49 | FromGitter | <zacharycarter> nevermind - I just checked out the project |
22:02:48 | FromGitter | <zacharycarter> Yardanico - can you explain what changed w/ case statements? |
22:02:55 | FromGitter | <zacharycarter> I'm interested |
22:03:05 | FromGitter | <zacharycarter> certain limitations have annoyed me |
22:03:46 | * | athenot quit (Remote host closed the connection) |
22:04:04 | * | athenot joined #nim |
22:05:29 | * | find0x90 joined #nim |
22:07:55 | * | athenot quit (Remote host closed the connection) |
22:13:26 | FromGitter | <zacharycarter> also: I work with some very confused people - I already knew that, but today made it so much more apparent |
22:29:03 | * | jaco60 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:30:53 | shashlick | @zacharycarter - I see the json, interesting - how are you planning to use it? do you already have some functional code? |
22:33:07 | * | enthus1a1t joined #nim |
22:34:56 | * | enthus1ast quit (Ping timeout: 256 seconds) |
22:35:40 | * | vlad1777d_ joined #nim |
22:38:12 | FromGitter | <zacharycarter> shashlick: @Varriount wrote a bunch of code I'm using now |
22:38:23 | FromGitter | <zacharycarter> I think the plan is for us to work together on the SDK since we're co-located |
22:38:58 | FromGitter | <zacharycarter> so there's probably going to be starbucks or dunkin donuts Nim programming date in our futures |
22:39:17 | FromGitter | <zacharycarter> depending on what kind of coffee Varriount likes - if he even drinks coffee :P |
22:48:09 | shashlick | 🙂 where you guys located? |
22:48:37 | FromGitter | <zacharycarter> Northern Virginia area, outside of Washington DC |
22:49:27 | FromGitter | <zacharycarter> I'm getting ready to put my house on the market and at the same time I'm looking for new work - so I may not be around here much longer |
22:51:02 | dom96 | ooh nice |
22:51:21 | dom96 | Take some selfies if you're not camera shy ;) |
22:53:43 | FromGitter | <zacharycarter> ahahaha will do:) |
22:58:04 | FromGitter | <zacharycarter> dom96: the discussion we were having a few nights ago about the cloud solution(s) my company wants us to move towards, and the tech they're pushing us to use to do it, made me think quite a bit about the situation. |
22:58:44 | brainproxy | in the final example code in manual section: https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement |
22:58:53 | brainproxy | should `use x` be a comment? |
22:59:01 | brainproxy | or... what does `use` mean? |
22:59:12 | FromGitter | <zacharycarter> I definitely think it's a case of over engineering - not because the solutions that are being proposed and settled on are too complex for the problem domain, but because we don't fully understand problem domain, and are reaching for the most complex solution based on assumption |
22:59:45 | FromGitter | <zacharycarter> I don't think use is anything brainproxy |
22:59:59 | dom96 | brainproxy: good question, haven't seen it in code though. |
23:00:29 | dom96 | zacharycarter: interesting, so my intuition is at least partially right |
23:01:35 | dom96 | brainproxy: Do report it on GitHub please |
23:03:18 | kinkinkijkin | I'm a little fuzzy on this, does variable assignments (not initiations) work with commas as well to set multiple variables to the same value? |
23:03:46 | kinkinkijkin | I need to set a large number of states at once and would like to reduce line count and source size |
23:05:09 | FromGitter | <zacharycarter> dom96: yes - I think it would make sense to first use a simpler solution rather than being like - okay we need kubernetes, and AWS and all these services - but I mean, things in the corporate world don't necessarily translate to sane logic |
23:05:25 | FromGitter | <zacharycarter> buzz words are powerful and so are blanket statements like - if we use x we can accomplish y |
23:05:36 | dom96 | kinkinkijkin: no, that's only for tuple deconstructing |
23:05:50 | FromGitter | <zacharycarter> I've probably heard the word spinnaker thrown around at least ten times in the past week - and no one has set up any kind of spinnaker instance on any of our infrastructure yet |
23:06:13 | FromGitter | <zacharycarter> kinkinkijkin - you can do this |
23:06:36 | FromGitter | <zacharycarter> ```var ⏎ foo = "bar" ⏎ bar = "foo" ⏎ ...``` [https://gitter.im/nim-lang/Nim?at=5ab436fcc574b1aa3e213075] |
23:06:55 | dom96 | This is the first time I hear of spinnaker |
23:07:09 | FromGitter | <zacharycarter> I really hate netflix at this point tbh |
23:07:30 | kinkinkijkin | that's initialization |
23:07:43 | FromGitter | <zacharycarter> oh assignments you said |
23:07:44 | FromGitter | <zacharycarter> sorry |
23:07:52 | brainproxy | dom96: will do |
23:07:58 | kinkinkijkin | I was wanting like |
23:08:03 | FromGitter | <zacharycarter> yeah I know |
23:08:07 | kinkinkijkin | isd, commandpart = true |
23:08:09 | FromGitter | <zacharycarter> var foo, bar = "blah" |
23:08:28 | kinkinkijkin | not initial assignments |
23:08:29 | FromGitter | <zacharycarter> you can probably accomplish this with a macro |
23:08:41 | FromGitter | <zacharycarter> but I don't think multiple assignments work with Nim currently |
23:08:49 | FromGitter | <zacharycarter> as dom96 said |
23:08:56 | FromGitter | <zacharycarter> sorry - I misunderstood your question / read it too quickly |
23:09:20 | kinkinkijkin | considering the size of this program that won't be necessary, I'll just put the state assignments in sequence |
23:09:31 | kinkinkijkin | if it were a bigger program I would consider it |
23:11:22 | * | natrys quit (Quit: natrys) |
23:19:14 | * | WhiskeyNick joined #nim |
23:19:34 | * | MJCaley joined #nim |
23:23:54 | kinkinkijkin | if I'm using an FIFO as a filestream, will flushing flush the FIFO or just flush the internal buffer? |
23:36:27 | * | athenot joined #nim |
23:41:21 | * | WhiskeyNick quit (Ping timeout: 248 seconds) |
23:47:23 | FromGitter | <zacharycarter> kinkinkijkin: according to the docs - https://nim-lang.org/docs/streams.html#flush,Stream (flushes the buffers that the stream s might use) but it's hard to say w/o more specifics |
23:47:51 | FromGitter | <zacharycarter> you can always refer to the source too - https://github.com/nim-lang/Nim/blob/master/lib/pure/streams.nim#L62 |
23:48:53 | FromGitter | <mratsim> That should be in the wiki somewhere: https://stackoverflow.com/questions/31367313/typed-vs-untyped-vs-expr-vs-stmt-in-templates-and-macros |
23:49:46 | FromGitter | <zacharycarter> yup |
23:51:41 | kinkinkijkin | how do you reference a position in a seq? |
23:51:51 | FromGitter | <zacharycarter> https://blog.heroku.com/open-cli-framework - looks very similar to that one framework... oh yeah - http://yeoman.io/ |
23:52:00 | FromGitter | <zacharycarter> just for CLI apps |
23:52:05 | kinkinkijkin | myseq(x) or myseq[x] etc ? |
23:52:07 | FromGitter | <mratsim> yourseq[yourposition] unless I misunderstood |
23:56:51 | * | leorize joined #nim |
23:59:29 | kinkinkijkin | is openFileStream new since nim 0.16? I'm making a demon on my openbsd laptop and it's saying it didn't know what "openFileStream" means |