<< 27-03-2018 >>

00:00:08FromGitter<cavariux> I agree with the idea of lockfiles
00:00:10*tmm1_ joined #nim
00:02:21*tmm1 quit (Ping timeout: 265 seconds)
00:05:14*tmm1 joined #nim
00:05:21*tmm1_ quit (Ping timeout: 240 seconds)
00:06:10kinkinkijkinI can't find anything on this, how do I import a neighbouring .nim ?
00:06:21*aguspiza quit (Ping timeout: 240 seconds)
00:08:04FromGitter<cavariux> import <path without .nim>
00:08:16FromGitter<cavariux> be sure to export the proc/var with * like proc name*() =
00:10:47kinkinkijkinthat is, if I want to be able to use it in the importing file?
00:14:06FromGitter<zacharycarter> include file.nim
00:14:31FromGitter<zacharycarter> I don't know what you're trying to do - import is different from include
00:14:47kinkinkijkinI meant import in a different way sorry
00:14:56kinkinkijkinI meant "how do I use procs in another .nim"
00:15:27FromGitter<zacharycarter> what @cavariux said
00:15:44FromGitter<zacharycarter> expose them with `*` and `import ./module.nim`
00:16:07FromGitter<zacharycarter> you might not even need the .nim extensnion
00:16:39*dgwana quit (Quit: Leaving)
00:20:41FromGitter<cavariux> Hi @zacharycarter , I was going to ask you what do you think about
00:20:42FromGitter<cavariux> https://github.com/cavariux/nimgl/blob/master/src/nimgl/opengl.nim
00:21:02FromGitter<cavariux> I have 90% opengl support, still some extensions and fix some bugs with the autogenerator
00:23:47kinkinkijkinhaving a weird issue
00:24:19kinkinkijkinin the line " if timeFloat < atk:", the compiler is saying it's expecting : where < is
00:24:27kinkinkijkintimeFloat is a float
00:24:41kinkinkijkinintialization is var timeFloat: float = time.float
00:25:20FromGitter<cavariux> and atk is also a float?
00:25:27FromGitter<cavariux> what other code do you have above?
00:25:58kinkinkijkinproc GenAHD(atk: float, hld: float, dcy:float, time:int): float =
00:26:08kinkinkijkinis the only thing above the var statement for timeFloat
00:26:13kinkinkijkinfor this proc
00:27:29FromGitter<cavariux> could you share a snippet of your code in pastebin or something similar to have a better look?
00:27:38kinkinkijkinsure
00:28:56kinkinkijkinhttps://dpaste.de/YmmR here is the whole thing (the problem bit is at 84, 16)
00:30:27FromGitter<cavariux> you don't have to call return at the end of the proc if you are using result btw (not the issue a side note)
00:30:40kinkinkijkinI know
00:30:44kinkinkijkinit's part of my code styling
00:31:08kinkinkijkinexplicitly returning tells the uninformed reader that returning is being done
00:33:42FromGitter<cavariux> I think you used instead of a space a unicode character because I rewrote the code the same as it was and it works, but if I copy paste there's an error
00:33:47FromGitter<cavariux> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ab9916b35dd17022ea319ab]
00:34:03kinkinkijkinhmm
00:34:07kinkinkijkinI'll try again
00:34:39kinkinkijkinthat was it
00:34:39FromGitter<cavariux> sure, because I don't see anything wrong
00:34:39kinkinkijkinthanks
00:37:40FromGitter<cavariux> great haha, one of those errors that are pretty weird
00:39:45kinkinkijkinis there a way to check if the executable is being compiled with thread support?
00:42:16FromGitter<cavariux> The pragma thread
00:42:20FromGitter<cavariux> {.thread.}
00:42:48kinkinkijkinidk how to use that for what I want
00:43:15kinkinkijkinI want to perform a certain set of actions if thread support is on, and a different set if it is off
00:48:11FromGitter<cavariux> Oh, I have no clue then sry
01:05:35FromGitter<zacharycarter> @cavariux - I'll have a look in a bit
01:07:46FromGitter<zacharycarter> kinkinkijkin: !eval compileOption("threads")
01:07:56FromGitter<zacharycarter> !eval compileOption("threads")
01:07:58NimBotCompile failed: in.nim(1, 14) Error: expression 'compileOption("threads")' is of type 'bool' and has to be discarded
01:08:06FromGitter<zacharycarter> !eval echo compileOption("threads")
01:08:08NimBotfalse
01:24:29*find0x90 quit (Quit: find0x90)
01:32:02*dddddd quit (Read error: Connection reset by peer)
02:26:06*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:46:35*yglukhov joined #nim
02:48:31*Lord_Nightmare quit (Ping timeout: 268 seconds)
02:51:05*yglukhov quit (Ping timeout: 240 seconds)
02:53:53*Lord_Nightmare joined #nim
02:57:57*r2 quit (Ping timeout: 264 seconds)
03:13:13*BitPuffin joined #nim
03:25:14*endragor joined #nim
03:26:15*tiocavera joined #nim
03:26:15*rockcavera is now known as Guest64747
03:26:15*Guest64747 quit (Killed (livingstone.freenode.net (Nickname regained by services)))
03:26:16*tiocavera is now known as rockcavera
04:06:46*krux02 quit (Remote host closed the connection)
04:26:08*cspar_ quit (Ping timeout: 276 seconds)
04:58:12*Elronnd is now known as we
04:58:39*we is now known as Elronnd
05:15:08*r3d9u11 joined #nim
05:26:33*rockcavera quit (Remote host closed the connection)
05:28:50*rockcavera joined #nim
06:02:03*SenasOzys quit (Read error: Connection reset by peer)
06:06:06*r3d9u11 quit (Remote host closed the connection)
06:15:40*nsf joined #nim
06:55:36*rokups joined #nim
07:09:47*yglukhov joined #nim
07:20:25*PMunch joined #nim
07:21:39*gokr joined #nim
07:23:23*Vladar joined #nim
07:27:16*user1101 joined #nim
07:48:08*dddddd joined #nim
07:52:31*gokr left #nim (#nim)
07:57:49*timotheecour quit (Ping timeout: 260 seconds)
07:57:58*pwntus_ quit (Ping timeout: 264 seconds)
08:00:48Araqcan I add ``--define:ssl`` to Nim's standard config? it's 2018, everything is HTTPS
08:09:15ZevvYes, please
08:09:20*floppydh joined #nim
08:09:22Zevvfor what my vote is worth
08:12:47FromGitter<Vindaar> Yup, I agree
08:29:37PMunchI'm good with that, just make it possible to disable it in the few scenarios were you don't want it
08:30:22PMunchHmm, I get "SIGSEGV: Illegal storage access. (Attempt to read from nil?)" when trying to read a field from a type with a case of when it's the wrong time. This is at compile time. I remember this having a better error message before, but is that only on runtime?
08:33:00*r3d9u11 joined #nim
08:33:37*jaco60 joined #nim
08:39:21*r3d9u11 quit (Ping timeout: 265 seconds)
08:42:51euantoryes, definitely agree to SSL by default!
08:44:59AraqPMunch, case object branch transitions are with a loophole, check the issue tracker
08:45:29PMunchWell they're not transitioning
08:45:48PMunchI just copied some code from one place to another and it was trying to access a field that wasn't there
08:46:33PMunchBy the way, did anything happen to the proposal of letting the different branches share type names?
08:51:15*r3d9u11 joined #nim
08:51:28AraqI like my proposal best but it's not planned for v1.
08:55:43FromGitter<phrmoy> Howdy, just learned about Nim. And I am just kinda angry it took me this long..
08:56:05FromGitter<Vindaar> Hey there! Better late than never :)
08:56:14FromGitter<phrmoy> Amen.
08:57:07FromGitter<yglukhov> @Araq, how about `--threads:on` as well? ;)
08:57:08euantorWelcome :)
08:57:33FromGitter<phrmoy> Thank you, looking forward to being part of this community!
08:57:50FromGitter<phrmoy> Hate to drop in and ask this, but do we expect Nim v1.0 before 2019?
09:01:53FromGitter<narimiran> hey @phrmoy, i recognize your name from julia gitter :)
09:02:37FromGitter<narimiran> there's one rule of nim gitter - WE. DON'T. ASK. ABOUT. v1.0 :D :D :D
09:03:07FromGitter<phrmoy> Yes, ive been flooding there ^^
09:03:10FromGitter<narimiran> everytime somebody asks that question, v1.0 is postponed for another month :D
09:03:23FromGitter<phrmoy> Oh no, sorry for what I have just done =P
09:03:37Araqah that is a good explanation
09:04:33FromGitter<phrmoy> I have been porting my trading algo from Python to Julia, and now will start experimenting with Nim for the project as well.
09:05:21FromGitter<narimiran> i've done some simple comparison between python (+ numpy + numba), julia and nim. nim was the fastest
09:05:58FromGitter<narimiran> i plan to do some more "benchmarks" and write about it, but have no idea when that might be published, lots of other stuff for me to do....
09:06:53FromGitter<phrmoy> I am eager to see Nim in action (literally)! 😄
09:09:36FromGitter<narimiran> if you're coming from python, it will take couple of weeks to get used to some stuff in nim ("why can't i do X like in python?", "oh, there's another way to do Y"), but after that - nim will feel natural :)
09:10:16FromGitter<mratsim> oh another finance + math guy :P
09:16:22FromGitter<mratsim> Be sure to check the mpdecimal wrapper I just release last week if you want arbitrary precision floating point numbers: https://github.com/status-im/nim-decimal I still have to add a high level API on top of it (`+`, `-` …) and also a currency package but it’s already a good start
09:16:46FromGitter<Varriount> @narimiran ^
09:18:45FromGitter<mratsim> oh @miran, bluenote added a basic tensor plotting tool to Arraymancer: https://github.com/mratsim/Arraymancer/pull/206 (it’s in python though)
09:19:02FromGitter<Varriount> @mratsim I assume you aren't using GMP because of its license?
09:19:14FromGitter<mratsim> Yes, we can’t use GPL on App Store
09:19:20FromGitter<narimiran> @Varriount why tagging me, what am i missing?
09:19:51FromGitter<mratsim> and GMP is not a decimal library. You need to use MPFR actually (which is build on top of it)
09:20:55FromGitter<Varriount> @narimiran Woops, I meant to tag @phrmoy
09:21:00FromGitter<mratsim> decimal library should be in radix 10 instead of radix 2, because we and the whole currency exchange world work in radix 10. This avoids rounding stuff like 0.1
09:21:27FromGitter<narimiran> @mratsim both plotting and .csv export are great additions!! bravo @bluenote10 !
09:22:33FromGitter<phrmoy> Excuse me, what is GMP?
09:22:48FromGitter<mratsim> Gnu Multi Precision library
09:22:59FromGitter<mratsim> for arbitrary precision arithmetics
09:25:09FromGitter<phrmoy> thank you
09:26:38FromGitter<Varriount> @mratsim What would you recommend for arbitrary precision integers?
09:26:40FromGitter<phrmoy> and thanks for sharing about ur package!
09:27:25FromGitter<phrmoy> licensing wouldnt be an issue for me per se at the moment, but it's good to keep in mind
09:27:26FromGitter<mratsim> @Varriount for now ttmath, that’s what we’re using at Status: https://github.com/status-im/nim-ttmath it’s arbitrary but fixed (like Uint256)
09:28:03FromGitter<mratsim> I’m working hard into bringing a pure Nim library in usable state: https://github.com/status-im/mpint
09:28:10FromGitter<mratsim> ttmath requires C++ compilation
09:28:27FromGitter<Varriount> Hm
09:29:16FromGitter<Varriount> @mratsim
09:29:45FromGitter<mratsim> yes?
09:30:19FromGitter<Varriount> Gah, sorry, gitter app posts the contents of my type box when I trap outside the keyboard.
09:30:28FromGitter<mratsim> trap? :P
09:30:35FromGitter<Varriount> *tap
09:30:39FromGitter<mratsim> do you have a mouse on your keyboard :P
09:30:48FromGitter<mratsim> (the living kind)
09:31:04FromGitter<Varriount> I'm on my phone (android)
09:31:49FromGitter<mratsim> Gitter doesn’t work on my phone anymore since I updated to 7.1 …
09:32:05FromGitter<Varriount> When I tap a link in the message window, the contents of the chat box is automatically posted for some reason.
09:33:28FromGitter<Varriount> @mratsim Neat, libmpdec is also used by Python 3.3+
09:36:57*SenasOzys joined #nim
09:42:19PMunchAraq, what was your proposal?
09:47:10Araqit's in the issue
09:48:18Yardanicomratsim: strange, it always worked for me
09:48:29YardanicoVarriount: official Gitter client for mobile is honestly garbage
09:49:44FromGitter<Varriount> What's the alternative?
09:51:27*NimBot joined #nim
09:53:00YardanicoVarriount: the only decent alternative is probably https://github.com/apiko-dev/GitterMobile , but it's not in active development
09:54:53*Arrrr joined #nim
09:54:59*Arrrr quit (Changing host)
09:54:59*Arrrr joined #nim
09:55:27PMunchAraq, I kinda like your approach even though some people seemed to really hate it :P But for consistence it would then also make sense to allow the same in regular case statements (although their return value would be very hard to reason about).
09:55:37FromGitter<Varriount> Yardanico: You were talking about https://github.com/nim-lang/Nim/issues/3629 ?
09:56:18AraqPMunch, or we allow 'if' in objects
09:56:42Araqand then we have the consistency back
09:57:11YardanicoVarriount: when? If you mean in the issue itself - I just gave my "+1", nothing more :)
09:57:39PMunchWell case is the better construct for all the cases where this wouldn't be used
09:57:46Yardanicoand if you mean about case expressions - it's now possible to use case statements where "discard" exits the program or throws an error
09:57:49PMunchCould you mix then?
09:58:34PMunchHave a "if kind in {FirstKind, SecondKind}: sharedField: string" and then have a case statement that differentiates all the other cases below?
09:59:51Araqunlikely :-)
10:00:45PMunchUgh, that would be ugly then. Those long if elif chains :s
10:01:15FromGitter<Varriount> I'd rather
10:01:43PMunchHow about nested cases on the same type?
10:01:50FromGitter<Varriount> I'd rather go with the obvious choice - duplicate fields in `of` blocks
10:02:08FromGitter<Varriount> That's what people first try to do.
10:03:21PMunchhttp://ix.io/13k3/
10:03:25PMunchLike that
10:04:01YardanicoPMunch, so it won't be possible to have shared field for some of kinds, not for all of them?
10:04:23PMunchHuh, yes it would?
10:04:39PMunchIn my example first and second field share the "sharedField" field
10:04:53PMunchThen thirdField only has the exclusiveField
10:05:06PMunchMan I should have named the enum types differently :P
10:05:16YardanicoPMunch, ah sorry, didn't see it because indentation is very small :)
10:05:20PMunchAnd first and second also have their exclusize fields
10:05:58PMunchVarriount, not sure why people would try that first since it doesn't work anywhere else..
10:06:24PMunchWould be cool to have though for all case statements, but would probably just be a mess
10:06:42FromGitter<mratsim> ah that’s one of the reason I don’t use object variants, coming up with names is already hard. It forces us to create even more even though they are the same :P
10:11:14FromGitter<Varriount> PMunch: That's what I see most newcomers first try, when they run into this problem.
10:12:19PMunchWeird..
10:12:36PMunchI mean it's a cool syntax
10:12:49PMunchBut that it's inconsistent with regular case statements is a bit odd
10:12:57*sleepyqt joined #nim
10:13:29PMunchSo either regular case statements should behave the same, or this should be solved in another way IMO
10:16:02*xkapastel quit (Quit: Connection closed for inactivity)
10:17:02FromGitter<Varriount> PMunch: Huh? I don't see how it's that far fetched.
10:17:40dom96What's the problem with Varriount's suggestion?
10:17:50FromGitter<Varriount> case kind: SomeKind:
10:18:20FromGitter<Varriount> of A: fieldOne, fieldTwo: int
10:18:42FromGitter<Varriount> of B: fieldTwo, fieldThree: int
10:19:10PMunchOh right
10:19:17PMunchI misunderstood what you meant
10:19:25PMunchYeah that is indeed the most obvious solution
10:19:45FromGitter<Varriount> That's what people usually try first.
10:19:50PMunchYeah
10:19:55Araqit's not obvious at all.
10:20:19Araqecho x.fieldTwo # what does it imply? x.kind in {A, B}
10:20:27Araqso say that in the object declaration.
10:20:44YardanicoAraq, honestly when I was new to the language I firstly tried Varriount's example :P
10:21:42FromGitter<Varriount> I tried that method too, at first.
10:22:13Araqit is not obvious, no matter how many people tried it.
10:22:27Araqare there two fields with happen to have the same name or not?
10:22:34Araq*which
10:22:38PMunchYeah, it does help not introduce bugs if you managed to name a field the same that shouldn't be named the same
10:23:03Araqnote that some proposals want to re-use the name, but not the type
10:23:08FromGitter<Varriount> As long as the "shared" field has the same type across cases, type inference should still be possible.
10:23:27Araqcase k
10:23:33Araqof kInt: val: int
10:23:38Araqof kFloat: val: float
10:23:44Araqof kString: val: string
10:23:51FromGitter<mratsim> different type should be an error
10:23:53Araqalso was requested
10:23:59Araqand also is "obvious".
10:24:18FromGitter<Varriount> But it is also much more complex to implement.
10:24:57Araqit's not about implementation complexity, duplicating the field name is bad syntax.
10:25:02Araqit really is.
10:25:15FromGitter<mratsim> can’t we just generate different sym names in C anyway?
10:25:40FromGitter<mratsim> like it’s done for shadowed variables
10:25:42Araqmratsim: we can do that easily but it's not the point.
10:25:48Araqit is bad design.
10:26:26Araqand I have just explained why.
10:26:29FromGitter<mratsim> I don’t know at all about the implication, just that at the very least, there should be an educating tutorial on that (why we don’t do it, and what the alternative)
10:27:30FromGitter<mratsim> Maybe having VTables would provide an alternative ;)
10:28:21FromGitter<Varriount> Araq: I also like your proposal.
10:29:45FromGitter<mratsim> I like it too, isn’t it the same as kirby’s except on a single line?
10:30:16FromGitter<Varriount> Though the thought of yet another special case in a language construct makes me nervous.
10:30:38FromGitter<mratsim> You can already use when in objects ...
10:30:43Araqfield name duplication would be a special case too.
10:31:05FromGitter<Varriount> Howzo
10:31:13FromGitter<mratsim> https://github.com/status-im/mpint/blob/2b47647019408b6642250cc6b542a9045031588b/src/private/uint_type.nim#L60-L64
10:31:28Araqit's nowhere else in Nim, aka a "special case".
10:31:29*r3d9u11 quit (Remote host closed the connection)
10:31:36FromGitter<mratsim> I could add special fields with when as well.
10:31:37FromGitter<Varriount> *Howso? Field declaration only occurs in type blocks
10:31:58Araqtuple[a, a: int] is invalid.
10:33:04Araqfor consistency we can allow it and it means "merge these fields" but we don't and so field name duplication for case objects is a special case.
10:33:37dom96Anyone have a link handy to the related issue on GH you guys are discussing
10:33:38dom96?
10:34:23FromGitter<Varriount> https://github.com/nim-lang/Nim/issues/3629#comment-173529871
10:34:32*vlad1777d joined #nim
10:34:50FromGitter<Varriount> @Araq ^ That's your proposal, right?
10:35:08dom96This seems to be the correct link: https://github.com/nim-lang/Nim/issues/3629#issuecomment-173529871
10:35:16dom96I guess you're on mobile
10:35:58dom96So if you implement this solution, will you let us do the same outside an object variant context? :)
10:37:36dom96FWIW if we aren't going to support the same field names with different types, then Araq's solution makes more sense
10:37:54dom96The other one implies that it is possible to specify a different type, and we'll have people complaining about that immediately
10:40:32FromGitter<survivorm> And another brick into that wall - wouldn't it be handy to share the same syntax with regular case, not making it object variant only?
10:41:28FromGitter<survivorm> What are the downsides of that solution for the regular case?
10:42:35Araqfield name duplication also means we lose the ability to enforce object case branches and only require unique names per branch.
10:42:44Araqas done in ML, Haskell, Rust ...
10:43:32FromGitter<survivorm> @Araq is this unrelated to my question?
10:44:09Araqand since all these languages do not have the "object case transition" problems it's fair to say Nim should follow them.
10:44:27Araqsurvivorm: I don't understand your question.
10:46:29FromGitter<survivorm> @Araq You said your proposal should be applied for case in object varian syntax only. Why? Why not set it case syntax in general, not only object variant's?
10:47:03AraqI'm not sure what it would mean.
10:47:40Araqturns the case into a series of 'if's, not 'elif's?
10:49:19FromGitter<mratsim> the “case” statement/expr in the general case is exhaustive, that wouldn’t work if you could have of {Foo1, Foo2}: stuff() of Foo1: stuff2()
10:49:44FromGitter<mratsim> 2 branches would match Foo1
10:51:03FromGitter<mratsim> but to be honest, I think if/case is one of Nim weak points compared to pattern matching in ML/Haskell. The Rust `match` also is a better I think (but not as nice as in FP lang)
11:00:04dom96Yes, Haskell is a good model for this, but at the same time Nim wasn't designed as an ML language
11:00:31dom96Implementing ML-like pattern matching now will really make Nim feel like a bit of a frankenstein :)
11:01:09Araqmaybe but let's not close doors by introducing duplicated field names :P
11:01:35Araqor by overlapping object fields for that matter.
11:02:29*Snircle joined #nim
11:05:53*aguspiza joined #nim
11:11:59FromGitter<survivorm> And what's the end opinion? I think almost all say yes to @Araq 's suggestion on the object variant's case. What about making it general, not specific to object variants?
11:13:15Araqmy end opinion is to do nothing until v1 is out and the case branch transition problems are settled.
11:14:04*riidom quit (Remote host closed the connection)
11:15:47FromGitter<survivorm> :)
11:16:43FromGitter<survivorm> Sitting by the river awaiting you'll eventually have your enemie's corpse float by :)
11:17:06FromGitter<mratsim> @dom96, This boat has sailed, Nim is already a Frankenstein. Introducing move and borrow checker + 4 kinds of GCs + VTables + Lisp-like metaprogramming + low level pragma (OpenMP, codegendecl) already settled that
11:17:39Araqmy Nim has no VTables
11:17:42FromGitter<mratsim> oh, did I mentionned compiling to Javascript? :P
11:17:56Araqcompiler targets do not count.
11:18:12FromGitter<mratsim> I would reply “your manual would disagree” but you took that down :/
11:18:19Araqotherwise C would be super mega frankenstein because it supports every CPU under the sun
11:18:44FromGitter<mratsim> I don’t have any issue with Frankenstein, he’s just misunderstood :P
11:19:05dom96lol
11:19:24FromGitter<zacharycarter> question - I'm working on this cross platform file notification lib, and I'm using kqueues for osx
11:19:28Araqand my borrow checker went by unnoticed :P
11:20:01Zevvdom96: are there any specific patterns to mix threads and async in Nim, or is this a typical "just don't do that" area?
11:20:19FromGitter<zacharycarter> I ran across - https://github.com/nim-lang/Nim/blob/master/lib/pure/selectors.nim - not sure what this module is for... is it basically doing what I'm trying to do already?
11:21:29dom96Zevv: There are genuine reasons for it. But I think it's something that can easily be used because people want an easy solution which is invalid.
11:22:06dom96If you're using QML with async then you shouldn't need a separate thread. Perhaps QML is an odd UI framework, but most of them provide some way to hook into their event loop
11:22:42dom96Genuine reasons for async with threads is to take advantage of multiple CPU cores
11:23:07ZevvI'm asking for the getaddrinfo() case I ran into. I'm now fiddling with a local solution but I end up with a loop doing a async sleep and channel poll until the results are in
11:23:22ZevvMy obvious solution would be to put a pipe between the thread and the event loop
11:23:46Zevvbut that's a bit of a hassle because of the complex structured data going over the pipe
11:24:09Zevvor a pipe and a channel, but it's all the same mess you run into when mixing threads and async I/O
11:24:58dom96Yes, so 'FlowVar' should be compatible with async
11:25:03dom96This is something that's on the roadmap
11:25:11dom96The ability to 'await' a FlowVar
11:25:11FromGitter<alehander42> the "shared field" syntax is not bad, but then you can miss a field while reading the case definition
11:25:33FromGitter<alehander42> still, whatever is needed to be able to have field: T in several branches is great
11:25:55dom96I still can't remember how Araq was intending to implement this. Maybe Araq can point you in the right direction and you can create a PR
11:27:03FromGitter<alehander42> @mratsim I think pattern matching can be very useful for the variant objects, but I think macro-based libs can deliver that(I think patty seems not far away)
11:28:36*riidom joined #nim
11:29:32FromGitter<alehander42> hm, nested pattern matching is "todo", but if it gets impl, it would be very pleasant
11:30:47FromGitter<mratsim> I’d rather have pattern matching in “sugar.nim” ;)
11:31:19FromGitter<zacharycarter> here's my osx file monitor code so far using kqueues - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aba2b87e4ff28713a7b52ce]
11:31:43Araqdom96, I don't really know either. make it inherit from Future[T] and set the callback to ... something
11:31:48FromGitter<zacharycarter> it works (kind of) - events are raised but the events don't seem to be correct
11:32:27dom96Araq: Last time we discussed it you didn't know either, and then 2 minutes later you remembered something :)
11:33:22dom96zacharycarter: nice, but that 'spy' name makes me anxious :)
11:33:40FromGitter<zacharycarter> :P
11:34:42FromGitter<alehander42> @mratsim well, one can add some patty's matching dsl to sugar.nim if it becomes useful enough
11:39:15euantorRegarding the `getaddrinfo()` issue, what are the current thoughts - better to write a simpel DNS client in Nim, or use `DnsQueryEx` on Windows and something else on other platforms?
11:40:06euantorI was considering looking at doing name resolution async a while back, but never got a chance to look at it too much
11:40:13Araqthe OS specific stuff tends to be better
11:40:22*jaco60 quit (Quit: Textual IRC Client: www.textualapp.com)
11:41:01*nsf quit (Quit: WeeChat 2.0.1)
11:41:08euantorLinux has `getaddrinfo_a()`: http://man7.org/linux/man-pages/man3/getaddrinfo_a.3.html
11:41:34*Arrrr quit (Read error: Connection reset by peer)
11:42:14FromGitter<zacharycarter> nevermind the kqueue code is working :/ I'm so stupid in the mornings sometimes
11:42:26FromGitter<zacharycarter> and at night I guess too - since I was working on this last night lol
11:42:53FromGitter<zacharycarter> I need to remember that when files are moved to the trash on osx, it isn't really a delete operation lol
11:43:45euantorAnd OpenBSD seems to have some stuff using `asr_run()`: https://man.openbsd.org/asr_run.3
11:43:55euantorI'm going to add these to the issue
11:46:40Araqdifferent topic, what about 'implicit' parameters.
11:46:51dom96what are those?
11:47:16AraqI just invented them but I've probably seen similar things in Lisp.
11:47:27Zevveuantor: the problem is that getaddrinfo() does so much more
11:48:20Zevvand you probably want to preserve that behaviour to prevent surprises. So my guess would be that putting getaddrinfo() in a thread would be the solution with the preferred behaviour
11:48:20euantor@Zevv But is it used in the stdlib, or is it simply used to resolve host names to A/AAA records?
11:48:25Araqimplicit db: DbConn
11:48:46Araqproc foo(db: DbConn) = bar() # if 'bar' has a 'db' parameter it's passed implicitly
11:48:58*vlad1777d quit (Ping timeout: 264 seconds)
11:49:25Araqto pass a different argument to bar, use an explicit keyword parameter
11:49:31FromGitter<alehander42> I can imagine that with `ctx` parameters in visitors too
11:49:33Araqbar(db = otherConnection)
11:49:35Zevvit's used to resolve names, which *might* result in doing a DNS query with A or AAAA records. It might also do a lookup in resolv.conf, query your ldap server or write a letter to your aunt, depending on the implementation of the host C library
11:50:01Araqhappens all the time in refactorings, parameter lists are pretty fragile
11:50:04euantoryes, so it'd be preferrable to use a pre-existing tool
11:50:17euantorhttps://github.com/nim-lang/Nim/issues/7422#issuecomment-376496331
11:51:06FromGitter<alehander42> very useful sometimes, but also very magical
11:51:46FromGitter<alehander42> it reminds me of `using`
11:51:58Araqindeed, which I killed :-)
11:52:32Araqproblem is you don't want to pass implicits to 'echo'
11:52:35Zevveuantor: the glibc implementation is no fun to use, as it depends on signals, iirc. Under water, it simply does the thread thing as well. getaddrinfo() sync is available on all platforms, so it seems like a sane idea to fix the asynchronousitiy (is that a word) on the Nim side instead of depending on all kinds of OS specific functions with very different interfaces
11:55:13FromGitter<alehander42> and `{.this.}` ? what did this do
11:55:16FromGitter<alehander42> it sounded similar
11:55:29FromGitter<alehander42> well, I used `using` somewhere in nimbus :D
11:55:44dom96Araq: Too magical. What I would like is way to reduce the noise of: proc initFoo(a,b,c: int): Foo = Foo(a: a, b: b, c: c)
11:55:56FromGitter<alehander42> i didn't know it's killed
11:56:15dom96The amount of times I have to type that is so annoying
11:56:19dom96We need syntax sugar for it
11:57:15FromGitter<zacharycarter> +1
11:58:12FromGitter<alehander42> honestly at that point you can just auto generate `newFoo` constructor if there are none of those supplied by the user
11:58:51dom96alehander42: yes, but I want to keep the ability to easily customise one of the parameters
11:58:53FromGitter<zacharycarter> maybe a pragma that does this?
11:58:55FromGitter<data-man> @zacharycarter : Maybe it's useful to you https://github.com/facebook/watchman/tree/master/watcher ⏎ For OS X 10.7+ uses FSEvents, and kqueue for earlier versions.
11:59:01FromGitter<alehander42> yes that's important
11:59:15FromGitter<alehander42> maybe Foo(<field>, <label>: <differentexpression>) ?
11:59:25dom96yeah, that would already be better
11:59:29FromGitter<alehander42> like `{e: 2, f}` in js ?
11:59:34FromGitter<zacharycarter> thx @data-man
11:59:35dom96yep
12:00:05FromGitter<narimiran> offtopic: there seems to be some interest in Nim down there at Julia's gitter :) maybe we'll have some new scientists here soon :)
12:00:13dom96And a 'constructor' pragma would be nice too
12:00:22dom96proc initFoo(a,b,c: int): Foo {.constructor.}
12:00:27FromGitter<alehander42> yeah, that would be nice (and some people would already know it from js, so it wouldn't be very surprising)
12:00:30dom96that could easily be a macro
12:00:56*PMunch quit (Remote host closed the connection)
12:01:14*PMunch joined #nim
12:03:02dom96so let's make sugar.nim happen and create a constructor macro in there :)
12:03:05dom96PRs welcome D:
12:03:07dom96*:D
12:04:08FromGitter<alehander42> :D isn't the new-old-future sugar.nim already there?
12:06:39dom96narimiran: Awesome :D Guess I should check out the discussion
12:14:58PMunchAraq, did you ask zahary about the quote thing?
12:20:30FromGitter<mratsim> How big can stuff in sugar be? Macros are great for sugar but they take a lot of space
12:20:52FromGitter<mratsim> can we actually depend on the macros module?
12:24:14PMunchHmm, someone in the Telegram channel is asking if you can use case with object types
12:25:04FromGitter<mratsim> With enum only I think
12:25:09FromGitter<mratsim> “kind types"
12:25:50PMunchYeah
12:27:00PMunchThis was his example: https://pastebin.com/FU9uXXzV
12:36:07FromGitter<diegogub> Hello! I'm trying to build a list of events like this: ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5aba3ab7c574b1aa3e39d79a]
12:37:19FromGitter<diegogub> I was using Event instead of LinkClicked...but link_id get lost and only have Event types..
12:37:52FromGitter<data-man> New dir: sugar? sugar/macro.nim, sugar/seqs.nim, sugar/string.nim, ..., sugar/everything.nim, sugar/godmode.nim
12:38:16FromGitter<mratsim> sugar/compiler.nim :P
12:38:33FromGitter<diegogub> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aba3b495f188ccc15003db8]
12:38:43FromGitter<diegogub> also this is not workin..
12:38:51FromGitter<diegogub> somebody could help me?
12:41:52FromGitter<diegogub> where should I use typedesc type"
12:41:53FromGitter<diegogub> ?
12:44:49Araquse 'if x of ObjectType', case is not a type switch
12:44:52FromGitter<mratsim> @diegogub ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aba3cc4012ff2bf681de8f3]
12:45:16*pwntus joined #nim
12:45:32*pwntus quit (Changing host)
12:45:32*pwntus joined #nim
12:45:43*pwntus is now known as Pwntus
12:46:47PMunchWooo, my protobuf library just wrote and read it's first protobuf message!
12:47:19FromGitter<mratsim> there is a competing thread in the forum ;) though I think it uses protoc.
12:47:23YardanicoPMunch, great! congrats!
12:50:20FromGitter<diegogub> @mratsim thanks..also, may be not having interfaces is quite confusing..How do I write a list of events in general?
12:51:23PMunchmratsim, competition is always good :)
12:51:34PMunchAnd yeah, I know of at least two protobuf implementations already
12:51:39FromGitter<zetashift> Is there a way I can use the ASCII null code is a value for a char variable?
12:51:53Yardanicolet nul = '\0' or just let nul = char(0) ?
12:52:30FromGitter<zetashift> ayy thanks, sometimes I make things more complicated than they are
12:52:44PMunchBut one wraps libprotobuf-c which is a runtime library for protobuf in C, and the other uses protoc
12:53:06YardanicoPMunch, protoc outputs very big code chunks
12:53:10Yardanicoeven in python
12:53:22FromGitter<data-man> @diegogub: Try https://github.com/xomachine/metaevents
12:53:28FromGitter<mratsim> @diegogub I’m not much of an interface developer, I’m more into numerical computing so I can’t say but maybe this would help you: https://github.com/andreaferretti/interfaced
12:53:52FromGitter<mratsim> @Pmunch and there is the Flatbuffer pure nim implementation from Skrylar as well
12:54:34FromGitter<mratsim> anyway i will have to use a serialization lib in Arraymancer and HDF5 looks so so so I was looking into Protobuf, FlatBuffer and Cap’n’proto.
12:54:51Yardanicodiegogub: you may also learn another way of writing things (without using interfaces or classes) :P
12:55:02FromGitter<mratsim> I’m waiting for the Flat’Cap’n’ lib :D
12:56:28PMunchYeah I'm writing protobuf mostly for compatibility, don't even have anything in particular I'm going to use it for :P
12:56:58*athenot joined #nim
12:57:14FromGitter<Vindaar> <- likes HDF5 :P
12:58:28FromGitter<diegogub> @data-man thanks, I will check that ⏎ @mratsim looks like a macro library to create interface type in nim..I think I should follow @Yardanico advice..but I cannot see it so far. I come from Go programming, so I used interfaces everywhere..
12:58:57AraqPMunch, zahary says it's too much of a hack. you need to live with your workaround for now
13:01:18FromGitter<data-man> @PMunch: Are you skipped it? ;) https://github.com/oswjk/protobuf-nim
13:02:06*athenot_ joined #nim
13:02:21FromGitter<zetashift> Aren't Nim concepts close to interfaces/traits?
13:02:53FromGitter<mratsim> Concepts cannot be put in a heterogeneous countainer at the moment, pending VTables
13:02:59FromGitter<mratsim> container*
13:03:31*athenot quit (Ping timeout: 245 seconds)
13:04:56FromGitter<mratsim> @diegogub maybe use methods?
13:05:39FromGitter<mratsim> if you need run-time polymorphism, that’s the best way today. and it will be much faster than a “if foo of” in all your proc
13:06:09FromGitter<zetashift> Getting that to work was planning for 1.0, no? I remember reading it in the roadmap on the github wiki, can't seem to find it now
13:06:34FromGitter<mratsim> Zah is working on it but I guess he was delayed by static[T]
13:07:05FromGitter<mratsim> I remember Araq telling me it’s just around the corner back in June ;)
13:07:05*dgwana joined #nim
13:08:03FromGitter<zetashift> That's alright, even though I'm looking forward to 1.0, asking what or when won't help me that much hehe
13:09:36FromGitter<mratsim> What you can do is creating more and more libraries that depends on devel so that they have to release faster :D.
13:09:55FromGitter<diegogub> @mratsim I was thinking about creating a method to return event type.. and use case
13:11:22PMunchdata-man, huh I haven't seen that one before
13:11:46FromGitter<mratsim> method can be overloaded on run-time types so you can have ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5aba431201a2b40f382e383f]
13:11:47PMunchAraq, too bad. Now I have to use a hack in order to not use a hack..
13:12:03PMunchIt's a bit hacky, but it doesn't break anything..
13:12:10FromGitter<diegogub> @mratsim first day with nim, Im trying to implement kind of cqrs ...I was thinking may be templates could avoid lot of code and repeat code with other languages..but not sure yet
13:12:26FromGitter<diegogub> @mratsim sound amazing..for what I want to do..
13:12:29PMunchdata-man, ah but that uses protoc as well
13:12:31FromGitter<mratsim> cqrs?
13:12:42PMunchSo I still have the really pure protobuf thing for myself :)
13:12:47FromGitter<diegogub> command query responsability segregation
13:12:55PMunchTheoretically this should even work on the JS target
13:13:15FromGitter<diegogub> @mratsim basically, functional programming...that kind of method overload looks good
13:13:41FromGitter<diegogub> I could write every event handler on a object (aggregate)
13:14:06FromGitter<diegogub> I will try it..
13:14:32PMunchBut I noticed that my parser is crashing the compiler a bit with "lib/system.nim(3559, 14) Error: interpretation requires too many iterations"
13:15:10FromGitter<mratsim> I thought following jzakiya request it was increased to 1 billion?
13:16:58FromGitter<diegogub> @mratsim thanks
13:17:09FromGitter<mratsim> you’re welcome
13:18:20PMunchmratsim, it doesn't actually say..
13:18:22FromGitter<mratsim> As a newcomer Nim will be a bit daunting and you will spent a lot of time googling various stuff, but for boilerplate squashing I assure you that it is the best language ever =).
13:18:28PMunchBut I hope it's not 1 billion already :P
13:22:49FromGitter<diegogub> @mratsim great! May be with templates right?
13:23:15PMunchHmm, building from a branch I built not too long ago to implement the quote do thing it works
13:23:31PMunchMaybe it has been upped to 1 billion between the version I currently have installed and then?
13:23:36FromGitter<zetashift> seems some D users have questions about Nim following the recent github repo: https://forum.dlang.org/thread/[email protected]
13:23:42PMunchdiegogub, or macros
13:25:54FromGitter<mratsim> @diegogub yes, basically templates can be though of “copy pasting” code.
13:29:30dom96zetashift: thanks for the link :)
13:30:49FromGitter<mratsim> @diegogub here is an example of template use: https://github.com/timotheecour/D_vs_nim/issues/12 it’s quite low-level as I’m basically copy-pasting C++ code but you can do the same with Nim code
13:31:06YardanicoPMunch, it's in devel only AFAIK
13:32:10PMunchAh, yeah I did "choosenim update devel" and now it compiles fine
13:32:15PMunchWhat was the old limit?
13:33:09FromGitter<mratsim> “if username == “PMunch": raise newEception(IterationError, “You are over the limit”)"
13:33:37PMunchHaha, this is actually the first time I've run into it :P
13:33:50FromGitter<mratsim> there is a forum thread in the past 3-4 days with the info iirc
13:35:12FromGitter<zetashift> @PMunch, the limit was `MaxLoopIterations* = 1500_000`
13:35:23FromGitter<zetashift> according to: https://github.com/nim-lang/Nim/commit/4301744e49f4b3758cc7a777c2d78c827bfbb344
13:36:04dom96oh man, all this talk of not allowing writeFile at compile-time in that D thread
13:36:58PMunchzetashift, thanks :)
13:37:45PMunchQuite crazy that it even takes 1_500_000 iterations as it is now :S
13:37:52PMunchAnd it's not even slow
13:38:10PMunchSub-second compile time for the entire project (of which the parsing that causes this is only a part)
13:40:09dom96"no heap-allocated runtime type at compile-time." is that really a case for Nim?
13:40:27*aguspiza quit (Ping timeout: 240 seconds)
13:41:24Araqnah, it's wrong.
13:41:36Araqyou can't put refs in a 'const'
13:41:41Araqbut for different reasons.
13:42:12dom96can I use a TableRef inside a compileTime proc?
13:43:48Araqsure
13:43:51Yardanicodom96, it works for me in static block
13:44:01dom96yeah, so that's misleading
13:44:10FromGitter<diegogub> @mratsim I will continue trying with templates..
13:47:09FromGitter<zetashift> I don't get the `the ability to generate C breaks type system guarantees like memory safety. It's like how inline assembly breaks optimizers and type system, and is annoying to implement. It makes the language more "powerful" hence less easy to reason about.`
13:47:23FromGitter<zetashift> in the dlang thread, second post
13:47:54AraqNim is more memory safe than D, if there is such a thing.
13:48:04Yardanicolet's talk about how mir directly uses LLVM :P
13:48:22AraqD doesn't even distinguish between GC'ed pointers and non-GC'ed pointers.
13:48:29dom96It's the usual "compiles to C" scaremongering.
13:48:35dom96Sorry to use that term, but IMO this is pure FUD
13:48:37FromGitter<zetashift> well let's not make it a language war but rather way that actually is wrong
13:49:00Yardanicodom96, they just don't need to forget that C++ used to compile to C
13:49:10dom96Even LLVM has undefined behaviour
13:49:13FromGitter<zetashift> ah yea I thought so, I found the 'how inline assembly..implement.' weird
13:49:25FromGitter<zetashift> wouldn't that make a lot of stuff unstable?
13:49:41Yardanicodom96, yeah, for nim there's no difference - there's already an LLVM backend, and it's not different from any other backend
13:50:05AraqUB is a sad fact of life but within a code generator you can enumerate the UB cases and protect against them.
13:50:14AraqWhich is exactly what Nim does.
13:50:14FromGitter<zetashift> IIRC even Rust had a point where it had a uncomfortable LLVM IR problem
13:50:27Yardanicoand arnetheduck is still updating llvm backend from time to time :) https://github.com/arnetheduck/nlvm
13:50:53Araqcode generation is intrisically different from using the codegen target directly.
13:51:05AraqI don't understand why it is so hard to understand.
13:51:16FromGitter<zetashift> props to that, LDC(D's LLVM target) is neat but they have dedicated people on it
13:51:21AraqASM has an "undefined opcode" exception.
13:51:26AraqC doesn't.
13:51:33dom96yep
13:51:35FromGitter<zetashift> Araq: probably the current trend of 'C is evil, kill it with fire'
13:51:40Araqthe C compiler doesn't generate undefined opcodes.
13:51:46Araqend of story.
13:51:57Araqhow hard is it to understand...
13:52:05dom96We honestly should write a quick article about this
13:52:08FromGitter<zetashift> Add it to the FAQ?
13:52:29dom96"The fallacy of the dangers of C compilation" or "Compilation to C considered dangerous"
13:52:57FromGitter<zetashift> Considerations of compiling to C?
13:53:06FromGitter<narimiran> yeah, stuff like that should be written / added to FAQ
13:53:36dom96yeah, I might write this as an article
13:53:43dom96maybe with Araq's help if he's willing
13:53:59euantorR4d1sh&>
13:54:15euantorweird, stupid Windows
13:54:17dom96euantor: That's a nice prompt lol
13:54:32euantorit's a copy from an SSH session
13:54:38euantorWe have some... interesting... host names
13:54:52*noonien joined #nim
13:55:00*jaco60 joined #nim
13:55:43dom96lol
13:56:43PMunchHmm, the XDeclaredButNotUsed hint, how do I disable that for a proc or a block of procs?
13:57:24euantorprobabl;y using the `{.hint.}` pragma
13:57:44euantorAn example for the line too long hint: `{.hint[LineTooLong]: off.}`
13:58:17PMunchI tried to do {.push hint[XDeclaredButNotUsed]: off.} but that didn't appear to work
13:58:47FromGitter<narimiran> just export that proc? :)
13:59:01Araqdom96, cool, let's do it
13:59:15dom96Araq: :D
13:59:23dom96After I come back from Tesco though :)
13:59:36FromGitter<narimiran> two days ago i found out that putting * at the end of the proc name solves that warning :)
13:59:41Yardanicohonestly I've never encountered problems with nim C codegen (well, only if I deliberately tried to do something very-very wrong)
14:00:07YardanicoI don't remember last time I got C compiler error related to nim codegen
14:00:18Araqit's true that Nim does not protect against some UB of C. in particular related to NULL derefs.
14:00:36Araqbut that's just something we didn't spend effort on, because
14:00:55euantorhaving an article to point people at when this comes up againa nd again would certianly help
14:01:02Araqa) it only comes up in code especially crafted to bring it up.
14:01:16Yardanicobut we'll probably still need to fix cpp+clang codegen issue (you can't compile openssl module with that combo)
14:01:20Araqb) clang and GCC have options to fight it.
14:01:33Araqwe don't have to reimplement that clang and GCC already offer.
14:01:38Araq*what
14:01:45PMunchnarimiran, well yeah that works
14:02:26PMunchBut this is in a macro. And I don't necessarily want to export the ouput of it if the user doesn't want me to..
14:03:13FromGitter<narimiran> it was a semi-joke :)
14:05:19FromGitter<mratsim> “Compilation to C considered harmful” is a much better clickbaity title
14:06:22Yardanico"10 reasons why your language sucks if it doesn't compile to C" :D
14:06:46Yardanico(not to offend anyone, just a joke)
14:07:23FromGitter<mratsim> nah, Compilation to C considered harmful would be taking the opposite position at first to attract either the hackernews crowd or the ban hammer. :P
14:07:59Yardanicodom96, btw, should we change strutils to strformat on first example here? https://nim-lang.org/features.html
14:08:34dom96sure
14:08:53dom96PRs welcome :
14:08:54dom96:)
14:09:04YardanicoI knew you will said that :P
14:09:07Yardanico*say
14:09:16dom96mratsim: yeah, maybe a little too clickbaity
14:09:25Yardanicodom96, oh, hmm
14:09:26Yardanicohttps://github.com/nim-lang/website/commit/1360883785d75db5969b1869e47b569b2119d793
14:09:27Yardanico:D
14:09:30dom96But it actually reflects the reality
14:10:19Yardanicomaybe website wasn't recompiled after this commit?
14:11:07dom96yep
14:11:10dom96Let me update
14:12:09dom96done
14:12:24Yardanicodom96, wow, that was fast!
14:12:35FromGitter<narimiran> btw, @mratsim, arraymancer website also needs recompiling, last time i checked :)
14:12:53dom96Literally just: cd ~/projects/website && git pull && git push live ;)
14:13:09dom96the beauty of git hooks
14:13:20FromGitter<mratsim> @narimiran I should release a new version actually :P
14:13:28dom96bbl
14:13:52Araqdom96, otherwise you would run deploy.sh, not much of an improvement :P
14:13:57FromGitter<mratsim> for me it’s just git checkout gh-pages && nimble gendoc && git push.
14:14:25FromGitter<mratsim> except that I realize that I must update all comments afterwards :P
14:18:28federico3something like http://paste.debian.net/1016962/ could be part of nimble gendoc
14:19:35FromGitter<mratsim> My gendoc is a bit involved: https://github.com/mratsim/Arraymancer/blob/068075dce61a88f4cf038d3c0035d5f84921983e/arraymancer.nimble#L172-L215
14:20:21Yardanicomratsim: https://github.com/nim-lang/Nim/issues/6910 is closed :)
14:21:11FromGitter<mratsim> it’s closed won’t fix ;)
14:22:01FromGitter<mratsim> The offending doc is generated from c2nim so probably it should be a c2nim issue
14:29:36FromGitter<mratsim> Is that normal that unsigned ints don’t throw a DivByZeroError but a SIGFPE. ⏎ ⏎ ```let a = 10'u ⏎ let b = 0'u ⏎ echo a div b``` [https://gitter.im/nim-lang/Nim?at=5aba55507685a046389d106b]
14:45:12*r3d9u11 joined #nim
14:46:20PMunchIs there really no way to silence the XDeclaredButNotUsed dint for a specific proc?
14:46:39FromGitter<alehander42> you can silence it for your whole project
14:47:09FromGitter<alehander42> or export it? or put it in `when false:` ?
14:47:54PMunchWell putting it in a when false defeats the purpose of generating it in the first place :P
14:48:10FromGitter<alehander42> well isn't it exported ? :D
14:48:24PMunchNo, it's generated for the user based on input.
14:48:30PMunchSo it will already be in their scope
14:48:54PMunchBut the macro generates a lot of procedures, some that the user might not be interested in
14:49:39FromGitter<alehander42> ahh
14:50:33FromGitter<alehander42> @Varriount this nimlime new tab with output thing is so weird :D I can never reproduce it with some pattern
14:52:07FromGitter<alehander42> I wish there was a sublime plugin to autoclose files with certain names, it will solve this bug in an instant :D
15:01:16*miran joined #nim
15:04:20PMunchCode is now up on GitHub, and protobuf parsing is actually working: https://github.com/PMunch/protobuf-nim/blob/master/protobuf.nim#L1047-L1076
15:04:37PMunchDisclaimer: if you try to do anything with it it will probably break
15:04:51*uran[m] joined #nim
15:04:57PMunchIf you do try it though make sure to create issues so I know what's not working and what is :)
15:05:10*PMunch quit (Quit: Leaving)
15:06:08*xkapastel joined #nim
15:06:17FromGitter<alehander42> I adapted a plugin from stack overflow to a auto remove file with a certain name command, now nimlime will be invincible for me <3
15:06:47FromGitter<alehander42> well done @PMunch ! :D the space protobuf race is hot today
15:10:21*r3d9u11 quit (Remote host closed the connection)
15:17:30*xet7 quit (Ping timeout: 246 seconds)
15:17:59*xet7 joined #nim
15:19:06*Trustable joined #nim
15:19:07AraqPMunch: there is a .used pragma exactly for this purpose...
15:19:29FromGitter<Vindaar> yay, finally managed to write my first (for me) non trivial macros :D
15:33:35*endragor quit (Remote host closed the connection)
15:35:42miranVindaar: congrats! :)
15:41:17FromGitter<zetashift> How do I turn a char intro a str?
15:41:20FromGitter<zetashift> string*
15:41:36FromGitter<zetashift> doing string(ch) still gives me a type error
15:42:01subsetparkzetashift - you can just use `$`
15:42:08subsetpark$'c' == "c"
15:43:15FromGitter<zetashift> thanks :D
15:43:31*SenasOzys quit (Read error: Connection reset by peer)
15:45:18*uran[m] left #nim ("User left")
15:54:39enthus1a1twhat is the correct value for nimble "Package type"? https://gist.github.com/enthus1ast/50d2e65776fda702c18a07763107f7ef
15:55:18miranenthus1a1t: lib
15:55:49enthus1a1tthx miran
15:56:02FromGitter<Vindaar> lib/bin means to say either 'lib' or 'bin'
15:56:12enthus1a1toh
15:56:17enthus1a1ttotally misunderstood
16:02:08FromGitter<alehander42> do we have a lib that can serialize every kind of nim value?
16:02:45FromGitter<alehander42> I am adding auto save of failing tests to quicktest and I wanted to go with json for the first try
16:02:54enthus1a1ti've played with NESM
16:03:04enthus1a1tand marshal
16:03:07FromGitter<alehander42> (ok, every reasonable kind)
16:04:15FromGitter<Varriount> NimYAML might work too
16:08:44FromGitter<alehander42> ugh, can I somehow stop unittest from testfiltering its command args
16:10:34FromGitter<dom96> Marshal module in stdkib?
16:10:49enthus1a1tyes
16:10:57FromGitter<dom96> Yay gutter for Android. Sending message while I'm trying to fix it
16:11:02FromGitter<dom96> *gitter...
16:11:07Yardanicoyeah, it's shit :P
16:13:19FromGitter<alehander42> yeah marshal looks very good!
16:13:49FromGitter<alehander42> ahh, I think I can almost stop unittest from misusing my cli args if testFilters is exported
16:13:52FromGitter<alehander42> `testsFilters = initSetstring ()`
16:14:19enthus1a1tbut marshal might use another serializer (other than json) in the future
16:15:15FromGitter<alehander42> @dom96 can I add a proc `disableParamFilter()` to unittest.nim?
16:15:38FromGitter<alehander42> `disableParamFiltering` maybe
16:16:29FromGitter<alehander42> actually I don't even have to do that
16:16:50FromGitter<alehander42> I can just rewrite the logic, so testsFilters don't include *every* arg, but only those without `:`
16:16:59FromGitter<alehander42> I'll open a PR
16:17:04jxyCan anybody point me to the direction where nim prepares ansi color for output
16:17:30jxyI'm trying to mute the color when it's output is not a tty
16:17:39Araqcompiler/msgs.nim
16:17:52Araqthere is --colors:off, I hope it works
16:18:09FromGitter<alehander42> ah, still `stuff::` is possible
16:22:49jxymy mistake. It's not nim. It's nimble, which always print color even if redirected to a file.
16:23:50jxyi guess somewhere nimble needs an isatty test
16:24:04enthus1a1ta cool compiler feature/flag would be to show in which file and line a `echo` appears, so one could easily get rid of old debug echos
16:25:13FromGitter<alehander42> @enthus1a1t we have such a feature in our unfinished nim debugger
16:25:30FromGitter<alehander42> very useful indeed, I have 10-s of echo-s sometimes
16:25:38enthus1a1tnim debugger?
16:28:16enthus1a1tdo you have the code released alredy? alehander42
16:28:23FromGitter<alehander42> @Araq does this sound reasonable https://github.com/nim-lang/Nim/pull/7423
16:29:30FromGitter<alehander42> @enthus1a1t yeah, I am working on a visual debugger environment which will have Nim support, (I doubt it will be open source tho)
16:36:17*floppydh quit (Quit: WeeChat 2.1)
16:55:03*Vladar quit (Quit: Leaving)
16:56:39*FromGitter quit (Remote host closed the connection)
16:56:39*oprypin quit (Quit: Bye)
16:56:56*FromGitter joined #nim
16:57:02*oprypin joined #nim
17:12:51*Vladar joined #nim
17:24:50*arecaceae quit (Remote host closed the connection)
17:25:14*arecaceae joined #nim
17:29:07FromGitter<diegogub> @mratsim multi method is working perfect. I just need to see how to share data between calls ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5aba7f632b9dfdbc3a2a9eb8]
17:29:20*athenot joined #nim
17:29:27*athenot_ quit (Read error: Connection reset by peer)
17:29:47FromGitter<alehander42> ok it seems marshal is working fine, quicktest can now repro tests automatically
17:30:51FromGitter<diegogub> @mratsim thanks for your help
17:34:34mirancan i create a tuple (or something else) in which one element will sometimes be a char and sometimes an int?
17:35:30FromGitter<Varriount> @alehander42 marshal is a great module, as long as you treat the format like a black box
17:35:51dom96miran: You can use an object variant for that
17:36:30mirani'm thinking of having extra fields - sometimes i'll use fieldX (int), and sometimes fieldY (char). !?
17:37:37mirandom96: ok, i'm looking at object variants, will see if i can use that
17:38:56Yardanicomiran, yes, it allows exactly that
17:51:50*nsf joined #nim
18:00:10miranok, i managed to make it work. now is the time to make it less ugly :)
18:05:50FromGitter<mratsim> ugliness is a feature Ada™
18:06:27FromGitter<mratsim> @PMunch I think I raised a bug about XDeclaredButNotUsed that didn’t shut up, that was 1 year ago or something
18:10:23FromGitter<mratsim> @diegogub no problem, my pleasure
18:10:55*natrys joined #nim
18:14:46ZevvIs it possible to override functions from the stdlib in Nim, I believe they call this 'monkeypatching' in some languages
18:18:13Zevvor let me ask what I'm actually trying to do: I'd like to replace proc dial from include/asynccommon.nim in a local implementation without having to change the Nim stdlib code
18:26:50*find0x90 joined #nim
18:27:49*find0x90_ joined #nim
18:28:32*athenot_ joined #nim
18:29:19*find0x90_ quit (Client Quit)
18:29:51*athenot quit (Ping timeout: 240 seconds)
18:31:28*find0x90 quit (Ping timeout: 260 seconds)
18:31:56YardanicoZevv, you can import every proc from that module except dial
18:31:59Yardanicoand write your own dial
18:32:02Yardanicothat's one of the ways
18:32:42*geocar joined #nim
18:34:17Zevvthat makes sense
18:36:42*tiocavera joined #nim
18:36:42*tiocavera quit (Changing host)
18:36:42*tiocavera joined #nim
18:36:42*rockcavera quit (Killed (leguin.freenode.net (Nickname regained by services)))
18:36:42*tiocavera is now known as rockcavera
18:37:18Zevv4.549 GB
18:37:22Zevvalsof het weer niks is
18:37:31Zevvmijn PS4 wordt een BF1-o-Matic
18:37:34Zevvkan straks niks anders meer
18:39:42FromGitter<Varriount> Zevv: ?
18:40:24Zevvow sorry, wrong window
18:40:33FromGitter<Varriount> Google translate says you're typing Dutch, however it doesn't make a lot of sense
18:41:02Zevvit doesn't :)
18:41:25Zevvapologies for the noise
18:43:38*xet7 quit (Quit: Leaving)
18:46:27*nsf quit (Quit: WeeChat 2.0.1)
19:07:47FromGitter<zetashift> Good time to be dutch hehe
19:11:57*BitPuffin quit (Remote host closed the connection)
19:31:42FromGitter<tim-st> When I have a pure enum cant I use a name that is the same as a keyword?
19:32:09Araqwith backticks at the declaration site
19:32:17Araqand Foo.keyword is supported iirc
19:32:27FromGitter<tim-st> Thanks!
19:33:43*athenot joined #nim
19:34:51*athenot_ quit (Ping timeout: 240 seconds)
19:45:41*athenot quit (Read error: Connection reset by peer)
19:46:47*athenot joined #nim
19:59:16*kunev_ joined #nim
19:59:32*kunev quit (Ping timeout: 276 seconds)
20:06:05*rokups quit (Quit: Connection closed for inactivity)
20:15:21*athenot quit (Ping timeout: 240 seconds)
20:16:16*athenot joined #nim
20:25:33FromGitter<AjBreidenbach> is there a way to get bitness at compile time?
20:27:56*dgwana quit (Quit: Leaving)
20:31:04FromGitter<AjBreidenbach> I mean other than importing NIM_INTBITS
20:33:26FromGitter<AjBreidenbach> or hostCPU could work I suppose
20:33:59*miran quit (Ping timeout: 276 seconds)
20:42:56dom96https://nim-lang.org/docs/system.html#cpuEndian
20:53:25FromGitter<AjBreidenbach> sorry no I want sizeof(int) :|
20:54:48dom96oh, there is a PR for that
20:56:29Araqsizeof(int) works at compile-time, always has.
20:57:22FromGitter<AjBreidenbach> oh, I'm just stupid
20:57:35FromGitter<AjBreidenbach> got it :)
20:59:07*Trustable quit (Remote host closed the connection)
20:59:07*aziz joined #nim
21:12:00*jaco60 quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:25:09FromGitter<cavariux> @dom96 nimble pulls submodules as well or do it just treat them as empty folders?
21:25:31dom96it pulls them
21:26:44FromGitter<cavariux> thanks, also I'm having a problem where I cannot get the len of a ```ref seq``` or a ```ptr seq``` and I cannot convert a seq to a ptr/ref seq because I'm asking it as an argument in a function
21:29:50*Cthalupa quit (Max SendQ exceeded)
21:30:04*Cthalupa joined #nim
21:32:43*endragor joined #nim
21:35:07Araqyour function is likely wrong
21:35:29Araqif it needs to mutate the seq, the parameter's type should be 'var seq[T]'
21:36:07FromGitter<cavariux> https://pastebin.com/47JrMLBk
21:36:21FromGitter<cavariux> I have to give both the length and the seq as different arguments
21:36:32*vlad1777d joined #nim
21:36:39FromGitter<cavariux> because I need to give the addr of the first value in the seq to a C library (opengl)
21:36:51*endragor quit (Ping timeout: 240 seconds)
21:37:30FromGitter<cavariux> and I cannot use a normal ```seq[float32]``` as an argument because when I use nameofseq[0].addr it tells me that it has no address
21:37:52FromGitter<cavariux> unless I use ref/ptr seq
21:38:12Araqnot true, use unsafeAddr(s[0])
21:38:25dom96yeah, or use 'var seq'
21:38:58dom96you should use 'ptr' at the very lowest level: almost always only for FFI
21:39:12dom96and if you're finding yourself writing 'ref seq' then you're likely doing something wrong too :)
21:39:13FromGitter<krux02> dom96 unsafeAddr is the correct way here
21:39:32dom96krux02: yes, but there are cases where it's not correct
21:39:37FromGitter<krux02> put i would use openarray
21:39:37dom96so it's useful to know
21:39:55FromGitter<cavariux> damn, thank you
21:39:58FromGitter<krux02> in that example it is correct
21:40:43FromGitter<cavariux> I wasn't aware of unsafeAddr and unsafeNew will read docs, thanxs again
21:45:22FromGitter<cavariux> And is there an easy way to convert an object to a ref of the same object?
21:47:18*PMunch joined #nim
21:50:01FromGitter<krux02> nope you can't convert anything to a ref, but you can basically convert anything to a ptr
21:50:16FromGitter<krux02> a ref is like a shared pointer in c++
21:50:46FromGitter<krux02> it owns the object and when all `ref` to an objecd die the object gets collected by the GC.
21:51:43FromGitter<krux02> I just use value types and pointers for everything. `ref` is overrated and not necessary for anything and only useful for very few things.
21:52:01dom96You can actually: var a: Foo; var b: ref Foo; new b; b[] = a
21:52:08FromGitter<cavariux> oh thanks, I guess I was thinking of it as a c++ way, thanks for clarifying it
21:52:46FromGitter<cavariux> but when I ask for an argument in a function in nim the variable is copied like in c++ or it is passed as a reference?
21:52:59FromGitter<krux02> dom96: that does a copy. It is not a ref to the same object.
21:53:38FromGitter<krux02> it is passed as a pointer or value depending on what is more efficient
21:53:41dom96yes, but it does allow you to "convert" to a ref
21:53:48FromGitter<krux02> or what the compiler things it is more efficient.
21:54:00FromGitter<krux02> the pointer is hidden though.
21:54:20FromGitter<cavariux> okay, so the only way of warrantying that it is not copied is to ask for a ptr right?
21:54:33FromGitter<krux02> You can see it in the generated source code, or if you print the addr of an object both from the calling and called function
21:54:43FromGitter<krux02> not really
21:55:09FromGitter<krux02> `var` for an argument is like a c++ reference
21:55:18FromGitter<krux02> it's a hidden pointer
21:55:26FromGitter<krux02> `ptr` is an explicit pointer.
21:55:50FromGitter<krux02> and last but not least there is {.byref.} pragma at the type
21:56:09Araqparameter passing does NOT copy.
21:56:09FromGitter<krux02> and {.byval.} i think is the opposite of it.
21:56:22FromGitter<krux02> Araq: int float double is copied
21:56:44FromGitter<krux02> sorry I mean int float32 float64
21:56:45Araqsure, teach me how my own compiler works.
21:56:58Araqthe important point is it DOES NOT COPY :P
21:57:16FromGitter<cavariux> Araq hahaha
21:57:22Araqit does copy when it's faster but people are always concerned about the copies
21:57:31FromGitter<krux02> It's not about teaching you, it is how you say "parameter passing does NOT copy". Which is not entirely true
21:57:45FromGitter<krux02> object parametrs do not copy
21:57:50Araqit's imprecise to better get the point across.
21:58:08FromGitter<krux02> yea you might be right
21:58:30FromGitter<krux02> sometimes it's better to oversimplify things and let the details for later
21:58:58FromGitter<cavariux> so there's no way of modifying the value passed as an argument in a procedure?
21:59:18Araqthere is. use a 'var' parameter.
21:59:24FromGitter<krux02> well, there is unsaveAddr, and `var`.
21:59:33Araqbut don't use 'var' for speed.
21:59:33FromGitter<cavariux> I mean, modifying the original value like in C
21:59:35FromGitter<krux02> (don't use unsafeAddr for this)
21:59:48Araquse 'var' when you need to mutate.
22:00:06Araqdon't use 'var' otherwise, parameter passing does not copy either way.
22:00:57FromGitter<krux02> I think it is named a bit confusingly.`var` is a reference that lets you modify the original variable. Wher `ref` is a pointer type.
22:02:16FromGitter<krux02> `ref` is a gc tracked pointer and `ptr` is just a raw pointer like you know them from C.
22:02:23Araqnobody ever came up with better names
22:02:35FromGitter<cavariux> okay okay, that yous clarified everything up
22:02:39FromGitter<krux02> I think it's to late to change that now.
22:02:42FromGitter<cavariux> thanks to both of you
22:03:00FromGitter<krux02> and it doesn't really matter that much how it is named.
22:03:16FromGitter<cavariux> I think the name ref and var should be the other way around?
22:03:21FromGitter<cavariux> but too late to change it
22:03:25Araqyeah, we won't change it, the names are pretty good IMO.
22:03:48Araqbut I wonder what you guys would come up with
22:04:44FromGitter<cavariux> so, what should I use ```var``` or ``unsafeAddr``` and why haha?
22:04:46FromGitter<krux02> well I like var for the reference, because there is already a var keyword for mutability.
22:05:04FromGitter<krux02> but I don't really like `ref` for the gc pointer
22:06:17FromGitter<krux02> I would call it ridiculously long, something like garbageCollectedPointer[T]. Just to make people not want to use it, but yea that is just me. I don't like gc.
22:06:32FromGitter<cavariux> safePointer would be allright too
22:06:34dom96cavariux: if your proc modifies the parameter then use 'var'
22:06:35FromGitter<cavariux> or even sptr
22:06:46FromGitter<krux02> no safePointer is a very bad name
22:06:55dom96`var` is a great name
22:06:58FromGitter<cavariux> @dom96 and if I just want to get the addr?
22:07:03FromGitter<krux02> what is it safe for?
22:07:06dom96cavariux: then use unsafeAddr
22:07:26FromGitter<krux02> safe for cryptography? safe for access control? safe for what?
22:07:32FromGitter<krux02> And how safe is it?
22:07:32FromGitter<cavariux> great, thanks @dom96 sry for the bother everyone
22:07:33dom96Do make sure the C function you're calling doesn't mutate the parameter though
22:07:45FromGitter<cavariux> @dom96 why is it?
22:08:03dom96why is what?
22:08:24FromGitter<krux02> it is just for semantics in the language
22:08:26FromGitter<cavariux> why shouldn't they mutate the value with unsafeAdrr but it's okay with addr?
22:08:58FromGitter<krux02> when you have a parametr not marked as var, you promise not to modify it. But you could hack and modify it anyway, and that is not nice
22:09:20FromGitter<krux02> it's like a c++ const reference and then in the function you const cast he const away and then modify the argument.
22:09:28FromGitter<cavariux> oh, okay so it's just for semantics but still good thanks
22:09:39FromGitter<krux02> when you modify the argument the argument should be `var` in the parameter list.
22:14:50shashlickis it possible to use currentSourcePath() in a template and have it give you source path for the file the template is used in rather than the file where the template is written
22:15:13*SenasOzys joined #nim
22:15:28*vlad1777d quit (Ping timeout: 260 seconds)
22:15:28*Senketsu quit (Ping timeout: 260 seconds)
22:16:38Araqfyi these names were taken from Modula 3. 'var', 'ref', 'untraced ref'
22:16:55AraqI replaced 'untraced ref' by 'ptr' because I thought it to make more sense
22:16:56*Senketsu joined #nim
22:17:15Araqand to make it a consistent 3 letter term.
22:17:41Araq'var' is also used in Modula 2 and Pascal.
22:18:15Araqit's not my fault you kids don't know rock-solid archaic technology :P
22:21:56shashlickor is it possible to get the working directory during compile time?
22:22:24Araqshashlick, no but you can patch the compiler to allow for getCurrentDir at compile-time
22:23:28shashlickI'm really tempted to add all the os procs into the VM
22:23:46*aziz quit (Quit: Ex-Chat)
22:23:59Araqthat won't be accepted. but getCurrentDir will.
22:24:29shashlickthere's 29 procs in os that aren't in nimscript already
22:25:53*vlad1777d joined #nim
22:26:49shashlickwhich of these do you think is fair to add? https://pastebin.com/Qgia8ApX
22:29:20dom96May as well post this here too: https://hnleaderboard.com/?
22:31:03FromGitter<zetashift> 85, not bad
22:31:20dom96I think it's funny that Rust is #1
22:32:07FromGitter<zetashift> Is it really that funny though? During their blogposting initiative I saw almost every post on the frontpage
22:32:38FromGitter<zetashift> Also for a while I saw anything that rust had in the title skyrocketing up there :P
22:33:36dom96Maybe funny is the wrong word, but it proves to me that Rust really is on HN too much :)
22:34:04FromGitter<Varriount> @alehander42 Can you try something for me?
22:34:57FromGitter<Varriount> With sublime open, shut your computer down. Make sure the "reopen windows when logging back on" box is checked
22:35:45*vlad1777d quit (Ping timeout: 248 seconds)
22:37:44FromGitter<Varriount> @zetashift I find it annoying. I want a more "fair" reality.
22:39:09FromGitter<cavariux> I truly want Nim to get popular :,c
22:39:50FromGitter<zetashift> Unimportant message from me: I just wrote a simple lexer in Nim! whoop whoop
22:41:36FromGitter<zetashift> And yeah, I also found it strange that some of those blogposts which didn't contain any real news but basically saying "Hey Rust is nice because C++ gave me PTSD" and got automatic votes for that
22:41:52FromGitter<cavariux> Hey Nim is nice because C++ gave me PTSD
22:42:36FromGitter<zetashift> yea but muh no GC and muh 10000% memory safety
22:42:52FromGitter<zetashift> Rust did a lot of right though no hate on that
22:46:25dom96Rust has some great marketing behind it
22:53:25*Vladar quit (Remote host closed the connection)
22:54:05FromGitter<cavariux> I thought nimble only ran the files under tests that started with a t
22:56:52FromGitter<cavariux> @dom96 but when I run a test all the files under tests regardless of the filename runs
22:57:38FromGitter<mratsim> you’re mixing nimble with koch (the compiler bootstrap/test tool)
22:57:57FromGitter<cavariux> Nimble README: Nimble offers a pre-defined test task which compiles and runs all files in the tests directory beginning with 't' in their filename.
22:58:39dom96readme could be wrong :)
23:00:00FromGitter<cavariux> oh okay, well might PR later
23:02:03*natrys quit (Quit: natrys)
23:11:21shashlickaraq: if you add an op to vmops.nim, do you need to add it to scriptconfig/nimscript as well?
23:11:28FromGitter<krux02> Araq: `ref` could be called `traced ptr`
23:11:58FromGitter<krux02> I go to bed now, good night.
23:12:35Araqshashlick, depends on how you did it. in general, no.
23:14:42shashlickokay I tried scriptconfig first but then it didn't work in macros so figured vmops is the place
23:15:04*athenot_ joined #nim
23:15:05*athenot quit (Ping timeout: 276 seconds)
23:19:52*find0x90 joined #nim
23:21:58FromGitter<mratsim> I don’t see what’s wrong with var ref and ptr
23:22:49FromGitter<cavariux> that var is a weird name, it's just a hypothetical talk, there's no way that it can change now
23:23:07FromGitter<mratsim> var is something that can vary?
23:23:14FromGitter<mratsim> i.e. mutable?
23:23:46FromGitter<cavariux> I know, but it is a ref but ref is already taken and var is used to setup variables so it's weird
23:24:17FromGitter<mratsim> It’s not, value objects and primitives can be mutated even though they are not refs
23:24:26shashlickaraq: nope, adding getCurrentDir() to vmops works in macros but not in nim script
23:24:57FromGitter<mratsim> a ref has reference semantics, this is orthogonal to being mutable/var
23:25:59FromGitter<cavariux> I guess, my only point is that var is already used to create variables but that's all I really don't care haha it works fine and looks fine just it could become confusing
23:26:55FromGitter<mratsim> var is used for mutable variables, I find it consistent. Otherwise it’s let. You can’t pass a let to a var parameter, you need to pass something created by var
23:27:51FromGitter<mratsim> I think your feedback as a new user is important so that we can add new things in the tutorials or in “Nim for the C++” programmer.
23:28:36*gokr joined #nim
23:28:49FromGitter<cavariux> Yeah it would be useful for new users
23:28:56FromGitter<mratsim> Rust people would just think var == let mut (for variable creation) or var == mut (for parameter passing) for example
23:29:20FromGitter<mratsim> ML people would think, “huh variables are not immutable?"
23:30:14FromGitter<mratsim> it’s hard to cater to everyone :/
23:30:55FromGitter<cavariux> But well, there's truly nothing we can do, they are already set and they work fine as they are
23:36:07FromGitter<phrmoy> Question, is the intent of having Nim transpile to javascript is so we can deploy things a server like node?
23:37:48FromGitter<zacharycarter> not really
23:38:23FromGitter<zacharycarter> but there is a flag to target nodejs with the js backend
23:39:32FromGitter<zacharycarter> the js target is so you can write javascript with Nim - it's analogous to writing javascript with TypeScript
23:39:43FromGitter<zacharycarter> or ES6 + Babel
23:39:52FromGitter<zacharycarter> or whatever crazy S compiles to JS these days
23:40:44FromGitter<zacharycarter> I hooked up gitlab to kubernetes running on AWS today :shipit:
23:41:01FromGitter<zacharycarter> well kubernetes was running on AWS - gitlab was not
23:44:38*noonien quit (Quit: Connection closed for inactivity)
23:45:24FromGitter<mratsim> I think Araq didn’t like to write javascript and preferred to write Nim so here comes your JS backend. ⏎ Also the first target was the browser and node came after ;).
23:45:59FromGitter<zacharycarter> I don't even think node is really a target per se
23:46:14FromGitter<phrmoy> Who likes to write JS? ;)
23:46:17*athenot_ quit (Ping timeout: 276 seconds)
23:46:18FromGitter<zacharycarter> I think it just imports some node related libraries
23:46:39FromGitter<zacharycarter> well - I don't think JS is going anywhere
23:46:43FromGitter<mratsim> @phrmoy, these days it seems like half the dev on Github are JS devs :P
23:46:53FromGitter<phrmoy> well but thats what I asked about
23:46:59FromGitter<mratsim> I’m always amazed of the number of stars JS repo can gather.
23:47:00FromGitter<zacharycarter> everything compiles to JS that runs on the web
23:47:11FromGitter<phrmoy> who likes to write assembly?
23:47:20FromGitter<phrmoy> ^^
23:47:24FromGitter<zacharycarter> my dad
23:47:31FromGitter<zacharycarter> I'd like to know how to
23:47:38*athenot joined #nim
23:47:43FromGitter<phrmoy> tuche, and he is a brave man and so are you =]
23:47:53FromGitter<zacharycarter> well he gets paid to do it so :P
23:47:54FromGitter<mratsim> I like to read assembly. And then carefully massage into producing the assembly I want.
23:48:04FromGitter<zacharycarter> yeah I want to assemblyfu
23:48:06FromGitter<mratsim> massage the compiler*
23:48:16FromGitter<zacharycarter> yeah baby
23:48:18FromGitter<phrmoy> i am starting to read assembly to figure out my Julia shortcomings
23:48:22FromGitter<phrmoy> so it's helpful
23:48:36FromGitter<phrmoy> but i certainly dont write in it, even tho its compiled to it
23:48:42FromGitter<zacharycarter> but erm - I haven't found the JS backend terribly useful
23:48:44FromGitter<phrmoy> thats the same mentality i have about JS
23:48:50FromGitter<zacharycarter> but it's pretty cool - you can bind to existing JS relatively easily
23:48:59FromGitter<phrmoy> thats what I wanted to know
23:49:06FromGitter<phrmoy> can we use react with Nim?
23:49:10FromGitter<zacharycarter> sure
23:49:11FromGitter<mratsim> you can use importcpp
23:49:19FromGitter<zacharycarter> https://github.com/andreaferretti/react.nim
23:49:24FromGitter<mratsim> and yes there was a electron+react+Nim shell
23:49:34FromGitter<zacharycarter> just use karax though IMO
23:49:51FromGitter<cavariux> nim + electron would be interesting
23:49:55FromGitter<phrmoy> As long as we can do things with react and electron
23:50:02FromGitter<zacharycarter> I'm starting to produce tooling for the js side of Nim
23:50:07FromGitter<phrmoy> the JS target is worth it
23:50:11FromGitter<zacharycarter> right now I'm working on a library to power something like nodemon
23:50:20FromGitter<cavariux> but I guess a good native gui library is still neaded
23:50:33FromGitter<phrmoy> in fact, the JS target is worth it one way or another
23:50:35FromGitter<zacharycarter> every language needs a "good" native gui library :)
23:50:39FromGitter<zacharycarter> that's why electron exists
23:50:54FromGitter<phrmoy> like someone already said, its the web, what you gonna do about it? ^^
23:51:01FromGitter<zacharycarter> the web is the worst
23:51:06FromGitter<zacharycarter> but yeah
23:51:12FromGitter<zacharycarter> what are you going to do about it....
23:51:24FromGitter<phrmoy> not use JS
23:51:34FromGitter<zacharycarter> that makes the web suck a bit less
23:51:38FromGitter<zacharycarter> still sucks
23:51:39FromGitter<mratsim> Every language is struggling with good GUI ...
23:52:02FromGitter<phrmoy> agreed, JS tho, something else in the world of languages with struggles
23:52:07FromGitter<zacharycarter> @phrmoy I recently made - https://github.com/zacharycarter/nim-sass
23:52:10FromGitter<cavariux> I feel that Java was one of the few that made it right
23:52:22FromGitter<zacharycarter> so we can compile sass with Nim now ✨
23:52:32FromGitter<phrmoy> that's awesome
23:52:50FromGitter<phrmoy> im still stunned it took me this long to uncover u guys
23:52:52FromGitter<mratsim> I put Java in the same basket as electron, a huge memory hog for 4 buttons and 1 menu
23:52:53FromGitter<phrmoy> hide much?
23:52:59FromGitter<cavariux> Nice, does that mean Nim -> Sass -> Css?
23:53:20FromGitter<zacharycarter> @cavariux no - it just means you can write a sass compiler in Nim
23:53:52FromGitter<mratsim> @phrmoy, it’s more like drowned in information overload
23:54:03FromGitter<zacharycarter> @mratsim there are ppl writing electron apps with very thin JS layers and majority of impl in Rust, claiming it's speedy
23:54:09FromGitter<phrmoy> information? you mean marketing overload
23:54:10FromGitter<zacharycarter> but I mean...
23:54:36FromGitter<phrmoy> which you could also call, disinformation
23:54:50FromGitter<mratsim> both I think
23:55:21FromGitter<mratsim> just check on quora “Looking for a new language” or anything in that vein
23:55:31FromGitter<zacharycarter> https://github.com/onivim/oni
23:55:58FromGitter<phrmoy> Red also seems like a great project (am I forbidden to express thoughts on other languages here?)
23:56:08FromGitter<zacharycarter> looks nice
23:56:09shashlick@zacharycarter: i just tried oni yesterday, looks great but 300MB for opening 2 small files
23:56:12FromGitter<phrmoy> different purpose to Nim
23:56:14FromGitter<zacharycarter> ouch
23:56:45FromGitter<zacharycarter> um no you can talk about Red but if you talk about Ponylang we'll cut your finger tips off one by one
23:57:01FromGitter<mratsim> @phrmoy, it’s not forbidden, only thing forbidden is trolling and saying that Nim transpires to C/JS ;)
23:57:19FromGitter<zacharycarter> I'm kidding I <3 ponies
23:57:40FromGitter<mratsim> we regularly talk about Haskell, Pony, Rust, D, whatever is the new language of the month (Zig?)
23:57:48FromGitter<zacharycarter> nooooo
23:57:59FromGitter<zacharycarter> the languages of the month (which you guys keep ignoring) are...
23:58:27FromGitter<zacharycarter> https://bitbucket.org/duangle/scopes/wiki/Home ⏎ and ⏎ https://plg.uwaterloo.ca/~cforall/
23:58:37FromGitter<phrmoy> @mratsim haha
23:58:42FromGitter<mratsim> Na it’s https://futhark-lang.org/
23:59:04FromGitter<zacharycarter> if you're a data scientist
23:59:06FromGitter<mratsim> actually it might be interesting for you @phrmoy since you’re coming from Julia
23:59:26FromGitter<zacharycarter> I think for all game programmers scopes is super interesting
23:59:30FromGitter<zacharycarter> and cforall is interesting forall
23:59:52FromGitter<phrmoy> ohhh this is kinda dangerous