00:24:31 | * | m712 quit (Ping timeout: 264 seconds) |
00:25:26 | * | m712 joined #nim |
00:38:01 | * | ertp07 quit (Read error: Connection reset by peer) |
00:38:35 | * | ertp07 joined #nim |
01:10:23 | * | vlad1777d__ quit (Ping timeout: 268 seconds) |
01:10:49 | * | vlad1777d__ joined #nim |
01:12:15 | * | onionhammer1 joined #nim |
01:13:55 | * | onionhammer quit (Ping timeout: 246 seconds) |
01:41:10 | * | apeiro joined #nim |
01:48:47 | * | lf-araujo quit (Ping timeout: 245 seconds) |
01:57:19 | * | gmpreussner quit (Ping timeout: 246 seconds) |
01:57:36 | * | gmpreussner joined #nim |
02:13:07 | * | arecaceae quit (Remote host closed the connection) |
02:13:27 | * | arecaceae joined #nim |
02:15:25 | * | apeiro quit (Ping timeout: 244 seconds) |
02:45:20 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:49:34 | * | laaron joined #nim |
02:58:41 | * | jfoutaise quit (Ping timeout: 248 seconds) |
03:00:28 | * | jfoutaise joined #nim |
03:45:29 | * | dddddd quit (Remote host closed the connection) |
04:07:44 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:09:32 | * | UNIcodeX_ joined #nim |
04:12:33 | * | UNIcodeX quit (Ping timeout: 245 seconds) |
04:12:45 | FromGitter | <zacharycarter> PR for sdl2 - https://github.com/nim-lang/sdl2/pull/117 |
04:33:13 | * | brakmic joined #nim |
04:39:10 | * | nsf joined #nim |
04:40:02 | * | brakmic_ joined #nim |
04:40:55 | * | brakmic quit (Ping timeout: 258 seconds) |
05:05:20 | * | narimiran joined #nim |
05:09:46 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
05:10:22 | * | laaron joined #nim |
05:16:22 | * | brakmic_ quit (Remote host closed the connection) |
05:21:56 | * | Jjp137 quit (Ping timeout: 244 seconds) |
05:30:15 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
05:30:55 | * | laaron joined #nim |
05:31:30 | * | solitudesf joined #nim |
05:42:06 | * | Jjp137 joined #nim |
05:44:35 | * | absolutejam1 joined #nim |
06:28:49 | * | tribly quit (Ping timeout: 248 seconds) |
06:29:12 | Tanger | Hey folks, is there much point in specifically importing procs and exports? Or does nim cut out all the dead code well enough? |
06:29:40 | * | tribly joined #nim |
06:32:04 | FromGitter | <alehander42> it does |
06:32:07 | FromGitter | <alehander42> afaik |
06:32:12 | FromGitter | <alehander42> dead code elimination |
06:32:25 | Tanger | Do you reckon it's better for readability to only include the stuff you use? |
06:33:01 | FromGitter | <alehander42> not really |
06:33:10 | FromGitter | <alehander42> at least its not typical nim style iirc |
06:33:34 | FromGitter | <alehander42> but it might be ok if you find out it helps you |
06:33:41 | FromGitter | <alehander42> read your code |
06:33:47 | * | solitudesf quit (Ping timeout: 245 seconds) |
06:33:51 | narimiran | Tanger: it depends, but mostly no. see: https://narimiran.github.io/2019/07/01/nim-import.html |
06:34:39 | FromGitter | <alehander42> yeah the method thing is a good argument |
06:35:16 | * | leorize quit (Ping timeout: 260 seconds) |
06:36:41 | Tanger | Nice read narimiran , cheers. I think my problem is that I haven't got nimsuggest and my goto-definitions working in bim |
06:36:43 | Tanger | *vim |
06:37:16 | FromGitter | <alehander42> actually i dont use nimsuggest iirc |
06:37:21 | Zevv | tanger: what read? |
06:37:22 | FromGitter | <alehander42> probably i am missing out |
06:37:32 | * | absolutejam1 quit (Ping timeout: 245 seconds) |
06:38:32 | Tanger | Zevv: https://narimiran.github.io/2019/07/01/nim-import.html |
06:38:44 | Zevv | thanks! |
06:40:00 | * | leorize joined #nim |
06:40:00 | narimiran | Tanger: i can only recommend neovim and leorize[m]'s plugin (https://github.com/alaviss/nim.nvim). it works like a charm! |
06:40:49 | Tanger | Got neovim. Was running with zah/nim's plugin |
06:42:01 | Zevv | good'ole vim users are left behind, lonely and suffering |
06:42:22 | Tanger | :( |
06:45:00 | FromGitter | <alehander42> neovim vs olevim |
06:45:10 | FromGitter | <alehander42> what about sublime users |
06:46:08 | Zevv | if you use sublime it is your own fault :) |
06:46:20 | FromGitter | <alehander42> its great |
06:46:44 | FromGitter | <alehander42> only thing i dont like is they dont produce more software |
06:47:07 | FromGitter | <rokups> so which editor has best nim support? using vscode now, but nimsuggest is confused at times there |
06:47:07 | FromGitter | <alehander42> but sublime merge is a good beginning |
06:47:41 | Tanger | Nimsuggest wasn't working cos my neovim is behind |
06:50:03 | Tanger | I mean, VSCode probably has the best out of the box setup for nim |
06:51:07 | FromGitter | <rokups> thought so |
06:52:44 | narimiran | @rokups i used vscode before, and i find my experience in neovim better, YMMV |
06:52:46 | * | ertp07 quit (Ping timeout: 252 seconds) |
06:54:33 | Tanger | I always prefer vim. Using vim may have ruined my capacity to quickly type out an email with normal keybindings, but it's probably worth it |
06:57:09 | FromGitter | <rokups> ill rather stick with vscode... ;) |
06:57:15 | Tanger | :P |
06:58:59 | * | krux02 joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:00:16 | * | PMunch joined #nim |
07:04:19 | * | gmpreussner joined #nim |
07:08:43 | FromGitter | <zacharycarter> Araq: I decided to simplify the engine I'm working on and build a Nim port of a RTS engine I found written in C - with some modifications |
07:08:49 | FromGitter | <zacharycarter> so RTS engine incoming |
07:08:55 | PMunch | Col |
07:08:58 | PMunch | Cool* |
07:09:21 | FromGitter | <zacharycarter> I can add a PBR rendering pipeline later - but porting a large complex C++ engine to Nim is just too much work atm |
07:09:27 | FromGitter | <zacharycarter> I'd rather get something simple up and running and then add on top of it |
07:10:14 | FromGitter | <zacharycarter> as opposed to spend months writing code and keeping my fingers crossed that everything will work when I finish adding all of the needed functionality |
07:10:52 | FromGitter | <rokups> > porting a large complex C++ engine to Nim is just too much work atm ⏎ wrap that engine instead |
07:13:45 | FromGitter | <zacharycarter> nah - it's a moving target |
07:14:12 | FromGitter | <zacharycarter> plus having something written in pure Nim IMO is better than wrapping a large project like that - the Urho3d Nim stuff is a good example of that |
07:16:21 | Araq | yay! |
07:17:27 | FromGitter | <rokups> search for "game engine" in github and count how many dead project from one guy you find :] |
07:17:46 | FromGitter | <rokups> we call it "cemetery of dead game engines" for a reason :D |
07:18:18 | FromGitter | <rokups> forking any project would already give you a leg up because you can pull from upstream |
07:18:25 | FromGitter | <arnetheduck> some things you need to discover through personal journeys ;) |
07:19:34 | FromGitter | <rokups> hah well yeah you are very right. this reminds me that i constantly keep reminding myself to not try to save other people from their own failures :trollface: |
07:23:22 | * | floppydh joined #nim |
07:23:25 | FromGitter | <arnetheduck> don't think they need saving usually, specially if the journey itself |
07:23:32 | FromGitter | <arnetheduck> is enjoyable or fruitful |
07:25:04 | FromGitter | <rokups> i can hardly say same about the time when i wasted 4-5 months of work on something i threw away for an opensource solution all because i was lazy to learn a bit |
07:31:50 | * | ertp07 joined #nim |
07:42:12 | Araq | zacharycarter: the only remaining problem is that you shouldn't write an engine, you should write a game ;-) |
07:42:35 | Araq | you can extract the useful parts into an engine later. |
07:44:06 | * | ertp07 quit (Read error: Connection reset by peer) |
07:44:44 | * | ertp07 joined #nim |
07:59:47 | FromGitter | <alehander42> what is the one lib/project you'd love to see in nim btw guys |
07:59:54 | * | brakmic joined #nim |
08:02:49 | FromGitter | <zacharycarter> Araq: well that's pretty much what I'm doing |
08:03:17 | * | brakmic quit (Read error: Connection reset by peer) |
08:04:04 | * | brakmic joined #nim |
08:06:08 | FromGitter | <zacharycarter> but games require lots of plumbing code if you're not going to use Unity / UE4 / CryEngine / Godot etc |
08:06:14 | FromGitter | <zacharycarter> or SDL2 with SDL2's renderer |
08:07:15 | FromGitter | <rokups> lots of plumbing code is already written |
08:11:11 | FromGitter | <rokups> tbh too bad urho3d wrapper died |
08:13:22 | * | fredrik92 is now known as couven92 |
08:13:40 | * | absolutejam1 joined #nim |
08:15:05 | vegai | https://openmymind.net/Interfaces-In-Nim/ |
08:15:14 | vegai | is this still the way to do interfaces? |
08:16:56 | Araq | yeah but --newruntime makes a strong point for adding interfaces to Nim... *cough* |
08:17:09 | Araq | we'll see |
08:18:20 | FromGitter | <alehander42> hm newruntime? |
08:19:08 | Araq | maybe I'm wrong |
08:21:24 | FromGitter | <alehander42> but why does it make a point |
08:25:02 | Araq | the 'owned' environment pointer that is duplicated can't work out |
08:26:00 | * | tdc joined #nim |
08:35:53 | * | absolutejam1 quit (Ping timeout: 258 seconds) |
08:43:13 | livcd | vegai: how do you find these obscure articles?! |
08:45:02 | * | absolutejam1 joined #nim |
08:45:53 | FromGitter | <alehander42> hm is this tuple of closures method giving too much overhead |
08:50:19 | Araq | define "too much", interfaces are slow everywhere |
08:50:32 | Araq | except on the JVM/LuaJIT |
08:54:13 | * | purebadger joined #nim |
09:01:10 | * | laaron quit (Remote host closed the connection) |
09:01:34 | * | laaron joined #nim |
09:02:58 | * | laaron quit (Client Quit) |
09:03:20 | * | laaron joined #nim |
09:06:44 | * | laaron quit (Remote host closed the connection) |
09:07:42 | * | ertp07 quit (Ping timeout: 252 seconds) |
09:11:46 | * | Shoozza quit (Quit: Bye) |
09:12:14 | PMunch | Hmm, what was the parser library for Nim that could generate graphs? |
09:20:56 | * | NimBot joined #nim |
09:22:21 | PMunch | Hmm, .uint8 has changed meaning.. |
09:23:34 | vegai | livcd: I searched for "nim interfaces" :) |
09:23:59 | * | dwdv joined #nim |
09:24:13 | * | absolutejam1 quit (Ping timeout: 245 seconds) |
09:24:21 | FromGitter | <alehander42> https://github.com/zevv/npeg |
09:24:24 | FromGitter | <alehander42> PMunch |
09:24:43 | FromGitter | <alehander42> Araq: arent they relatively slow on JVM as well |
09:25:39 | * | ertp07 joined #nim |
09:27:45 | Araq | alehander42: usually it's inlined and specialized |
09:28:09 | Araq | a JIT can do it quite easily, it has the information because it works at runtime |
09:28:36 | FromGitter | <alehander42> but why cant we specialize based on callsites |
09:28:42 | FromGitter | <alehander42> which pass a concrete type |
09:28:47 | ehmry | if I get FiledError exceptions for discriminant assignment, is that something I should fix in application code, or just used -d:nimOldCaseObjects ? |
09:29:49 | PMunch | alehander42, thanks :) Why isn't that mentioned in the highlights at the top though? It's a pretty awesome feature |
09:29:52 | * | ertp07 quit (Ping timeout: 246 seconds) |
09:32:33 | Araq | ehmry, fix it in your application code, at least try to |
09:32:43 | Araq | usually it's easy to fix |
09:32:54 | Zevv | PMunch: it's part of "various methods for tracign, optimizing and debugging your parser" :) |
09:33:02 | Araq | obj.kind = val; obj.field = a |
09:33:06 | Araq | becomes |
09:33:15 | Araq | obj = ObjType(kind: val, field: a) |
09:33:17 | FromGitter | <alehander42> PMunch i think its in the docs, Zevv, people like the graph debug |
09:33:26 | FromGitter | <alehander42> oh youre here |
09:35:55 | Zevv | everybody loves graphs |
09:36:00 | PMunch | Zevv, it's AFAIK a pretty unique feature though, would be nice to highlight it a bit better :) |
09:36:36 | PMunch | I mean many tools exists to generate graphs for various grammars, but this generates it on compile-time from the actual code, which is actually really cool :) |
09:37:16 | PMunch | Too bad dot doesn't have an easy way to generate railroad diagrams though.. |
09:37:17 | Zevv | ok, I'll make a little tiny fuzzy cuddly graph and put it on the top of the page |
09:37:29 | * | Zevv wikipedias "railroad diagram" |
09:37:39 | PMunch | It's the kind that's in the JSON spec |
09:37:58 | PMunch | www.json.org |
09:38:03 | PMunch | This stuff |
09:38:47 | PMunch | I've written a JSON parser just based off those diagrams |
09:39:03 | ehmry | Araq: should the standard library be assumed to work in this regard? |
09:39:23 | * | ertp07 joined #nim |
09:39:23 | Zevv | PMunch: well, graphviz is at fault here |
09:39:31 | PMunch | Yeah I know |
09:41:56 | Araq | ehmry, yeah |
09:42:57 | vegai | Rust's traits are rather cheap though |
09:43:05 | ehmry | Araq: ok, ty |
09:43:31 | FromGitter | <mratsim> Cheap? |
09:44:45 | vegai | mratsim: they like to say "zero cost" everywhere |
09:44:50 | vegai | but I don't like that term |
09:47:22 | FromGitter | <mratsim> Nim equivalent/superset would be concept. At runtime it's the same zero-cost but at compile-time it's probably a bit more compute. But Rust compilation times are several order of magnitudes slower than Nim |
09:50:07 | FromGitter | <alehander42> but concept would lead to vtables |
09:50:13 | FromGitter | <alehander42> which is not zero-cost usually |
09:50:46 | vegai | I guess concepts aren't documented :/ |
09:50:51 | FromGitter | <rokups> vtables would be cheaper if table was embedded into the object instead of placing a pointer to table |
09:50:59 | FromGitter | <alehander42> but concepts are generic on the other hand |
09:51:22 | FromGitter | <alehander42> so you're right, it will just instatiate some functions based on the concrete type in some cases |
09:51:39 | FromGitter | <alehander42> so vtables remain for in the cases where runtime polymorphism is needed |
09:52:11 | vegai | oh, the docs are on the experimental side: https://nim-lang.org/docs/manual_experimental.html#concepts |
09:52:22 | vegai | thanks for that, I had forgotten these things totally |
09:52:30 | FromGitter | <mohamedmoussa89> Are these called union types? ⏎ `Vector = RowVector | ColVector` |
09:52:32 | FromGitter | <alehander42> they are https://nim-lang.org/docs/manual_experimental.html |
09:53:18 | vegai | yeah, I think this might be perfect for what I need, we'll see |
09:53:55 | FromGitter | <alehander42> @mohamedmoussa89 i think sometimes people call algebraic types union types in nim |
09:54:12 | FromGitter | <alehander42> but those are union types in a more haskell-y sense afaik |
09:54:25 | FromGitter | <mratsim> I'm pretty sure for collection of trait object Rust also uses VTables |
09:55:05 | FromGitter | <alehander42> they are generic types as well btw, this confused me several times (so you cant just have a int | string field in a nongeneric obj) |
09:55:22 | FromGitter | <alehander42> iirc |
09:55:29 | FromGitter | <mohamedmoussa89> Is there anywhere I can read about them? they are not mentioned in the manual as far as I can tell |
09:56:23 | FromGitter | <mratsim> Yep see details here: https://alschwalm.com/blog/static/2017/03/07/exploring-dynamic-dispatch-in-rust/ |
09:56:30 | FromGitter | <mohamedmoussa89> If I have a function `proc f(v: Vector)` and I call `f( newColVector(..))`, does it basically generate a new function that specalises on `ColVector`? |
09:56:48 | FromGitter | <mratsim> yes |
09:57:31 | * | absolutejam1 joined #nim |
09:57:56 | Araq | "This works without newruntime and worked with newruntime in 0.19.4" yay 0.19.4 had newruntime users |
09:58:45 | FromGitter | <alehander42> such an oldruntime |
09:59:15 | Araq | time to change the name |
10:00:10 | FromGitter | <mratsim> runtimeV2 :P |
10:00:47 | FromGitter | <alehander42> interesting is it possible to use |
10:00:52 | FromGitter | <alehander42> hm how are called fat pointers |
10:00:59 | FromGitter | <alehander42> which store stuff inside the pointer itself |
10:01:17 | Zevv | "unportable dirty hacks" |
10:01:30 | FromGitter | <alehander42> amazing |
10:01:30 | Araq | mratsim: internally it's called optNimV2 |
10:01:32 | FromGitter | <alehander42> technology |
10:01:36 | FromGitter | <mratsim> smart pointers? Intrusive pointers? |
10:02:12 | FromGitter | <alehander42> so you just put in several bits hints to which the vtables are |
10:02:32 | FromGitter | <alehander42> this doesnt make sense |
10:03:45 | FromGitter | <alehander42> but e.g. still i suppose usually you dont have so many vtables in most programs, so you somehow can use less bits to address them and combine this with other data |
10:04:08 | * | absolutejam1 quit (Ping timeout: 272 seconds) |
10:04:15 | FromGitter | <alehander42> but probably doesnt really help a lot, you still have the indirection which is slow, not the several bytes of size which needs to be aligned anyway |
10:05:28 | FromGitter | <mratsim> btw @Araq, I finished my proof-of-concept phase for my Embedded Tensor DSL compiler. ⏎ ⏎ Now as you see int he issues, I encountered a lot of issues for my compile-time backend (I also want a JT in the future). ⏎ ⏎ Do you know how much would be needed to enable compiler plugins as DLLs? ... [https://gitter.im/nim-lang/Nim?at=5d1c7de8be7a4666445eac59] |
10:06:06 | * | solitudesf joined #nim |
10:06:44 | Araq | not sure, can't be hard, DLL support improved quite a lot thanks to hotcodereloading |
10:13:32 | FromGitter | <mohamedmoussa89> Following on from my previous question, does anybody know why the following doesnt work? ⏎ https://play.nim-lang.org/#ix=1NAK |
10:14:48 | FromGitter | <mohamedmoussa89> Basically it looks like `fooN,T (a:Vector[N,T]; b:Vector[N,T])` only works if `a` and `b` are exactly the same type, but I expected to be able to pass different types in. Is this possible? |
10:15:19 | FromGitter | <alehander42> i think they are unified indeed |
10:15:19 | FromGitter | <mohamedmoussa89> (where `Vector = RowVector | ColVector`) |
10:16:17 | Araq | iirc use a 'p: distinct Vector[N, T]' |
10:16:42 | FromGitter | <mratsim> Use [V, W: Vector] and a: V[N, T], b: W[N, T] |
10:17:05 | Araq | mratsim: sure this works? |
10:17:15 | FromGitter | <mratsim> On mobile at the moment so can't give you a file |
10:17:15 | FromGitter | <mohamedmoussa89> No generic parameters allowed for V |
10:17:23 | FromGitter | <mohamedmoussa89> I have tried that before |
10:18:01 | FromGitter | <mratsim> Define type Vector[N, T] = RowVector[N, T] or ColVector[N, T] |
10:18:12 | FromGitter | <alehander42> you can define a Vector2 |
10:18:16 | FromGitter | <alehander42> which is the same |
10:18:21 | FromGitter | <alehander42> and pass it for the second arg, this works |
10:18:24 | FromGitter | <alehander42> but its a big hack |
10:18:26 | vegai | hmm, I cannot seem to create a sequence of things where things are concepts |
10:18:30 | FromGitter | <mratsim> If you don't had the generics to your typeclass it will not accept them in that situation |
10:18:36 | FromGitter | <alehander42> vegai yeah thats the vtable thing needed |
10:18:44 | vegai | alehander42: ah, right |
10:18:46 | FromGitter | <mratsim> @vegai it's not implemented yet |
10:18:56 | vegai | ok, thanks |
10:19:03 | FromGitter | <mohamedmoussa89> @mratsim sorry I wasn't specific enough in the chat but that is indeed what I did in my nimplayground link |
10:20:09 | FromGitter | <mratsim> Ah indeed, mmmh strange, I'm pretty sure I found a way 2 years ago when I was playing with such issues |
10:20:45 | FromGitter | <mratsim> Especially with "SomeInteger" |
10:20:53 | FromGitter | <mohamedmoussa89> I think you mentioned before, you moved away from using dimensions in type signature |
10:22:02 | FromGitter | <mohamedmoussa89> or maybe i am thinking of somebody else |
10:23:01 | FromGitter | <mratsim> Alternatively, use plain Vector as input, and in the body you can access N and T via a.N and a.T |
10:23:20 | FromGitter | <mohamedmoussa89> what I really wanted though, was two vectors with different T |
10:23:22 | FromGitter | <mratsim> And you can do static: assert to enforce properties at compile-time |
10:23:28 | FromGitter | <mohamedmoussa89> ah |
10:23:34 | FromGitter | <mohamedmoussa89> yes, i have used that trick before |
10:23:46 | FromGitter | <mohamedmoussa89> I guess I will have to use it again |
10:24:20 | FromGitter | <alehander42> on thing i try is |
10:24:21 | FromGitter | <alehander42> template vector(N: untyped, T: untyped): untyped = ⏎ ColVector[N,T] | RowVector[N,T] |
10:24:27 | FromGitter | <alehander42> and use vector(N, T) |
10:24:29 | FromGitter | <alehander42> in type args |
10:24:39 | FromGitter | <alehander42> but for some reason this doesnt work |
10:24:48 | FromGitter | <alehander42> proc foo*N,T (v: ColVector[N,T] | RowVector[N,T]; p: ColVector[N,T] | RowVector[N,T]): string = ⏎ "foo" ⏎ works |
10:25:00 | FromGitter | <alehander42> but not proc foo*N,T (v: vector(N, T); p: vector(N, T)): string = ⏎ "foo" |
10:25:37 | * | purebadger quit (Ping timeout: 248 seconds) |
10:25:51 | Araq | http://ix.io/1NAP/nim works |
10:26:28 | vegai | so I think the tuple as interface things will work the best after all :) |
10:26:35 | vegai | it's kinda neat, actually |
10:26:43 | FromGitter | <mohamedmoussa89> @Araq what is the difference between that and the template version? |
10:26:56 | FromGitter | <mohamedmoussa89> sorry, not an expert on templates |
10:27:30 | Araq | well the type alias to the | type confuses the compiler |
10:27:39 | Araq | so I don't use it, and tada, it compiles |
10:27:52 | Araq | not sure yet if it's a bug :P |
10:28:28 | FromGitter | <alehander42> Araq i have a better solution |
10:28:29 | FromGitter | <alehander42> imo |
10:28:29 | FromGitter | <mohamedmoussa89> using `or` instead of `|` gives a different error |
10:29:03 | vegai | and seems like I can use generics in these tuple/interfaces too, nice |
10:29:35 | Araq | vegai, whatever you do, always mix runtime polymorphism with compiletime polymorphism |
10:29:52 | Araq | :P |
10:30:23 | vegai | :D |
10:30:33 | vegai | I am bound to make many many mistakes |
10:31:25 | FromGitter | <alehander42> Araq why is https://play.nim-lang.org/#ix=1NAQ |
10:31:28 | FromGitter | <alehander42> not working :( |
10:31:33 | FromGitter | <mohamedmoussa89> @alehander42 what was the first thing you wrote? it didnt seem to come through correctly |
10:31:50 | FromGitter | <alehander42> similar thing to Araq's solution |
10:31:56 | FromGitter | <mohamedmoussa89> ah |
10:33:20 | Araq | v: (type section here) is not valid |
10:33:31 | FromGitter | <alehander42> but it is not that |
10:33:38 | FromGitter | <alehander42> it's type a .. ; a |
10:33:40 | FromGitter | <alehander42> and i know this works |
10:33:42 | * | absolutejam1 joined #nim |
10:33:46 | FromGitter | <alehander42> because i use it *a lot* |
10:33:55 | FromGitter | <alehander42> in my js backend with jsobject(a=int, b=..) |
10:33:56 | FromGitter | <alehander42> :D |
10:35:01 | Araq | not sure, sem'checking for types is really broken |
10:37:24 | FromGitter | <alehander42> fair |
10:38:23 | * | absolutejam1 quit (Ping timeout: 245 seconds) |
10:38:41 | * | synshroud quit (Quit: ZNC 1.7.4 - https://znc.in) |
10:40:16 | FromGitter | <alehander42> oh this is good https://github.com/nim-lang/Nim/pull/11642 |
10:40:50 | FromGitter | <alehander42> its very annoying to try to compile a debug version of nim and put manually statements just to find out where in your own code you need to workaround the crash |
10:43:14 | * | synshroud joined #nim |
10:45:52 | * | abm joined #nim |
10:49:23 | * | purebadger joined #nim |
10:51:48 | Araq | why not fix the crashes instead? |
11:01:23 | * | ertp07 quit (Ping timeout: 244 seconds) |
11:05:14 | * | gangstacat quit (Quit: Ĝis!) |
11:14:06 | leorize | Zevv: well I can add vim8 support |
11:14:22 | leorize | but then pretty sure you'll already have neovim in your distro repo |
11:14:27 | leorize | so may as well just use that :) |
11:15:37 | narimiran | leorize: IIRC Zevv mentioned he uses Vi, not Vim :) the king of hipsters :D |
11:22:04 | Zevv | no its vim, but not neovim |
11:22:23 | Zevv | vi is pure masochism, vim is bearable |
11:22:43 | Zevv | leorize: \o/ hooray! |
11:22:51 | Zevv | for vim8 support |
11:22:52 | narimiran | sorry, then i misremembered. it might have been somebody else |
11:23:10 | Zevv | do vim7 and vim6 as well :) |
11:23:17 | Zevv | I can live with sync |
11:25:43 | * | ertp07 joined #nim |
11:26:34 | leorize | zah/vim with a bit of fixing up will get you vim6/7 support :p |
11:26:44 | leorize | zah/nim.vim* |
11:26:54 | * | absolutejam1 joined #nim |
11:31:50 | * | absolutejam1 quit (Ping timeout: 258 seconds) |
11:41:43 | * | sealmove joined #nim |
11:43:17 | * | Vladar joined #nim |
11:43:30 | * | stefanos82 joined #nim |
11:45:05 | PMunch | Hmm, trying to uncompress something I get this error: |
11:45:09 | PMunch | Error: unhandled exception: zlib version mismatch! [ZlibStreamError] |
11:45:24 | PMunch | From the zip package: .nimble/pkgs/zip-0.2.1/zip/zlib.nim(311) uncompress |
11:51:08 | * | dddddd joined #nim |
12:00:13 | * | absolutejam1 joined #nim |
12:02:48 | * | gangstacat joined #nim |
12:05:17 | * | absolutejam1 quit (Ping timeout: 268 seconds) |
12:10:44 | * | absolutejam1 joined #nim |
12:18:53 | * | absolutejam1 quit (Ping timeout: 244 seconds) |
12:20:40 | * | tdc quit (Ping timeout: 246 seconds) |
12:20:50 | * | tdc joined #nim |
12:23:39 | FromGitter | <alehander42> Araq, because users are not compiler devs |
12:24:15 | FromGitter | <alehander42> if a user hits such a bug, he might open an issue and he just wants to workaround it somehow, which usually can be done if you see which of your macro/etc doe crashes |
12:24:16 | Araq | surely they can report "internal compiler errors" |
12:24:28 | FromGitter | <alehander42> but why on earth should it be so hard for them |
12:24:42 | Araq | bbl |
12:24:51 | FromGitter | <alehander42> its much easier to report if you can see immediately which part of your own code led to the error |
12:25:40 | FromGitter | <alehander42> and often you need to fix your current code/task first and later fix the language you use |
12:26:07 | FromGitter | <alehander42> (of course you're right that in principle we should try to fix those errors when we can, sorry) |
12:31:48 | * | Snircle joined #nim |
12:39:05 | PMunch | Hmm, echo zlibVersion() says it's 1.2.11, and according to pacman that is the installed version.. |
12:48:03 | FromGitter | <zetashift> @PMunch related perhaps? https://github.com/nim-lang/zip/issues/39 |
12:48:17 | FromGitter | <zetashift> ah I just saw comment |
12:48:18 | FromGitter | <zetashift> lmao |
12:48:22 | PMunch | Yeah I just found and commented on that :P |
12:57:18 | Araq | patch it to use .compile: "zip.c" |
12:57:29 | Araq | and forget about the dynlib version check altogether :P |
13:11:01 | Araq | Worst push time: 301_341ns vs 356_106ns |
13:11:17 | Araq | new runtime vs realtime GC |
13:11:31 | Araq | but these numbers are so noisy that it's meaningless |
13:11:52 | FromGitter | <alehander42> what is push time |
13:12:37 | Araq | it's the gc_latency benchmark |
13:13:01 | Araq | but I think I'm benchmarking OS context switches :P |
13:13:20 | * | Vladar quit (Remote host closed the connection) |
13:15:10 | Araq | silly benchmarks... |
13:17:50 | Araq | -d:useMalloc is twice as slow though |
13:17:59 | Araq | so Nim's allocator is doing some things right |
13:26:30 | * | PMunch quit (Remote host closed the connection) |
13:36:40 | * | nsf quit (Quit: WeeChat 2.4) |
13:36:54 | * | Sencatsu quit (Ping timeout: 244 seconds) |
13:47:45 | * | vlad1777d__ quit (Ping timeout: 248 seconds) |
13:55:01 | * | absolutejam1 joined #nim |
13:59:06 | * | Sencatsu joined #nim |
14:00:33 | * | vlad1777d__ joined #nim |
14:01:24 | * | lritter joined #nim |
14:05:33 | * | brakmic quit (Remote host closed the connection) |
14:09:05 | * | absolutejam1 quit (Ping timeout: 248 seconds) |
14:32:59 | FromGitter | <alehander42> @dom96 as part of my web framework i have https://gist.github.com/alehander42/4c704744738aee6eab49ba561d018aa8 |
14:33:07 | FromGitter | <alehander42> this is the karax "render" component |
14:33:17 | * | leorize quit (Remote host closed the connection) |
14:33:20 | FromGitter | <alehander42> i remember you asked for it before but i suspect you had something else in mind |
14:33:36 | FromGitter | <alehander42> as i just include the code inside my view |
14:33:50 | FromGitter | <alehander42> and use the karax builtin html generation |
14:35:10 | * | leorize joined #nim |
14:37:03 | FromGitter | <mratsim> Btw, I think a Karax tutorial to create a webapp (say a TODO ;)) would be valuable. |
14:37:32 | * | purebadger quit (Ping timeout: 245 seconds) |
14:45:11 | * | absolutejam1 joined #nim |
14:49:38 | * | absolutejam1 quit (Ping timeout: 258 seconds) |
14:52:01 | * | floppydh quit (Quit: WeeChat 2.5) |
15:03:38 | FromGitter | <alehander42> does nim support alloca (like in some nim-ish way except for directly calling it) |
15:09:55 | leorize | why would you want something like alloca? |
15:10:10 | FromGitter | <rokups> @mratsim karas has todo example |
15:16:58 | FromGitter | <mratsim> @alehander42 I think we have it somewhere in status-im/nim-ranges |
15:17:52 | FromGitter | <mratsim> also see: https://github.com/bpr/vla |
15:21:14 | * | absolutejam1 joined #nim |
15:23:27 | FromGitter | <juancarlospaco> Hi |
15:26:19 | * | absolutejam1 quit (Ping timeout: 268 seconds) |
15:27:43 | * | dwdv quit (Quit: quit) |
15:33:34 | * | absolutejam1 joined #nim |
15:38:32 | * | absolutejam1 quit (Ping timeout: 272 seconds) |
15:49:08 | lmariscal | https://github.com/ocornut/imgui/issues/2529#issuecomment-507971615 a quick chip-8 emulator written in Nim by @kraptor |
16:01:06 | FromGitter | <mratsim> Nice, there is no link to his repo though :/ |
16:01:55 | * | couven92 quit (Quit: Client disconnecting) |
16:04:51 | lmariscal | It seems he works from his private gitea :/ |
16:07:40 | FromGitter | <kdheepak> I upgraded to the latest nim and latest nimble and am getting issues with my .nimble file. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d1cd2ccb1b66b7203cc4562] |
16:08:21 | FromGitter | <kdheepak> This seems similar to this: https://github.com/nim-lang/nimble/issues/616 |
16:08:42 | FromGitter | <kdheepak> But I don't see a solution posted there, it appears that the problem just went away. |
16:08:53 | FromGitter | <kdheepak> Any suggestions on what has to be changed for this to work? |
16:10:55 | lmariscal | Have you tried uninstalling and installing again the package? |
16:11:07 | lmariscal | And, are you using the latest version of glm? |
16:11:52 | FromGitter | <kdheepak> I'm the author of the glm package here. |
16:11:59 | FromGitter | <kdheepak> I'm trying to add a new feature |
16:12:14 | FromGitter | <kdheepak> I've upgraded my nim using choosenim to v0.20.0 |
16:12:15 | FromGitter | <alehander42> imgui looks great |
16:12:27 | FromGitter | <kdheepak> and now I'm unable to build |
16:12:36 | lmariscal | :v oh |
16:12:56 | FromGitter | <alehander42> but i wonder if there is something similar that can work with retained mode easily |
16:12:57 | FromGitter | <kdheepak> I even tried a fresh package using nimble init and still the same issue. |
16:14:20 | FromGitter | <kdheepak> Trying choosenim devel to see what happen |
16:15:00 | lmariscal | It seems there's some invalid syntax in the file, but it's weird that it happens too with a fresh package |
16:15:19 | lmariscal | Have you changed your cfg file? |
16:17:09 | FromGitter | <kdheepak> I don't have a cfg file |
16:19:33 | lmariscal | Is glm the only package that you are unable to compile or other packages stopped working as well like in the issue? |
16:21:25 | FromGitter | <kdheepak> I think everything didn't work. |
16:21:42 | FromGitter | <kdheepak> I switched to devel and back to stable and now I don't get the error anymore. |
16:22:44 | lmariscal | That's weird, but if everything is "fixed" now it would be great if you could document how you made it work in the issue |
16:41:43 | * | couven92 joined #nim |
16:45:30 | * | krux02 quit (Remote host closed the connection) |
16:50:27 | FromGitter | <zacharycarter> Does anyone have write access to - https://github.com/nim-lang/sdl2 ? Wondering whether - https://github.com/nim-lang/sdl2/pull/117 - could be merged. |
16:56:06 | * | Trustable joined #nim |
16:59:10 | FromGitter | <kdheepak> oof it's back |
16:59:16 | FromGitter | <kdheepak> I'm getting the same error now |
16:59:29 | FromGitter | <kdheepak> and switching back and forth from devel doesn't make it go away. |
17:01:14 | FromGitter | <alehander42> var a = "123" |
17:01:19 | FromGitter | <alehander42> "123" is actually on the heap |
17:01:25 | FromGitter | <alehander42> i cant believe i didnt think of that |
17:08:05 | FromGitter | <kdheepak> Yeah this is not a local issue as well: https://travis-ci.com/NREL/glm/jobs/213036343#L467 |
17:08:26 | FromGitter | <kdheepak> The same thing happens on Travis @lmariscal |
17:09:47 | * | krux02 joined #nim |
17:12:42 | * | brakmic joined #nim |
17:15:13 | * | nsf joined #nim |
17:15:58 | FromGitter | <kdheepak> It's extremely inconsistent |
17:16:36 | FromGitter | <kdheepak> I switched to devel and got the error. Then deleted ~/.nimble/pkgs/ and still got the error. Then switched back to stable and the error went away. |
17:18:31 | * | brakmic_ joined #nim |
17:20:25 | shashlick_ | @kdheepak can you check contents of ini file generated in /tmp/nimblecache |
17:21:00 | shashlick_ | Also can you share your nimble file and any cfg file |
17:21:46 | * | brakmic quit (Ping timeout: 272 seconds) |
17:22:10 | FromGitter | <kdheepak> Sure @shashlick_, everything that I'm working on is in this repository: https://github.com/NREL/glm |
17:23:14 | FromGitter | <kdheepak> /tmp/nimblecache/glm_4338518342434582321/glm.ini ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d1ce48207bf5635af1fd243] |
17:23:14 | disruptek | ed is masochism, vi is bearable. :-P |
17:26:52 | * | Trustable quit (Remote host closed the connection) |
17:32:32 | * | absolutejam1 joined #nim |
17:34:24 | FromGitter | <rokups> nano anyone? |
17:36:00 | FromGitter | <kdheepak> I think it might be because I'm going something funny like this: https://github.com/NREL/glm/blob/9b28be831825713994a23297e7bc4139d0994760/glm.nimble#L7 |
17:37:37 | * | absolutejam1 quit (Ping timeout: 248 seconds) |
17:39:34 | FromGitter | <kdheepak> I think I figured out the problem, atleast for me. |
17:40:01 | FromGitter | <kdheepak> It was the echo function I had in the config.nims file, which ended up in the .ini file |
17:41:02 | FromGitter | <kdheepak> https://github.com/NREL/glm/commit/5634c8d63d5bb70247dca3432858cf2c0a6cae4e |
17:47:00 | FromGitter | <JasperJenkins> Try updating nimble to the latest, it should be fixed. https://github.com/nim-lang/nimble/issues/665 |
17:49:12 | FromGitter | <kdheepak> Hmm. Okay, I've just removed the echo for now. |
17:53:27 | FromGitter | <genotrance> Ya I already fixed that but it's in head |
18:01:11 | FromGitter | <zacharycarter> got an event system working in the engine - going to start working on graphics now |
18:01:12 | * | ertp07 quit (Read error: Connection reset by peer) |
18:01:50 | FromGitter | <zacharycarter> https://github.com/zacharycarter/zeal/blob/master/src/zealpkg/event.nim |
18:02:03 | * | ertp07 joined #nim |
18:03:13 | * | jjido joined #nim |
18:04:07 | * | sealmove quit (Quit: WeeChat 2.5) |
18:05:14 | FromGitter | <zacharycarter> I'l start calling it "the game" since everyone hates the concepts of game engines here :P |
18:07:07 | * | absolutejam1 joined #nim |
18:08:04 | * | purebadger joined #nim |
18:10:35 | * | ertp07 quit (Ping timeout: 250 seconds) |
18:11:30 | * | ertp07 joined #nim |
18:17:36 | FromGitter | <kdheepak> Thanks for all the help! |
18:31:38 | * | narimiran quit (Remote host closed the connection) |
18:33:48 | * | UNIcodeX_ quit (Quit: Leaving) |
18:34:57 | * | narimiran joined #nim |
18:38:36 | Araq | zacharycarter: call it "SpaceCraft" |
18:39:59 | FromGitter | <zacharycarter> haha |
18:41:08 | FromGitter | <zacharycarter> I'm sure I'll be using a lot of placeholder 3d assets until I can attract an artist, but if I can find some decent sci-fi models then definitely |
18:41:19 | * | gangstacat quit (Quit: Ĝis!) |
18:44:33 | * | gangstacat joined #nim |
19:08:26 | * | kungtotte quit (Remote host closed the connection) |
19:09:34 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:13:24 | FromGitter | <juancarlospaco> "FortNim: Player Unknown's BugGrounds" :P |
19:14:07 | FromGitter | <juancarlospaco> Theres a dev documentation app named Zeal tho. |
19:16:24 | FromGitter | <mratsim> 3rd engine's the charm |
19:16:51 | ldlework | i always say that |
19:17:17 | FromGitter | <mratsim> AFAIK @zacharycarter had zengine, and I don't remember the name of the first one |
19:17:33 | * | jjido joined #nim |
19:17:35 | FromGitter | <zacharycarter> frag |
19:17:54 | FromGitter | <alehander42> always love looking at those |
19:18:40 | FromGitter | <zacharycarter> I think I learned enough through those two projects to make something that might actually be useful this time around |
19:19:11 | FromGitter | <mratsim> game engine seems like such a huge task: Programming + Graphics + Sound + Physics + Networking + Some NP-complete problems like pathfinding |
19:19:50 | FromGitter | <mratsim> neural networks are easier |
19:19:55 | FromGitter | <zacharycarter> there are already a lot of libraries written for those things though |
19:20:08 | FromGitter | <zacharycarter> the work is really gluing them all together |
19:20:19 | FromGitter | <zacharycarter> but yeah - it is quite a bit of work, but IMO worth the learning experience |
19:20:34 | FromGitter | <zacharycarter> plus, you don't have to learn someone else's engine when you're done, you hopefully know how yours works |
19:20:50 | FromGitter | <zacharycarter> this is the first engine I'm building an integrated map editor for |
19:20:54 | FromGitter | <zacharycarter> which will be fun |
19:21:39 | Araq | I wrote an RTS "engine" once, in Pascal. Never ported the code to Nim |
19:22:04 | Araq | got units to run around on a map |
19:22:17 | Araq | with minimap, scrolling, animation |
19:22:26 | Araq | and a map editor. |
19:22:36 | ldlework | I forget, does Nim have runtime reflection? |
19:22:52 | Araq | no. |
19:23:20 | ldlework | Has anyone written a DI container for Nim yet (if anyone knows off hand) ? |
19:23:59 | Araq | dunno, using runtime polymorphism for testing of code is a bloody stupid idea |
19:25:11 | * | gangstacat quit (Ping timeout: 252 seconds) |
19:27:26 | * | gangstacat joined #nim |
19:30:16 | Araq | you separate code from data and then you construct some data for testing your code. It works well. |
19:32:04 | ldlework | what |
19:32:37 | * | absolutejam2 joined #nim |
19:33:46 | * | brakmic joined #nim |
19:34:25 | * | absolutejam1 quit (Ping timeout: 248 seconds) |
19:34:59 | ldlework | Araq, what does data have to do with dependency injection? |
19:35:50 | lmariscal | does openArray take into account UncheckedArray? |
19:36:08 | lmariscal | and if not, can I safely transform from an array to an UncheckedArray? |
19:36:32 | FromGitter | <mratsim> no it doesn't, it needs a length |
19:36:33 | * | brakmic quit (Read error: Connection reset by peer) |
19:36:43 | * | brakmic_ quit (Ping timeout: 245 seconds) |
19:36:51 | * | brakmic joined #nim |
19:37:08 | FromGitter | <mratsim> castptr UncheckedArray[int (myArray[0].unsafeAddr) |
19:37:25 | FromGitter | <mratsim> cast\ptr UncheckedArray\[int\ (myArray[0].unsafeAddr) |
19:37:32 | lmariscal | thanks, will better be asking for a ptr instead for the wrapper |
19:37:56 | Araq | ldlework: ever wondered why Java code is full of DI and C code isn't? |
19:38:31 | Araq | C separates data from code and Java doesn't. this has consequences like that. |
19:38:32 | ldlework | Because the Java runtime has enough faculties to support creating a DI container and C doesn't |
19:39:14 | Araq | what does that mean? C doesn't lack function pointers. |
19:39:43 | Araq | wow, nimpretty is getting pretty good, https://github.com/nim-lang/Nim/pull/11646 |
19:39:45 | ldlework | Yes, but you'll be building the underlying faculties needed for DI using function pointers, and its reasonable to understand why many people wouldn't do that |
19:40:11 | ldlework | "separates data from code" doesn't mean much to me unless you're just talking about "objects" in which case I am not sure how it applies to this conversation |
19:40:12 | * | ertp07 quit (Ping timeout: 252 seconds) |
19:40:37 | * | ertp07 joined #nim |
19:41:07 | ldlework | or how c's "separation of data and code" allots it complete avoidance of all the issues revolving around a program's objects graph, late binding, testing, and so on |
19:41:15 | ldlework | (it doesn't of course) |
19:42:17 | ldlework | anyway, looks like the answer is no, there's no containers out there, was just curious. |
19:43:05 | Araq | I think you know what I mean, but you like DI, so any argument like "you don't need it" doesn't convince you. |
19:43:17 | * | tdc_ joined #nim |
19:43:58 | ldlework | i don't "like" DI insofar a i recognize well-studied properties of programs, and object-graphs in statically typed languages and that DI containers are a well-studied solution to that problem |
19:44:36 | ldlework | you also say "DI" like the DI containers/frameworks that work to facilitate automated DI are DI -- but all programming languages involve DI, such that all functions require having their parameters passed to them |
19:44:47 | ldlework | and someone must create the instances of those arguments in order to pass them |
19:45:18 | ldlework | it's a general principle of inversion of control that has nothing to do with containers or frameworks or reflection or anything like that... how to solve an interface's dependencies is a universal property of programs |
19:45:28 | * | tdc quit (Ping timeout: 245 seconds) |
19:47:16 | ldlework | you indeed, don't need any help doing DI in your programs, but there are well known benefits to having loosely coupled code with consistent inversion of control - consistent inversion of control leads to the a problem of the bubbling callsite where all object creation floats to the entrypoint. someone at some point said, gee this looks ridiculous I wonder if there's an obvious API here to automate this, and DI |
19:47:18 | ldlework | is the result |
19:47:58 | ldlework | "separating data and code" does not address this domain of concepts whatsoever and is a non-answer. has nothing to do with my bad-faith preventing me from seeing the hard-hitting truths in your non-answer. |
19:48:32 | Araq | You don't need "inversion of control" to create test object graphs. |
19:48:55 | ldlework | testing units is a singular value add of inversion of control |
19:49:26 | ldlework | and yes, people wrote and tested software before they formalized the properties of static type dependencies |
19:50:45 | Araq | yeah and now people use FP and don't need DI anymore. "After" they formalized the properties it turned out they were fed with bullshit for a couple of decades. |
19:51:45 | Araq | and I don't care if you consider it a "non-answer", there is no such thing. There are only answers that you really don't like. |
19:52:25 | ldlework | No, in the FP world like haskell, dependency injection is so fundamental to alegbraically typed languages they simply don't talk about it the same way that ecosystems that are more object oriented have to frame it |
19:52:28 | ldlework | the problem doesn't go away |
19:52:32 | ldlework | it is a complete non-answer |
19:55:13 | * | purebadger quit (Ping timeout: 248 seconds) |
19:55:24 | Araq | https://stackoverflow.com/questions/14327327/dependency-injection-in-haskell-solving-the-task-idiomatically |
19:56:08 | ldlework | Yes |
19:56:10 | ldlework | Read the comment section |
19:56:27 | ldlework | They are simply passing the logger as a dependency |
19:56:30 | ldlework | misses the whole point |
19:56:35 | ldlework | it doesn't address the question whatsoever |
19:56:59 | ldlework | constructing a dependency and passing it to a dependent is exactly what I meant by "all programming languages deal with DI" as an intrinsic property |
19:57:16 | lmariscal | argDefault = argDefault.replace("(((ImU32)(255)<<24)|((ImU32)(255)<<16)|((ImU32)(255)<<8)|((ImU32)(255)<<0))", "high(uint32)") I love this replace |
19:57:23 | ldlework | when the type satisfying the logger interface should change, this implementation must change |
19:57:34 | ldlework | multiplied by refactor points across the program |
19:57:43 | ldlework | yes, you can write programs this way, but you don't have to |
19:57:49 | ldlework | and even in haskell you can solve this problem automatically |
19:58:44 | Araq | if DI means "first class functions passed around", then sure, Haskell is full of DI. |
19:58:46 | ldlework | do you have to use computers and automation to make an intrinsic part of your program, object graph construction, automatic and declarative? no you don't, and people got by before they started doing that. |
19:59:00 | ldlework | its not just functions, but literally any dependency |
19:59:18 | ldlework | and yes haskell, but every other programming languages, is also full of DI, because, yes that's what "injecting a dependency" means |
20:00:32 | * | abm quit (Quit: Leaving) |
20:03:07 | ldlework | if B depends on A and B creates A and therefore must pass A its dependencies, then B must also create A's dependencies. If those have dependencies too, it can get heavy for B. So maybe you have some of those dependencies passed into B, but now you've just moved the problem to C. It's a formalizable problem, and if you extrapolate than object-graph construction moves all the way up into the entrypoint where the |
20:03:09 | ldlework | whole graph is constructed at once. You can do this in any language including an FP one. You now avoid the problem of having dependency-type-refactor points all over your program, but now you have this crazy entrypoint. So all the containers and frameworks do is give you an API for describing the relations between dependencies such that, your entrypoint becomes more declarative than imperative. This all still |
20:03:12 | ldlework | applies to languages like Haskell or any other language. |
20:03:49 | ldlework | The only question is whether the language runtime has the faculties for making writing that API easy on the API writers, and the API to be egrominic enough for users to bother using. |
20:04:03 | ldlework | "separating code and data" has nothing to do with anything |
20:05:39 | Araq | https://www.reddit.com/r/haskell/comments/8m9y91/how_does_one_do_dependency_injection_manually_in/dzlx8l7/ well some Haskell user disagrees and says it's actually rather inconvenient to do in Haskell. |
20:07:53 | Araq | this indicates that 'DI' is not a well defined term. |
20:09:13 | ldlework | They also missed the point of the question, it seems they're no authority |
20:09:19 | ldlework | I use haskell. |
20:09:22 | ldlework | And I've just laid the case. |
20:09:29 | Araq | and yeah, when you separate code and data there is much less desire to "patch" your code for testing. so you need less "dynamic dispatch" and no matter how you define DI, dynamic dispatch is an essential idea of it. |
20:09:30 | ldlework | "separate data and code" is not a case. |
20:09:43 | ldlework | data has nothing to do with testing a unit with dependencies |
20:10:24 | ldlework | and again unit testing is a single thing that benefits from consistent inversion of control with interfaces |
20:10:52 | ldlework | you're not patching anything either. |
20:11:17 | ldlework | you're literally utilizing interfaces for their intrinsic purpose, to alter the implementation of a typed dependency |
20:12:17 | Araq | ok, so your definition of DI doesn't touch on "dynamic dispatch", got it. |
20:13:31 | ldlework | it's not dynamic dispatch though |
20:13:38 | ldlework | there's no vtable... |
20:13:45 | ldlework | there's nothing magical about a container |
20:13:55 | ldlework | a simple mapping of types to types, or interfaces to types |
20:14:04 | ldlework | you ask the container for an instance of a given type |
20:14:20 | ldlework | if it's registered, it creates an instance, first creating instances of it's dependencies and their dependencies and so on |
20:14:25 | ldlework | then it returns the instance |
20:14:28 | ldlework | this isn't "dynamic dispatch" |
20:14:39 | ldlework | why do you seem to only care to flippantly dismiss out-of-hand? |
20:15:15 | ldlework | it's not like i personally invented this domain, you shouldn't let your urge to disagree with me personally overwhelm :| |
20:15:44 | * | purebadger joined #nim |
20:15:50 | * | brakmic quit (Read error: Connection reset by peer) |
20:15:56 | Araq | well I think I know what DI means and I've almost never seen DI work without some form of dynamic dispatch |
20:16:07 | ldlework | you just had it laid out |
20:16:13 | ldlework | lol |
20:16:17 | * | brakmic joined #nim |
20:16:25 | ldlework | where's the dynamic dispatch? |
20:16:47 | ldlework | it's funny you accuse me of having bad-faith and being concretely set in my position |
20:17:02 | ldlework | you should try reasoned arguments instead of meta-discourse |
20:20:22 | * | purebadger quit (Ping timeout: 272 seconds) |
20:20:39 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:20:40 | * | Kaivo quit (Quit: WeeChat 2.5) |
20:20:48 | Araq | I am unable to find a reply that wouldn't involve bad words, so I shall be silent. |
20:25:33 | * | Kaivo joined #nim |
20:28:52 | dom96 | Araq: Regarding nimpretty, any chance I can convince you of this: https://gist.github.com/dom96/ea123cbdb3f7580bac27c7c6883af2fe |
20:29:45 | Araq | bah, that's uglier |
20:31:04 | Araq | I don't like this style. what we can do is to make nimpretty recognize it and use it if it's already used in the same file. but it shouldn't be used in the stdlib |
20:34:42 | dom96 | Adding so many of these rules to nimpretty sounds like it'll be a maintenance nightmare |
20:35:21 | dom96 | The purpose of having a consistent format is to make things readable, having even slight variations breaks that |
20:36:17 | * | narimiran quit (Ping timeout: 248 seconds) |
20:38:52 | FromGitter | <awr1> i wish {.importc.} were a bit more flexible. i would like to have to be able to call compile time functions in the importc but it seems as if it won't work. i'd use macros, but meh |
20:39:03 | * | nsf quit (Quit: WeeChat 2.4) |
20:39:58 | FromGitter | <awr1> like i'd like to do a bit of processing on a Nim identifier name, say `GenericReply`, convert it to snake_case, add a prefix and suffix, to get the importc string `xcb_generic_reply_t` |
20:41:00 | FromGitter | <awr1> but `{.importc: "xcb_" & "$1".toSnakeCase() & "_t".}` unfortunately doesn't seem to call `toSnakeCase()` |
20:45:27 | FromGitter | <awr1> ideally i would prefer it if i could do something like `{.importc: toXCBTypeName.}`where `toXCBTypeName` would be a compile time pure unary function operating on a single string |
20:45:31 | FromGitter | <awr1> and returning a string |
20:45:52 | FromGitter | <alehander42> idlework honestly you seemed a bit more flippant in this discussion imho, please dont assume bad faith/etc |
20:46:38 | FromGitter | <alehander42> i think people just have different experiences of "DI"/other ideas and many of those discussions are just lost on semantic level anyway |
20:48:46 | ldlework | alehander42, sorry the tone was set from my perspective by having something I was looking into called bloody stupid which is a bit distinct than just having a different experience about a thing |
20:49:10 | ldlework | and then summarily dismissed without much effort along the way. but you're free to interpret it however i guess. |
20:49:28 | FromGitter | <alehander42> but its about "runtime polymorphism .." |
20:50:09 | FromGitter | <alehander42> thats exactly my point, thats not even dismissal of your thesis, but of concrete materializations of the idea the other person saw before |
20:51:57 | FromGitter | <alehander42> most people have an opinion based on experience with certain usecases/aspects of things and its not always easy to change it immediately even if its based on incorrect foundations |
20:52:02 | FromGitter | <alehander42> hypothetically |
20:52:57 | FromGitter | <alehander42> otherwise can you give an example of well working DI containers in other lang? |
20:54:52 | Araq | awr1: I think we can count that one as a bug, please report it |
20:56:16 | Araq | dom96: well exactly. |
20:56:56 | Araq | nimpretty should be simple and format according to the one style we agreed upon |
20:57:17 | Araq | btw fun fact: nimpretty doesn't understand Nim's indentation :D |
20:57:43 | Araq | but it "guesses" correctly, almost always. |
20:58:00 | Araq | (we will fix that one though) |
20:59:01 | ldlework | alehander42, they literally accused me of not caring about any reply and being already set in my position. your characterization couldn't hope to convince anyone who played my role in it, not sure why you wasted your breath. |
21:01:07 | dom96 | Araq, what is the one style we agreed upon? |
21:01:23 | Araq | the one nimpretty uses. |
21:02:23 | dom96 | Who's "we" in this context? |
21:03:24 | Araq | nep1.rst |
21:03:47 | * | tdog joined #nim |
21:03:59 | Araq | yeah yeah I know, it lists |
21:04:01 | Araq | proc lotsOfArguments(argOne: string, argTwo: int, argThree: float |
21:04:01 | Araq | argFour: proc(), argFive: bool): int |
21:04:02 | Araq | {.heyLookALongPragma.} = |
21:04:19 | dom96 | lol |
21:04:20 | Araq | however, that's closer to nimpretty's formating than your suggested style is |
21:04:42 | dom96 | sure, just don't split on pragmas |
21:05:12 | dom96 | and stop changing commas to semicolons everywhere |
21:05:16 | dom96 | and I'll be 90% happy :P |
21:06:17 | * | tdc_ quit (Ping timeout: 245 seconds) |
21:09:35 | Araq | ldlework: I'm a single person and I didn't mean to "accuse" you of anything. |
21:10:05 | ldlework | <@Araq> I think you know what I mean, but you like DI, so any argument like "you don't need it" doesn't convince you. |
21:10:33 | ldlework | You accuse me of bad-faith, of purposefully not taking or misinterpreting your point. Then you say it doesn't matter because I've already decided anyway and can't be moved by reasoned argument. |
21:10:40 | FromGitter | <awr1> @Araq https://github.com/nim-lang/Nim/issues/11649 done. |
21:10:51 | ldlework | I have no idea what being a single person has to do with anything. I'm a single person too. Is that relevant? |
21:11:14 | Araq | "they literally accused me ..." |
21:11:23 | ldlework | Yes, you literally accused me of those things with that comment. |
21:11:52 | ldlework | Maybe don't engage in this kind of thing at all since I'm not your enemy and such things don't need to be clarified. |
21:15:25 | * | shadowbane quit (Quit: Konversation terminated!) |
21:15:48 | Araq | well I'm glad to hear that. |
21:18:27 | FromGitter | <awr1> a few friends of mine asked me about nim and i like briefly described it as "the language c++ wishes it was" but in retrospect i wonder if that's a good thing, lol |
21:20:43 | * | absolutejam3 joined #nim |
21:20:54 | * | absolutejam2 quit (Ping timeout: 268 seconds) |
21:21:24 | * | ertp07 quit (Ping timeout: 252 seconds) |
21:23:17 | Araq | well the next time please use more words. |
21:25:15 | FromGitter | <awr1> i mean i did, ultimately |
21:25:38 | * | ertp07 joined #nim |
21:30:20 | * | couven92 quit (Quit: Client Disconnecting) |
21:36:16 | Araq | huh? |
21:36:40 | Araq | https://github.com/nim-lang/Nim/issues/11649 well you apply toLowerASCII to $1 |
21:36:50 | Araq | which results in $1 |
21:37:10 | Araq | I thought the issue is that 'importc' cannot do compile-time evaluations |
21:39:05 | FromGitter | <awr1> nvm |
21:40:46 | FromGitter | <awr1> oh uhhh |
21:41:22 | FromGitter | <awr1> yeah i don't really know how to go about this, maybe this should be moved to RFC |
21:41:39 | FromGitter | <awr1> b/c as-is you can't really do anything complicated in importc |
21:41:55 | FromGitter | <awr1> besides prefixes and suffixes |
21:42:23 | * | Jesin quit (Quit: Leaving) |
21:43:31 | lmariscal | rewrote the generator for ImGui bindings to fix some issues: https://github.com/nimgl/imgui |
21:44:14 | FromGitter | <awr1> if you want i'll close that issue and write up an RFC for the other idea i had |
21:47:24 | * | Jesin joined #nim |
21:50:35 | FromGitter | <awr1> @lmariscal also that's awesome! i've been pining for imgui bindings for a while |
21:51:57 | lmariscal | thanks, in this new version enums are enums and ImVector is a generic type to comply with the c++ source |
21:52:13 | lmariscal | also want to create some helper procs for it |
21:58:45 | Araq | awr1: use c2nim, it does support #mangle rules |
21:59:04 | * | stefanos82 quit (Quit: Quitting for now...) |
21:59:28 | Araq | dom96: https://github.com/nim-lang/Nim/pull/11650 ... why is async so big... :-( |
22:01:14 | * | lf-araujo joined #nim |
22:04:38 | * | solitudesf quit (Ping timeout: 245 seconds) |
22:07:21 | dom96 | That's not that big |
22:07:33 | dom96 | Why is `owned` even a thing when most things are `owned`? |
22:08:54 | Araq | most things are not. |
22:10:00 | Araq | but once it works we can evaluate it precisely |
22:10:20 | Araq | and change the default. I'm pretty sure we got it right though |
22:11:06 | Araq | we could also 'infer' it quite easily but I hesitate to do that |
22:12:45 | * | ertp07 quit (Read error: Connection reset by peer) |
22:13:21 | * | ertp07 joined #nim |
22:13:57 | * | brakmic quit () |
22:19:46 | * | krux02 quit (Remote host closed the connection) |
22:39:39 | * | lf-araujo quit (Ping timeout: 264 seconds) |
23:00:49 | * | absolutejam3 quit (Ping timeout: 248 seconds) |
23:04:40 | * | lf-araujo joined #nim |
23:29:02 | * | ertp07 quit (Read error: Connection reset by peer) |
23:30:18 | * | ertp07 joined #nim |
23:50:50 | * | xet7 quit (Remote host closed the connection) |
23:52:15 | * | xet7 joined #nim |