<< 21-08-2019 >>

00:01:16FromGitter<awr1> you can also use `patchFiles`. BUT be careful, please
00:02:58FromGitter<awr1> since you're *generating* nim code you can adopt's nim philosophy of "well, the output codegen doesn't need to be perfectly human-readable"
00:03:08FromGitter<awr1> so maybe you can forego using `[]`.
00:03:27*actuallybatman joined #nim
00:03:28FromGitter<awr1> make your own procedure, `get()` or something.
00:08:28*actuallybatman quit (Ping timeout: 272 seconds)
00:13:46*actuallybatman joined #nim
00:20:20*sentreen quit (Ping timeout: 244 seconds)
00:29:31FromGitter<kayabaNerve> `CustomSeq = distinct seq` ?
00:30:53*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
00:31:19*laaron joined #nim
00:34:14*sentreen joined #nim
00:51:43FromGitter<Obround> Ok...
00:52:56FromGitter<Obround> @kayabaNerve -- That might work...
01:48:32*ng0_ joined #nim
01:50:58*nif quit (Quit: ...)
01:51:07*nif_ joined #nim
01:51:32*ng0 quit (Ping timeout: 260 seconds)
01:56:55*nif_ quit (Quit: ...)
01:57:44*nif joined #nim
02:25:15*dddddd quit (Remote host closed the connection)
02:26:21*endragor joined #nim
02:51:50*rayman22201 quit (Quit: Connection closed for inactivity)
03:12:10*vivus joined #nim
03:27:35*rockcavera quit (Remote host closed the connection)
03:39:25*fjellfras joined #nim
03:41:36*NimBot joined #nim
03:52:15FromDiscord_<HurstWriter> I want to confirm my understanding.
03:52:15FromDiscord_<HurstWriter>
03:52:15FromDiscord_<HurstWriter> ```
03:52:15FromDiscord_<HurstWriter> loadExtensions()
03:52:15FromDiscord_<HurstWriter> # glClearColor(0.0, 0.0, 0.0, 1.0) # Set background color to black and opaque
03:52:15FromDiscord_<HurstWriter> ```
03:52:16FromDiscord_<HurstWriter>
03:52:18FromDiscord_<HurstWriter> won't compile until I uncomment the `glClearColor(...)` because of dead code elimination
03:53:03FromDiscord_<HurstWriter> this is the sdl2 opengl example, with everything commented out below `loadExtensions() ` for context
03:54:25*chemist69 quit (Ping timeout: 250 seconds)
03:56:27*chemist69 joined #nim
03:58:51*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
04:03:36*laaron joined #nim
04:11:43*laaron quit (Remote host closed the connection)
04:14:07leorizeuhmm dead code elimination doesn't have any effect on this...
04:14:39leorizeit's only to remove unneeded functions from the C output produced be the compiler
04:15:09*laaron joined #nim
04:16:29leorizeZevv, disruptek, narimiran: anyone willing to test my refactoring of nim.nvim? It should work, hopefully :P
04:21:52*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
04:22:19*laaron joined #nim
04:25:43*laaron quit (Remote host closed the connection)
04:26:09*laaron joined #nim
04:26:30FromGitter<zacharycarter> anyone know how to get nimgen to work in cpp mode?
04:29:08*gangstacat quit (Quit: Ĝis!)
04:40:34*nsf joined #nim
04:49:34*arecaceae quit (Remote host closed the connection)
04:49:58*arecaceae joined #nim
04:52:23FromGitter<zacharycarter> Never mind.
05:24:12*vivus quit (Remote host closed the connection)
05:28:26Zevvleorize: you lied to me. YOu have *three* users, not two!
05:28:48Zevvwill update and test later today!
05:32:47*solitudesf joined #nim
05:34:21FromDiscord_<Shield> zacharycarter do you have by chance the 32bit binaries of bgfx?
05:36:46leorizeZevv: it's in the refactoring branch :P
05:54:02FromGitter<kdheepak> Hi all, I have a Javascript function that I get using require. But `require` in Nim returns a `JsObject`. How do I cast that to a function?
06:04:24FromGitter<kdheepak> How do you cast to a jsobject to a proc in nim's javascript target
06:04:46*LargeEpsilon joined #nim
06:11:33*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
06:12:38FromGitter<kdheepak> https://nim-lang.org/docs/jsffi.html#to%2CJsObject%2Ctypedesc
06:12:43FromGitter<kdheepak> I think this is the answer.
06:16:41*narimiran joined #nim
06:16:56*laaron joined #nim
06:17:58*PMunch joined #nim
06:18:36*btop joined #nim
06:29:16FromGitter<zacharycarter> Shield: I can build some for you, but do you need them for Windows or some other os?
06:29:38FromGitter<zacharycarter> because I really only have access to Windows and WSL atm
06:33:41*terps joined #nim
06:39:49*terps quit (Ping timeout: 252 seconds)
06:42:42*skelett quit (Quit: WeeChat 2.4)
06:53:11*krux02 joined #nim
06:58:56*laaron- joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:57*laaron quit (Remote host closed the connection)
07:04:57*gmpreussner joined #nim
07:11:40*ng0_ is now known as ng0
07:15:02*LargeEpsilon quit (Read error: Connection reset by peer)
07:16:04FromDiscord_<Shield> just windows, I'd like to try your bindings but couldn't compile it myself
07:19:23*solitudesf quit (Ping timeout: 268 seconds)
07:34:45FromGitter<kdheepak> Anyone have any example of using fetch / async using nim's javascript target?
07:42:16*MrAxilus[m] joined #nim
07:45:40FromGitter<kdheepak> Nim's await does not work for me in Javascript
07:46:17FromGitter<kdheepak> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d5cf6c9fa99e74f6a65f647]
07:54:19*btop quit (Ping timeout: 246 seconds)
08:03:04FromGitter<kdheepak> I don't know how to get data from a Future object in the javascript target
08:03:57FromGitter<kdheepak> This example: https://github.com/nim-lang/Nim/blob/devel/tests/js/tasync.nim is not super helpful
08:26:05*floppydh joined #nim
08:44:21*terps joined #nim
08:46:01PMunchI assume you've read the actual documentation for it kdheepak? https://nim-lang.org/docs/asyncjs.html
08:53:19Zevvleorize: could you please drop the 'nimsuggest instance terminated' message on nvim exit?
08:57:58*actuallybatman quit (Ping timeout: 245 seconds)
09:31:34PMunchHmm, kdheepak. I'm looking at asyncjs and I'm as lost as you are..
09:31:46PMunchSo await is only available inside a procedure marked with async
09:32:31PMunchBut there doesn't appear to be any way to call an async procedure and wait for it in a synchronous procedure..
09:39:42*LargeEpsilon joined #nim
09:42:16*clyybber joined #nim
09:43:55clyybberAraq: Hey, do you have an idea why 32bit fails on https://github.com/nim-lang/Nim/pull/11926 ?
09:58:33*shomodj joined #nim
10:01:35*shomodj_ joined #nim
10:05:07*Vladar joined #nim
10:05:12*shomodj quit (Ping timeout: 244 seconds)
10:05:23FromDiscord_<Kiloneie> What are Nim's greatest weaknesses, besides not being 1.0 and small community ?
10:13:35*terps quit (Ping timeout: 250 seconds)
10:18:10narimiranno big sponsor behind it
10:19:29FromDiscord_<Kiloneie> i wrote, anything else besides, noone knows about it because big moneys thrown at everyone's faces ?
10:20:38FromDiscord_<Kiloneie> Nim vs C, just use Nim, as it's the much safer and readable language, compared to Python, also much safer, less bug prone as it doesn't let you do stupid things, and is way faster
10:21:00FromDiscord_<Kiloneie> That i know, theres multiple inheritance it can't do, but besides that... what ?
10:21:08CcxWrkThe library situation is not great, but that comes with small community.
10:22:03FromDiscord_<Kiloneie> Okay, let's say that documentation, standard library, 1.0, community is all resolved in like 5 years or whatever, is there any reason to use some other language over it ?
10:22:18CcxWrkPersonally I'd probably go with OCaml over Nim for a lot of things because of that, even though both have significantly smaller binding coverage than say Python.
10:22:45CcxWrkOh sure.
10:23:34CcxWrkFor one, you may want to use the language the operating system interface is written in. C on UNIXy systems, C++ on Windows, it's complicated on Android.
10:23:50CcxWrkThe translation is always somewhat lossy.
10:24:27FromDiscord_<Kiloneie> Wouldn't you just do Nim code, then stuff Nim can't do for making an OS, go look at the code it generated in C, and finish from there ?
10:24:38FromDiscord_<Kiloneie> i mean, wouldn't it be better than pure C ?
10:25:26FromDiscord_<Kiloneie> And yes Android is a mess, that OS doesn't know what it is or wants.
10:25:27CcxWrkYou may want a language with better security guarantees (say Monte or Pony), you may want language from completely different paradigm (Prolog is invaluable to me), there is a plenty of reasons.
10:26:07FromDiscord_<Kiloneie> Basically it's mostly subjective.
10:26:21CcxWrkIt can be objective but project-specific.
10:26:37CcxWrkDo you need formal proof of code correctness? Go with Ada/SPARK. And so on.
10:27:48FromDiscord_<Kiloneie> For hobbyists and beginners, a language like Nim would cover most things. I think it makes a very good language for beginners,(yes i know documentation is a must there, so are tutorials)
10:28:04FromDiscord_<Kiloneie> for some specific things like you mentioned, there are better alternatives
10:29:21CcxWrkKiloneie: I mostly agree with http://norvig.com/21-days.html you need to learn quite a few approaches different languages take to get understanding of the problem domain.
10:29:46FromDiscord_<Kiloneie> I will take a look
10:30:34CcxWrkFor total beginners I mostly suggest AWK via the book. Very limited feature set so not too many things to keep in mind. In general languages with few features are good starters. Pascal was designed for that too.
10:30:49*LargeEpsilon quit (Ping timeout: 252 seconds)
10:31:41CcxWrkI'd call Nim more of a pragmatic choice than a learning one. Still way better than C++ or Haskell that try to cram in everything and a kitchen sink. But still there'll be a lot of gotchas for inexperienced.
10:33:15CcxWrkThe advantage of Python and other languages with interactive interpreter is very easy way to see what's going on and experiment. (Partially true in Forth too)
10:34:27CcxWrkIf you want a better Python I'll point you to Icon or rather the modern version called Unicon. Nim feels more of a ML crossed with C with a little sprinkles of Python syntax on top to me.
10:37:57FromDiscord_<Kiloneie> Idk my first language was Game Maker's GML, it was very easy, and you made games, really great for beginners, but once you started making games larger than pacman, let's say how i wanted to make a space game, where you construct your own space ship from modules, micro the inside of the ship like in FTL game, and it's dynamic typing becomes a huge pain in the ass, and typing every function by it's name like, object_index, sprite_index, x,
10:38:50FromDiscord_<Kiloneie> And yes python's interactive mode is great, but Nim's compiler is actually so fast, you can do that method of learning almost in the same manner ?
10:39:24dom96I would challenge the notion about whether you actually want a language with "better security guarantees"
10:39:36dom96You should be more specific when making these claims :)
10:40:13CcxWrkOh sure, it's a complex topic. I was trying to point out you the answers are complex too. :)
10:41:22CcxWrkKiloneie: I'd disagree on that. There's big power to the introspection and in Python's case built-in help/docstrings.
10:42:50*fjellfras quit (Quit: Leaving)
10:42:52FromDiscord_<Kiloneie> This introductionary video of mine is bugging me how to correctly introduce Nim, i did first program setup and hello world synopsis in like 30 minutes, intro video... ugh... This is why i am asking all these questions.
10:42:52FromDiscord_<Kiloneie>
10:42:53FromDiscord_<Kiloneie> And sure, i never found writting and executing code line by line much appealing to me, besides.... command prompt stuff ?.
10:43:20FromDiscord_<Kiloneie> Do you guys want to read my synopsis for my 2 videos ? im kinda lost on the first one.
10:44:34CcxWrkEven command line can be fun if you have "turtle" or for the old foggies "robot Karel" alongside it.
10:48:31CcxWrkdom96: That said, I don't think there is any way to restrict ambient authority in Nim, is there? It'd be amusing to see a tamed version of the language though I don't think it fits it too well.
10:49:02dom96no idea what ambient authority is :O
10:51:02CcxWrkSomething a piece of code can do without it being explicitly passed in. It's a general concept and looks bit different on language, OS and hardware levels.
10:51:28*Vladar quit (Remote host closed the connection)
10:51:52*Vladar joined #nim
10:53:26CcxWrkProbably the most familiar would be the tamings of JavaScript (Google Caja, Secure EcmaScript, Jessie), but there has been quite a few projects on producing variants of languages with such guarantees.
10:54:12Araq.tags: [] mechanism :P
10:56:43CcxWrkYeah, that's an opt-in though (and I'm not sure if sufficient). I was talking about languages with "no escape hatches" policy.
11:00:40*shomodj joined #nim
11:00:58CcxWrkYou also have to eliminate globals among other things. But yeah, effect tracking possibly within linear typing system seems to be one of possible ways to isolate authority. Less popular than the object-oriented and message-passing ones currently. So that could actually work I think.
11:01:04FromGitter<alehander42> PMunch, i worked on asyncjs
11:01:09FromGitter<alehander42> what are you trying to do
11:02:56*terps joined #nim
11:03:11FromGitter<alehander42> sorry, this is not really possible iirc
11:03:20FromGitter<alehander42> await is forbidden out of async in javascript
11:03:32FromGitter<alehander42> except for top level: i think latest browser/node versions or flags support it
11:03:48FromGitter<alehander42> typically on top level i can discard myAsync() in node
11:03:55FromGitter<alehander42> and the script seems to await the end of it
11:04:04*shomodj_ quit (Ping timeout: 248 seconds)
11:04:22FromGitter<alehander42> but if you want to await inside synchronous procedure, i guess one would need to make it also asynchronous
11:04:59FromGitter<alehander42> i am afraid we are limited by javascript/node async semantics here as its practical to map to them
11:05:46PMunchBut doesn't that mean that either everything is async, or that nothing is?
11:06:34FromGitter<alehander42> basically if you need to somewhere await stuff, yeah, its "callstack" probably needs to be async
11:06:53FromGitter<alehander42> https://stackoverflow.com/questions/47227550/using-await-inside-non-async-function
11:07:27disruptekleorize: i'm not getting instant checking in the new nim.nvim; do i now need to toggle that somewhere?
11:08:04disruptekmaybe i never did. 😉
11:08:37FromGitter<alehander42> thats a known thing iirc https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/
11:08:46FromGitter<alehander42> ", you’re right back to realizing color is still there, bleeding all over your codebase."
11:10:10clyybberAraq: Hey, you there?
11:11:44krux02I am here
11:11:54krux02clyybber: if that helps
11:12:05*LargeEpsilon joined #nim
11:12:20clyybberI don't know, do you know how https://github.com/nim-lang/Nim/pull/11926 could fail 32bit tests?
11:12:36PMunchalehander42, ah I see.. Maybe some details about this shoud be added the the asyncjs documentation?
11:13:18clyybberkrux02: AFAICT I don't use 64bit exclusive things
11:13:37FromGitter<alehander42> PMunch, you're right, it's not obvious
11:13:47FromGitter<alehander42> especially if people know waitFor
11:14:32PMunchYeah I just started looking into it because @kdheepak asked about it, and by reading through the docs and writing out some examples I really couldn't get an idea of what I did wrong..
11:14:49FromGitter<alehander42> yes, maybe the error should also include it
11:14:59FromGitter<alehander42> we can define await globally in jsffi
11:15:22FromGitter<alehander42> with a error template that says "you can only await inside {.async.} in the javascript backend"
11:15:32FromDiscord_<Kiloneie> This is my synopsis for my Nim introductionary video, can you give me your thoughts ? https://justpaste.it/6ltqe
11:15:45disruptekyou simply need to keep in mind that when you are in an async context, you use `await`, because it's async-aware. that's the case in any backend, not just js.
11:16:13FromGitter<alehander42> yeah, that's true
11:16:28FromDiscord_<Kiloneie> And this is snyopsis for video #2 your first program Hello world: https://justpaste.it/5f63f
11:16:47FromGitter<alehander42> but you can still give some kind of a hint like "you need to use this in async"
11:17:27FromGitter<alehander42> even, i'd argue for the asyncdispatch, such a hint should include a "if you want to await it in a sync function, you can use waitFor"
11:17:40*endragor quit (Remote host closed the connection)
11:18:12FromGitter<alehander42> and for the javascript backend: "there is no way to wait for it in sync code except on top level"
11:18:56PMunchYeah, that would be nice
11:19:17PMunchCan you get the result of an async procedure at the top level?
11:21:37disruptekof course, using `waitFor`.
11:21:48PMunchNot in JS
11:21:54PMunchwaitFor doesn't exist there
11:22:18disruptekthat makes me sad.
11:22:32PMunchJavaScript makes everyone sad
11:22:52FromGitter<alehander42> you can
11:22:56FromGitter<alehander42> but with `then()`
11:23:16FromGitter<alehander42> oh .. let's not jump on the "javascript sad" bandwagon
11:23:21PMunchHaha :P
11:23:28Araqclyybber: pong
11:23:30FromGitter<alehander42> wasm is here, people are free to make a nim backend :P
11:23:39Araqalehander42: tested the new karax?
11:23:46FromGitter<alehander42> ugh sorry, didnt find the time
11:23:46PMunchNew Karax?
11:24:08PMunchNim can still do WASM through C and Emscripten right?
11:29:43*nif quit (Quit: ...)
11:29:50disruptekyes, but the ideal future of nim->wasm is probably nim->llvm backend->wasm.
11:29:52*nif joined #nim
11:31:11clyybberAraq: Hi
11:31:13PMunchYeah I guess that makes sense. the same way we now du Nim -> C -> Binary
11:31:28clyybberAraq: Any idea why https://github.com/nim-lang/Nim/pull/11926 is failing only on 32bit?
11:32:07Araqno but you also broke https://ci.appveyor.com/project/dom96/nim/builds/26830991/job/80xbxg3qff7jvuf9/tests
11:32:35clyybberHuh, what the hell
11:34:06*theelous3 joined #nim
11:35:08clyybberHow can I tell nimble to use nim_temp when doing nimble test?
11:35:47clyybberNevermind
11:42:01clyybberAraq: Is a nkStmtList with no sons legal?
11:48:24*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
11:48:31PMunchHmm, FOSDEM call for participation is out: https://fosdem.org/2020/news/2019-08-13-call-for-participation/
11:48:42Araqclyybber: not really but the sons.len can be 0
11:48:51*laaron joined #nim
11:49:58PMunchSo, the big question, can we fill 7-8 hours with Nim talks and apply for a devroom?
11:50:46FromGitter<alehander42> BrusselsNimConf2020
11:51:36FromGitter<alehander42> i think its possible, but i doubt this is the only req
11:52:11PMunchhttps://submission.fosdem.org/submission/devroom
11:52:15PMunchNot too far from it
11:52:24FromGitter<alehander42> i think something like a "newer system langs" devroom would be way easier, but .. i doubt the diplomacy is there
11:52:39PMunchYeah, I've been thinking about that as an alternative
11:52:58PMunchOr just a "Newer languages" room, doesn't have to be system langs
11:53:07FromGitter<alehander42> yeah
11:53:50PMunchBut which langs..
11:54:03clyybberAraq: Ok, pushed a fix, maybe it magically fixes the 32 bit tests too.
11:55:32FromGitter<alehander42> nim, zig, crystal, pony, scopes? maybe julia? probably many
11:55:35narimiranv-lang, of course :D this would generate everybody's interest :D
11:56:09*nif quit (Quit: ...)
11:56:19*nif_ joined #nim
11:56:24narimiranor, we just claim there will be v-lang talk, but then when the time comes.... :D
11:56:48FromGitter<alehander42> if they have enough progress, i'd welcome them with open arms
11:57:54PMunchI'm talking to a guy who's active in the V community right now actually
11:58:10PMunchWould definitely be interesting to hear a talk about it
12:01:25FromGitter<zetashift> @Kiloneie on the first one there a bit of repetition but looks nice otherwise, the second one is good too but I'd recommend also saying that `nim c -r foo.nim` compiles in debug mode
12:04:12narimiran@Kiloneie do you plan a long video series about programming in nim? what it will be about? will you make some project or go through various topics or something else?
12:05:32leorizeZevv: I don't know when nvim exit... but I can omit that message for error code 0 (which I'm going to)
12:08:01leorizenarimiran: since you probably didn't check the log, can you please try to pull the "refactoring" branch of nim.nvim?
12:08:23leorizeI've done some cleanup / optimization, and hopefully everything still works
12:08:44narimiranleorize: you're right, i didn't check the logs. yeah, i could do that
12:08:47leorizedisruptek: the plugin never supported automated linting :P
12:09:15leorizenarimiran: you need to get an IRC bouncer :P
12:10:06narimirannaaah, i'm fine the way the things are currently. sometimes i'm offline and that's it :)
12:10:18PMunchleorize, just leave him a message with MemoServ :)
12:13:36PMunchOkay, I'm taking some innitative on this as I think it would be really cool. I'm inviting anyone who's interested to join me over in #fosdem19newerlangs to discuss the creation of a newer languages Developer room. And I'm pinging people in other newer languages channels to see if they want to join.
12:20:04FromGitter<alehander42> PMunch awesome
12:22:19*solitudesf joined #nim
12:26:14FromGitter<zacharycarter> I see Rust is missing from your list @alehander42 :P
12:26:38PMunchI think Rust has it's own room
12:26:44PMunchOr at least they did last year I think
12:27:33FromGitter<zacharycarter> The main languages in that list that are interesting to me are Scopes and Nim
12:27:34*MrAxilus[m] left #nim ("User left")
12:27:40*MrAxilus[m] joined #nim
12:27:45*MrAxilus[m] left #nim ("User left")
12:28:14FromGitter<arnetheduck> nim->llvm->wasm already exists / works, but the support stuff around it is missing - on the top of my list is something that generates a javascript api from the wasm code - something like https://github.com/rustwasm/wasm-bindgen
12:28:34FromGitter<alehander42> @zacharycarter they probably have their own room : )
12:28:45FromGitter<zacharycarter> yeah true
12:28:47FromGitter<alehander42> they're on a next level of popularity
12:29:19FromGitter<zacharycarter> Scopes seems to have a much much smaller community than Nim does
12:29:23FromGitter<alehander42> overally, i feel this is for languages without bigger backing, like kotlin , rust etc
12:29:29FromGitter<alehander42> hm thats true
12:29:47FromGitter<arnetheduck> in another discussion the other day I made the point that it would make sense for nim to drop its javascript backend completely and refocus on wasm instead - assuming nim is released in a year or two, js will be mostly obsolete as a way to compile "other" languages for the web or node
12:29:59FromGitter<alehander42> i just found it interesting before
12:30:01FromGitter<alehander42> @arnetheduck booo
12:30:08FromGitter<zacharycarter> it is interesting
12:30:40clyybberarnetheduck: I agree
12:30:45FromGitter<zacharycarter> +1
12:30:48FromGitter<arnetheduck> @alehander42 look around - javascript projects are busy moving to typescript and don't realise they've been obsoleted already by wasm
12:31:17FromGitter<alehander42> i am all for a very good nim wasm backend
12:31:19FromGitter<zacharycarter> although I think Nim should first focus on stability
12:31:25FromGitter<alehander42> and i hope a lot of resources should be put in that
12:31:25FromGitter<zacharycarter> and fixing what's broken
12:31:41FromGitter<alehander42> but it doesnt make sense to deprecate the javascript backend in the next 5-ish years
12:31:47FromGitter<alehander42> imho
12:31:53FromGitter<zacharycarter> as well as making experimental features that are planned as keepers, non-experimental
12:31:56FromGitter<arnetheduck> why on earth would you moved to a typed language and compile to javascript of all things? makes no sense.. js backend represents a maintenance burden and a mindshare sink for nim, and it's not like nim as too many resources
12:32:22*Kaivo joined #nim
12:32:30FromGitter<alehander42> @arnetheduck sorry, but wasm is still in its infancy for webdev
12:32:47*cgfuh joined #nim
12:33:45FromGitter<arnetheduck> today yes. in a year or two which is the earliest point that nim has a chance of being stable?
12:35:35FromGitter<alehander42> javascript still would be everywhere
12:35:43livcdarnetheduck: do you think wasm will be usable in 1-2 years ?
12:35:44FromGitter<alehander42> this transition would take ~a decade
12:35:46FromGitter<alehander42> at least
12:35:51FromGitter<alehander42> imo
12:36:22*rockcavera joined #nim
12:36:30FromGitter<arnetheduck> if the nim js backend was a high-quality, fully working environment that supported "most" of nim, it would be a different matter - but it's not - it has severe and quite arbitrary limitations that need significant work to resolve.
12:36:48disruptekthis. wasm doesn't just let us sidestep that.
12:36:54disruptekit's far more performant and capable.
12:37:02disruptekwhat would you rather write wasm in?
12:37:20FromGitter<arnetheduck> @livcd given that the big-3 browsers have implemented it *already*, I'm not sure what you mean by "usable"
12:37:45FromGitter<alehander42> however 95% of the code / libs/ api-s out there expect a javascript base
12:37:47FromGitter<arnetheduck> it's also usable in nodejs which is the other "big" js environments, so I don't really see what the use case is
12:37:55FromGitter<alehander42> lets just ignore all nuance
12:37:58FromGitter<alehander42> and the ecosystem
12:38:02dom96PMunch: yay, thank you for keeping a look out on this. That devroom sounds like an awesome idea.
12:38:18dom96Guessing FOSDEM people might be concerned about bias in you choosing Nim talks though :P
12:38:31FromGitter<arnetheduck> @alehander42 agree - that's why a bindgen is needed, so that the wasm code can be accessed conveniently from nim, *as if* you were using the js backend
12:38:46FromGitter<alehander42> the nim javascript backend is fine imo: it has stdlib limitations which dont really bother its usage as people just dont .. need those modules
12:38:56FromGitter<arnetheduck> it's just a matter of replacing some of the "internal" implementation details with a backend that is far more suitable for nim
12:39:09*terps quit (Ping timeout: 252 seconds)
12:39:27livcdarnetheduck: available on all devices
12:39:34livcdcan you use wasm with iOS safari ?
12:39:36FromGitter<arnetheduck> *accessed conveniently from js
12:40:20dom96arnetheduck: no way on the proposition to drop JS
12:40:25FromGitter<alehander42> is interopping with javascript code easy in today's wasm? can you access the DOM, interop with react/etc similar
12:40:34dom96The JS backend works well enough for most use cases
12:40:43FromGitter<alehander42> this is really not that easy to pull out
12:40:46FromGitter<arnetheduck> @alehander42 yup - but you need a bindgen
12:40:48FromGitter<alehander42> pull off*
12:40:48dom96we've got a SPA framework written in it and a forum that uses it
12:40:57dom96we should enable WASM on a per-proc basis
12:41:19dom96(that would be a pretty killer feature as DOM access is still a problem for WASM AFAIK)
12:41:20livcdare there applications in the wild that are only wasm?
12:41:42FromGitter<alehander42> lets first have a good nim wasm backend
12:41:49FromGitter<alehander42> and worry about the javascript one after that
12:42:00PMunchdom96, that's partially why I want to invite all the languages now, before we create the application
12:42:04FromGitter<arnetheduck> funny enough and for natural reasons, the ones that are most interested in wasm are game devs, a group that nim supposedly targets specifically
12:42:32FromGitter<alehander42> but you are creating an artifficial "us against them" here
12:42:46dom96PMunch: Makes sense. Let me know if there is anything I can do to support your efforts
12:42:57FromGitter<arnetheduck> @livcd: https://blogs.unity3d.com/2018/08/15/webassembly-is-here/
12:43:24FromGitter<alehander42> i want both backends for now
12:43:59dom96there is nothing to argue for here
12:44:19dom96both backends will remain for the foreseeable future, wasm is nowhere near ready for us to just drop the js backend
12:44:38dom96if a wasm backend matures we may think about deprecating the JS backend
12:45:46FromGitter<arnetheduck> yes, we anticipated this would be the reaction :)
12:47:39dom96I don't understand how you can consider just dropping the JS backend right now as something viable
12:47:52FromGitter<alehander42> you knew how unreasonable your idea was from the beginning :P
12:48:08dom96Do you simply not care about the current users of Nim?
12:48:08livcdarnetheduck: why "we" ?
12:48:20FromGitter<alehander42> @arnetheduck i know you're trying the "let's push for X that is aligned with only my project's interest" but come on
12:48:58FromGitter<arnetheduck> but the writing is on the wall, and I'd encourage you to evaluate the proposal based on its technical merits: which output nim most naturally maps to, where nim gets the most bang for the maintenance buck, etc and you'll quickly see that there's a lot more opportunity for reuse if the friction between the backend and the language is smaller
12:49:11disruptekexactly.
12:49:15disruptekllvm has other benefits.
12:49:25FromGitter<arnetheduck> @alehander42 no, mostly I'm arguing it from the point of view of someone that *has* written a backend for nim
12:49:39disruptekit's just a technically superior backend format.
12:49:58FromGitter<alehander42> but you're creating an artificial "javascript vs wasm"
12:50:02FromGitter<alehander42> nothing stops a nim wasm backend
12:50:13disrupteknothing stops a js backend. go nuts.
12:50:28FromGitter<alehander42> disruptek, eh?
12:50:30disrupteknim->llvm also enables graalvm.
12:50:43disruptekno one said js backend had to be dropped.
12:50:47FromGitter<arnetheduck> no, I'm pointing out that you can access nim code from javascript *better* if nim is compiled to wasm and a js interface is automatically generated - from a purely technical point of view
12:51:02FromGitter<alehander42> disruptek, well that was exactly what it was said
12:51:21dom96disruptek: literally what was said
12:51:43disruptekwell, lemme see a quote. i saw some "writing on the wall" type stuff, which is accurate, imo.
12:52:13*gangstacat joined #nim
12:52:18FromGitter<arnetheduck> I'm not saying that nim code should not be usable from javascript - I'm saying that in 2019, it doesn't technically make sense to generate javascript code from a statically typed language - it's... uh.. "inefficient"
12:52:37clyybberyou can skip the quotes
12:52:38FromGitter<alehander42> @arnetheduck and i am talking to you as somebody who created several dsl-s which do something similar : generating automatically a javascript interface : this sucks to be used / debugged / analyzed
12:52:39dom96Sure, I agree with that.
12:52:53FromGitter<alehander42> unless you actually use more wasm-based stuff
12:53:17FromGitter<alehander42> if you just work on a typical web frontend: today, not in "whenever wasm ecosystem is there" day
12:53:21dom96WASM is great and I want us to adopt it
12:53:22dom96I want Nim to have a WASM backend
12:53:24dom96and I want to use it
12:53:26FromGitter<alehander42> this is not a better way
12:53:29Araqall my attempts to access the DOM failed with the emscripten/wasm route
12:53:30FromGitter<arnetheduck> you could have your forum and your dsl and all that, and more nim features working with more performance for free this way
12:53:52Araqthat was roughly a year ago
12:53:55Araqmaybe it's better now
12:54:00disruptekwhy don't we just drop this wasm discussion and focus on llvm? that's a much more powerful intermediate that gives us wasm for free.
12:54:08FromGitter<arnetheduck> @livcd "we" as in status (because we develop a lot of nim code)
12:54:16Araqbut then wasm needs threading and eventually most of posix
12:54:22*nif_ quit (Quit: ...)
12:54:29Araqit's a decade away from that IMO
12:54:41*nif joined #nim
12:54:49disruptekwasm has threading, iirc.
12:54:57Araqand I often wonder if a x86 emulator wouldn't do better instead of reinventing everything
12:54:57FromGitter<arnetheduck> @Araq nah, not really. WASM is an evolution of asm.js which has been around for that decade that you're talking about
12:55:10Araqasm.js is terrrible
12:55:17Araqand wasm shares some its design flaws
12:55:33FromGitter<arnetheduck> compared to javascript? :)
12:55:53disruptekmaybe araq just doesn't want to target the web at all.
12:55:54Araqyes, even compared to JS.
12:56:03clyybberAraq: Is there some caveat to closures on 32bit?
12:56:27Araqdisruptek: I spent a significant amount of research on this topic a year ago, "doesn't want to" is unfair
12:56:37dom96"you could have your forum and your dsl and all that, and more nim features working with more performance for free this way"
12:56:38disruptekwhat's your proposal?
12:56:40FromGitter<alehander42> @arnetheduck i think the wrong fallacy in your thesis is that "if we dont drop the javascript backend, the wasm resources will have no resources" which i dont see as valid
12:56:45dom96If I can have that, then sure, drop the JS backend
12:56:49dom96But right now that isn't the case
12:56:53FromGitter<alehander42> (the quotes mean my understanding of it, not a quote)
12:56:54dom96So talk of dropping JS is unrealistic
12:57:13disruptekjs doesn't need to be dropped, but putting more effort into llvm support would be huge.
12:57:34FromGitter<alehander42> but there is barely new effort being put in the javascript backend
12:57:44dom96disruptek: Araq wrote an SPA framework and most of the JS backend, I think that proves his want to target the web
12:57:49FromGitter<alehander42> this has totally nothing to do with the llvm one
12:58:09disruptekit has everything to do with it.
12:58:14clyybberllvm->wasm
12:58:36FromGitter<alehander42> disruptek what i mean is that the javascript backend doesnt take any resources from working on the llvm one
12:58:37FromGitter<arnetheduck> @alehander42 my thesis is "the js backend slows down other nim development because of maintenance and constraints on core nim developmet" - this should be unsurprising to anyone doing software development, that lots of code ossifies feature and stability development
12:58:43disruptekalso llvm->graalvm, which means interop with anything that targets jvm.
12:59:00FromGitter<alehander42> @arnetheduck and what are examples of those constraints?
12:59:11disruptekbbl
12:59:13FromGitter<arnetheduck> simple: you change the AST, you must update the JS backend
12:59:23FromGitter<arnetheduck> you add a feature, you must consider the JS backend
12:59:49FromGitter<alehander42> which often takes 5 minutes
12:59:51FromGitter<arnetheduck> you have additional options in the std lib (when js) that receive less testing and contribute to complexity of understanding
12:59:58FromGitter<alehander42> at least i've never had the impression
13:00:02FromGitter<alehander42> that this is a bottleneck
13:00:06FromGitter<alehander42> in development
13:00:17AraqWe drop the JS backend, we lose users.
13:00:19dom96this is what's great about the JS backend: it evolves with the language
13:00:20clyybberdisruptek: JVM interop would be killer
13:00:29dom96I don't know of a single language that has a native JS backend
13:00:30Araqthat's always the side of the coin that you never mention!
13:00:34dom96except Nim
13:00:57FromGitter<alehander42> dom96 many "kinda" do: scala.js clojurescript, unofficial projects for several others
13:01:23FromGitter<alehander42> but less well than nim imo
13:01:24FromGitter<arnetheduck> of course it's not a bottleneck individually - 5 minutes here and there however adds up - it's a cost - with constrained resources, you focus on where you have the best returns
13:01:45dom96alehander42: are these part of the Scala/Clojure compiler?
13:02:01FromGitter<alehander42> not sure, probably not
13:02:02clyybberCan someone with a 32bit machine help me test something?
13:02:06FromGitter<arnetheduck> dom96 uhhh, typescript is kind of.. major in this regard?
13:02:36dom96arnetheduck: Typescript is exclusively translated to JS, no?
13:02:51FromGitter<alehander42> @arnetheduck also, if your thesis was true, typescript would've started targetting wasm very aggresively like yesterday
13:02:56FromGitter<arnetheduck> I wouldn't be surprised if they're busy adding a wasm backend :)
13:03:33dom96Typescript is not the same at all. I can't write a native application that runs on my server in typescript and also target the web browser with it, can I?
13:03:50Araqdom96: probably you can with Node.JS
13:03:57dom96Araq: keyword being "native"
13:04:03FromGitter<arnetheduck> @alehander42 see "assemblyscript"
13:04:03Araq*shrug*
13:04:41FromGitter<alehander42> @arnetheduck eh that's not by the typescript folks
13:04:47FromGitter<alehander42> we also have similar projects for nim
13:04:54FromGitter<alehander42> see: we're done :)
13:05:40FromGitter<alehander42> basically, i see it like "let's see an amazing wasm backend: if its so amazing, the decision to drop javascript would be easy ;)"
13:05:52*cgfuh quit (Quit: WeeChat 2.5)
13:06:42livcddom96: haxe ? :D
13:07:22dom96livcd: Possibly, but AFAIK Haxe has dozens of backends and each are of differing quality
13:07:30dom96Nim put a lot of focus on the JS backend
13:07:41dom96And it shows in the quality
13:08:54FromGitter<arnetheduck> anyway, all this was just one of the things that came out of a free thinking session about what it would take to make nim both awesome and reach a stable and releasable point.. "sunk cost" is generally a poor argument of keeping something.
13:09:14FromGitter<alehander42> but it has nothing to do with sunk cost imo
13:09:56FromGitter<alehander42> but with "this is what works great now, when the amazing new thing actually starts existitng, lets compare"
13:09:57*terps joined #nim
13:10:06FromGitter<alehander42> also "if the nim js backend was a high-quality, fully working environment that supported "most" of nim"
13:10:12FromGitter<alehander42> sorry, but this is also not tecnically a good arg
13:10:20FromGitter<alehander42> i feel you havent really *used* that backend
13:10:31FromGitter<alehander42> most core stuff that isnt supported
13:10:39FromGitter<alehander42> isnt really needed for software targetting it
13:10:48FromGitter<arnetheduck> @alehander42 would you develop a js backend today, knowing that emscripten already works for nim+c and a wasm backend exists?
13:11:37FromGitter<alehander42> i agree : its not perfect, a wasm backend would be great, but honestly i think with a bit of work it can rival typescript on most fronts .. now, i dont say it *needs* to do it, just that its already ~= to it for me
13:12:42FromGitter<alehander42> @arnetheduck sorry, but this comparison seems as a fallacy to me again
13:12:46FromGitter<arnetheduck> and to reiterate, I know that it's blasphemy to suggest removing it today, but think of it from this perspective: starting today, where would you spend resources? look at the technical merits of the different solutions.
13:13:12FromGitter<alehander42> to "maintain" the js backend, we need much less resources than to take the "wasm" backend to actually useful level
13:13:18FromGitter<alehander42> right now
13:14:06FromGitter<alehander42> so the smartest thing for me is to keep it and work a lot on a wasm backend
13:14:28FromGitter<alehander42> in the same time
13:14:41*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:15:24FromGitter<arnetheduck> and fwiw, even if you remove js backend today and focus on something else, all the javascript-using nim code keeps working. you just keep using nim 0.20 and you're fine.
13:16:03FromGitter<alehander42> and if you dont ..
13:16:10FromGitter<alehander42> you can still work on a wasm/llvm backend ..
13:16:22FromGitter<alehander42> you just .. work on it.
13:16:27FromGitter<alehander42> and you're fine : )
13:16:58clyybberAraq: I'll be on vacation for a few days and don't have a 32bit machine handy, so I can't investigate those failures. Also I have no idea where they could come from. Maybe you are better equipped to find out.
13:17:07FromDiscord_<strexicious> Are tuple elements tightly packed in memory?
13:17:14FromGitter<arnetheduck> yup, that's what I'm doing :) I'm not making PR's to remove JS either :)
13:17:44FromDiscord_<strexicious> I need a `seq[(float, float, uint)]` but consecutive in memory.
13:18:32FromGitter<alehander42> @arnetheduck sorry for my sarcastic tone, totally uncalled for
13:19:07FromGitter<alehander42> yeah, i have to try something with it in my free time
13:19:27*shomodj joined #nim
13:19:29FromGitter<arnetheduck> but I also take note of the state of the nim issues tracker and allow myself to think creatively about ways to.. optimize it ;)
13:19:33FromGitter<alehander42> check if i can use it for something in electron :P
13:20:08clyybberstrexicious: Use a packed object
13:20:50narimiran@arnetheduck btw, are you (status) still using nim 0.19? if so: (when) do you plan to switch to 0.20/1.0?
13:22:08Araqclyybber: it would help to split the bugfix and the refactoring
13:22:37Araqso that we can see what causes the test suite regression
13:23:22clyybberAraq: The bugfix is just adding sink to `@`
13:23:45clyybberIn the refactoring I did some other bugfixes, but those were not reported.
13:23:47FromDiscord_<strexicious> Thanks clyybber
13:23:57Araqwhat kind of bugfixes?
13:24:32clyybberSometimes we didn't move into result, even though we could.
13:25:09clyybberIt is visible in the before/after transformation of getEnv
13:26:48clyybberAraq: The 32bit failures only appeared after https://github.com/nim-lang/Nim/pull/11926/commits/938217ff69470b681d2492e1962d440aa2ccad39
13:27:01FromGitter<arnetheduck> @narimiran we're still on 0.19.6, I'm not sure what issues remain at this point but I guess one crucial point is that we've made ourselves less dependent on the exact nim version so upgrading to 0.20 isn't.. critical.
13:27:14shashlick@Clyybber why not use dockcross
13:27:20shashlickSee nightlies
13:27:47FromGitter<arnetheduck> we try to solve as many problems as possible in libraries instead, it's more flexible from a release coordination point of view
13:28:17Araqhttps://ci.appveyor.com/project/dom96/nim/builds/26851519/job/wcxechrgp0fcaodg/tests dom96, I broke jester
13:29:13FromGitter<arnetheduck> another way to look at it: 0.19.6 was too good :)
13:29:15clyybbershashlick: Is it like a VM?
13:35:45*clyybber quit (Quit: WeeChat 2.5)
13:37:34*MarderIII joined #nim
13:44:02*dddddd joined #nim
13:51:56shashlickWhat os are you on
13:54:06FromGitter<iffy> I've built some improvements to db_sqlite into my application that I'd like to contribute back. I'm not seeing any sqlite tests in the Nim repo, though. Should I contribute these changes to the stdlib or as an installable module?
13:54:25livcdsomeone just posted this https://github.com/sunjohanday/xander
13:57:04Araqiffy while you're at it also contribute tests please :-)
13:58:05FromGitter<iffy> Happy to, Araq! But I don't know if it should be to the Nim repo or a nimble package
13:58:55Araqwell it's in the Nim repo
13:59:25FromGitter<iffy> I'm remembering the history of sqlite in Python. We always installed pysqlite because the stdlib didn't have all the features we wanted
13:59:59shashlickAraq - when you use wrapped libs, do you configure / cmake / make or download dlls
14:01:51*terps quit (Ping timeout: 264 seconds)
14:05:05*PMunch quit (Remote host closed the connection)
14:10:07*MarderIII is now known as warkruid
14:10:30*terps joined #nim
14:10:36*warkruid quit (Quit: Leaving)
14:10:57*MarderIII joined #nim
14:11:11*MarderIII is now known as warkruid
14:15:49*deansher quit (Ping timeout: 250 seconds)
14:15:49*dvn quit (Ping timeout: 250 seconds)
14:16:02*deansher joined #nim
14:16:16*euantor quit (Ping timeout: 250 seconds)
14:18:20Araqshashlick: depends, most of the DLLs are from a trusted source
14:18:44*Mister_Magister quit (Ping timeout: 248 seconds)
14:19:43*Cadey quit (Ping timeout: 250 seconds)
14:21:17*drewr quit (Ping timeout: 245 seconds)
14:21:33FromGitter<iffy> Should I be working off of `devel` branch or `master`? I can't get `koch` to build in `devel`
14:21:35*floppydh quit (Quit: WeeChat 2.5)
14:21:55*Cadey joined #nim
14:22:55narimiran@iffy devel
14:23:15narimiranmaster is effectively dead
14:23:52*Mister_Magister joined #nim
14:23:59FromGitter<iffy> k, how do I overcome this: https://github.com/nim-lang/Nim/issues/11454 The workaround leads me to a different error: `lib/system.nim(3990, 10) Error: type mismatch: got <string, nil>`
14:24:03*terps quit (Ping timeout: 264 seconds)
14:24:22narimiraniffy are you using nim 0.20.x?
14:24:51FromGitter<iffy> I have 0.20.x installed via choosenim, but I just cloned the Nim git repo to do some work in there
14:25:20FromGitter<iffy> I don't think I'm using my 0.20.x nim to build it. I'm copying and pasting from the README
14:25:34*euantor joined #nim
14:26:33*endragor joined #nim
14:26:54narimiranafter you cloned the repo, are you on 'devel' branch before doing the stuff mentioned in the readme?
14:27:20FromGitter<iffy> yep
14:27:49FromGitter<iffy> I'm deleting and trying again
14:27:51narimiranalso, maybe there is some clash between choosenim's stuff and this git stuff (i think i had some problem when i was still using choosenim)
14:28:13FromGitter<iffy> I'm suspecting that, too... but I wish I could know for sure
14:28:26*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
14:29:12*dvn joined #nim
14:29:23dom96best way to check would be to remove ~/.nimble/bin from your PATH
14:29:24dom96I don't see any other way that choosenim's installation could interfere
14:30:05FromGitter<iffy> ah, wait a second ... I cloned from my fork the first time. This time I cloned from the real repo
14:30:10FromGitter<iffy> ``````
14:30:12*laaron joined #nim
14:30:13FromGitter<iffy> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d5d55757d3c16364115c7b6]
14:30:16FromGitter<iffy> bah
14:30:27FromGitter<iffy> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d5d5583c8a85a44c23cc71f]
14:30:46FromGitter<iffy> results in
14:30:50FromGitter<iffy> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d5d559ac8a85a44c23cc75a]
14:30:56narimiranwhy are your csources v0.19?
14:31:12FromGitter<iffy> I was trying the workaround in https://github.com/nim-lang/Nim/issues/11454
14:31:25FromGitter<iffy> okay, let me try the README as is and literally copy and paste
14:31:50narimiranthat issue is about bootstrap nim v0.19 from (outdated and abandoned) master.
14:32:34leorize[m]nowadays I install ndb whenever I need sqlite in Nim :p
14:33:10narimiranif you are on linux/mac, you only need to do `sh build_all.sh` (step 2 in the readme) after cloning, no need for any other manual stuff
14:33:44FromGitter<iffy> leorize: oh, those binding changes in ndb are exactly the ones I was going to contribute back!
14:35:03FromGitter<iffy> (but I didn't know about ndb)
14:35:54*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
14:36:58*laaron joined #nim
14:37:03Araqiffy then better use ndb
14:38:40*drewr joined #nim
14:40:03FromGitter<iffy> Should the stdlib db_sqlite somehow point people to ndb? Or should the issues ndb fixes be merged back into stdlib?
14:42:34*terps joined #nim
14:42:56FromGitter<iffy> nm, just found your comment: https://github.com/nim-lang/Nim/issues/9453#issuecomment-435482881
14:43:56*nsf quit (Quit: WeeChat 2.5)
14:53:00Araqstdlib should point to ndb and ndb needs to be in important_packages if it isn't already
14:53:15Araqcourse it isn't...
14:53:19*Araq sighs
14:55:26*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
14:56:04*laaron joined #nim
14:56:14*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:02:42narimiranok ok, i know what i need to do
15:02:51*shomodj joined #nim
15:03:18narimiranbtw, "Latest supported Nim version is 0.19" from ndb's readme
15:03:51*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
15:04:43*drewr quit (Remote host closed the connection)
15:05:10*laaron joined #nim
15:07:27*laaron quit (Remote host closed the connection)
15:09:15*laaron joined #nim
15:11:43*ZORR0W quit (Ping timeout: 250 seconds)
15:15:03*terps quit (Ping timeout: 264 seconds)
15:18:16FromGitter<awr1> RE the JS stuff: asmjs has its problems, but i think its authors would probably admit that considering its javascript trying to encode quasi-bytecode/JIT directives
15:18:20FromGitter<kdheepak> @PMunch and @alehander42 thanks for looking into this and providing some feedback.
15:18:43*laaron quit (Remote host closed the connection)
15:19:12FromGitter<kdheepak> I did make some progress on that though. It turns out the `Future` object returned by a `async` colored function in Javascript is just a `Promise`.
15:19:38disruptekcolored functions. yay!
15:19:40FromGitter<kdheepak> So I was able to `cast` it to a `JsObject` and then use `callbacks to update a global variable.
15:19:47FromGitter<awr1> in some sense nim is "weird" by a similar token because it targets languages that was originally designed for human readability
15:20:23FromGitter<kdheepak> Something like `p.then( callback )`
15:20:53FromGitter<awr1> but i can guess one can respond with "well, stroustrup made cfront, didn't he?"
15:21:03FromGitter<kdheepak> But yeah, figuring that out look a while.
15:21:13*laaron joined #nim
15:21:33FromGitter<kdheepak> Once I did that I was able to "mix colors".
15:21:52FromGitter<kdheepak> Essentially everything get triggered by callbacks.
15:23:08*drewr joined #nim
15:25:21*btop joined #nim
16:03:30*Yardanico joined #nim
16:03:35*Yardanico quit (Client Quit)
16:04:18*Yardanico joined #nim
16:05:55dom96kdheepak: can you document this in our docs or on some article somewhere? :)
16:11:57FromGitter<kdheepak> I'll make a blog post!
16:12:22FromGitter<kdheepak> I already have a couple unfinished drafts of blog posts related to nim that I've been meaning to get out.
16:13:22FromGitter<kdheepak> @dom96 and others, do you think `castT (x)` and `x.to(T)` should do the same thing in the javascript target?
16:13:32FromGitter<kdheepak> where `x` is a JsObject.
16:13:43FromGitter<kdheepak> and `T` in a Nim Type.
16:15:51FromGitter<alehander42> Don't they :o
16:16:15*nif quit (Quit: ...)
16:16:24*nif joined #nim
16:17:04FromGitter<alehander42> If then is standard for Javascript we can add an overload for it in jsffi
16:18:00shashlickis osx like linux in /usr/lib and /usr/include or like windows with putting dlls in same dir or path, or some third way
16:19:55FromGitter<kdheepak> @alehander42 huh I was wrong, they are doing the same thing.
16:20:18*zyklon joined #nim
16:20:37FromGitter<alehander42> Yep iirc
16:21:02FromGitter<alehander42> But good idea, to note they should be the same
16:24:05*uvegbot quit (Ping timeout: 250 seconds)
16:31:33FromGitter<kdheepak> Is there a way to echo a `JsObject`? I get an error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d5d71e5c508da44c35963c6]
16:36:41FromGitter<alehander42> Yes
16:36:54FromGitter<alehander42> Define $ for it
16:37:13FromGitter<alehander42> And make it use e. G. Json stringifyfro
16:37:21FromGitter<alehander42> Stringify
16:37:34FromGitter<alehander42> Other probably better options is to import jsconsole
16:37:39FromGitter<alehander42> And use log
16:40:27FromGitter<vitreo12> Hello guys! Are there any reasons why this code doesn't work? ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5d5d73fb8e8dde63d81262e5]
16:41:09FromGitter<kdheepak> @alehander42 thanks for the answer. My ideal solution would be to use `echo x` and have that translate to `console.table(x)`.
16:41:58FromGitter<kdheepak> @vitreo12 if you edit your chat message here in gitter, people on other messaging platforms will not be able to see the edit.
16:42:22FromGitter<vitreo12> Ah, I'll just re-send it then. Sorry, first time using gitter :)
16:42:41FromGitter<kdheepak> Yup :) I understand, been there.
16:42:41FromGitter<vitreo12> Edited message from before: ⏎ ⏎ Are there any reasons why this code doesn't work? ⏎ (from nim's forum, https://forum.nim-lang.org/t/5111)... [https://gitter.im/nim-lang/Nim?at=5d5d748125764a3642d5b9c7]
16:42:56*endragor quit (Remote host closed the connection)
16:43:23FromGitter<vitreo12> While, at the same time, these two work: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d5d74abc508da44c359772a]
16:44:17*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:46:56FromGitter<kdheepak> @alehander42 is there a way to override the code that `echo` generates when passed a `JsObject`?
16:54:33*wildtrees joined #nim
16:55:24*wildtrees quit (Remote host closed the connection)
16:55:53*wildtrees joined #nim
16:56:57FromGitter<alehander42> You can try to overload echo
16:57:14FromGitter<alehander42> But I think just using directly the function you want is better
16:57:32FromGitter<alehander42> Stuff like echo works well when you can define $
16:57:39FromGitter<alehander42> For a type
16:57:44FromGitter<alehander42> A
16:59:16*go|dfish quit (Ping timeout: 246 seconds)
17:00:58*go|dfish joined #nim
17:01:18*warkruid quit (Ping timeout: 245 seconds)
17:04:47FromGitter<kdheepak> Okay thanks!
17:04:56FromGitter<kdheepak> I'll just use console.table directly.
17:06:17*nsf joined #nim
17:10:14*gangstacat quit (Quit: Ĝis!)
17:12:44*gangstacat joined #nim
17:14:21FromGitter<kdheepak> @alehander42 I'm looking for a less tedious way to create a JsObject on the fly. Any suggestions? Currently, if I want the Javascript code to be `{ color: 0xff0000 }` I need to create a Nim type called Color that has an attribute int, etc. Then let's say I want to in another part of the code to generate Javascript code to be ` { color: 0xff00ff, angle: 30 } `, I need to create another Nim type called ColorAndAngle that
17:14:21FromGitter... has attributes int and float, create an instance of it, etc.
17:15:27FromGitter<kdheepak> This is painful because the API that I'm working with always all these different objects to be passed in, and has sane defaults for keys that don't exist, that I don't want to reimplement in Nim.
17:17:15*warkruid joined #nim
17:21:26*warkruid quit (Client Quit)
17:22:48FromGitter<kdheepak> Even tuple's don't work.
17:23:03*seni joined #nim
17:23:33FromGitter<kdheepak> ``` var temp: tuple[color: int] = (1, ) ⏎ console.log(temp)``` ⏎ ⏎ results in `Object { Field0: 1 }` [https://gitter.im/nim-lang/Nim?at=5d5d7e15c508da44c359b734]
17:27:47FromGitter<kdheepak> Maybe the solution is to write some macro / proc around this? ⏎ ⏎ ``` var temp = newJsObject() ⏎ temp["color"] = 0xffff00``` [https://gitter.im/nim-lang/Nim?at=5d5d7f1325764a3642d60565]
17:28:24*shomodj joined #nim
17:35:01*seni quit (Quit: Leaving)
17:42:30shashlickmacros 101 - how do I get the value in a variable passed to a macro - strVal gives me the variable's name instead of the value it contains
17:43:51*LargeEpsilon quit (Ping timeout: 252 seconds)
17:44:14*joki1337 joined #nim
17:44:34*joki1337 quit (Client Quit)
17:45:44FromGitter<zacharycarter> can only do this if the value is known at compile time
17:50:13enthus1astis there a proc that correctly escapes a file system path?
17:50:40shashlickquoteShell perhaps?
17:50:42enthus1astquoteShell() seems not to work properly
17:53:27enthus1astNORMAL: test/Peter, Test Q. - Some Name - foo.ext
17:53:34enthus1astQUOTED: 'test/Peter, Test Q. - Some Name - foo.ext'
17:53:50enthus1astmaybe i should just quote the filename withouth the path
17:55:31*terps joined #nim
18:00:02*btop quit (Ping timeout: 245 seconds)
18:02:41enthus1astbut are you aware of a function that do a "real" shell escape like "foo\ baa\ baz" ?
18:04:33*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:04:49FromGitter<kdheepak> I'm trying to write a very simple macro and am getting compile errors: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d5d87c1d45f7c26fa0d71b0]
18:05:04FromGitter<kdheepak> Can someone direct me in what I'm missing?
18:07:39*terps quit (Ping timeout: 250 seconds)
18:12:22FromGitter<Araq> the macro is ok, but now how you use it
18:13:02FromGitter<awr1> works fine
18:13:04FromGitter<awr1> https://play.nim-lang.org/#ix=1SXR
18:13:07FromGitter<awr1> what version of nim?
18:13:59Araqbtw for easy JS object construction, use the jsffi module
18:16:09FromGitter<kdheepak> @araq which function from the jsffi module? I've even looked through the source and haven't found one that simplifies this process.
18:16:28FromGitter<kdheepak> I was using the macro like so: ` discard myMacro {color: 0xffff00}`
18:17:10FromGitter<kdheepak> Ah discard was the problem.
18:18:53Araq let obj = JsAssoc[cstring, int]{ a: 22, b: 55 }
18:18:56enthus1astAraq: was there a change recently, that when compiled with "nim c -r foo.nim" the modules are not compiled when they're not changed? Because since my last nim update, i must compile with "nim c -r -f foo.nim" when import a template (onionhammer/nim-template)
18:19:26Araqenthus1ast: only if you messed up your config
18:20:00Araqthis feature was recently introduced yes, but it should be disabled
18:20:31enthus1astnim.cfg ?
18:20:50Araqyeah
18:21:03Araq--incremental:on/off or maybe --symbolfiles
18:22:31*sagax joined #nim
18:22:45enthus1astneither is in my config
18:25:22FromGitter<kdheepak> @Araq thanks for the reply. What if I want `obj = { a: 22, b: 5.0, c: "hello world" }`? i.e. different types.
18:25:37FromGitter<kdheepak> My understanding is that there's no way to instantiate that with JsAssoc
18:25:41FromGitter<kdheepak> right?
18:27:56*actuallybatman joined #nim
18:28:39Araqdifferent types?
18:29:24enthus1astAraq: none of the switches fixes this issue
18:30:16FromGitter<kdheepak> > *<Araq>* different types? ⏎ ⏎ Yeah, if the values are int, float and string
18:36:50*terps joined #nim
18:36:58Araq type TestObject = object
18:36:58Araq a: int
18:36:58Araq b: cstring
18:37:00Araq let obj = TestObject{ a: 1, b: „str“ }
18:37:51Araqenthus1ast: must be something else then. maybe it's just in your head and it works like before
18:38:01Araqand you're editing the wrong files :P
18:38:51enthus1astthis could of course be, but it started after i pulled recently
18:39:43enthus1astmaybe i should compare my config with the current one in the main repo
18:45:53FromGitter<kdheepak> @Araq that example you said didn't work. I'm getting an error from jsffi.nim ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d5d91612cdb146ad613e96a]
18:46:54Araqwell I took it from the 'tjsffi.nim' test which is green
18:50:23*spip37 joined #nim
18:51:06FromGitter<kdheepak> Thanks for that. That example pointed me in the right direction.
18:51:53FromGitter<kdheepak> I copied over the macro from jsffi that overloads `{}` and made some edits: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d5d92c9fa99e74f6a6a3d99]
18:52:00FromGitter<kdheepak> This does what I want I think.
18:52:08FromGitter<kdheepak> Now to test it in my codebase.
19:05:57FromGitter<alehander42> You don't need this, you can just use JsObject{a:2}
19:06:47FromGitter<alehander42> I think
19:16:55*terps quit (Ping timeout: 276 seconds)
19:26:28*PrimHelios_ quit (Ping timeout: 264 seconds)
19:45:01*nsf quit (Quit: WeeChat 2.5)
19:46:39*btop joined #nim
19:47:12*PrimHelios joined #nim
19:55:09FromDiscord_<Shield> does the compiler give any warnings if you don't define move and sink procs or does it do it automatically?
19:56:20FromGitter<kdheepak> @alehander42 That works!!
19:56:33FromGitter<kdheepak> How do you emit the `this` keyword?
19:56:48FromGitter<kdheepak> I have a function that requires the `this` to be passed in as an argument?
19:56:58FromGitter<kdheepak> I don't think I can use `bindMethod` for this.
20:07:18*Vladar quit (Remote host closed the connection)
20:08:04*actuallybatman quit (Ping timeout: 248 seconds)
20:08:25*actuallybatman joined #nim
20:22:33*btop quit (Ping timeout: 268 seconds)
20:54:06*abm joined #nim
20:54:07*narimiran quit (Ping timeout: 246 seconds)
20:55:45*btop joined #nim
20:58:18*shomodj joined #nim
21:06:01*actuallybatman quit (Ping timeout: 246 seconds)
21:12:55*actuallybatman joined #nim
21:13:54*spip37 quit (Remote host closed the connection)
21:18:25*actuallybatman quit (Ping timeout: 244 seconds)
21:30:32*actuallybatman joined #nim
21:40:50FromDiscord_<Kiloneie> I have a question, i am planning on making my own website via WordPress to host my Written Tutorials to accompany my Video ones(once they come out), is it dumb to use my channel name "www.kiloneie.com" or should i, CAN i use "www.NimForBeginners.com" / "www.LearnNim.com" something like that ?
21:41:36FromDiscord_<Kiloneie> Which included getting WordPress Premium for extra stuff, and ads bla bla.
21:55:34FromDiscord_<Kiloneie> Actually i am gonna use Wix, lol WordPress is expensive for what it offers.
21:56:18*solitudesf quit (Ping timeout: 272 seconds)
22:06:34*actuallybatman quit (Ping timeout: 276 seconds)
22:15:20dom96Looks like compile-times could be what will break Rust's adoption: https://raphlinus.github.io/rust/2019/08/21/rust-bloat.html
22:17:39*actuallybatman joined #nim
22:25:52*krux02 quit (Remote host closed the connection)
22:41:04*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:50:52*btop quit (Ping timeout: 245 seconds)
23:08:23FromGitter<Varriount> kiloneie: I'd use www.kiloneie.com - that way you can use it for personal/professional stuff as well.
23:18:58*rayman22201 joined #nim
23:19:01*actuallybatman quit (Ping timeout: 246 seconds)
23:19:07FromDiscord_<Shield> @zacharycarter
23:33:46*btop joined #nim
23:38:52*btop quit (Ping timeout: 276 seconds)
23:46:39*wildtrees quit (Quit: Leaving)