00:35:12 | * | wildlander quit (Quit: Konversation terminated!) |
00:45:47 | * | theelous3_ quit (Ping timeout: 240 seconds) |
00:49:43 | * | snowolf joined #nim |
00:55:55 | FromGitter | <zacharycarter> @kayabaNerve - was watching your interview on Ember - didn't realize DAGs were such a used thing in crypto |
01:14:23 | * | Aareon_ quit (Ping timeout: 276 seconds) |
01:32:18 | FromGitter | <kdheepak> @yglukhov I'm trying to build a iOS only app using just Nim, I think there are some features missing in the darwin (https://github.com/yglukhov/darwin) repository. Is the repo meant to be a macos/ios abstraction? I'm wondering if I should I make PRs when I find something that is iOS only? |
01:49:55 | FromGitter | <retsyo> OT: how to use AI/MachineLearning to decypher? Currently I have old applications from whose name I think they uses LZW compression. However I checked some LZW libs(C/python/nim) but none of them yields the same output files. I think the DOS app uses different code symbols during compression. So how can we program to fetch the proper compression algorithm? Thanks |
01:50:45 | FromGitter | <zacharycarter> @retsyo just FYI there is a nim offtopic channel on IRC and a nim-lang/twitch OT channel on gitter |
01:50:55 | FromGitter | <zacharycarter> not sure about discord or anything else |
01:53:33 | FromGitter | <zacharycarter> I don't have an answer to your question |
01:53:36 | FromGitter | <zacharycarter> sorry :( |
01:58:23 | * | smt quit (Read error: Connection reset by peer) |
02:34:55 | * | dddddd quit (Remote host closed the connection) |
03:05:29 | * | banc quit (Quit: ZNC - http://znc.in) |
03:22:01 | * | banc joined #nim |
03:36:31 | * | Aareon_ joined #nim |
03:48:55 | FromGitter | <technicallyagd> Is there a way to use `when` statement inside sequence construction to include more than one item? |
03:48:59 | FromGitter | <technicallyagd> like in here https://pastebin.com/MPKxWS0P |
03:49:26 | FromGitter | <technicallyagd> the second 6 will still be included |
03:50:35 | FromGitter | <technicallyagd> even when `no` is `false` |
03:51:54 | FromGitter | <zacharycarter> I don't think that will work |
03:51:59 | FromGitter | <zacharycarter> I think you'd have to do something like |
03:53:26 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5be8f93692b7d1172175b5e3] |
03:53:51 | FromGitter | <zacharycarter> could probably find a more terse way to express that |
03:54:09 | FromGitter | <zacharycarter> but I don't think you can use when inside of an assignment statement like that - I could be wrong |
03:54:24 | FromGitter | <technicallyagd> you could have 1 item |
03:54:27 | FromGitter | <technicallyagd> max |
03:56:02 | FromGitter | <technicallyagd> ```code paste, see link``` ⏎ ⏎ this would work [https://gitter.im/nim-lang/Nim?at=5be8f9d26b9822140d17d8b7] |
03:59:31 | FromGitter | <technicallyagd> or do you mean this? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5be8faa3e0fd6b4360dcb6db] |
04:00:07 | FromGitter | <technicallyagd> they both work on my machine. |
04:06:22 | FromGitter | <zacharycarter> okay interesting |
04:06:32 | FromGitter | <zacharycarter> let me try a few things |
04:06:34 | FromGitter | <technicallyagd> Well actually, `when`won't work if you simply want to ignore the value ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ this will print `@[1, 2, 4, 5, 0, 0, 7]` [https://gitter.im/nim-lang/Nim?at=5be8fc4a6b9822140d17e9bf] |
04:06:43 | FromGitter | <technicallyagd> It will default to `0` |
04:06:54 | FromGitter | <zacharycarter> heh |
04:08:30 | FromGitter | <zacharycarter> well just a few guesses here |
04:09:01 | FromGitter | <zacharycarter> when is resolved at compile time - I'm guessing that's the reason 0 is the result instead of 6 |
04:09:35 | FromGitter | <zacharycarter> I'm not sure what you're trying to do - but is there any reason you're relying on `when`? |
04:11:05 | FromGitter | <technicallyagd> I am trying to translate some cpp code that makes heavy use of preprocessor directives |
04:11:41 | FromGitter | <technicallyagd> ```code paste, see link``` ⏎ ⏎ Like this one [https://gitter.im/nim-lang/Nim?at=5be8fd7c47217e07ff0aff3b] |
04:12:32 | * | endragor joined #nim |
04:12:53 | FromGitter | <technicallyagd> oh wait it's actually `C` |
04:13:33 | FromGitter | <zacharycarter> I see |
04:16:19 | FromGitter | <technicallyagd> lol, that's a `Cmake` script. damn. I have wasted almost an hour on something I don't need. |
04:19:57 | FromGitter | <zacharycarter> lol |
04:20:01 | FromGitter | <zacharycarter> well |
04:20:21 | FromGitter | <zacharycarter> I'd definitely be Pinocchio if I said I hadn't been there before |
04:20:35 | FromGitter | <zacharycarter> but I'm glad you found some resolution :) |
04:20:53 | FromGitter | <zacharycarter> still curious to know if this is possible though - it seems like it should be |
04:24:06 | FromGitter | <technicallyagd> Yeah, that's kind of what I expected too. |
04:28:43 | FromGitter | <zacharycarter> I have a strong feeling it is and I'm just tired / don't know but I'll leave it up to someone else to answer |
04:30:54 | FromGitter | <technicallyagd> Lol, it's all good, this is not my priority now. Why haven't you gone to bed then? Deadline? |
04:31:46 | FromGitter | <zacharycarter> No - I am always tired haha, I slept most of the day away |
04:32:09 | FromGitter | <zacharycarter> personal issues not worth getting into here haha |
04:33:04 | * | vlad1777d joined #nim |
04:33:56 | FromGitter | <technicallyagd> I see. |
04:33:58 | FromGitter | <technicallyagd> Well, I hope you get the issues sorted out soon then. |
04:34:19 | FromGitter | <zacharycarter> thank you, me too :) |
04:39:07 | * | vlad1777d quit (Ping timeout: 268 seconds) |
05:07:24 | * | nsf joined #nim |
05:20:45 | * | kapil____ joined #nim |
05:24:03 | * | darithorn quit () |
05:46:25 | * | ftsf joined #nim |
06:06:34 | * | Summertime quit (Quit: Sunsetting.) |
06:07:31 | * | Summertime joined #nim |
06:34:40 | * | stefanos82 joined #nim |
06:57:07 | * | brainproxy quit (Ping timeout: 246 seconds) |
06:59:47 | * | mech422_ joined #nim |
07:02:05 | * | smt joined #nim |
07:03:00 | * | krux02 joined #nim |
07:03:04 | * | mech422 quit (Ping timeout: 272 seconds) |
07:19:05 | * | brainproxy joined #nim |
07:21:35 | * | ftsf quit (Read error: Connection reset by peer) |
07:21:55 | * | ftsf joined #nim |
07:26:28 | * | ftsf quit (Remote host closed the connection) |
07:57:51 | * | Vladar joined #nim |
08:10:39 | * | smt quit (Read error: Connection reset by peer) |
08:25:03 | * | floppydh joined #nim |
08:30:25 | * | PMunch joined #nim |
08:39:55 | * | kapil____ quit (Quit: Connection closed for inactivity) |
08:46:41 | PMunch | Hmm, I think your idea was better Araq. Create a DLL for nimsuggest instead of something I could just import directyl |
08:47:08 | PMunch | I tried to do it, but getting it to compile with both internals from the compiler and nimble packages was a pain :P |
08:47:26 | PMunch | But does Nim <-> Nim DLLs work now? |
08:47:49 | * | smt joined #nim |
08:56:40 | Araq | well it's covered by tests |
08:56:54 | Araq | and my idea wasn't "use a DLL", that was yours |
08:57:08 | Araq | I suggested you 'import' the compiler like nimsuggest does |
08:57:28 | PMunch | Yeah that was my original plan |
08:58:14 | PMunch | But after having made a copy of NimSuggest without all the input/output logic and trying to import it into my project I can't get it to compile properly |
08:59:31 | * | leorize quit (Remote host closed the connection) |
08:59:52 | * | leorize joined #nim |
09:00:29 | PMunch | And you were the first to mention a DLL: https://irclogs.nim-lang.org/03-11-2018.html#17:31:53 I always intended to try it as an import |
09:00:36 | PMunch | But I'm not sure that is feasible |
09:03:17 | PMunch | Hmm, what causes this error? http://ix.io/1rCo/ |
09:04:21 | PMunch | IIRC the DLL tests where very basic. And the basic case work fine. But if you just get a tiny bit more complex the GC trips up: https://github.com/nim-lang/Nim/issues/6886 |
09:18:43 | * | vlad1777d joined #nim |
09:21:53 | * | smt quit (Read error: Connection reset by peer) |
09:24:26 | PMunch | Seems like & throws an error when the program is compiled with -d:useNimRtl |
09:24:31 | PMunch | I'm guessing this is a bug? |
09:26:36 | Araq | "I can't get it to compile properly" why not? |
09:27:22 | PMunch | Well I tried to copy in the cfg file from nimsuggest. And when I tried to combine that with nimlsp which uses some nimble packages it was not happy |
09:28:47 | PMunch | It uses --noNimblePath, turning it off or trying to manually specify the paths for the packages I use meant it didn't find things like Options |
09:29:20 | * | mrrio joined #nim |
09:32:56 | Araq | with 0.19 out you can use the compiler Nimble package, I guess |
09:33:09 | PMunch | Hmm |
09:33:23 | Araq | anyhow, that's easier to fix than the DLL problems |
09:33:59 | PMunch | Good point |
09:35:32 | PMunch | What's the deal with nimcore by the way? |
09:43:12 | * | dddddd joined #nim |
10:01:04 | Araq | security |
10:01:28 | Araq | clients of nimscript don't necessarily want a gigant 'staticExec' loophole |
10:04:12 | * | couven92 joined #nim |
10:05:14 | FromGitter | <cyberlis> Hi, are there any service like hackerrank or leetcode, with nim support? |
10:06:24 | FromGitter | <mratsim> exercise.io |
10:06:29 | FromGitter | <mratsim> exercism.io |
10:07:17 | FromGitter | <mratsim> also this mentions Nim, but it doesn’t appear anywhere: https://www.hackerrank.com/environment/languages, I sent a mail 5 months ago but no answers |
10:07:32 | FromGitter | <cyberlis> @mratsim thank you :) |
10:19:21 | FromGitter | <gogolxdong> What's the canonical way of bit operation, like writing a bit ? Is it or? |
10:34:04 | FromGitter | <gogolxdong> or specifically , how to truncate 1 shl 8 to byte? |
10:35:33 | Araq | byte((1 shl 8) and 0xff) |
10:37:42 | * | adeohluwa joined #nim |
10:42:50 | * | vlad1777d quit (Ping timeout: 272 seconds) |
10:47:44 | FromGitter | <gogolxdong> ``` +-+-+-+-+-+-+-+-+ ⏎ |1| 0x7f | ⏎ +-+-+-+-+-+-+-+-+``` [https://gitter.im/nim-lang/Nim?at=5be95a506b9822140d1a0da2] |
10:47:53 | * | smt joined #nim |
10:49:21 | FromGitter | <gogolxdong> from this layout to seq[byte] |
10:50:36 | FromGitter | <gogolxdong> a method as straightforward as this layout figures. |
10:50:45 | * | snowolf quit (Ping timeout: 252 seconds) |
10:55:09 | * | kapil____ joined #nim |
11:00:03 | * | snowolf joined #nim |
11:01:41 | FromGitter | <cyberlis> what is prefered string formating method in nim? strformat module? |
11:10:08 | FromGitter | <narimiran> @cyberlis yeah |
11:13:07 | * | hoijui quit (Quit: Leaving) |
11:13:17 | FromGitter | <cyberlis> i remember there was this type of syntax "text $1 another text $2" or "text #1 another text #2". was it deprecated? |
11:13:54 | FromGitter | <narimiran> well, you can still use it, but strformat might be more elegant/readable |
11:17:51 | PMunch | @gogolxdong, not sure what you are trying to do. But maybe binaryparse could be of help? |
11:31:03 | FromGitter | <AchalaSB> Hi, Im trying to compile Nim to wasm. I reffered https://github.com/Feneric/nim-wasm-helpers. Since it is not compatible with my OS Im not able to use this. ⏎ Is there any other approch to run Nim-> wasm?? |
11:35:51 | * | snowolf quit (Ping timeout: 252 seconds) |
11:36:04 | FromGitter | <gogolxdong> I am writing QUIC. |
11:38:22 | FromGitter | <gogolxdong> initial packet. |
11:38:44 | * | snowolf joined #nim |
11:49:36 | FromGitter | <gogolxdong> construct initial packet. |
11:53:18 | FromGitter | <yglukhov> @kdheepak the darwin repo is intended to be a collection of ios/macos frameworks bindings. yet it lacks tons of things. Feel free to add anything missing. |
11:54:32 | FromGitter | <gogolxdong> need some magic or all the aligned field need 1 bit shift transform. |
12:14:18 | * | snowolf quit (Ping timeout: 264 seconds) |
12:14:55 | FromGitter | <Vindaar> Um, anyone else unable to bootstrap the compiler on current devel? Getting an `undeclared identifier: Stat` error from `os.nim` |
12:19:56 | Araq | Vindaar: which OS? |
12:20:07 | FromGitter | <cyberlis> i can't find in documentation, can I dynamically append elements to set? |
12:21:10 | FromGitter | <alehander42> @AchalaSB have you tried the approach in the comments of https://github.com/nim-lang/Nim/issues/8713 |
12:21:29 | FromGitter | <Vindaar> @Araq running void linux |
12:21:58 | FromGitter | <alehander42> e.g. compiling nim to C/C++(not sure which of those) code functional for clang and using clang to compile to wasm |
12:22:05 | FromGitter | <alehander42> what are you trying to build with nim & wasm |
12:25:07 | FromGitter | <zacharycarter> @AchalaSB you can't target WASM with Nim unless you're using NLVM - and I'm not sure how far along that is |
12:25:39 | FromGitter | <zacharycarter> you can use emscripten |
12:26:40 | FromGitter | <zacharycarter> I definitely wouldn't reference the repo you're looking at - while it might work, there's no reason you need to add vargarant to the mix |
12:27:29 | FromGitter | <zacharycarter> https://github.com/zacharycarter/zapp/blob/master/nim.cfg |
12:29:13 | Araq | Vindaar: does 'nim --version' say "Linux"? |
12:34:59 | FromGitter | <Vindaar> @Araq yeah, it does: `Nim Compiler Version 0.19.9 [Linux: amd64]` |
12:35:21 | PMunch | gogolxdong: https://github.com/PMunch/binaryparse/blob/master/binaryparse.nim#L689 might be helpful |
12:41:55 | FromGitter | <Vindaar> @Araq ohh, I figured it out! |
12:43:12 | FromGitter | <Vindaar> It was a problematic `config.nims` which for some ended up defining `nimscript` which then caused the branch `when defined(nimscript)` in `os.nim` to be compiled, so `posix` was never imported. Sorry! |
12:51:28 | * | snowolf joined #nim |
13:07:16 | * | snowolf quit (Ping timeout: 260 seconds) |
13:07:17 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
13:08:28 | * | snowolf joined #nim |
13:12:12 | * | endragor quit (Remote host closed the connection) |
13:14:20 | * | kapil____ quit (Quit: Connection closed for inactivity) |
13:16:22 | * | Yardanico joined #nim |
13:16:51 | * | pwntus quit (Quit: Leaving) |
13:18:48 | * | Yardanico quit (Remote host closed the connection) |
13:19:33 | * | Yardanico joined #nim |
13:20:18 | * | snowolf quit (Ping timeout: 264 seconds) |
13:33:51 | * | kapil____ joined #nim |
13:54:15 | FromGitter | <yyyc514> Are there shorthands for soring a seq? i feel like the common seq types should be defined somewhere |
13:54:24 | FromGitter | <yyyc514> or do i always reach for sortedByIt |
13:58:04 | FromGitter | <mratsim> everything is in nim algorithm: https://nim-lang.org/docs/algorithm.html |
13:59:13 | FromGitter | <yyyc514> yes i know that |
13:59:31 | FromGitter | <mratsim> if it’s not there build it ;) |
13:59:53 | FromGitter | <yyyc514> i found sort(system.cmp) but it's getting confused with tables for some reason i have no idea |
14:00:21 | leorize | doesn't tables have their own sort? |
14:00:41 | FromGitter | <yyyc514> ah sort vs sorted :) |
14:01:36 | FromGitter | <yyyc514> `grades.deduplicate().sorted(system.cmp)` |
14:01:44 | FromGitter | <yyyc514> feels kind of verbose, feels like system.cmp shoudl be defaulted |
14:02:36 | FromGitter | <yyyc514> writeing sorted() is a one line but still |
14:04:56 | FromGitter | <yyyc514> i guess i can make it generic too though but still :) |
14:05:16 | FromGitter | <yyyc514> `proc sortedT (x: seq[T]) : seq[T] = sorted(x, system.cmp)` is there a reason that shouldn't be in core lib? |
14:05:43 | FromGitter | <mratsim> there is a PR open, but I thought it was merged in 0.19 |
14:06:29 | FromGitter | <mratsim> https://github.com/nim-lang/Nim/pull/9174 |
14:06:34 | FromGitter | <yyyc514> evidentally not :) |
14:06:54 | FromGitter | <yyyc514> sweet |
14:10:14 | FromGitter | <alehander42> are there any existing langs built as subsets of Nim compiling in a very niche way |
14:10:31 | FromGitter | <mratsim> spry-lang |
14:11:41 | FromGitter | <mratsim> and also this one: https://min-lang.org/ |
14:12:12 | FromGitter | <alehander42> yeah I was reading on spry, I imagine their 'compilation' is compiling the interpreter + the program in one ? |
14:13:09 | FromGitter | <mratsim> you compile an interpreter, en then you can run it on.sy file or use a real |
14:13:18 | FromGitter | <mratsim> then* |
14:13:28 | FromGitter | <mratsim> a REPL* |
14:13:36 | FromGitter | <alehander42> yeah , this makes sense, so it uses nim values under the hood |
14:14:37 | FromGitter | <alehander42> ok, I was still wondering about a language that is actually a valid subset of Nim, just being compiled for something specific |
14:15:02 | PMunch | Araq, I got it compiled and working now |
14:15:21 | PMunch | Not sure what I did wrong yesterday, but it was a lot easier today :P |
14:15:38 | FromGitter | <alehander42> I wonder if I should use nim as the frontend for an eventual future version of https://github.com/alehander42/pseudo |
14:16:52 | FromGitter | <alehander42> but if I do, it would be a very limited subset which kinda makes it not idiomatic, so it feels like an unwise idea(this is a problem with the current frontend too) |
14:17:37 | PMunch | Huh, that is actually a pretty cool project |
14:19:00 | FromGitter | <pr-yemibedu> Nim has template language examples |
14:19:48 | FromGitter | <pr-yemibedu> so the JSON stuff is a subset. |
14:25:16 | * | Aareon_ quit (Ping timeout: 264 seconds) |
14:34:21 | PMunch | Oh, I need to type up my FOSDEM lightning talk proposal |
14:34:36 | PMunch | Anyone else planning to propose a talk? |
14:36:38 | Araq | krux02 might :P |
14:37:39 | FromGitter | <alehander42> what are you going to talk about @PMunch :O |
14:39:15 | * | Aareon_ joined #nim |
14:40:29 | FromGitter | <alehander42> @pr-yemibedu yeah, but I feel that reusing an existing language for pseudo sucks, as people who know that language now have to write in a very limited/bizarre version of it which is confusing |
14:41:46 | FromGitter | <alehander42> but maybe people already do it for some other langs/niche situations, so I was looking for examples |
14:42:58 | * | tribly quit (Ping timeout: 246 seconds) |
14:44:10 | * | tribly joined #nim |
14:45:02 | Araq | IMHO Pidgin-Nims are better than the alternative as hopefully the lexing rules (r"" vs "" vs """ """) remain |
14:45:04 | FromGitter | <pr-yemibedu> So writing in a DSL is the point of your pseudo. |
14:45:19 | Araq | which is always a pain to get right/remember |
14:45:29 | Araq | (Bash, I'm looking at you...) |
14:47:24 | FromGitter | <alehander42> @Araq what is a pidgin-nim ? a subset of nim? |
14:47:32 | FromGitter | <pr-yemibedu> pseudo is intended as a teaching aid for people just starting to learn a new language? |
14:48:55 | FromGitter | <alehander42> @Araq the problem is that I want to experiment with type safety and limit some unsafe features / add different type thingies, so this would be very unidiomatic, but maybe this would be obvious for an user |
14:50:17 | FromGitter | <narimiran> @yyyc514 regarding that PR about `sorted` with the default param: PR is merged (not open), so you should be able to use it if you switch to Nim devel |
14:50:24 | FromGitter | <alehander42> @pr-yemibedu it was intended as a format for "encoding" the logic of small programs/algorithms so you can easily generate it once (e.g. in a parser generator, by hand or in a ML-generating-code engine) and emit code in different languages |
14:51:34 | shashlick | Has anyone done any AST to Nim work before |
14:52:21 | FromGitter | <alehander42> @pr-yemibedu so I used Python for the "manual" usecase, as I thought it would be neat to write your logic in Python and bootstrap libs in e.g. C#/Go/Js/C++/wharever you need based on it, but today I feel a dynamic lang is a bad fit for this |
14:53:54 | FromGitter | <pr-yemibedu> so many this that make a ruby and python programmer happy also make life a pain for a Go or C# developer and vice versa. |
14:55:31 | Araq | alehander42: I would take Nim's lexer and parser and AST and modify it to suit your needs but I'm as biased as possible |
14:55:31 | FromGitter | <alehander42> well, I had lang-specific generators and middleware-s, so the generated code looks quite different in each lang |
14:55:39 | FromGitter | <pr-yemibedu> but I do think that showing the limits of one language and figuring out when is a good time to switch using pseudo could be nice. |
14:57:04 | FromGitter | <alehander42> Araq, I might do that, but this would be still a different language :D |
14:57:20 | Araq | I'm also not sure I understand your project |
15:00:09 | Araq | is this a least common denomiator language or a real language of its own? |
15:00:16 | FromGitter | <alehander42> it's 2 things |
15:00:21 | FromGitter | <alehander42> well, you have a intermediate format, let's call it "pseudoformat" |
15:00:29 | FromGitter | <tim-st> Araq: can this be legal syntax: `proc test(idx: var int = 0) = discard` |
15:00:45 | FromGitter | <tim-st> currently it doesnt work |
15:01:28 | FromGitter | <alehander42> and if you can encode a program/set of algorithms or a lib in it, it's basically ast + type info + a pseudo-specific "stdlib" definition |
15:01:41 | PMunch | alehander42, I was planning on pitching metaprogramming in Nim (as an imperative language) |
15:01:54 | FromGitter | <alehander42> and it generates code in e.g. 10 languages |
15:02:03 | PMunch | I think it's one of Nims more enticing features (asides from the syntax and the speed, but those are harder to wow people with) |
15:02:29 | FromGitter | <alehander42> the second thing is a frontend: you can use another language to compile to this intermediate pseudoformat ast |
15:02:52 | Araq | I personally am tired of metaprogramming talks and would love to see a "Nim as the new C(++)" talk |
15:03:03 | Araq | but I'm not representative |
15:03:08 | FromGitter | <pr-yemibedu> so what is the upper limit of how powerful Pseudo can be? |
15:03:19 | PMunch | A small primer on what Nim is, then some high level stuff on what metaprogramming in Nim can do (more or less what this https://hookrace.net/blog/introduction-to-metaprogramming-in-nim/ shows off) |
15:03:40 | FromGitter | <alehander42> so that language frontend is the thing I am wondering about: subset of Nim vs Python vs some pseudo specific language |
15:03:51 | PMunch | Araq, well the C++ crowd is pretty entrenched I think |
15:04:19 | FromGitter | <pr-yemibedu> Really making something is great in a talk |
15:04:20 | PMunch | You might be able to get some people who are new to game design or high-perf tasks that don't want to learn C++ though |
15:04:21 | Araq | PMunch, well I'm not telling you what to do |
15:04:23 | FromGitter | <arnetheduck> yay for less metaprogramming focus.. leads to a lot of hammer-and-everything-is-a-nail mentality |
15:04:53 | FromGitter | <alehander42> @pr-yemibedu powerful in what sense |
15:05:41 | PMunch | That's fair, but I feel like it's one of Nims more "special" features |
15:05:42 | PMunch | It's certainly one of the things that got (or maybe rather kept) my interest in the language |
15:05:42 | Araq | arnetheduck, metaprogramming is still great but I'm tired of *talks* about it :P |
15:05:43 | * | tiorock joined #nim |
15:05:43 | * | tiorock quit (Changing host) |
15:05:43 | * | tiorock joined #nim |
15:05:43 | * | rockcavera is now known as Guest38419 |
15:05:43 | * | Guest38419 quit (Killed (livingstone.freenode.net (Nickname regained by services))) |
15:05:43 | * | tiorock is now known as rockcavera |
15:05:49 | PMunch | Araq, are there enough Nim talks at all to be tired of them? |
15:05:53 | FromGitter | <pr-yemibedu> if Pseudo has recursion, then it leaves out languages that need to be reimplement that functionality because of tying in some trampoline code. |
15:06:20 | PMunch | I'll make sure to mention all of the other great features Nim has to offer as well though, but I want to wet peoples appetites for learning Nim |
15:06:34 | Araq | alehander42, targetting 10 languages alone is a monster-task, you won't get to play with newish type system extensions :P |
15:06:50 | FromGitter | <pr-yemibedu> if Pseudo has pattern matching, how does that down grade to JS in an idiomatic way? |
15:07:27 | FromGitter | <arnetheduck> I'd like to see a talk on remolding the language with a different system.nim that does crazy stuff (implement a different `+` for `int`, remove `float` or whatever) |
15:07:32 | PMunch | And I will mention stuff like how meta-programming can be used to improve performance as well as promoting good patterns as well, so it should be interesting for a broad audience |
15:08:04 | PMunch | arnetheduck, that would indeed be interesting. But maybe not fit for a lighting talk at FOSDEM |
15:08:07 | FromGitter | <pr-yemibedu> so I was reading the very long list of Nim capabilities and it can just do almost anything with enough time and effort. |
15:08:10 | FromGitter | <arnetheduck> @PMunch you mean like https://github.com/status-im/nim-chronicles/issues/29? :) |
15:08:25 | PMunch | It wold be cool if they had a "small" languages dev-room |
15:08:49 | PMunch | Might be a nice way to have more in-depth talks without having a full-on Nim dev-room |
15:08:50 | FromGitter | <alehander42> Araq, well I will have a very specific type system application |
15:09:05 | FromGitter | <alehander42> it's hard to explain quickly, I'll summarize my idea somewhere these days |
15:09:58 | FromGitter | <alehander42> @pr-yemibedu well it will probably not have pattern matching as it's very lang-specific indeed: also I want to make the code read-friendly , not write-friendly so it wouldn't use too many shiny things |
15:10:10 | FromGitter | <pr-yemibedu> @PMunch have you thought about a talk like "Solving small problems quickly in Nim" ? |
15:10:49 | PMunch | arnetheduck, with great power comes great responsibility. It's definitely easy to shoot oneself in the foot with metaprogramming |
15:11:24 | PMunch | pr-yemibedu, yeah I thought about it. But I don't think there's enough time.. |
15:11:33 | PMunch | It's a 15min max length |
15:11:36 | FromGitter | <pr-yemibedu> @alehander42 that answers the heart of the question about what your tool does. so it probably not good to target Nim, F#, Haskell, SML, for that reason possibly |
15:12:03 | PMunch | And I want to have at least 1/3 - 1/2 of it just introducing people to Nim as a language |
15:12:26 | Araq | PMunch, the other problem is not specific to meta-programming, but it definitely touches it. I call it "overly generic thinking" |
15:12:56 | FromGitter | <pr-yemibedu> the point of "small problems quickly" is to get you to show a practical or radical view of something. It would lend well to a C++ group. So instead of AWK and C++, just do it all in Nim. |
15:13:04 | Araq | you have to sort 3 numbers and assuming you lack sort() in the stdlib, you write a sort algorithm |
15:13:34 | Araq | but with guaranteed O(n log n), stable and using a dedicated algorithm for small Ns |
15:13:44 | Araq | because that's what the literature suggests. |
15:14:03 | PMunch | pr-yemibedu, not quite sure what you mean. Do you have an example of such a solved problem? |
15:18:08 | FromGitter | <pr-yemibedu> I am unfortunately just getting starting with Nim. I did not know how trivial you want it to be. AWK is just three for loops over a line reader that passes a predicate and string to be manipulated with a set of global sigils. Oh and a single START and END proc that get called. |
15:18:50 | PMunch | Araq, not quite sure what you mean.. Or rather what the problem was |
15:19:52 | PMunch | pr-yemibedu, ah no worries. But what would the problem to solve be? |
15:20:51 | FromGitter | <pr-yemibedu> instead of having to use AWK and C++ separate, you encode a mini-AWK in Nim. |
15:21:11 | PMunch | When do you use AWK and C++ together though? |
15:21:14 | FromGitter | <pr-yemibedu> what would be best to me is to show how you solve your own real problems |
15:22:06 | Araq | PMunch, never mind |
15:22:49 | FromGitter | <pr-yemibedu> awk is a better preprocessor of text files and C++ is a better language for a final algorithm. I would hate to do AWK in C++. |
15:22:53 | PMunch | Yeah that was basically my plan, but with a high-light on metaprogramming |
15:23:06 | PMunch | That's a good point |
15:24:26 | FromGitter | <pr-yemibedu> in Nim, meta is a broad spectrum. so much built in that actually looks like only simple procs |
15:26:04 | FromGitter | <mratsim> how about “Nim is the new Fortran” talk ;) |
15:26:20 | * | Trustable joined #nim |
15:26:39 | FromGitter | <pr-yemibedu> Nim Is actually better than Fortran, because you can write Fortran in Nim |
15:28:09 | FromGitter | <mratsim> well that argument doesn’t hold due to quine ;) https://github.com/mame/quine-relay |
15:32:16 | PMunch | Haha, that's a fun project :P |
15:33:42 | PMunch | Oh Nim is in there as well, wonder what it does |
15:36:26 | FromGitter | <mratsim> the code is scary |
16:01:35 | * | darithorn joined #nim |
16:04:24 | PMunch | tim-st, if you are here could you try to run the suggestlib branch of nimlsp? |
16:04:55 | PMunch | I just updated it. It should use code that I've copied from nimsuggest intsead of spawning separate nim processes. I hope this makes it work better on Windows |
16:04:57 | * | PMunch quit (Quit: Leaving) |
16:05:35 | * | iffy joined #nim |
16:05:42 | FromGitter | <kdheepak> @yglukhov thanks for the reply. There's some things that are iOS specific, do you think that should go in there as well? |
16:06:26 | * | narimiran joined #nim |
16:07:38 | iffy | I'm getting sporadic IOErrors (on Travis-CI) when trying to do `write(stderr, longstring)`. Sometimes it fails, sometimes it doesn't (without changing the code). Since it's sporadic, I don't know how to reproduce it. But wondering if others have come across this? |
16:09:49 | iffy | also, it never fails on my computer |
16:10:01 | iffy | (or hasn't yet, rather) |
16:10:13 | FromGitter | <pr-yemibedu> how long is the string? |
16:10:57 | iffy | 776 bytes |
16:11:18 | iffy | I'm not flushing after I write; is that the problem? (I write lots of other stuff before it fails on the long string) |
16:12:14 | FromGitter | <pr-yemibedu> it is what I was thinking, not sure how the internals reuse the handle between writes. |
16:12:36 | iffy | k, I've added some flushes -- I'll see if it happens again |
16:12:43 | FromGitter | <pr-yemibedu> but beyond how long the string is, how often does the write call occur? |
16:13:33 | iffy | About a dozen times in a second -- not that fast |
16:14:39 | FromGitter | <pr-yemibedu> instrumentation? |
16:14:50 | iffy | ? |
16:15:26 | FromGitter | <pr-yemibedu> I mean are you writing out diagnostic information or are you really getting a lot of non fatal errors that you are constantly outputting? |
16:16:42 | iffy | The failures come in my unit tests, when I'm writing my application's normal log information to stderr. Here's a link to just above one of the errors: https://travis-ci.org/iffy/wiish/jobs/454045905#L1031 |
16:16:46 | FromGitter | <pr-yemibedu> because if you capture the error in the loop and write it out only when you break out, that may also help. |
16:17:05 | iffy | I'm not capturing the error -- I just let it fail the test |
16:17:18 | FromGitter | <pr-yemibedu> oh okay. |
16:18:17 | iffy | I have more examples, too. Here's one that went a little nuts with the sysio/system loop: https://travis-ci.org/iffy/wiish/jobs/453468802#L1274 |
16:19:21 | iffy | And here's one that didn't really go nuts at all: https://travis-ci.org/iffy/wiish/jobs/453468387#L1027 |
16:19:41 | iffy | The last two were on the same unchanged code. The first link I shared contains flushing |
16:21:23 | FromGitter | <kdheepak> When I try to run the profiler, I get the following error: `../../../.choosenim/toolchains/nim-0.19.0/lib/system/profiler.nim(92, 23) Error: undeclared identifier: 'framePtr'` |
16:23:35 | FromGitter | <kdheepak> There's a related issue to this: https://github.com/nim-lang/Nim/issues/8991 |
16:23:47 | FromGitter | <kdheepak> so no profiler support in v0.19.0 at the moment? |
16:26:03 | FromGitter | <kdheepak> The problem is that a config.nims exists in the current folder. https://github.com/nim-lang/Nim/issues/4446#issuecomment-239356177 |
16:28:47 | * | pwntus joined #nim |
16:28:57 | * | pwntus_ joined #nim |
16:29:09 | * | pwntus quit (Client Quit) |
16:29:12 | * | pwntus_ quit (Read error: Connection reset by peer) |
16:29:28 | * | pwntus joined #nim |
16:32:52 | * | smt quit (Ping timeout: 246 seconds) |
16:40:18 | * | smt joined #nim |
16:44:20 | * | kapil____ quit (Quit: Connection closed for inactivity) |
16:45:18 | * | smt quit (Read error: Connection reset by peer) |
16:45:22 | * | smt` joined #nim |
16:50:25 | * | smt` quit (Ping timeout: 244 seconds) |
17:00:19 | * | iffy1 joined #nim |
17:02:49 | * | iffy quit (Ping timeout: 244 seconds) |
17:06:10 | FromGitter | <tim-st> PMunch: yes, I will test it, thanks |
17:07:49 | FromGitter | <pr-yemibedu> @kdheepak I run with the profiler turned on. |
17:08:28 | FromGitter | <kdheepak> @pr-yemibedu I think if there's a config.nims file, it won't work. |
17:09:03 | FromGitter | <pr-yemibedu> I do in fact *not* have a custom config.nims setup |
17:10:00 | FromGitter | <tim-st> PMunch: build fails: `... nimlsppkg\suggestlib.nim(96, 9) Error: undeclared identifier: 'listUsages'` |
17:10:22 | FromGitter | <kdheepak> @yglukhov how much effort do you think it is to add the Python exception support in nimpy? |
17:11:30 | FromGitter | <kdheepak> ```code paste, see link``` ⏎ ⏎ I think the change needed is the above three lines to this macro: ⏎ ⏎ https://github.com/yglukhov/nimpy/blob/1054b36eab795109ccab43f1026fa129c83282a1/nimpy.nim#L738-L772 [https://gitter.im/nim-lang/Nim?at=5be9b44162866f74738a3d23] |
17:12:29 | FromGitter | <kdheepak> To get the bare minimum support for an Exception, i.e. raise a general purpose exception in all cases. |
17:13:42 | * | iffy1 left #nim (#nim) |
17:14:18 | FromGitter | <kdheepak> I think the `if` block here needs to include a `try`, `except` ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ with the `except` including the code above. [https://gitter.im/nim-lang/Nim?at=5be9b4ea3102f145218e812d] |
17:14:37 | FromGitter | <kdheepak> and returning a PPyObject(nil) |
17:14:53 | FromGitter | <kdheepak> Thoughts? I think you'll be able to think of better ways to do this. |
17:15:04 | FromGitter | <yglukhov> @kdheepak regarding darwin. there are already appkit and uikit frameworks there. so it's fine to add platform specific frameworks. platform-specific definitions within a single file should just be behind `when defined(ios/macosx)` |
17:15:39 | FromGitter | <kdheepak> Okay, great! I'll plan to do that. |
17:16:54 | * | snowolf joined #nim |
17:18:52 | FromGitter | <yglukhov> @kdheepak regarding py exceptions you've clearly outlined the way I would do it, there's not much to add, except more specific exception type mapping, but that's not necessary for the mvp :) |
17:20:54 | FromGitter | <kdheepak> I'd submit a PR but my nim macro knowledge is abysmal. |
17:21:12 | FromGitter | <yglukhov> ok, thank you. |
17:21:25 | FromGitter | <yglukhov> what do you want to add to darwin btw? |
17:21:53 | FromGitter | <kdheepak> I was planning to use pdfkit and add apple pencil support. |
17:22:50 | FromGitter | <kdheepak> I'm at the moment struggling to get a white screen with a button showing, so it'll be a little while before I can get everything going and get to a point where I'm actually contributing to your `darwin` repo. |
17:23:19 | FromGitter | <kdheepak> But you've done a great job with `darwin` (and `nimx`) too! |
17:23:25 | FromGitter | <yglukhov> wow, i've never even heard of pdfkit :) |
17:23:43 | FromGitter | <kdheepak> pdfkit is actually ios/macos :D |
17:23:55 | FromGitter | <kdheepak> so it makes a lot of sense to be in `darwin`. |
17:26:57 | FromGitter | <yglukhov> indeed. you can try give me some more details on your nimx problem, maybe I'd be able to help. maybe better pm though, not to flood here. |
17:27:33 | FromGitter | <kdheepak> Okay sounds good! I'll PM. I didn't know if it was more appropriate here or via PM. |
17:28:04 | FromGitter | <kdheepak> I will say, I'm really really liking Nim's objc interlop :) |
17:30:12 | FromGitter | <yglukhov> the nim one or the darwin one? those are different you know :) |
17:30:44 | FromGitter | <kdheepak> I don't think I follow? |
17:31:11 | FromGitter | <kdheepak> Nim's objc interlop vs the darwin objc interlop? |
17:32:26 | FromGitter | <yglukhov> nim has a builtin way to bind to objc (grep importobjc in the manual). darwin introduces its own way (grep objc macro in darwin). |
17:32:42 | FromGitter | <kdheepak> ohhhh I didn't know that! |
17:35:00 | FromGitter | <yglukhov> well, maybe it doesn't matter then. but it's good you started with darwin ;) |
17:36:13 | FromGitter | <kdheepak> Haha yeah, I think I was just using `{.objc.}` |
17:36:16 | * | smt joined #nim |
17:36:59 | FromGitter | <kdheepak> So I guess `darwin`'s mac specific objc interlop :) |
17:36:59 | FromGitter | <zacharycarter> Can someone explain this explanation to me? - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5be9ba3b9600d10e649c1ed7] |
17:37:08 | FromGitter | <zacharycarter> what exactly are offline objects? |
17:37:16 | FromGitter | <zacharycarter> does he mean like a binary executable? |
17:38:59 | FromGitter | <mrwonko> strutils.split's documentation (https://nim-lang.org/docs/strutils.html#split%2Cstring%2Cchar%2Cint) says "The same as the split iterator (https://nim-lang.org/docs/strutils.html#split.i,string,char,int), but is a proc that returns a sequence of substrings." It sounds like in my use case I should prefer the split iterator, but the link seems to be wrong… |
17:39:59 | FromGitter | <mrwonko> okay, found the documentation (https://nim-lang.org/docs/strutils.html#15) though |
17:40:16 | FromGitter | <kdheepak> @zacharycarter I think it means that with Nim I can compile code to C and ship C, (I can also compile to binaries and ship them). But with Scopes, I'm even though I can compile to JS and ship JS, I'm more likely (?) to ask the developers to install Scopes and compile to JS on their end and not ship the JS. |
17:40:58 | FromGitter | <zacharycarter> gotcha |
17:41:08 | FromGitter | <zacharycarter> thanks @kdheepak |
17:41:37 | FromGitter | <zacharycarter> it's interesting though that such an approach would be taken with a language (or an extension of one) targeting game development |
17:41:45 | FromGitter | <zacharycarter> I imagine a binary would be your end goal |
17:41:57 | FromGitter | <zacharycarter> not to have to fire up some interactive programming environment to play the game |
17:42:04 | FromGitter | <zacharycarter> I probably just need to explore the project a bit more |
17:52:26 | * | smt quit (Read error: Connection reset by peer) |
17:52:40 | * | smt joined #nim |
17:54:31 | * | PMunch joined #nim |
17:54:46 | shashlick | how do you do multiple nimble packages in one repo? |
17:55:22 | FromGitter | <zacharycarter> I don't think you can? |
17:55:22 | * | Yardanico quit (Remote host closed the connection) |
17:55:26 | FromGitter | <zacharycarter> well |
17:55:31 | FromGitter | <zacharycarter> let me take that back - you can |
17:55:35 | shashlick | got an example - https://github.com/nim-lang/graveyard |
17:55:36 | FromGitter | <zacharycarter> but not in the same directory |
17:56:41 | FromGitter | <zacharycarter> I don't think there is any way to manage them from a hierarchical manner |
17:56:54 | FromGitter | <zacharycarter> or like a top level manner - if you understand what I'm trying to get at |
17:56:56 | * | Yardanico joined #nim |
17:57:07 | shashlick | would be nice but okay for now i guess |
17:57:13 | shashlick | i'm wrapping http://tree-sitter.github.io/tree-sitter/ |
17:58:28 | * | Yardanico quit (Remote host closed the connection) |
17:58:29 | PMunch | tim-st, still here? |
18:00:42 | FromGitter | <tim-st> Yes, btw: I think if you echo the current exception here https://github.com/PMunch/nimlsp/blob/suggestlib/src/nimlsp.nim#L413 that can yield the error from last time |
18:01:47 | PMunch | Hmm, I'm pretty sure I had that |
18:02:52 | PMunch | I just reset my local branch to the suggestlib one and it works fine.. |
18:03:38 | FromGitter | <tim-st> for me building it doesnt work, I'm on 0.19. dev |
18:04:28 | PMunch | Hmm, same here |
18:04:33 | PMunch | Are you building with "nimble debug"? |
18:04:38 | FromGitter | <tim-st> yes |
18:04:45 | FromGitter | <tim-st> hm, wait |
18:05:06 | * | martin1_ quit (Ping timeout: 268 seconds) |
18:05:24 | FromGitter | <tim-st> with nimble debug it seems to work, but then I get another error from the last time |
18:05:49 | FromGitter | <tim-st> Hint: ast_pattern_matching [Processing]..\lib\system.nim(2970) sysFatal ⏎ Error: unhandled exception: Unknown IO Error [IOError] |
18:05:56 | FromGitter | <pr-yemibedu> @Araq how were you able to get such a nice language that compiles on Linux and Mac and Windows? |
18:07:02 | FromGitter | <pr-yemibedu> was there a simple minimum that needed to be complete for the compiler to work on each platform? |
18:07:29 | PMunch | tim-st, hmm strange |
18:07:35 | FromGitter | <tim-st> PMuch: it compiles with `nim c -d:nimcore -d:nimsuggest -d:debugCommunication -d:debugLogging` nimlsp.nim |
18:07:47 | FromGitter | <tim-st> the problematic one is `-d:jsonSchemaDebug` |
18:07:56 | PMunch | Huh, strange |
18:08:09 | PMunch | All that does is echo out the result from the jsonschema macro |
18:09:13 | FromGitter | <mrwonko> Is there reflection in Nim? I'd like to write a URL Query String Parser that takes a tuple type as an argument and creates a value of this type with the fields set using the arguments of the matching name. (Similar to Go's JSON/XML/… parsing into structs.) |
18:10:14 | PMunch | mrwonko, not 100% sure what you mean. But I'm pretty sure it should be possible .) |
18:12:15 | FromGitter | <tim-st> PMunch: same behaviour like before, I try to add the exception output |
18:12:17 | FromGitter | <pr-yemibedu> @mrwonko wants something like the F# type provider |
18:13:43 | FromGitter | <pr-yemibedu> @mrwonko you can get at the AST in Nim and push your new types or fields. I think that is how the JSon Parser works. |
18:17:14 | FromGitter | <pr-yemibedu> maybe this helps? https://hookrace.net/blog/introduction-to-metaprogramming-in-nim/#json-parsing |
18:18:08 | * | druonysus joined #nim |
18:18:08 | * | druonysus quit (Changing host) |
18:18:08 | * | druonysus joined #nim |
18:20:25 | FromGitter | <pr-yemibedu> Then https://nim-lang.org/docs/json.html and go down to the *`to` macro* section to see what may be your ideal. |
18:23:04 | FromGitter | <mrwonko> ah yes, `to` looks very close to what I have in mind |
18:30:28 | * | brainproxy quit (Ping timeout: 245 seconds) |
18:40:02 | FromGitter | <mrwonko> Okay, so if I understand this correctly I basically need to generate the AST to parse the string and construct the tuple from it, where my input is a NimNode of the tuple type. That looks like a nice way to get to know the macro system, but also like it would take me a couple of hours. I'll stick to a special case solution for now and will come back to it later. |
18:42:38 | FromGitter | <pr-yemibedu> Nim has templates too and really the hold thing is just a proc with an understanding of about four or five macro level things. |
18:44:04 | FromGitter | <tim-st> PMunch: how can I test the lsp server manually? I want to feed it some json data and look when it crashes |
18:44:20 | FromGitter | <pr-yemibedu> but you may want to implement a procedure that does the split and a parse in a case statement for building a dictionary of your query. |
18:44:32 | PMunch | Hmm, well you would need to imitate the LSP protocol |
18:44:46 | FromGitter | <tim-st> I have some logged jsons |
18:45:03 | FromGitter | <tim-st> where it says `Got frame:` |
18:45:21 | PMunch | You could basically use this: https://github.com/nim-lang/langserver/blob/master/langserver/client.nim |
18:48:30 | FromGitter | <mrwonko> Is there any standard non-exception error type? |
18:48:56 | FromGitter | <mrwonko> Or are you encouraged to use exceptions for all types of errors? |
18:49:32 | FromGitter | <mrwonko> I'm only aware of Option, which reduces errors to a simple "not present" state |
18:50:00 | FromGitter | <pr-yemibedu> I don't use exceptions |
18:51:10 | FromGitter | <pr-yemibedu> I think that https://nim-lang.org/docs/system.html#ValueError is what I use. |
18:51:12 | FromGitter | <mrwonko> Yeah, that would also be my preferred approach. I'm very used to thinking in Go idioms these days, where each function that can fail has an explicit `error` return value, although I personally prefer a proper Monad like Haskell's `Either` |
18:51:43 | FromGitter | <Clyybber> How can I create a macro that takes in strings? |
18:51:48 | FromGitter | <Clyybber> Or identifiers? |
18:51:56 | FromGitter | <Clyybber> Which are types? |
18:53:55 | * | miran joined #nim |
18:54:00 | * | zachk joined #nim |
18:54:41 | * | zachk quit (Changing host) |
18:54:41 | * | zachk joined #nim |
18:55:03 | * | narimiran quit (Ping timeout: 268 seconds) |
18:55:25 | FromGitter | <alehander42> @pr-yemibedu yeah it might be hard, I need the opposite: I want to have a lot of static guarentees in my input programs |
18:55:52 | FromGitter | <alehander42> so even if I generate e.g. a ruby or c program, it will still be checked very well |
18:56:36 | FromGitter | <alehander42> this would be hard tho, even for numbers, because of things like 1/0 or over/under-flow in different languages(I underestimated this, but Araq had a good point about it and error checking) |
18:59:46 | FromGitter | <alehander42> but I hate the idea of saturated arithmetic by default.. putting `mod X` after a primitive op invisibly is even worse |
18:59:57 | FromGitter | <alehander42> it needs special operators, as in Nim |
19:00:59 | FromGitter | <alehander42> and it leads to silent data corruption otherwise |
19:01:18 | FromGitter | <alehander42> e.g. https://stackoverflow.com/questions/50630376/int-overflow-coerced-to-0 |
19:01:19 | FromGitter | <pr-yemibedu> what does that fix? |
19:02:44 | * | theelous3_ joined #nim |
19:04:48 | FromGitter | <pr-yemibedu> oh I see. well some languages have large number towers (Scheme) or internally go across the primitive and Object analogous types (Ruby?) |
19:05:32 | FromGitter | <pr-yemibedu> but that does not tell you anything about the algorithm. that just means the implementation in the language being naïve will give poor or incorrect results. |
19:08:58 | FromGitter | <pr-yemibedu> is the point to give *optimal* code ever? or only always correct code? the latter at least can clearly be given rules based on known types. You may have to `Box` an `int32` or call `.toString()` with a `.TryParse()` to form equivalence. Knowing is half the battle. I wonder what would be equivalent for the literal irrational `1/3` supported in Scheme? |
19:09:09 | FromGitter | <alehander42> well, my hope is that the input program will be proved relatively correct |
19:09:26 | FromGitter | <alehander42> the problem is that usually you control the backend |
19:09:54 | FromGitter | <alehander42> so you can make sure that the code will be executed as your type system promised |
19:10:29 | FromGitter | <alehander42> but if you target a lot of other languages, and you specifically want to generate idiomatic code in them, this becomes pretty hard in some cases |
19:10:48 | FromGitter | <alehander42> the point is to give correct & idiomatic code |
19:12:23 | * | brainproxy joined #nim |
19:12:49 | FromGitter | <alehander42> well I guess you can generate (/ 1.0 3) ? I am not sure about this part of scheme's standrd |
19:13:18 | * | floppydh quit (Quit: WeeChat 2.3) |
19:15:23 | FromGitter | <alehander42> anyway, this might be getting very offtopic for here, you can ping me in the pseudo room or on pm on this topic if you have questions I guess |
19:21:48 | shashlick | how do you specify that nim should compile with gcc or g++ depending on file? |
19:23:47 | * | kapil____ joined #nim |
19:42:37 | shashlick | Some forward typedef declaration breaking in cpp mode but works in c mode |
19:43:05 | * | NimBot joined #nim |
19:43:20 | * | natrys joined #nim |
19:51:07 | * | platoff joined #nim |
20:05:42 | * | snowolf quit (Ping timeout: 252 seconds) |
20:06:41 | * | stefanos82 quit (Quit: Quitting for now...) |
20:07:33 | * | snowolf joined #nim |
20:11:22 | * | smt` joined #nim |
20:12:00 | * | smt quit (Ping timeout: 252 seconds) |
20:13:40 | * | Trustable quit (Remote host closed the connection) |
20:14:50 | * | smt` quit (Read error: Connection reset by peer) |
20:15:01 | * | smt joined #nim |
20:15:10 | * | vlad1777d joined #nim |
20:15:13 | FromGitter | <tim-st> PMunch: my only guess is, that `file:///C:/Users/-/test/test.nim` should be `file://C:/Users/-/test/test.nim` assuming it is seen as `/C:/Users/-/test/test.nim` |
20:16:21 | PMunch | Wait, you get file:///C: ? |
20:16:24 | PMunch | That's not right.. |
20:17:03 | FromGitter | <tim-st> `server: New document opened for URI: file:///C:/Users/-/test/test.nim saving to C:\Users\-\nimlsp\08763A20C6A9BEC3.nim` |
20:17:25 | FromGitter | <tim-st> after this line the server is always already crashed |
20:18:05 | PMunch | Hmm |
20:18:58 | PMunch | Yeah it then tries to open nimsuggest for /C:/Users/-/test/test.nim |
20:19:16 | PMunch | Could you try "nimsuggest --v2 --stdin /C:/Users/-/test/test.nim" in a terminal? |
20:19:22 | FromGitter | <tim-st> sure |
20:19:45 | FromGitter | <tim-st> `cannot find file: C:\C:\Users\-\test\test.nim` |
20:20:03 | FromGitter | <tim-st> without the prefix it works |
20:20:15 | FromGitter | <tim-st> (prefix slash) |
20:22:08 | PMunch | Aha.. |
20:22:10 | PMunch | Hmm |
20:22:21 | PMunch | Do you have an other editor to test with? |
20:22:24 | * | smt quit (Read error: Connection reset by peer) |
20:22:39 | FromGitter | <tim-st> yes, intellij-lsp plugin, but there already initialize fails |
20:22:48 | PMunch | Just to see if that's a bug in Sublime LSP (as I assume), or if it is a very strange design choice in LSP (not off the table) |
20:23:02 | PMunch | Initialize fails? |
20:23:03 | * | smt joined #nim |
20:23:32 | FromGitter | <tim-st> that's the error I get from intellij-lsp; maybe you can install it and test if it works for you |
20:24:00 | PMunch | What's the error? |
20:24:13 | PMunch | Oh wait |
20:24:29 | PMunch | The file:///C:/ thing is from intellij-lsp |
20:24:39 | FromGitter | <tim-st> no, sublime |
20:24:47 | PMunch | Ah okay |
20:24:59 | FromGitter | <tim-st> I'm pretty sure the path is wrong |
20:25:05 | PMunch | What was the error from intellij then? |
20:25:15 | PMunch | Yeah it should be file://C:/ |
20:25:19 | FromGitter | <tim-st> it takes 2mins to start |
20:26:06 | PMunch | Ouch.. |
20:27:25 | FromGitter | <tim-st> it says: "LanguageServer for definition exe path ... not initialized after 10seconds" |
20:30:24 | PMunch | Hmm, strange |
20:30:29 | PMunch | Any output from nimlsp? |
20:30:57 | * | oky left #nim (#nim) |
20:31:49 | FromGitter | <tim-st> only this few things where server: is from nimlsp https://gist.github.com/tim-st/a4d2f6388cfe07ff9f001395e83005b4 |
20:32:20 | FromGitter | <tim-st> so it crashes shortly after nimsuggest was started |
20:32:30 | FromGitter | <tim-st> it even echoed it's config used |
20:32:38 | FromGitter | <tim-st> it must be the wrong path |
20:34:40 | PMunch | Yeah, probably |
20:34:54 | PMunch | Hmm |
20:35:28 | PMunch | So we have to remove slashes until it's a valid path.. |
20:35:32 | PMunch | Or something else silly |
20:36:18 | FromGitter | <tim-st> does it mean sublime gave us bad file path? |
20:43:45 | PMunch | Think so yeah |
20:44:00 | PMunch | But it would be interesting to try it with another LSP client |
20:44:07 | PMunch | To see if we get similar results |
20:44:47 | PMunch | If you just want to test it locally you can just change the 7 to an 8 in the slicing of the URI |
20:49:20 | FromGitter | <tim-st> seems to work :) |
20:50:50 | FromGitter | <tim-st> but seems quite buggy :D |
20:51:00 | FromGitter | <tim-st> atleast no crash |
20:51:18 | FromGitter | <tim-st> well now it crashed |
20:51:57 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:53:33 | * | stefanos82 joined #nim |
20:56:56 | FromGitter | <zacharycarter> :P |
20:59:39 | FromGitter | <tim-st> PMunch: `graph.repr` doesn't work and results in stackoverflow exception, this made it crash |
21:00:29 | PMunch | tim-st, that is purely a debug statement. Just delete it |
21:01:23 | FromGitter | <tim-st> ok, nice, I think this plugin can really make lsp work good with nim |
21:01:45 | PMunch | That's the idea :) |
21:01:45 | * | platoff joined #nim |
21:03:13 | FromGitter | <alehander42> if it crashes, does it crash the plugin host |
21:03:25 | FromGitter | <alehander42> i am not very well versed in sublime's plugin model |
21:04:46 | PMunch | Well, if nimlsp crashes it shouldn't crash the Sublime LSP plugin |
21:04:47 | FromGitter | <tim-st> you get an error window it asks you if you want to restart the server. But even if you restart, the server works again but sublime doesnt get it, so you have to restart sublime, at least this is my feeling |
21:04:58 | PMunch | But if the Sublime LSP plugin crashes I have no idea what happens |
21:05:50 | * | nsf quit (Quit: WeeChat 2.3) |
21:12:03 | * | flyx quit (Ping timeout: 264 seconds) |
21:12:20 | * | flyx joined #nim |
21:12:48 | * | theelous3_ quit (Ping timeout: 252 seconds) |
21:13:46 | FromGitter | <alehander42> great, then I should really try the lsp plugin soon |
21:14:24 | PMunch | Oh don't get me wrong |
21:14:30 | PMunch | It's still very early stages :P |
21:16:53 | * | flyx quit (Ping timeout: 250 seconds) |
21:17:16 | * | flyx joined #nim |
21:18:07 | PMunch | But by all means, try it out and create bug reports :) |
21:23:40 | * | miran quit (Ping timeout: 268 seconds) |
21:41:54 | * | stefanos82 quit (Quit: Quitting for now...) |
21:42:56 | * | kapil____ quit (Quit: Connection closed for inactivity) |
21:58:48 | * | mrrio quit (Quit: Connection closed for inactivity) |
22:09:18 | * | Vladar quit (Remote host closed the connection) |
22:17:24 | * | enthus1ast quit (Ping timeout: 252 seconds) |
22:30:55 | * | enthus1ast joined #nim |
22:46:38 | FromGitter | <gogolxdong> @PMunch ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bea02ce62866f74738c3c31] |
22:49:08 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bea03646b9822140d1e722f] |
22:50:53 | FromGitter | <gogolxdong> Is string stream proper for putting bits as [1,0x7f, ...]? |
22:57:57 | PMunch | gogolxdong, what are you trying to do there? |
22:59:09 | PMunch | That definition is a 9 bit sequence |
22:59:14 | FromGitter | <gogolxdong> putting 1, 0x7f binary into buffer |
22:59:39 | FromGitter | <gogolxdong> bit |
23:00:15 | PMunch | It would read the first bit, which is 0, then the next 8 which is 00000010 |
23:00:55 | FromGitter | <gogolxdong> How to achieve this? |
23:01:06 | PMunch | What are you trying to do? |
23:01:40 | FromGitter | <gogolxdong> construct QUIC initial packet |
23:02:16 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bea0678bb06d73a9964aba5] |
23:02:21 | * | natrys quit (Quit: natrys) |
23:03:05 | PMunch | u1, u7 |
23:04:21 | PMunch | http://ix.io/1rFC |
23:04:31 | PMunch | Assuming the numbers are bit lengths |
23:07:24 | FromGitter | <gogolxdong> How about putting? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bea07ac47217e07ff119017] |
23:14:57 | FromGitter | <gogolxdong> I know it's 0xff as a byte. |
23:23:19 | PMunch | http://ix.io/1rGv |
23:23:42 | PMunch | It's a binary parer, so you need to give it binary data |
23:24:03 | PMunch | "\xff" will put a single byte 0xff into the string stream |
23:24:16 | PMunch | Then get will read it out |
23:26:16 | PMunch | And if you want to write the binary data: http://ix.io/1rGH |
23:30:50 | FromGitter | <gogolxdong> wow, very elaborative, very helpful. Thanks ! |
23:34:52 | FromGitter | <gogolxdong> as you wrote so many libraries of serialization , which do you think has the most compress efficiency? I find this might be superior than any other like protobuf |
23:38:32 | * | snowolf quit (Ping timeout: 250 seconds) |
23:39:21 | FromGitter | <gogolxdong> or cbor |
23:40:33 | PMunch | Heard good things of Cap'n Proto |
23:40:37 | PMunch | Never tried it though |
23:42:27 | * | krux02 quit (Remote host closed the connection) |
23:43:24 | FromGitter | <gogolxdong> I think binaryparse beat them. :) |
23:44:14 | PMunch | Well, binaryparse isn't really any specific protocol |
23:44:23 | PMunch | It's meant to just parse any odd binary data |
23:44:42 | PMunch | Used it for work to implement satellite packet data generation |
23:44:55 | PMunch | Basically just copy down the spec and your off to the races :) |
23:46:45 | xace | if i want to update a <pkg> with nimble, do I just run `nimble refresh && nimble install <pkg>` or is there a better approach? |
23:47:09 | PMunch | You can just run "nimble install <pkg>" |
23:47:26 | xace | PMunch: what about tracking if there are updates available? |
23:47:43 | PMunch | Hmm, check github? |
23:47:54 | xace | im reading it atm,. im guessing nimble list --ver |
23:47:54 | PMunch | I don't think there's a way built in tbh |
23:48:12 | PMunch | Oh yeah, that seems like it's right |
23:49:03 | xace | yeah, but im guessing thats for all the repos, and not the ones on my local machine |
23:50:55 | xace | i could probably whip together something for this, but i wanted to see that im not reinventing an existing feature |
23:54:28 | PMunch | Maybe "nimble list --installed --ver"? |
23:54:44 | PMunch | Wait, that lists the local version |
23:55:00 | xace | well at least that info is helpful :) |
23:55:29 | xace | PMunch: dont bother with it, was just wondering if there was something, for the moment Ill just manually update it and bring it up later |
23:58:07 | * | PMunch quit (Remote host closed the connection) |