<< 20-06-2018 >>

00:08:40*kinkinkijkin joined #nim
00:14:07*kinkinkijkin quit (Quit: Leaving)
00:27:11*kinkinkijkin joined #nim
00:29:50*dddddd quit (Remote host closed the connection)
00:39:03*kinkinkijkin quit (Remote host closed the connection)
01:10:11*endragor joined #nim
01:15:11*endragor quit (Ping timeout: 260 seconds)
01:33:40FromDiscord<2vg> Varriount: Well, I can not find detailed documentation.
01:33:40FromDiscord<2vg> https://rawgit.com/kedean/nest/master/docs/nest.html
01:55:11*jxy quit (Ping timeout: 268 seconds)
01:55:26*jxy joined #nim
02:05:55FromGitter<kevinelong_twitter> is jester not useful for your application as a router or do you mean something more specific?
02:23:58*m-jy joined #nim
03:05:42*Jesin joined #nim
03:11:13FromDiscord<2vg> Although routing of jester is easy to use, it is not so in terms of performance aspect.
03:11:13FromDiscord<2vg> The most efficient routing would be radix tree base.
03:11:13FromDiscord<2vg> nest is based on critbit and can do efficient routing.
03:34:21*endragor joined #nim
03:43:31*NimBot joined #nim
03:48:28*odc quit (Ping timeout: 256 seconds)
03:49:36*euantor quit (Ping timeout: 256 seconds)
03:50:10*r4vi quit (Ping timeout: 256 seconds)
03:50:29*zielmicha_ quit (Ping timeout: 256 seconds)
03:50:29*mgdelacroix quit (Ping timeout: 276 seconds)
03:50:29*msmorgan quit (Ping timeout: 276 seconds)
03:50:44*xkapastel quit (Ping timeout: 256 seconds)
03:50:44*LyndsySimon quit (Ping timeout: 256 seconds)
03:51:47*dashed quit (Ping timeout: 276 seconds)
03:51:53*enigmeta quit (Ping timeout: 276 seconds)
03:52:11*surma quit (Ping timeout: 256 seconds)
03:52:26*geocar quit (Ping timeout: 276 seconds)
04:43:27*nc-x joined #nim
04:50:08*rayman22201 joined #nim
04:50:14*nc-x quit (Ping timeout: 260 seconds)
04:56:51*Vladar joined #nim
05:06:21*miran joined #nim
05:11:29*nc-x joined #nim
05:14:26nc-xIs this a bug or is it expected https://pastebin.com/SjmUmWYc (*= is being treated as a single token by the compiler here)
05:15:11xomachine[m]Araq: It did not in v0.18.0. Is it possible to avoid the extension addition?
05:15:12xomachine[m]fedkanaut: Not sure that it is exactly that you are looking for, but I can suggest to take a look at [metaevents](https://xomachine.gitlab.io/metaevents/). This library allow you pass anything you want as an event, but needs preliminaly declaration.
05:17:02*nsf joined #nim
05:18:49*nc-x quit (Ping timeout: 260 seconds)
05:22:13*nc-x joined #nim
05:22:37*surma joined #nim
05:23:18*xkapastel joined #nim
05:25:59*dashed joined #nim
05:27:37*enigmeta joined #nim
05:29:46*geocar joined #nim
05:31:18*odc joined #nim
05:32:07*msmorgan joined #nim
05:37:02*r4vi joined #nim
05:37:15*zielmicha_ joined #nim
05:37:43*LyndsySimon joined #nim
05:40:04*xkapastel quit ()
05:47:24*nc-x quit (Ping timeout: 260 seconds)
05:48:14*msmorgan quit (Ping timeout: 276 seconds)
05:50:26*msmorgan joined #nim
05:51:51*mgdelacroix joined #nim
05:55:21*msmorgan quit (Ping timeout: 240 seconds)
05:56:05*mgdelacroix quit (Ping timeout: 245 seconds)
05:56:51*geocar quit (Ping timeout: 256 seconds)
05:56:51*dashed quit (Ping timeout: 256 seconds)
05:56:51*surma quit (Ping timeout: 256 seconds)
05:56:58*LyndsySimon quit (Ping timeout: 256 seconds)
05:57:59*r4vi quit (Ping timeout: 276 seconds)
05:58:23*odc quit (Ping timeout: 265 seconds)
05:58:32*enigmeta quit (Ping timeout: 276 seconds)
05:58:52*zielmicha_ quit (Ping timeout: 265 seconds)
05:59:06*shortCircuit__ joined #nim
05:59:16shortCircuit__awal:
05:59:18shortCircuit__hi
06:01:54shortCircuit__and hello admins. I am in a bit of a mess, some time ago I shared a file on this channel, and it had some sensitive stuff related to my company. not that sensitive though. https://irclogs.nim-lang.org/11-01-2018.html https://w.awalgarg.me/d/hURa73C_4 and https://w.awalgarg.me/d/8jNEov4tz .. but any way policy is policy. I have taken down the links. but it would be great if the admin could remove these
06:02:03shortCircuit__these got indexed by google
06:02:32shortCircuit__and they know my pseudoname Alex Day.
06:02:39shortCircuit__so please please
06:03:38Araqremove from what? IRC logs? forum?
06:04:31*nc-x joined #nim
06:04:38nc-xAraq: https://irclogs.nim-lang.org/20-06-2018.html#05:14:26
06:04:40Araqsorry, yeah, obviously it's iRC logs
06:05:49shortCircuit__is it possible to remove?
06:06:11Araqhuh? that snippet contains 6 lines of pure Nim syntax
06:06:31shortCircuit__wait
06:06:53shortCircuit__https://irclogs.nim-lang.org/11-01-2018.html#09:17:34
06:08:19shortCircuit__https://irclogs.nim-lang.org/28-11-2017.html#06:58:36
06:08:41shortCircuit__those two
06:09:53Araqthese links all don't work for me
06:10:00*mgdelacroix joined #nim
06:10:03Araq"This file is protected against unauthenticated access by its owner"
06:10:17Araqwe can delete you from the logs if you wish
06:10:57Araqbut I don't understand why that would be necessary. :-)
06:11:41shortCircuit__I am not sur as well. but I don't want to take any risks
06:11:59shortCircuit__s/sur/sure
06:12:24*miran quit (Ping timeout: 256 seconds)
06:14:04Araqok, will see if we can remove you from the logs
06:14:19shortCircuit__ok. thank you so much
06:15:04shortCircuit__I need a new alias now. :( . I get amazed by my ability to mess things up. everytime.
06:20:40*enigmeta joined #nim
06:21:09*geocar joined #nim
06:21:44*r4vi joined #nim
06:22:01*LyndsySimon joined #nim
06:22:09*euantor joined #nim
06:22:12*dashed joined #nim
06:22:59*nc-x quit (Ping timeout: 260 seconds)
06:23:19*zielmicha_ joined #nim
06:24:56*msmorgan joined #nim
06:26:46*surma joined #nim
06:27:24*odc joined #nim
07:28:06FromGitter<Varriount> Araq: What do you think of https://github.com/nim-lang/Nim/pull/8075 ?
07:28:19*dddddd joined #nim
07:31:08*cspar joined #nim
07:39:24*PMunch joined #nim
08:01:37*yglukhov[i] joined #nim
08:08:19FromGitter<kayabaNerve> Araq: what about beer I transpiled to tea?
08:08:37FromGitter<kayabaNerve> Just like the Nim transpiler /s
08:09:33FromGitter<kayabaNerve> Actual question, what's the difference? To me, it looks like Nim is both.
08:10:32Araqwhat would that be? beer taste with tea's side effects? what a terrible combination :P
08:11:06FromGitter<kayabaNerve> Tea with enough alcohol where you might as well do shots
08:11:06AraqI promised to not talk about the T word anymore
08:11:37shortCircuit__if you don't mind me asking how long it will take to dissapear from the logs _/\_ Araq
08:12:04FromGitter<ChristianWitts> not really a bad thing. Stellenbrau makes a beer called Governor’s Red Lager which is a rooibos infused lager, and it’s really good
08:12:26FromGitter<ChristianWitts> and rooibos tea is <3
08:12:29*floppydh joined #nim
08:12:38FromGitter<kayabaNerve> dom96: Araq won't give me answers :( Would you mind explaining?
08:13:01AraqshortCircuit__, when dom96 wakes up... :-)
08:13:11shortCircuit__okies
08:13:54FromGitter<kayabaNerve> Why isn't he awake?
08:13:58AraqchristainWitts yeah, true, probably it works out
08:14:04FromGitter<kayabaNerve> Also, Araq, you're German, right?
08:14:18Araqye
08:14:21shortCircuit__I have disowned the name on irc :P got a new email. changed in important places. I am in so many slack accounts.
08:15:45FromGitter<kayabaNerve> You have a great country . I'm leaving that though
08:16:32PMunchI'm considering to write a piece on transpile vs. compile
08:16:43FromGitter<kayabaNerve> Slack is annoying where you need a per team login. I wish you had a master login with optional slave logins
08:16:52PMunchLook at the etymology for both terms, and try to create a good solid definition
08:17:07PMunchAnd of course show that Nim is compiled
08:17:09FromGitter<kayabaNerve> You'd only need to sign into one account but could keep your work and other stuff apart
08:17:17FromGitter<narimiran> shortCircuit: either you royally screwed up, or you're being very paranoid :D either way - not good! :D
08:22:23AraqPMunch, it's fine though. Call Nim a "transpiler" until many people use the LLVM backend. After all, why distinguish the language from its implementation. :P
08:24:57livcdI guess it's because people compare Nim to CoffeeScript. hence the discussions about compiler vs transpiler
08:25:19FromGitter<kayabaNerve> Araq admits Nim isn't compiled and therefore not a real language. This and more out-of-context bullshit at 11
08:25:30FromGitter<kayabaNerve> Who does that?
08:27:01Araqlol
08:27:12livcdpeople on the internet )
08:33:13FromGitter<kayabaNerve> Link? I want something be too
08:33:28FromGitter<kayabaNerve> *new to rant over. Yesterday was net neutrality...
08:33:44FromGitter<kayabaNerve> Fun fact! If all American's switch
08:34:08FromGitter<kayabaNerve> *switched providers if they could, or stopped getting service if they only had one, unemployment would double.
08:36:17*Arrrr joined #nim
08:44:10PMunchHuh, why is that?
08:46:28FromGitter<kayabaNerve> Because they work online and would lose their jobs
08:46:45FromGitter<kayabaNerve> Does nim have a whitepaper?
08:47:22FromGitter<kayabaNerve> 25% work online. ~20% only have one option.
08:54:03FromGitter<diegogub> Hi guys, Is there a way to vendor pkg into project?
08:54:28FromGitter<diegogub> building docker images is easier this way..as I don't need to download dependencies..
09:07:38PMunchkayabaNerve, ah that makes sense
09:21:53*brainpro1 quit (Quit: WeeChat 2.1)
09:21:55Arrrrclone every project into a pkg subfolder
09:22:13ArrrrI think it is not possible to choose nimble location
09:25:56FromGitter<kayabaNerve> @diegogub make sure to verify the licenses
09:26:03FromGitter<kayabaNerve> GPL may not like that
09:26:31FromGitter<kayabaNerve> Arrrr: you can just put them in the root and not use them as packages but rather source files
09:27:04FromGitter<kayabaNerve> This is nimble package, right? PKG, last I checked, was a Nodejs -> native executable tool. It's very nice.
09:27:39FromGitter<kayabaNerve> Oh. That's what you were suggesting. Sorry. Nvm.
09:28:07federico3diegogub: you don't need to vendor stuff in your project. If you want to ship a local Nimble cache with your image just run Nimble build
09:33:48FromGitter<kayabaNerve> Just using docker properly is best as frederico3 says
09:40:06dom96diegogub: you can specify a local --nimbleDir
09:40:19dom96nimble install --nimbleDir:./nimbleDir myPkg
09:40:28dom96It should install all packages into ./nimbleDir/pkgs
09:40:46livcdhmm i almost never use docker images with Go apps
09:40:55FromGitter<kayabaNerve> Morning dom96
09:40:58livcdthought people would not do with Nim as well
09:41:03FromGitter<diegogub> @dom96 thanks! I will try that
09:41:09FromGitter<kayabaNerve> Why isn't Nim's compiler a transpiler? It seems like... Both to me
09:41:40FromGitter<kayabaNerve> Or either
09:41:48FromGitter<kayabaNerve> Ara-q said ask you
09:41:58FromGitter<kayabaNerve> Because he'll no longer answer it :p
09:42:04dom96Nim->C == Compiler
09:42:08dom96Nim->JS == Transpiler
09:42:16dom96So yes, you're right
09:42:23dom96at least according to the Wikipedia definition
09:42:26dom96But it's a silly word anyway
09:42:29dom96I agree with Araq
09:43:19*xet7 joined #nim
09:43:23dom96Damn, the forum is getting pretty busy
09:46:33FromGitter<kayabaNerve> I didn't know forums met women...
09:46:57FromGitter<kayabaNerve> dom96 what's the difference between c and js
09:48:09FromGitter<Vindaar> @narimiran @mratsim and others using Nim for science: wait no longer, we can finally do non-linear least square fitting in Nim: https://github.com/Vindaar/nim-mpfit :D
09:48:21FromGitter<mratsim> "beer taste with tea's side effects” lol
09:48:29FromGitter<mratsim> @Vindaar, yeeaaahhh =)
09:48:53FromGitter<mratsim> “parseHalfLifeData” I thought I was reading wrong
09:49:32cmk_zzzI'm trying to get nim to compile a static executable using musl but I am failing on openssl. I've followed the instructions on the "module openssl" page. It builds a static executable but when I run it I get "could not load: libcrypto.so". Which I find odd as I am trying to statically link with libcrypto.a
09:49:41FromGitter<Lite5h4dow> How do I set up the Run command for Nim?
09:49:49cmk_zzzThere must be something fundamental I am not understanding
09:49:56FromGitter<Lite5h4dow> I have set the path just don't know what this rub command is
09:50:24FromGitter<mratsim> it’s been a while since I did physics, but I did love the part about exponential decay, when I was younger I wanted to be astrophysician :P
09:51:04FromGitter<mratsim> then actually went for a mechanical engineering degree. But I spent more times tinkering on Linux than tinkering with physical stuff :P
09:51:16FromGitter<Vindaar> Astrophysicist I hope :D yeah, that's what got me into physics, too :)
09:51:28FromGitter<Vindaar> Well, honestly nowadays I hardly do any physics either..
09:51:34FromGitter<mratsim> “rub command” xD
09:51:40FromGitter<Lite5h4dow> XD
09:51:59cmk_zzzI should say I use nim v0.18.0 and OpenSSL 1.1.0h
09:53:47PMunchdom96, it depends on your definition of abstraction level. I'd say that since Nim has a lot of compile-time stuff like macros and templates it works on a higher abstraction level than JS
09:53:52FromGitter<mratsim> @cmk_zzz: passl:”/pathtolibcrypto.a” and dynlibOverride maybe?
09:54:14PMunchA DSL is more abstract than regular code
09:54:16FromGitter<narimiran> @Vindaar great job!!
09:55:33FromGitter<Lite5h4dow> This is for atom
09:55:54dom96cmk_zzz: You need to use --dynlibOverride https://nim-lang.org/docs/nimc.html#dynliboverride
09:56:10PMunch> Damn, the forum is getting pretty busy
09:56:16PMunchProbably because of your nice redesign :)
09:56:19Araqcmk_zzz, I wrapped BearSSL and then kinda stopped working on it
09:56:39Araqbut if the stdlib could use that, that would be so awesome and solve your problem too
09:57:31dom96PMunch: :D
09:59:16cmk_zzzdom96: yes, that is what I have. I.e nim c -d:ssl --dynlibOverride:ssl --passL:-L/opt/musl-openssl/ --passL:-lcrypto --passL:-lssl
10:00:06cmk_zzzand --passL:-static
10:02:10Araqyay
10:02:53Araqguess what, 'koch' is ahead of its time and 'koch boot cpp' already exists
10:03:11Araqand even better, bootstrapping with the C++ backend just works (TM)
10:06:31cmk_zzzanyway I'll play around with it a bit tomorrow when I am awake. Too tired to see what is going on. Thanks
10:14:20*noonien joined #nim
10:16:15FromGitter<kayabaNerve> Araq: C++ has been rude to me :(
10:17:45Araqit doesn't matter, Nim writes the C++ code for you.
10:19:19FromGitter<mratsim> We ripped all C++ dependencies from Nimbus and lived happily ever after ;)
10:19:56Araqwhy is that?
10:22:59FromGitter<mratsim> we couldn’t put types with non trivial destructors in a seq
10:23:11FromGitter<mratsim> casting worked except with Clang
10:23:19FromGitter<mratsim> (non trivial destructors again)
10:23:37FromGitter<mratsim> issues when compiling with VCC
10:24:15FromGitter<mratsim> https://github.com/status-im/nim-ttmath/issues/10
10:24:21FromGitter<mratsim> https://github.com/status-im/nim-ttmath/issues/14
10:24:32FromGitter<mratsim> oh, stack corruption with GCC on windows
10:24:47FromGitter<mratsim> and string conversion that was broken
10:26:22AraqI'm testing it with GCC on Windows without problems so far
10:27:20FromGitter<mratsim> we removed a lot of stuff to make it compile again
10:27:57FromGitter<mratsim> but I focused on its replacement because we didn’t want to meet yet another edge case
10:31:53Araqah my testing is bonkers, 'koch boot cpp' doesn't do what I think it does
10:33:52dom96Araq: What's next? `koch boot objc`? :P
10:37:24Araqhttps://github.com/nim-lang/Nim/issues/7870
10:37:37Araqhttps://github.com/nim-lang/Nim/milestone/2
10:37:49Araqit has never been more transparent of "what's next".
10:38:14dom96I was making a joke. Guess it wasn't funny :(
10:38:18Araqthe chaotic side-projects (nimpretty) are all a result of my holidays
10:38:32dom9620 issues to go, not too much :P
10:38:36AraqI'm allowed to have fun in my holidays :P
10:38:39dom96I guess I should add some things to this milestone ;)
10:39:07*donlzx joined #nim
10:39:15Araqplease don't before these have been resolved. unless you are working on it
10:39:40dom96What's the use in waiting for the milestone to be finished before adding more issues to it?
10:39:48dom96That's just not transparent at all
10:39:53dom96I'll PM you the issues I want to add
10:39:56dom96and we can discuss them
10:40:11Araqok fine
10:45:12FromGitter<mratsim> this has milestone 0.9.6 btw: https://github.com/nim-lang/Nim/issues/1500
10:45:38dom96hehe
10:45:47dom96Good old 0.9.6
10:46:51*donlzx quit (Quit: Leaving)
10:54:20*xet7 quit (Remote host closed the connection)
11:01:41livcdnow is the right time to ask..when is the 1.0 versiong going to be released ?:D
11:06:28*NimBot joined #nim
11:10:23FromGitter<mratsim> When Bethesda releases Elder Scroll 6
11:10:48*elrood joined #nim
11:13:22federico3when it's ready
11:18:40dom962 years before Half Life 3 is released
11:19:08PMunchHaha
11:19:42PMunchmratsim, you joke but ES6 has now actually been announced
11:20:16PMunchHmm, why is the sign function in math called sgn.. Are we really that lazy
11:20:29FromGitter<mratsim> Fortran? :P
11:20:59FromGitter<mratsim> I think it’s standard in C
11:21:31FromGitter<mratsim> you can’t say that we’re lazy, otherwise we would not use keywords for “and”, “not”, “xor"
11:22:01elroodeasier to type on qwertz
11:23:49PMunchPEBUAC - Problem Exists Between User And Computer
11:24:01PMunchHow is "sign" hard to type on QWERTZ?
11:26:49elroodit's not. was referring to and not and xor being a sgn of laziness for us non-us-kbd-layouters
11:27:47elroodaltgr-< and shift-6 wore out too many wrists already
11:29:46elroodalso the whole point of nim is pebuac
11:35:20*arecaceae quit (Remote host closed the connection)
11:35:44*arecaceae joined #nim
11:44:55FromGitter<bevo009> Noob question of the day.....why do the first 2 examples compile, with incompatible types? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b2a3e37ce3b0f268d2c8c80]
11:45:53PMunchelrood, aah gotcha
11:46:15PMunchYeah you really notice that programmers weren't using the Norwegian layout..
11:47:07PMunchI tried at some point to do the AZERTY thing and have numbers as the second choice for those keys
11:47:16PMunchKeeping brackets and stuff more easily available
11:47:22PMunchBut it was just super annoying
11:47:47FromGitter<mratsim> @bevo009, int literals like 2 are coerced into whatever the first numerical arg is if needed
11:47:59FromGitter<mratsim> but for variables, it is not done because static check
11:48:18FromGitter<mratsim> if you want the scond to compile use 2.float or import lenient_ops (if on devel)
11:49:22FromGitter<tim-st> @bevo009 a very strict compiler wouldnt allow the first, too, it's only to support developer; if you want it more strict you can declare explicit: `b: float = 2.0` or `b: float64 = 2.0`
11:49:24awalshortCircuit__: Lol you just added more to the irc logs by pasting those links here again :P
11:49:46PMunchawal, the links are dead though
11:50:00awalPMunch: yeah but google has caches
11:50:16awalI wonder if I can get them removed, I control the hosting domain
11:50:48PMunchProbably
11:51:04PMunchGoogle has become pretty nice about this after "rights to be forgotten" was passed in the EU
11:51:34awalI see. I'll look into it if shortCircuit__ desires.
11:52:12FromGitter<tim-st> PMunch: the problem is that these requests to google appear at lumendatabase, who deletes this^^
11:52:27awallol
11:52:37shortCircuit__awal: I did. dyaum
11:53:10awalInternet 101 folks: if it is here once, it is here forever.
11:53:58awalshortCircuit__: Don't worry I have been similarly foolish in the past
11:54:14dom96awal: You control the domain? Really?
11:54:28awaldom96: The links, yes
11:54:34awalNot the irc logs :P
11:56:25awalshortCircuit__: Tell your company that everything is leaked and now they must rewrite everything from scratch immediately
11:58:30dom96awal: In that case probably better if you expire the link
11:58:52dom96Means I don't have to do anything (:P) and will break Google Cache too
11:59:30awaldom96: Oh I already disabled them. Didn't break google cache (yet).
12:00:03dom96great
12:01:06awaldom96: Is the logs website custom (in nim?)?
12:01:09shortCircuit__I don't even undesrtand why was there was fuss about the snippet .
12:01:17dom96awal: of course :)
12:01:25awaldom96: Nice, open-source?
12:01:47FromGitter<mratsim> “they must rewrite everything in Nim"
12:02:04dom96yep https://github.com/nim-lang/nimbot
12:02:41awalThanks!
12:14:43FromGitter<bevo009> @mratsim I think I worked out the rule ⏎ It only doesn't compile when b (an int) is involved in this example, so... ⏎ ⏎ 1) Variable Integer Operands combined with a float operand (which can be a variable or primitive, first or second in the operation) won't compile ⏎ 2) Primitive Integer Operands are ok to mix with floats, variable or primitive ... [https://gitter.im/nim-lang/Nim?at=5b2a453314805602859179d0]
12:15:38FromGitter<mratsim> primitive integer operand are called int literals by the way ;) but yes you understood perfectly.
12:15:59FromGitter<bevo009> yeah I thought I had the terminology wrong
12:16:09FromGitter<mratsim> mmm I’m surprised echo 2 + 2.5 compiles though
12:17:14FromGitter<tim-st> because 2 is parsed as float:
12:18:02FromGitter<mratsim> yes here, but in echo 2 + 2.5, it’s parsed a int first and then the compiler sees a float so it should raise, I’m pretty sure I saw a post on that somewhere
12:18:20FromGitter<bevo009> why didn't my code display properly there? I put in 3 backticks
12:18:28FromGitter<mratsim> in echo 2.5 + 2, compiler first see a float, then an int literal so converts it to float
12:20:00FromGitter<tim-st> ok, didnt know that
12:20:51FromGitter<mratsim> i may be wrong, but I’m pretty sure type resolution, converters and int literals coercion is done from left to right
12:22:18elroodwhy would you think that should matter with an operation that is commutative?
12:22:56FromGitter<mratsim> the static type checking and commutativity are different concerns
12:23:21elrooduh..
12:25:11elroodif type checking, implicit conversion etc. matter on the order of your operands your type system is doing something fundamentally wrong
12:26:18FromGitter<mratsim> proc foo(a: int, b: float) should not match a: float, b: int.
12:27:05elrooddepends on what foo does. if it's a commutative operation like addition it should
12:27:29FromGitter<mratsim> there is no {.tag: commutative.} in Nim though you can probably add a macro
12:29:12elroodi wasn't saying it should be equivalent while parsing
12:41:31*Sembei joined #nim
12:43:34*Pisuke quit (Ping timeout: 264 seconds)
12:47:19FromGitter<narimiran> hey @bevo009, regarding the issue you just posted.... i know about these situations, but i feel this would only unnecessary complicate things, and i like to keep it simple....
12:48:00FromGitter<narimiran> as you read the tutorial, you might find in some other places that i simplified some things or i didn't mention some edge cases, etc.
12:49:42FromGitter<kaushalmodi> @bevo009 @mratsim So is this simplification correct: Regardless of the position of an int literal, it can be raised to a float if needed.
12:51:19FromGitter<mratsim> not only float, any integer type, but i’m not sure about the any position. It’s not that important anyway, you can always add explicit type 1’f64 where needed if the compiler complains
12:52:31FromGitter<bevo009> @nariman no worries it's your book. I just like to know precise rules. I'm still more a beginner, not intermediate
12:53:07FromGitter<narimiran> @bevo009 but please don
12:53:46FromGitter<kaushalmodi> @narimiran Of course, I am getting involved in this discussion just to understand this.. not to suggest adding this to the tutorial.
12:53:53*Arrrr quit (Quit: Arrrr)
12:53:53PMunchnarimiran, people seem to really enjoy your tutorial :)
12:54:10FromGitter<bevo009> @kaushalmodi I think this is the rule:
12:54:29*gangstacat quit (Ping timeout: 256 seconds)
12:55:49FromGitter<narimiran> PMunch: seems so :) i guess this was indeed something that was missing from nim documentation, and there are people with limited previous experience who are starting with nim
12:56:32FromGitter<kaushalmodi> OK this helps put things in place: https://github.com/narimiran/nim-basics/issues/3.. I was wondering what this discussion had to do with Nim Basics :)
12:56:52FromGitter<kaushalmodi> .. and sorry once again for that , vs & confusion in concatenation
12:57:42FromGitter<bevo009> I think it was an auto-correct error, trough for through...haven't seen any others
12:58:12FromGitter<bevo009> I'm glad I decided to read it though, I learnt more than I thought
12:58:27FromGitter<narimiran> i'm glad to hear that :)
12:58:45FromGitter<kayabaNerve> Int literals are scarring
12:59:20FromGitter<kayabaNerve> Araq: please just let me add any ibt
12:59:25FromGitter<kayabaNerve> *int together
12:59:33FromGitter<mratsim> uh no
12:59:41FromGitter<mratsim> use a dynamic language for that
13:00:06FromGitter<bevo009> I do like that about javascript
13:00:16FromGitter<kayabaNerve> I don't need that
13:00:26FromGitter<mratsim> you can use converter or lenient_ops if you want that in Nim
13:00:36FromGitter<kayabaNerve> I want if I'm seeing typex var = type + typex
13:00:48FromGitter<kayabaNerve> For them to become typex and to get typex
13:01:17FromGitter<mratsim> Potentially lossy conversion should be opt-in not default.
13:01:23FromGitter<Vindaar> my opinion: I hate implicit type conversions. They screw you over without you realizing it. Also things like people writing `if(<someNumber>){}` in C ugh... I love that Nim is pretty strict about types (and I wouldn't mind if it was even stricter)
13:01:37FromGitter<mratsim> ^
13:01:47AraqVindaar: +1 :-)
13:01:51FromGitter<kayabaNerve> (2*2)*2ull should be 2ull * 2ull * 2ull
13:02:03FromGitter<narimiran> i, for one, like python's `if len(xs)` :)
13:02:25Araqwhich is not idiomatic, idiomatic Python would be 'if xs'
13:02:30FromGitter<mratsim> People crashed space shuttles with implicit type conversion (granted it was miles<->meters but still)
13:02:38FromGitter<narimiran> or even `if xs`, but that be too much for nim community
13:02:47Araqwhich is actually more bearable than 'if len(xs)'
13:02:49FromGitter<narimiran> ah Araq, you were quicker :)
13:02:58FromGitter<kayabaNerve> A human construct.
13:03:07FromGitter<kayabaNerve> No they aren't
13:03:16FromGitter<kayabaNerve> Syntax vs semantics
13:03:29FromGitter<mratsim> compiler enforced proper units usage
13:03:41FromGitter<narimiran> agreed that `if xs` is better/nicer/"more bearable" than `if len(xs)`. can we have it? :)
13:04:02FromGitter<kayabaNerve> Boi. Syntax vs. Semantics
13:04:05*enthus1ast quit (Ping timeout: 240 seconds)
13:04:23FromGitter<kayabaNerve> proc cube(x: int): int =
13:04:36FromGitter<kayabaNerve> result = x*3
13:04:42FromGitter<kayabaNerve> Does that compile?
13:04:48FromGitter<kayabaNerve> Does that work?
13:05:11FromGitter<kayabaNerve> It's syntactically valid but it doesn't work. It should be x\*x\*x
13:05:26FromGitter<kayabaNerve> Using mi instead of km is an example of that
13:05:43FromGitter<kayabaNerve> It's not the compilers job to do anything but more than a warning
13:06:03FromGitter<kayabaNerve> Automatic, implicit, or silent type conversion is related to syntax though
13:06:16FromGitter<bevo009> This compiles in jS:
13:06:22FromGitter<bevo009> console.log(50 * "50") => 2500
13:06:37FromGitter<mratsim> if you add a int3 types, you coud define a cube int-> int3 proc that does not compile in your example
13:06:47FromGitter<mratsim> it is, they are using ADA
13:06:59FromGitter<mratsim> Nim unit types are based on Ada
13:08:00FromGitter<mratsim> —> https://www.quora.com/Does-NASA-use-Ada "most of the flight software for the ISS and some of the simulations were written in Ada and are continued to be maintained."
13:08:38FromGitter<kayabaNerve> But do they use types in Ada?
13:08:56FromGitter<kayabaNerve> And did they use the wrong type or did the compiler implicit convert?
13:08:58Yardanico@bevo009 well, you can do the same in Nim with converters :D
13:09:04FromGitter<kayabaNerve> Finally, no it's not
13:09:33FromGitter<kayabaNerve> The job of a compiler is to take source and either say where a human messed up or output an executable
13:09:46FromGitter<kayabaNerve> It's not to prevent human mistakes
13:09:51FromGitter<kayabaNerve> It's not an AI
13:10:06FromGitter<mratsim> static type checking is all about preventing that
13:10:14*gangstacat joined #nim
13:10:19FromGitter<kayabaNerve> But did they use types or int
13:10:27FromGitter<mratsim> mistakes happen, a static type checker is a safety belt
13:10:38FromGitter<kayabaNerve> Because it's only relevant if they typed it, and the compiler implicit converted
13:10:41*nsf quit (Quit: WeeChat 2.1)
13:10:56FromGitter<kayabaNerve> If they didn't type it or they used the wrong type, your argument is invalid
13:11:11FromGitter<kaushalmodi> Is this discussion about if Nim should be a dynamic language instead? :P
13:11:32FromGitter<kayabaNerve> Agreed. The discussion isn't static typing valid. The discussion is what's a compilers job though and if your NASA argument is an example why not to have implicit type casting
13:11:44FromGitter<kayabaNerve> The answer is no to the second
13:11:57FromGitter<mratsim> you can do it in Ada, Nim, Haskell, Idris
13:17:33FromGitter<Varriount> @kaushalmodi I'll test your PR later on today, after work. Thanks for the improvements!
13:29:18*BitPuffin joined #nim
13:35:21FromGitter<Vindaar> Araq: "On a related note, these security concerns regarding the JavaScript package management ecosystem made me change my mind, I am now more in favour of a "batteries included stdlib"." (https://github.com/nim-lang/Nim/issues/7810) Ooh :)
13:40:45FromGitter<kaushalmodi> TIL about "enum-length arrays" in Nim.. they are pretty cool
13:41:18FromGitter<kaushalmodi> `array[someEnumType, int]`
13:43:03FromGitter<mratsim> leftpad strikes again :D
13:52:16FromGitter<kayabaNerve> Not that mess again
14:10:31AraqVindaar: are you Yardanico ?
14:10:40YardanicoAraq, he's not? :P
14:10:48FromGitter<Vindaar> ehm, no?
14:11:02YardanicoIt wouldn't make sense for me or for him to make another identity :P
14:11:42FromGitter<mratsim> I think he meant, “do I have another stalker?” ;)
14:11:59FromGitter<Vindaar> haha, good point :D
14:12:37Yardanicoooh :P
14:15:03*cryptocat1094 joined #nim
14:19:16Araqyeah, that was the joke :-)
14:19:54*miran joined #nim
14:23:00FromGitter<kaushalmodi> I thought 0b1111_1111'i8 would be a two's complement representation of -1.. it's not..
14:25:56PMunchkaushalmodi, it works on play.nim-lang.org
14:25:58dom96It looks right to me?
14:26:15PMunch!eval let x = 0b1111_1111'i8; echo x
14:26:17NimBot-1
14:26:23FromGitter<kaushalmodi> hmm
14:26:34FromGitter<kaushalmodi> a bug on devel then?.. let me paste a snippet
14:26:57FromGitter<kaushalmodi> ```let minusOne: int8 = 0b1111_1111```
14:27:15FromGitter<kaushalmodi> ```nim_src_EJY9M9.nim(4, 22) Error: type mismatch: got <int literal(255)> but expected 'int8'```
14:27:34PMunchWell you're missing the 'i8
14:27:43FromGitter<mratsim> 0b1111_1111’i8
14:27:57PMunchJust changed that to "let minusOne = 0b1111_1111'i8"
14:28:04FromGitter<kaushalmodi> hmm.. I see.. I was declaring a var to be i8 and then assigning to it.. that doesn't work
14:28:14FromGitter<kaushalmodi> I need to get an int var and then cast it to i8
14:28:24FromGitter<mratsim> it’s not considered an int literal it seems
14:28:42FromGitter<mratsim> .int8
14:28:47FromGitter<mratsim> don(t cast, convert
14:29:01PMunchThis works fine: http://ix.io/1e4v/
14:29:09FromGitter<kaushalmodi> I used the wrong term.. I call calling "foo'i8" as casting to i8
14:29:32Araq Error: type mismatch: got <int literal(255)> but expected 'int8' <-- perfect error message IMO
14:29:55FromGitter<kaushalmodi> I understood the error
14:30:07FromGitter<mratsim> I think he expected (and me too), 0b, 0o and 0x to be considered int literals
14:30:21PMunchIt would be neat if the 0b and 0x literals would be able to see that they fit in a (u)int(8/16/32/64)
14:30:41FromGitter<kaushalmodi> I thought that `let foo: int8 = 0b1111_1111` was the same as `let foo = 0b1111_1111'i8`
14:31:01FromGitter<kaushalmodi> PMunch: Exactly!
14:31:23FromGitter<kaushalmodi> I am from a hardware/ASIC design background
14:31:29Araqthe value interpretation of int literals is not subject to where the integer literal is used
14:31:32FromGitter<kaushalmodi> so "-0xabcd" is bogus
14:31:41FromGitter<kaushalmodi> negatives always exist as two's complements
14:32:00Araqsorry, but that would be a terrible language design.
14:32:18PMunchWhy? var x: int8 = -1 works fine
14:32:32PMunchAnd 0b1111_1111 fits snuggly in 8 bits
14:32:48Araq-1 is not ambiguous but 0b1... is!
14:33:03Yardanicowhy not just use -1 instead of this 0b1111_1111 ? :P
14:33:25PMunchYardanico, if it's used for masking purposes it's more explicit and easier to read if you use the bits
14:33:32Araq0b1... either means -1 or 255 and the compiler tells you in Nim it means 255. Makes perfect sense.
14:33:47Araqand 255 does not fit an int8.
14:34:22PMunchAraq, then we should have an explicit way to define twos complement
14:34:27PMunch2b1111_1111 :P
14:34:45Araq0b1111_1111'i8 -- we have it. use it.
14:35:09PMunchEh, fair enough
14:35:19dom96deja vu
14:35:22FromGitter<kaushalmodi> I was just surprised, that's all. Now this is going in my notes :)
14:35:24dom96We've argued about this before :)
14:35:58FromGitter<kaushalmodi> It's kind of useless to do `let foo: int8 = 0b...`
14:36:26FromGitter<kaushalmodi> If someone is using binary/hex representation, they more likely than not know what they are doing
14:36:32FromGitter<kaushalmodi> and they would expect two's complement
14:37:26FromGitter<mratsim> On the contrary, people using binary hex probably know what they are doing I think
14:37:53Araqbinary/hex is not for people "who know what they are doing", it's for people who need their manhood rituals
14:38:25FromGitter<mratsim> ladies can use them too though?
14:39:04FromGitter<mratsim> and when writing a VM you use hex a lot.
14:39:46Araqonly if the corresponding spec happens to use hex notation
14:40:35FromGitter<kaushalmodi> When you see ones and zeros, there's no "negative sign" stored digitally
14:40:44FromGitter<kaushalmodi> binary -1010 makes no sense
14:41:03Araqand the spec uses hex notation most probably for the same reason, real hackerz only use hex editors and all that nonsense
14:41:20FromGitter<mratsim> lol @“real hackerz"
14:41:36Yardanicoreal hax0rz
14:42:19Araqyeah binary -1010 makes no sense. do you know what also makes no sense? -1.1
14:42:31Araqlets use hexadecimal floating point notation instead.
14:42:39*gsingh93_ joined #nim
14:42:59Araqah but you happen to not know the IEEE double precision format so you write -1.1 instead, got it.
14:43:46FromGitter<mratsim> doing financial computation with the IEEE double precision format makes no sense
14:43:55FromGitter<mratsim> oh you use Excel, well guess what
14:43:58*rayman258 joined #nim
14:44:02FromGitter<kaushalmodi> I understand the IEEE double precision format.. I am talking specifically about 0b and 0x prefixed ints
14:44:53FromGitter<kaushalmodi> But it get it.. need to do the "'i8" conversion instead of directly assigning to i8 type var
14:45:32*m-jy quit (Remote host closed the connection)
14:45:47AraqI don't know why it's so hard to accept that hex notation is a relict, ambiguous and inferior to a non-ambiguous notation
14:46:51Araqand people only use it because they learned it and they seek some revenue for having to learn this nonsense
14:47:35FromGitter<mratsim> I think you are confusing hex notation and regex :P
14:47:48Araqif these notation were oh so important, why does floating point lack this notational support in most languages out there?
14:47:49*rayman22201 quit (Ping timeout: 256 seconds)
14:47:52FromGitter<kaushalmodi> When you deal with OR'ing, etc operations on flags etc, binary/hex makes more sense
14:47:57FromGitter<mratsim> ^
14:48:16PMunchYup
14:48:27FromGitter<mratsim> when dealing with raw memory, especially shifts, it’s easier to visualize in hex (binary just takes too much space)
14:48:35PMunchHex and binary doesn't make sense for ints or floats, but for flags and bytes
14:49:11FromGitter<mratsim> but then, use seq\[byte\] and not seq\[uint8\] or string ;)
14:49:28FromGitter<kaushalmodi> For my understanding.. so 0x1111_1111'i8 does a conversion from int to int8?
14:49:36FromGitter<mratsim> it does not convert
14:49:43FromGitter<mratsim> it’s created directly as int8
14:50:02FromGitter<mratsim> there is no conversion overhead here
14:50:21FromGitter<mratsim> the difference is like “2” vs $2
14:50:35FromGitter<kaushalmodi> understood.. I was just trying out `let minusOneAgain = 0b1111_1111.int8` and that didn't work
14:50:46FromGitter<kaushalmodi> thanks
14:51:17FromGitter<mratsim> 0b1111_1111.int8 would give you 255 because 0b1111_1111 in int is 255 then it’s ocnverted
14:52:03FromGitter<mratsim> I’m not sure how C/C++ deal with that btw
14:52:12PMunchHmm, let x: byte = 0b1111_1111; echo x.int8
14:52:23PMunchThat should be a valid conversion IMO
14:52:32Araqyeah, the difference between value conversions and bit pattern conversions. and the pinnacle of programming langauge design, C, uses ... what for it... value conversions
14:53:10FromGitter<mratsim> @PMunch, for byte yes
14:53:17*btbytes joined #nim
14:53:31FromGitter<mratsim> but the temp variable in Kaushal case is an int
14:53:42Araqboo! C is not a real low level language! how can you ever dream of writing an OS in it
14:54:36PMunchmratsim, yeah I know. I was just trying out different things
14:55:21FromGitter<mratsim> if you convert int8 to byte, I think you will have an overflow error though
14:55:24PMunchAraq, I remember you saying that copying a bad design isn't good design. Just because C does something unintuitive doesn't mean that Nim has to do it
14:55:40PMunchmratsim, that doesn't make sense either..
14:55:55Araqyeah, but values are far more intuitive than bit patterns.
14:55:56FromGitter<mratsim> because byte are an alias to uint8 instead of being an alias to char (like the C spec says) or a distinct type
14:57:14PMunchAraq, again I agree that bit patterns and hex representation makes little sense when you are dealing with actual values. But for things like bit-masks, and flags it makes little to no sense to use a value representation.
14:58:16PMunchThere's a difference between "this is three bits in positions 2, 5, and 7" and "this is the number 42"
14:59:03Araqwell either 0b1... means "bit pattern" or 255 or -1. "bit pattern" is not a concept in Nim.
14:59:24Araqnor is it really a concept anywhere else for that matter.
14:59:26PMunchThat's what I'm saying, it should be
14:59:50PMunchIt is used all over the place, why not make it a concept
15:00:35AraqI can tell you why.
15:01:06Araqbecause these kinds of sophistries are already everywhere in Nim and produce terrible results with a meta programming system.
15:01:50FromGitter<mratsim> @PMunch, for your use case, enums + set are usually good enough
15:01:54PMunchHuh, that's a word I've never seen before :)
15:03:34PMunchmratsim, yes there are always ways to work around it
15:03:46Araqthat means "immediate victory" for me, right?
15:04:37Araqthose who are able to use the most Latin words do win.
15:06:21PMunchBut what do you mean that they cause terrible results with the meta-programming system?
15:07:17*endragor quit (Remote host closed the connection)
15:07:19Araqever used macros.getType ?
15:07:45*endragor joined #nim
15:07:47PMunchI tried..
15:08:11PMunchOh wait, I think binaryparse uses it
15:08:38Araqthe last thing we need is one more set of builtin types like bits8, bits16, bits32, bits64 that everybody who tries to write a serializer for Nim (e.g. uses getType) needs to carefully consider.
15:09:05Araqhow to map bits16 to JSON? how to map bits64?
15:10:05Araqwhy do I need to consider bits64? what was wrong with uint64?
15:12:01*endragor quit (Ping timeout: 248 seconds)
15:12:35PMunchI feel like that is a point in my favor though. Bits and values are conceptually different things. Maybe it would make more sense to represent bits8 as an array of bools in JSON (or some other format). If I have a uint8, that get's "upconverted" to a int64 because of JSON what do I do when I get it back and expect an 8-bit flags field?
15:12:39FromGitter<mratsim> type bits64 = distinct uint64, problem solved
15:14:04FromGitter<mratsim> or type bits64 = object\n raw_data: uint64
15:15:22*nsf joined #nim
15:15:59*enthus1ast joined #nim
15:16:47Araqhttps://youtu.be/IMxWLuOFyZM?t=214
15:17:42Araq^ Nim's getType in a nutshell.
15:19:52PMunchHaha :P
15:20:16elroodhad high hopes to find a bunny hidden in nim's source somewhere for a second. disappointed
15:20:18*endragor joined #nim
15:20:41*gangstacat quit (Ping timeout: 256 seconds)
15:21:24PMunch"What is your type?", "My distinct or my actual type?", "I don't know that!" *whoooa, Unexpected Exception*
15:21:52Araqyep.
15:24:18FromGitter<kaushalmodi> I was just converting the Nim by Example's Primitive Types section to my notes, but I couldn't take it at face value and so ended up down this two's complement rabbit hole.. how does this look? https://scripter.co/notes/nim/#primitive-types
15:24:27*endragor quit (Ping timeout: 240 seconds)
15:27:20FromGitter<Vindaar> @kaushalmodi `float` is simply an alias for `float64` if I'm not mistaken
15:27:32PMunchkaushalmodi, you also have byte which is the same as char and uint8 IIRC
15:27:38PMunchVindaar, wasn't that fixed?
15:28:21PMunch> Integers can also have 0[xX], 0o, 0[Bb] prepended to indicate [...]
15:28:25FromGitter<Vindaar> @PMunch was it? That's why I'm saying if I'm not mistaken, hehe. Possible that I missed it
15:28:33PMunchWhy is the center one different?
15:30:18FromGitter<Vindaar> system.nim defines the following: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ so at least `float` and `float64` seem to be the same, no? [https://gitter.im/nim-lang/Nim?at=5b2a7309467bd7268c20339d]
15:31:17PMunchOh maybe you're right, just remember reading something about it having changed
15:32:00FromGitter<kaushalmodi> @Vindaar Thanks, will update that.
15:32:13FromGitter<kaushalmodi> PMunch: What about that quoted part: "Integers can also have 0[xX], 0o, 0[Bb] prepended to indicate "?
15:33:45PMunchCan o only be small?
15:33:52FromGitter<kaushalmodi> Ah ok
15:33:59FromGitter<kaushalmodi> to not confuse with 0?
15:34:05PMunchAnd why is it xX but Bb?
15:34:11FromGitter<kaushalmodi> Some fonts are bad at distinguishing 0 vs O
15:34:47FromGitter<kaushalmodi> If I use capital O, I get: ⏎ ⏎ > Error: 0O67 is not a valid number; did you mean octal? Then use one of '0o', '0c' or '0C'.
15:34:54*Trustable joined #nim
15:34:57PMunchHuh, odd
15:35:07FromGitter<kaushalmodi> !eval let foo = 0O67
15:35:07PMunchBut then you should have it as [ocC]
15:35:08NimBotCompile failed: in.nim(1, 12) Error: 0O67 is not a valid number; did you mean octal? Then use one of '0o', '0c' or '0C'.
15:35:11*xkapastel joined #nim
15:35:27elroodwho else would have expected 0b1111_1111'i8 to be -128 ?
15:35:28FromGitter<kaushalmodi> yeah, good point (was just trying out that eval thing)
15:35:43FromGitter<kaushalmodi> elrood: that's -1
15:35:49PMunchelrood, what?
15:36:18PMunchThat's just the magic of twos compliment
15:36:24PMunchIt's actually pretty nifty
15:36:43FromGitter<kaushalmodi> elrood: Flip all 1's and add 1 and prepend with negative sign
15:37:00*btbytes quit (Quit: Textual IRC Client: www.textualapp.com)
15:37:02FromGitter<Vindaar> Interesting, because in parseOct of parseutils only 'o' and 'O' are supported, but not c
15:37:09FromGitter<Vindaar> https://github.com/nim-lang/Nim/blob/devel/lib/pure/parseutils.nim
15:37:31FromGitter<Vindaar> Maybe should be changed to have the same behavior as literals?
15:37:37*enthus1ast quit (Ping timeout: 248 seconds)
15:37:38FromGitter<kaushalmodi> yep
15:37:53FromGitter<kaushalmodi> @Vindaar Can you open that issue?
15:38:42FromGitter<Vindaar> Once I'm back on my laptop, sure
15:38:50PMunchLet's demonstrate with 4 bit bytes: 0b0010 + 0b0001 (2+1), add together 0b0011 (3). 0b0010 + 0b0010 (2+2), add together and watch the carry 0b0100 (4). Now with negative numbers: 0b1111 + 0b0001 (-1 + 1) add with overflowing carry: 0b0000 (0). 0b1110 + 0b0001 (-2 + 1), add together 0b1111 (-1).
15:39:01PMunchelrood ^
15:39:30FromGitter<kaushalmodi> @mratsim yes, my quick definition was incomplete
15:40:32FromGitter<mratsim> here you go @elrood for actual examples of 2 complement representation: https://github.com/status-im/nim-stint/blob/compile-time-and-js-compat/stint/private/as_words.nim#L60-L75
15:41:59FromGitter<mratsim> on the side of wikipedia articles you have some examples as well: https://en.wikipedia.org/wiki/Two%27s_complement
15:42:12elroodguys, cheers, thanks for your efforts, i actually know my math basics ;) i see the that joke isn't popular here
15:42:37FromGitter<mratsim> oh, I thought it was a genuine question
15:42:55PMunchHaha, me too :P
15:43:25elroodsorry, should have added a winking smilie or some other hint, i thought that goof was more established here
16:00:31*Arrrr joined #nim
16:11:16*floppydh quit (Quit: WeeChat 2.1)
16:23:12*gangstacat joined #nim
16:55:27csparHi. I'm trying to use the tables modules, and I'm getting segfaults on calling hasKey (trace goes to tableimpl.rawGet). Does this mean my hash function is broken?
16:55:41Yardanicocspar, how are you initializing your table?
16:56:29csparright now? "var fontsMap: Table[fonts.FontAndSize, ttf.FontPtr]"
16:59:07Yardanicocspar, you should use initTable
17:01:50csparYardanico, thanks much
17:02:35*Trustable quit (Remote host closed the connection)
17:16:10*PMunch quit (Quit: Leaving)
17:18:38*shortCircuit__ quit (Quit: WeeChat 1.8)
17:20:56*gangstacat quit (Ping timeout: 256 seconds)
17:22:00*nsf quit (Quit: WeeChat 2.1)
17:26:46*gangstacat joined #nim
17:41:45*rayman22201 joined #nim
17:44:05*rayman258 quit (Ping timeout: 240 seconds)
18:13:50*fvs joined #nim
18:36:07FromGitter<kayabaNerve> Dom96: How much would you charge to make a 32bit OS, keyboard, c stdlib... That could run the Nim compiler and bootstrap itself? 🤔
18:36:18FromGitter<kayabaNerve> Btw, I don't think anyone will ever ever hire you to do that.
18:36:33FromGitter<kayabaNerve> *OS in Nim
18:37:07FromGitter<kayabaNerve> Just thinking you had nimkernel and it'd be an interesting project. Isn't someone slowly replacing Minix source files with Nim to eventually have a full a Nim OS?
18:39:27xomachine[m]Hm, is there any difference between hostOS and targetOS [here](https://github.com/nim-lang/Nim/blob/devel/compiler/extccomp.nim#L503) ? I wonder if they should have different values when cross compiling from one OS to other. (At the moment they are same and equals target OS)
18:42:19FromGitter<kayabaNerve> https://github.com/ckkashyap/nim-xv6 Found it. Unix, not Minix
18:45:54elroodxomachine[m], those terms only make a difference when building a cross-compiler, host would be the system the compiler is meant to run on, and target the one it should generate code for
18:50:02xomachine[m]elrood: well, when I run the compiler from linux and the compiler flags contain `--os:windows` the targetOS should be "osWindows" and hostOS - "osLinux" right?
18:50:39elroodshould be correct
18:51:31*kinkinkijkin joined #nim
18:51:59dom96kayabaNerve: Sounds like fun. I wouldn't charge anything, you just need to build me a time machine
18:52:34xomachine[m]but the values are same in fact: they both are osWindows
18:53:17FromGitter<kayabaNerve> Dom96 How much would you charge for you to build me a time machine?
18:53:28FromGitter<Vindaar> <-- just typed a text about "Are we scientists yet?" that was apparently eaten by Gitter / lost in the void... stupid trains :P
18:54:58FromGitter<kayabaNerve> @Vindaar Maybe
18:55:16FromGitter<kayabaNerve> One of us has to accidentally inject ourselves with a horrible disease first
18:55:32FromGitter<kayabaNerve> Cancer/AIDS/Zombie Rabies
18:55:40FromGitter<kayabaNerve> Rite of passage there
18:55:45dom96kayabaNerve: 12 schmeckles
18:56:21FromGitter<kayabaNerve> How many USD will you take in exchange for a schmeckle?
18:56:32FromGitter<kayabaNerve> Or how many plumbuses.
18:56:41FromGitter<kayabaNerve> I am a very rich man and have both at my disposal
18:57:16FromGitter<Vindaar> Again: @mratsim I just wrote that imo you should add @brentp's nim-plotly to the "Are we scientists yet?" post of yours. And maybe change the sections / add different ones. E.g. many things done by Arraymancer aren't event represented anymore (k-means clustering was added recently?) etc. Maybe something about optimization / regression, data storage for science (the things I work with, which is why I notice). And
18:57:16FromGitter... probably much more.
18:57:17dom96$1 million + 50 plumbuses (I cannot guarantee that a working time machine will be delivered)
18:57:24FromGitter<Vindaar> Knowing you, it's probably on your TODO list though :)
18:57:48FromGitter<kayabaNerve> dom96 As a very rich man, I think we may have an agreement
18:58:02elroodxomachine[m], that sounds odd. could you give a bit more context about what you are doing? just guessing in the blue, but are you on linux building a compiler that's supposed to run on windows and generate windows binaries? in that case conf.target.targetOS and conf.target.hostOS both being windows would make sense
18:58:07FromGitter<kayabaNerve> I will contact my lawyers, solely for me, a very rich man, to start the paperwork
18:58:16elroodbetter ask Araq though, it's his code
18:58:33Araqelrood: your analysis seems spot on.
19:00:08FromGitter<kayabaNerve> #Nim on freenode, right?
19:00:31AraqNimOS is coming, but it's called "SteamOS". Valve decided to write all their new code in Nim.
19:00:47Yardanico:O
19:01:19FromGitter<kayabaNerve> Yes? Not on freenode? QuakeNet?
19:01:26FromGitter<kayabaNerve> I can name a bunch here
19:01:55AraqHalf Life 3 in Nim confirmed.
19:02:04elroodkayabaNerve, go ahead. we'll wait patiently and politely and when you're done confirm freenode was indeed correct ;P
19:02:34FromGitter<kayabaNerve> Elrood: D:
19:03:40FromGitter<kaushalmodi> Hello guys.. can you comment on the correctness of the code snippet and analysis in http://localhost:1313/notes/nim/#int-types?
19:04:04elroodAraq, you sound a bit as if people had mentioned transpiler a tad too often lately and you already received your first batch of local beers ;)
19:05:16*TechAspirer joined #nim
19:05:30TechAspirerSo there's no need to sue? :D
19:05:32FromGitter<mratsim> @Vindaar yes, it’s been a while, I have to revisit the post
19:05:50TechAspirerYep. this is it. Great.
19:05:54Yardanico@kaushalmodi localhost? :P
19:05:55FromGitter<Vindaar> @mratsim Ok, so just consider it as a friendly ping :)
19:06:20FromGitter<kaushalmodi> I ninja-editted that
19:06:37Yardanicowell, we don't see any edits on IRC as you may know
19:06:38FromGitter<kaushalmodi> Here's the link again: https://scripter.co/notes/nim/#int-types
19:06:44YardanicoIRC doesn't have a concept of editing :)
19:06:48Yardanicoso we would use *corrected
19:06:48FromGitter<kaushalmodi> yeah.. just realized that
19:07:44Yardanico@kaushalmodi, well "So for a 64-bit CPU, this would be the same size as int64." but if you compile your program as 32bit one and it will run on 64bit CPU, int will be 32bit
19:07:49Yardanicoyou can test that yourself
19:08:48xomachine[m]Posted an issue about that [here](https://github.com/nim-lang/Nim/issues/8081)
19:08:55TechAspirerYardanico: Everyone should just use 16 bits
19:09:00YardanicoTechAspirer, of course! :P
19:09:04TechAspirerNo more are ever needed for any reason
19:09:14TechAspirerIt's a new singular standard
19:09:30FromGitter<mratsim> You can’t even run a browser on 64kB of RAM ...
19:09:36TechAspirerWith constant execution that will guarantee to max out a platform's capabilities
19:10:06FromGitter<kaushalmodi> Yardanico: "but if you compile your program as 32bit one and it will run on 64bit CPU, int will be 32bit" TIL! I didn't even know that I can compile as 32-bit on my machine :P Looking for that flag now ..
19:10:21FromGitter<mratsim> -m32
19:10:28FromGitter<kaushalmodi> thanks :)
19:10:50TechAspirer@mratsim Not work that attitude
19:10:51Yardanicoit's for GCC :)
19:11:01Yardanicoso you would use it like --passC:-m32
19:11:30Yardanico@kaushalmodi try nim c --cpu:i386 --passC:-m32 --passL:-m32 assuming your GCC is multilib
19:12:04*yglukhov[i] quit (Remote host closed the connection)
19:12:22FromGitter<kayabaNerve> Yardanico: Thoughts on having this as a Nim flag?
19:13:07FromGitter<kaushalmodi> Yardanico: I confirm!
19:13:37Yardanico@kayabaNerve i don't really know, I don't use this feature at all because everyone is using 64bit nowadays
19:13:49Yardanicobut I'm not the one to decide anyway :P
19:13:51*yglukhov[i] joined #nim
19:14:18cryptocat1094I wonder, could I use the 6502 C target for Nim?
19:14:26*TechAspirer quit (Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org)
19:14:33FromGitter<mratsim> for windows I don’t think it’s that useful, but linux/android/iOS is
19:14:46FromGitter<kayabaNerve> It works on 16 bit platforms
19:14:56FromGitter<kayabaNerve> I have Nim up on a Tomu
19:15:17FromGitter<kayabaNerve> Be careful with your OS settings though
19:15:33*yglukhov[i] quit (Remote host closed the connection)
19:16:06FromGitter<kayabaNerve> And linking
19:16:11elroodkayabaNerve, are you saying the nim compiler runs on your tomu, or your c compiler generated binaries that do? ;P
19:16:30*yglukhov[i] joined #nim
19:16:37xomachine[m]Yardanico: thanks for advice about a cross compilation, but the issue I posted was not about how to perform that. There was just a minimal example about how to reproduce the problem, in the real case I use a bit more complicated options and a custom C compiler.
19:16:42FromGitter<kayabaNerve> The second
19:16:54Yardanicoxomachine[m], yeah, I understood your issue
19:16:57FromGitter<mratsim> I’m working on a 65812 emulator in Nim, adding all the opcodes is so tedious ...
19:17:25FromGitter<kayabaNerve> @mratsim Solution: make it a PS5 emulator instead
19:17:37FromGitter<kayabaNerve> Or XBox One
19:17:51FromGitter<kayabaNerve> I'd love MCC on my desktop
19:18:03FromGitter<mratsim> Well, I’ll start with something useful first ;)
19:18:25FromGitter<kayabaNerve> Nothing that had yet
19:18:34FromGitter<kayabaNerve> *has yet to be made can be useful
19:18:55FromGitter<kayabaNerve> And an XBOne emulator would be useful as hell
19:19:11*noonien quit (Quit: Connection closed for inactivity)
19:20:09FromGitter<mratsim> I’m joking of course. But it’s probably too hard for me at the moment. Just thinking of dealing with Windows stuff, the copy protection thing, the Internet/connectivity thing … the GPU ….
19:22:05*yglukhov[i] quit (Ping timeout: 256 seconds)
19:23:04*kinkinkijkin quit (Quit: Leaving)
19:24:23*brainproxy joined #nim
19:28:53*kinkinkijkin joined #nim
19:40:50*kinkinkijkin quit (Quit: Leaving)
19:42:55FromGitter<Vindaar> @kaushalmodi here you go: https://github.com/nim-lang/Nim/issues/8082 ⏎ If my internet stops dying on me all the time, I'll take a look at the emacs-module thing finally :)
19:43:38FromGitter<mratsim> @Araq, regarding our discussion on recursive proc from yesterday, I think space leaks are a much bigger issue in functional programming languages: https://simonmar.github.io/posts/2018-06-20-Finding-fixing-space-leaks.html
19:46:19FromGitter<kaushalmodi> @Vindaar ⏎ ⏎ > I'll take a look at the emacs-module thing finally :) ⏎ ⏎ Thanks! [https://gitter.im/nim-lang/Nim?at=5b2aaf0b0168e70c08d7342b]
19:50:07*nasusiro joined #nim
19:50:17nasusirogreetings everyone
19:55:45Yardanicohello
19:56:38nasusiroNim looks really an interesting language
19:56:51nasusiroI like how it lets you choose the language output
19:57:13nasusiroI was wondering though; I chose cpp as my output and produced the same C-style code for C++
19:57:18nasusirois this the correct behavior?
20:01:33*miran quit (Ping timeout: 264 seconds)
20:03:56Yardaniconasusiro, well, nim is compiled to C/C++ so you shouldn't really look at C/C++ output unless you hit a bug in codegen
20:04:37nasusirooh I was just curious and saw the output is identical between C and C++ results, that's why I wanted to ask
20:04:43Yardanicowell, it's not identical really
20:04:46Yardanicothere's some C++ specific stuff
20:04:56nasusirolike?
20:06:34Yardaniconasusiro, " struct NimStringDesc : public TGenericSeq"
20:07:04nasusirowhere should I see this piece of code?
20:07:28Yardaniconasusiro, in any .cpp file compiled from nim which uses strings
20:07:44Yardanicoand why are you curious about this c/c++ ?
20:08:01nasusirowhen you say strings, you mean something like echo("hello world!") ?
20:08:20Yardaniconasusiro, yes
20:08:30Yardanicowhy are you interested in this so much? :)
20:09:05nasusirobecause I like studying programming languages and compiler design as a whole
20:09:47nasusiroI liked how Nim is designed and got a little bit disappointed that did not offer any option to compile directly to machine code
20:09:58nasusirobut I guess C is used for portability purposes
20:10:06nasusiroand years of tested optimization techniques
20:10:11Yardanicoyeah, you're right
20:10:51Arrrrthat's it
20:12:00nasusiroI'm wondering how much faster the compilation will be if any .c file output is amalgamated like how SQLite does
20:12:39Yardanicothere's incremental compilation for Nim files in development
20:13:06nasusiroI will give Nim a shot
20:13:17nasusiroI hope it's not too addictive
20:14:13Yardanicodepends on what you will use Nim for :)
20:14:36Yardanicobut generally if you will get used to some nim features it will be hard to come back to another languages :D
20:18:58nasusirooh trust me, I'm a psycho-masochist lol
20:19:07elroodyou'll love nim
20:19:25nasusiroI still love using C++, even though I have had enough with it. I'm just an awkward geek
20:19:40nasusiroelrood: I like Nim's syntax
20:20:02nasusiroreadable like Python and Lua
20:21:14FromGitter<mratsim> There are some differences with pointers/references as well since C allows stuff that C++ doesn't
20:21:22*gsingh93_ quit (Quit: Connection closed for inactivity)
20:21:41FromGitter<mratsim> and obviously exceptions, Nim uses C++ exceptions with the C++ target while it rolls its own system with C target
20:21:56FromGitter<mratsim> and that’s the only reason why Araq wants to change the default backend to C++ :/
20:22:10nasusiroNim uses exceptions the right way; C++'s was a mistake
20:23:17nasusirowhich cases Nim is good to use for?
20:23:53FromGitter<mratsim> depends of if you mean currently or in terms of potential
20:24:17FromGitter<mratsim> In terms of potential I don’t see a limit (though I’m biaised so feel free to challenge me)
20:24:36FromGitter<mratsim> in terms of current use, it seems la game devs are loving Nim
20:24:42FromGitter<mratsim> like*
20:24:54FromGitter<mratsim> I use it for data science/deep learning
20:25:03FromGitter<mratsim> And I’m using it at work for blockchain
20:25:08*cryptocat1094 quit (Quit: gtg)
20:25:25FromGitter<Varriount> I'm using it for interpreter work
20:25:33nasusiroare you chatting remotely via a different app and use this enclosed nickname along with FromGitter?
20:25:52FromGitter<mratsim> The Nim forum and website are entirely written in Nim as well
20:25:52Yardaniconasusiro, a lot of people here are from Gitter actually
20:26:02Yardanicothere's a Gitter<->IRC bridge for this channel
20:26:11FromGitter<mratsim> There are IRC, Gitter, Discord, Matrix bridges
20:26:12nasusiroI have no idea what Gitter is
20:26:31nasusirois it a Slack competitor?
20:26:33FromGitter<mratsim> it’s a dev focused chat apps
20:26:45FromGitter<mratsim> with tiht integration with Github
20:27:07nasusirolol technology has become too much for me to handle
20:27:19nasusiroI miss my '90s ;-(
20:28:32*cspar quit (Ping timeout: 245 seconds)
20:28:32FromGitter<mratsim> In the 90s, searching stuff took too long though ...
20:29:41Yardaniconasusiro, for a lot of people it's easier to just open a tab in the browser rather than download an IRC client/connect to an IRC server
20:29:45*Sembei quit (Quit: WeeChat 2.2-dev)
20:29:47Yardanicoand you get free logging with Gitter :)
20:30:22FromGitter<Varriount> @kaushalmodi Are you around?
20:30:59elroodnasusiro, to play the devil's advocate, you can feel right at home here, you'll still ultimately and under the hood be compiling good old c/cpp most of the time when using nim
20:31:00nasusiroyeah, in the '90s I was able to learn things at a deeper level. Nowadays before I understand the intro, they change everything and feels like I am a living GOTO #1
20:31:15FromGitter<mratsim> were is the permalink for the forum, it seems like destructors/newruntime are for v1 for real: https://forum.nim-lang.org/t/3945 :O
20:31:35*PMunch joined #nim
20:32:29nasusiroelrood: can I compile any C or C++ code and be able to use it with Nim?
20:32:34nasusirowithout too much fuss that is
20:32:47Yardanicowell, there's C/C++ ffi and c2nim
20:32:51Yardanicoalso nimgen
20:33:01nasusironice
20:33:24*gangstacat quit (Quit: Ĝis!)
20:33:42FromGitter<kaushalmodi> @Varriount Yes, for few mins
20:33:49FromGitter<mratsim> you don’t compile the C or C++ code, nim compiles it for you ;)
20:34:23FromGitter<mratsim> unless you were talking about shared lib, then you can use the header file just like in C.
20:34:32nasusirois there a way for Nim to provide it existing C or C++ code and compile it for me? or should I provide flags and so forth?
20:34:57*gangstacat joined #nim
20:35:02Yardaniconasusiro, why would you want that?
20:35:09Yardanicoyou want to convert c/c++ to nim or what?
20:35:41nasusiroI'm asking for the case I want to migrate an existing code to Nim for multiple reasons
20:36:39*Vladar quit (Quit: Leaving)
20:36:47Yardaniconasusiro, well, idiomatic nim is very different from C/C++
20:36:52FromGitter<mratsim> some example: https://github.com/status-im/nim-rocksdb, https://github.com/status-im/nim-ttmath, https://github.com/status-im/nim-secp256k1
20:37:05Yardanicobut yeah, you can interface with C/C++
20:37:12Yardanicoand compile .c and .cpp files with your nim files
20:37:18nasusiroyeah FFI will be handy in this case
20:37:23FromGitter<mratsim> @yardanico I think it’s just a question about including C/C++ code and incrementally replacing it with pure Nim solutions
20:38:43FromGitter<mratsim> More advanced use with OpenCL and Cuda code: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/private/p_kernels_interface_opencl.nim https://github.com/mratsim/Arraymancer/blob/master/src/tensor/private/incl_higher_order_cuda.nim
20:38:52Yardaniconasusiro, well, you should probably learn the language a bit. you can compile .c and .cpp files via compile pragma
20:39:00Yardanicoand yeah, check out @mratsim's examples, they're great
20:39:04elroodshameless plug, mratsim ;P
20:39:12Yardanico(well, they're not examples, they're real code)
20:39:12FromGitter<mratsim> obviously ;)
20:39:26nasusironow
20:40:15FromGitter<mratsim> so you can even wrap, header only C++ template libraries ;)
20:41:19nasusironice mratsim
20:41:27nasusirovery cool examples
20:41:40elroodand as to your 90s preferences, nim's roots lie in python and pascal in large part, so you have another link right there
20:42:23Yardanicoalso *a bit* of lisp (macros), ada
20:47:17nasusiroelrood: my '90s reference was more about how things were simpler back then comparing the madness we have today
20:47:49elroodcompletely with you on that
20:51:02FromGitter<mratsim> we didn’t have javascript at the time, that’s all JS fault :P
20:52:48dom96"Transpiling is normally a little risky. Transpiling with a custom transpiler over ~500KLOC is downright terrifying." this sentence makes me cringe
20:52:54*dom96 is reading this https://news.ycombinator.com/item?id=17355348
20:53:41dom96Also, the author's original codebase was written in Pascal...
20:54:12nasusiroback then we would work with a couple of tools and take it to the deepest path you can possibly imagine. Now? HA! They don't even hire you anymore
20:54:40nasusirodom96 did well to use the right tool for the right job at the time.
20:58:21*Arrrr left #nim (#nim)
20:58:53elrooddom96, what do you find cringeworthy there? let's hope nim's bdfl isn't currently following..
20:59:20dom96The word "transpiler" just sounds super silly
21:01:37nasusirodom96: well, C with classes started as a C++-to-C transpiler
21:01:49nasusiroso, no need to cringe :)
21:02:30elroodsounds like the commenter means it as more of a hacky way of haphazardly transforming one language into another, introducing its own set of bugs and corner-cases over the ones the underlying language and implementation already have
21:02:33FromGitter<Varriount> @kaushalmodi For the terminal PR, it might be possible to use the `{.global.}` pragma to initialize the default foreground/background colors at application initialization time, without breaking dead code elimination.
21:03:01dom96Anyway, I added a comment to that HN thread
21:04:08FromGitter<kaushalmodi> @Varriount That would take the global namespace then, I believe?
21:04:15elroodhm, unfortunately can't see it yet
21:05:17FromGitter<kaushalmodi> Should those vars be renamed to windowsConsoleDeafaultFg or something like that?
21:06:12FromGitter<kaushalmodi> I anyways cannot verify the build on Windows with the global pragma.. do you want to move ahead with that if that works?
21:07:38nasusirowhat I find hilarious and worrisome at the same time is that nowadays we have all these languages that produce either C or C++ output that compiles to machine code and I'm often asking myself: if you care so much about performance, why not going the machine code in the first place?
21:07:57nasusirofor instance, Cython transpiles to C code that gets imported as a Python module
21:08:18nasusiroRPerl transpiles to C++ that transpiles to C that transpiles to XS
21:08:29FromGitter<mratsim> The issue with Cython is not compilng to C, it’s all those PyObject and PyDecRef and PyIncRef that litters the code
21:08:36oprypinnasusiro, why write performant code in a tedious manner if you could do it in a convenient manner?
21:08:46dom96And C transpiles to machine code
21:08:51nasusirooprypin: that's the thing; I would have done the same
21:08:51dom96It's transpilers all the way down!
21:09:17nasusirobut D chose a different path and compiles fast and produces a fast machine code as well
21:09:35nasusirothere are some interesting cases that worth the effort of study and investigation
21:09:42FromGitter<mratsim> There is not much difference in both between Nim and D
21:10:03FromGitter<mratsim> there is an in-depth review here: https://github.com/timotheecour/D_vs_nim
21:10:28AraqD's backend is rather bad and for speed you use D's LLVM based compiler
21:10:38FromGitter<mratsim> Timothee Cour is the Dub (D package manager) maintainer and was checking Nim for a project so he made a comparative list
21:11:05AraqLLVM is the big unifier and its IR is quite close to C, ymmv
21:11:18nasusiroAraq: bad in what way if I may ask? I'm interested in such observations
21:11:28*Bevo_ joined #nim
21:11:46Araqif you produce machine code directly you'll get underwhelming results until you spend as much effort in the optimizers as the LLVM guys do.
21:12:00Araqit's just not reasonable.
21:12:16elroodit's all a matter of balancing convenience, performance and target reach. d originally was based on an already existing c++ compiler backend which wasn't necessarily on-par with modern compilers in eg. floating point math-heavy code
21:12:33elroodnim chose (correct me if i'm wrong) c for maximum target reach
21:12:58elroodwith llvm as a backend option, compiler frontends should move closer to one another
21:13:02FromGitter<mratsim> to be fair, floating point math heavy code is often done in Assembly anyway (BLAS)
21:13:17Araqportability, speed and when I started LLVM wasn't as common
21:14:00FromGitter<mratsim> What I’m surprised is that both Rust and Crystal have slow compilation speed, and it seems like LLVM is the actual issue
21:14:09Araqit did exist though iirc and I briefly evaluated it, among C--
21:14:24Araqwhich is now unknown :-)
21:14:29FromGitter<mratsim> also Rust is targeting a Middle IR that then targets LLVM IR.
21:15:00elroodllvm's optimizations take time
21:15:20Araqelrood, and yet clang is quite a speed beast
21:15:30FromGitter<mratsim> I remember that 7 years ago, Clang was much much faster than GCC though
21:15:41nasusiroif Tiny C's optimizations were close to GCC's, then TCC would be an amazing option for Nim
21:15:45FromGitter<mratsim> so i think Rust and Crystal are doing something wrong
21:16:49AraqI blame their frontends, mratsim
21:17:03elroodAraq, undoubtedly, compared with gcc it's quite performant. yet running through the optimizer passes is what makes compilation of crystal, rust, d's ldc implementation etc quite a lot slower than people would like to see
21:17:24elroodyou can actually quite directly compare things with d's implementations
21:17:42FromGitter<mratsim> D doesn’t have compilation time issue AFAIK
21:18:18elrooddmd and ldc share the frontend, yet respectively use digitalmars' and llvm's backend
21:18:34FromGitter<mratsim> how are the compilation times between both?
21:18:36AraqI know, but I don't know any numbers
21:19:12Araqand IMO an optimizer is allowed to take its time, for fast turnaround, you can turn off the heavier optimizations
21:23:49nasusiroAraq: about C-- "which is now unknown"; well, Haskell's GHC uses it as one of its transpilation procedure until it produces C code as its final output
21:23:54nasusiroit's a madness lol
21:24:13FromGitter<Vindaar> @kaushalmodi Didn't get very far unfortunately, yet. The whole interfacing is a little weird for me. Struggling to understand quite a bit. I'll take a look at the C tutorial you posted on the issue next. But that will probably only happen Sunday :)
21:24:34elroodmratsim, sorry, can't find any up-to-date comparisons offhand. all i can say is the difference in compilation time was quite notable, but usually absolutely worth it when considering runtime performance
21:27:02nasusiroare there any plans for Nim to add an actual run flag? I know about -r, but I first have to compile the code and then run it which is a bit turnoff for me
21:27:07elroodto get an idea, https://github.com/ldc-developers/ldc/issues/830
21:27:16FromGitter<mratsim> I see, of the D packages I was really impressed by Mir.
21:28:03FromGitter<mratsim> unfortunately there are some stuff they have access too that I can’t access in Nim (like number of registers, L1 and L2 cache size)
21:28:20FromGitter<mratsim> which is quite important to optimize stuff like matrix multiplications :/
21:28:29FromGitter<mratsim> access to*
21:32:35FromGitter<kaushalmodi> @Vindaar Thanks. Basically we need the Nim code to compile to that example C code with that include header, but that Nim Emacs module isn't doing that.
21:33:51Araqmratsim: that is OS specific code, not a Nim problem
21:34:26FromGitter<mratsim> No, it’s that D via LDC has access to LLVM intrinsics
21:35:27Araqintrinsics do not give you CPU cache sizes... or maybe they do...
21:35:52FromGitter<mratsim> The Mir library author specifically asked that in a PR ;)
21:36:48AraqI can see where this is going... :P
21:37:00elroodexactly. those llvm intrinsics are one example of what would be nice to see in nim, yet i am a bit sceptical about because of the tight integration of c as its primary backend
21:37:19FromGitter<mratsim> I’ll ask arnetheduck when nlvm is an official Nim backend ;)
21:41:20Araqwell we already use intrisics in Nim
21:41:27Araqor have libraries that use these.
21:41:45Araqthese require 3 implementations tough, for Visual C++, LLVM and GCC
21:42:56*NimBot joined #nim
21:42:59FromGitter<Vindaar> @kaushalmodi Yes. What I find weird is that the `emacs_module.h` doesn't even exist anymore in the current emacs source code. There's `emacs_module.c` and a really bare bones `emacs_module.h.in` (what's a .h.in?) instead.
21:43:35Araqit's the template file for the emacs_module.h
21:43:52Araqrun autoconf/.configure to produce it
21:43:58FromGitter<Vindaar> ooohhh
21:45:25FromGitter<kaushalmodi> @Vindaar I have linked the emacs_module.h in that issue.
21:45:41FromGitter<kaushalmodi> In Emacs source, it's in src/. Dir.
21:47:03Araqthis configure setup allows Emacs to be compiled on a vax which is nice if you have too much free space in your house: https://en.wikipedia.org/wiki/VAX#/media/File:Robotron_K1840_2.jpg
21:47:08nasusiroso far I like this channel, because it has a very positive vibe...nice!
21:47:47FromGitter<Vindaar> hmpf, can't try it right now, because I'm missing some dependencies for emacs. ⏎ @kaushalmodi yep, saw that. was confused when I saw your gist is called `emacs_module.c` though :P
21:47:58FromGitter<mratsim> Just be aware that “transpiler” is a reason for getting banned ;)
21:48:13elroodi'm not banned. yet :P
21:49:01elroodand that's just an implementation detail anyway
21:49:16FromGitter<kaushalmodi> @Vindaar Sorry, typo
21:49:23nasusirolet's call it "The Optimus Prime procedure"
21:49:31FromGitter<Vindaar> Araq, haha, although that pic isn't loading for me right now :D
21:50:27FromGitter<mratsim> @nasusiro I think you are mixing transpiler with pile bunker
21:50:38FromGitter<Vindaar> @kaushalmodi yep, since my internet is so spotty right now, I just wanted to check the file from the emacs source, instead of hoping that my question reaches you :D
21:51:09nasusiromratsim: well, those who don't like hearing or reading the transpiler name, they could use code transformation
21:51:22nasusirothus, OPP for short
21:51:52FromGitter<mratsim> oh, I see, Pile bunkers are these: http://tvtropes.org/pmwiki/pmwiki.php/Main/PileBunker
21:54:07nasusiromratsim: that's how a C++ chaotic bug looks like behind the metaprogramming template scene looks like lol
21:54:23nasusirobummer...I mistype the same thing twice
21:55:52*PMunch quit (Quit: leaving)
21:59:15dom96I'm considering getting NimBot to secretly keep a list of people that say "transpiler", and just refuse to eval code for them randomly if their score is too low :P
22:00:20dom96mratsim: btw, AFAIK first versions of Nim were in Pascal not Delphi
22:01:03FromGitter<mratsim> ah? I’m pretty sure i was corrected for saying pascal in the past :/
22:01:34Araqthere is no meaningful distinction, I used the subset of Delph that I knew would translate to Nim
22:01:38FromGitter<mratsim> instead of refusing to eval just say “Did you know, Nim is not a transpiler but a compiler"
22:01:49FromGitter<mratsim> or “pro tip"
22:02:02Araqlater moved from Delphi to FPC
22:02:37Araqit's not like C vs C++, everybody made the switch from Pascal to Delphi
22:02:47dom96mratsim: Yeah, I'm kidding. I may do that.
22:03:00Araqok, apparently some company used "Extended Pascal" and is now rewriting their codebase in D
22:03:04*Araq shrugs
22:03:36Araqbut everybody else used the Borland dialect
22:04:52dom96Nim is a clear choice here and that's why I care.
22:05:39dom96It seems the author never heard of Nim, or did and had some other bias that prevented them from even mentioning Nim (which is the equivalent of killing kittens in my book).
22:05:56Araqyou mean with its pas2nim tool?
22:06:14dom96Yes, and it's similarity to Pascal
22:06:14Araqnah, better use D instead lol
22:06:18elroodchoice also depends on community size, backing, maturity etc., it's obviously not only a question of language similarity
22:06:46dom96Does the author mention any of those as the reasoning for their choice?
22:07:05dom96I'll be honest and say that I skimmed the post, but I doubt it
22:07:21Araqelrood, true but then Rust or Go or Java or ... would all have been better
22:07:27elroodno idea, would of course be interesting and insightful to see their reasoning and response to your question
22:07:28dom96And if those were factors at play they could have easily mentioned Nim and said "Well, D has a larger community"
22:08:07elroodwe'll see what they respond with
22:08:14*find0x90 joined #nim
22:08:45dom96"Oh, I didn't know about Nim. Thanks! I'll check it out!"
22:08:52dom96Never to be heard from again.
22:09:27dom96That's my bet, but I'd love to be wrong
22:10:42AraqI dunno, I guess I'm already satisfied not everybody ends up using Go or JavaScript
22:10:52nasusiroso if Nim is not a transpiler, isn't it a source-to-source compiler which is the same thing?
22:10:59elroodouch
22:11:05elroodthin ice, nasusiro ;)
22:11:39nasusiroelrood: that was a genuine question, seriously
22:11:53dom96Isn't ASM source too?
22:12:01dom96Does that make gcc a source-to-source compiler?
22:12:05*Bevo_ quit (Ping timeout: 260 seconds)
22:12:13elroodnasusiro, i know, it's just turned into some sort of a running gag in this channel, don't mind the silliness, ask away
22:12:43dom96We need a good meme template for this
22:12:50nasusirodom96: personally, I haven't seen a compiler that emits assembly, unless I explicitly ask it to do so
22:12:52dom96Perhaps I should create a competition for this
22:13:12Araqnasusiro, that is what GCC does (or at least did for a couple of decades)
22:13:12nasusirodom96: forget about memes. they are going to be prohibited in EU now :/
22:13:39dom96nasusiro: Assembly is just a textual representation of machine code
22:13:44elrooddom96, nim has had quite a bit of exposure in the last years, pretty sure the hackernewsers will have a more profound reason to have ruled it out than just not having heard of it. and their reasons should be valuable to decide what to improve and focus on in nim's development in the nearer future
22:14:19dom96yeah. Btw guys, please give feedback here: https://forum.nim-lang.org/t/3930
22:14:26dom96This means you Araq ;)
22:14:50nasusirodom96: why not follow the Golang method then? they emulate every platform via code and they generate machine code based on that
22:14:51Araqelrood, HN knows Nim but the poster of the article might not have known it
22:16:06Araqyeah, why not do it like Go... because we don't have the resources and even if we had, focussing on the frontend is the better idea
22:16:13dom96indeed
22:16:26dom96Compiling to C is awesome
22:16:47Araqbtw, why doesn't Go follow C# then? Hire a type theorist and get generics right, how hard can it be...
22:16:54elroodAraq, i bet they have considered it. quite probable they missed the relation to and migration path from pascal though
22:17:21Araqelrood, the author wasn't aware that Go/Rust have closures...
22:17:22dom96elrood: yeah, that's likely as well
22:17:33FromGitter<mratsim> but Araq, Go should be easy for young new dev fresh out of university to pick up. Generics are too hard.
22:17:56dom96Like some people on HN/Reddit said: it seems the author found D, liked it, and then wrote a blog post to say why it was chosen for his company's project
22:18:30dom96mratsim: I know, right? Not like we have high school students writing Nim code every day...
22:18:31FromGitter<mratsim> He seems to have been quite involved with the D community, he mentions 2017 for I don’t remember what in his blog.
22:18:43nasusirodom96: you read the Pascal to D article that was too biased towards author's D use?
22:19:50dom96hrm?
22:19:50FromGitter<mratsim> it’s fine if he is biased, the main issue is that Nim is an obvious choice given his codebase in Pascal and his goal of expressivity and ergonomics for non-software engineers
22:20:00nasusirodom96: btw, what C is used during compilation? C89, C99, or C11?
22:20:12dom96C99 IIRC
22:20:17dom96or maybe even C89
22:20:20Araqno, C89
22:20:36Araqor rather "the C that MS can compile"
22:21:32FromGitter<mratsim> He considered Go, Ada and D for his final 3 >_>, coming from Pascal
22:21:42nasusirodom96: those who are on Windows, do they depend on VC++ compiler or on MinGW?
22:21:52Araqthe standards are mostly like the HTML standards, sure there are some documents lying around somewhere but only 3 implementations survived
22:21:56FromGitter<mratsim> MinGW but VCC works too
22:21:58dom96nasusiro: Either
22:22:17FromGitter<mratsim> well at least the CI is setup with MinGW
22:22:29Araq(for browers the number is higher)
22:22:33nasusiroso, the best thing would be to use GNU89 for UNIX/MinGW and VC++ on Windows for compatibility purposes
22:22:46Araqnah
22:23:04FromGitter<mratsim> Nim works with tcc if you want ;)
22:23:23nasusirohow can I test it
22:23:26FromGitter<mratsim> I even compile Nim with Nvidia nvcc, it works fine.
22:23:26nasusiroI have tcc installed
22:24:14FromGitter<mratsim> nim c cc=tcc works?
22:24:29dom96--cc:tcc
22:24:36FromGitter<mratsim> ah thank you
22:25:07*find0x90 quit (Quit: find0x90)
22:25:33nasusirono kidding!
22:25:36nasusirolet me try this :D
22:25:41FromGitter<mratsim> https://nim-lang.org/docs/backends.html Why is the author “Puppet Master”?
22:26:51nasusiroquestion: since < is deprecated, what should I use in its place?
22:27:12FromGitter<mratsim> @nasusiro, you can find the different compiler configs here: https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg. You can customize it per project/directory
22:27:42nasusirodom96: before when I asked whether you read the Pascal to D article, here it is in case you are interested https://dlang.org/blog/2018/06/20/how-an-engineering-company-chose-to-migrate-to-d/
22:28:04elroodcould someone please complain that --cc: isn't listed in nim's command line options output?
22:28:19nasusiromratsim: so I add this nim.cfg for each project and just run nim?
22:28:23nasusirohow does it work?
22:28:34FromGitter<mratsim> no it’s added by default
22:28:46*Jesin quit (Quit: Leaving)
22:29:21FromGitter<mratsim> but if you want a new compiler config, it’s explained here: https://nim-lang.org/docs/nimc.html
22:29:50FromGitter<mratsim> for example this is mine for Cuda support: https://github.com/mratsim/Arraymancer/blob/master/nim.cfg
22:30:26Araqelrood, ouch, that must have been missing for years, there is only 'cc' but no '--cc' documented
22:30:33FromGitter<mratsim> and another example for nintendo switch: https://forum.nim-lang.org/t/3939
22:30:35nasusirooh man, Nim has so many cool things
22:32:59*Jesin joined #nim
22:38:26nasusirohow to clean a generated binary file? just delete it or is there a command that cleans a nim project as a whole for me?
22:41:46Araqjust delete it
22:45:44*elrood quit (Quit: Leaving)
22:46:24nasusirothis is what I did
22:46:42nasusirodom96, are you the original creator of Nim or one of the core developers?
22:49:21dom96the latter
22:49:32dom96Araq is the creator
22:51:36nasusirooh man, I'm surrounded by giants LOL!
22:53:24nasusiroI was wondering: why have you retain -v for --version and not -V? with -v you could enable --verbosity to 3 by default
22:53:35nasusirounless you wanted a different level with --verbosity
22:54:08nasusiroat least, that's the most common flag within compiler / programming languages I have tested so far
22:58:06dom96We have bigger fish to fry than "What should `-v` mean?"
22:59:28nasusirocan you rephrase to a simple English idiom so I can understand you better? English is not my native language, my apologies.
22:59:34nasusiro*simpler
23:01:29nasusirohmmm...basically --listCmd does what I would expect from -v (what I personally consider --verbose)
23:03:25nasusirooooh you meant you have bigger things to worry about; my bad.
23:03:38dom96yep
23:03:53FromGitter<fedkanaut> @xomachine Looks like that may be what I'm looking for, cheers!
23:14:27nasusiroanyway folks, I'm off. keep up the good work.
23:14:30*nasusiro quit (Quit: Quitting for now...)
23:19:19*BitPuffin quit (Remote host closed the connection)
23:23:02*zahary joined #nim
23:26:00*gsingh93_ joined #nim
23:27:16*rayman22201 quit (Quit: -a- IRC for Android 2.1.40)
23:31:29*zahary quit (Quit: Leaving.)
23:48:10*jdhorwitz joined #nim
23:51:41*jdhorwitz quit (Client Quit)
23:52:58*jdhorwitz joined #nim
23:55:36*jdhorwitz quit (Client Quit)