<< 08-07-2018 >>

00:02:06PMunchBut annoyingly I can't reproduce in a smaller sample..
00:04:18FromGitter<kayabaNerve> NVM then
00:06:00FromDiscord<exelotl> so if I'm understanding correctly, waitFor is similar to await, but await requires the event loop to be running, while waitFor runs the event loop by itself?
00:08:18PMunchHmm, it appears that it's a collision
00:09:40PMunchSo it appears that if I have two plugins that use GC stuff one of them will segfault..
00:19:22*find0x90 quit (Quit: find0x90)
00:29:38*mwbrown joined #nim
00:38:49*arecaceae quit (Read error: Connection reset by peer)
00:39:34*arecaceae joined #nim
00:47:52FromGitter<kayabaNerve> @Varriount You got my hopes up.
00:47:58FromGitter<kayabaNerve> I'm just saying.
00:48:04FromGitter<kayabaNerve> I thought we had something.
00:48:10FromGitter<kayabaNerve> But you led me on...
00:48:54FromGitter<kayabaNerve> Just don't come back years from now and ask where all the nice developers went
00:49:03FromGitter<kayabaNerve> </joking> :P
00:59:21*PMunch quit (Quit: leaving)
01:11:26*dddddd quit (Remote host closed the connection)
01:30:29FromGitter<Varriount> @kayabaNerve Alas, Cryptocurrently, and Block Chain just don't appeal to me.
01:30:52FromGitter<Varriount> I'm more of a "this is how you interface with this hardware" kind of guy. :P
01:31:22CodeVanceshould div be a keyword in nim?
01:31:45CodeVance@Varriount blockchains are an illusion
01:32:27FromGitter<Varriount> CodeVance: Seems a bit niche to be a keyword.
01:32:58CodeVancekarax readme calls div a keyword
01:33:07FromGitter<Varriount> It's a function: https://nim-lang.org/docs/system.html#div,int,int
01:33:35FromGitter<Varriount> Karax might use it for it's own internal DSL though. It might be considered a keyword in the DSL.
01:33:39CodeVanceI'll make an issue on karax
01:41:53FromGitter<kayabaNerve> @Varriount Tox is a decentralized secure chat app. No cryptocurrency or blockchain involved.
01:45:30CodeVancetox.chat
01:51:01FromGitter<kayabaNerve> That
01:55:29FromDiscord<awr> assigning a seq to another seq performs a deep copy right?
01:55:35CodeVanceI still don't understand the difference between type/untyped. I know it has to do with whether code is defined or not but its still confusing
01:55:47CodeVanceI need a flow chart
01:56:36CodeVanceawr I think the default for assignment is deepcopy
01:57:10CodeVanceI think you can do a shallowcopy default if you use the shallow pragma
01:57:21FromDiscord<awr> okay thanks
02:14:53FromGitter<Varriount> awr: No, not deepcopy
02:15:19FromGitter<Varriount> A deepcopy duplicates references (that is, a new reference is created, pointed to a copied block of memory)
02:16:02FromGitter<Varriount> Sequence and string assignments follow the same semantics that assigning a `struct` in C or an `object` type in Nim do.
02:16:25CodeVanceCreates a new reference pointing to the same obj?
02:16:34FromGitter<Varriount> Yes.
02:16:37CodeVanceI thought copying the ref is the same result
02:17:00FromGitter<Varriount> Here, let me write up some pseudocode
02:21:15FromGitter<Varriount> CodeVance, awr: https://gist.github.com/Varriount/ae5aab05a8771cdd155fe0ae3282f19a
02:23:09FromGitter<Varriount> So, note that if the element that the sequence contains is a reference, only the reference itself is copied, not the memory it points to.
02:25:05FromGitter<Varriount> dom96, araq: Is there some failing test that got past the build checks? All the most recent PRs have the same failing set of tests.
02:28:13CodeVancehttps://travis-ci.org/nim-lang/Nim/builds
02:28:35CodeVanceLast three seem to fail
03:16:05*Calinou quit (Remote host closed the connection)
03:17:14*Calinou joined #nim
03:42:00*leorize quit (Ping timeout: 256 seconds)
03:48:32*bevo joined #nim
04:01:53*skrylar quit (Remote host closed the connection)
04:06:59*fjvallarino quit (Remote host closed the connection)
04:07:26*fjvallarino joined #nim
04:12:21*fjvallarino quit (Ping timeout: 264 seconds)
04:21:35*crem quit (Ping timeout: 255 seconds)
04:22:05FromDiscord<DotDash> Coming from Java, what would the equivalent of `Object...` (varargs of any type) be, if it exists?
04:22:54FromGitter<Quelklef> `varargs[typed, converter]`
04:22:57*crem joined #nim
04:23:44FromGitter<Quelklef> If you're doing explicit casting from `Object`, dunno
04:24:04FromGitter<Quelklef> Because not all Nim values are objects I believe
04:24:12FromDiscord<DotDash> hmm
04:24:17FromDiscord<DotDash> doesn't seem to be working in a proc
04:24:25*lompik joined #nim
04:24:34FromGitter<Quelklef> what's your converter
04:24:43FromDiscord<DotDash> '$' for now
04:24:47FromGitter<Quelklef> hmmmmm
04:24:48FromGitter<Quelklef> send me the code?
04:25:27FromDiscord<DotDash> https://gist.github.com/xDotDash/c35d3ae90a8b4111bc726976acf8b484
04:25:44FromGitter<Quelklef> how are you calling it
04:26:15FromDiscord<DotDash> like if I wanted to do `invokeFunction("myfunc", 5, true)`
04:26:41FromGitter<Quelklef> hmmmm
04:26:43FromGitter<xDotDash> perhaps there is a more idiomatic way to do it?
04:27:04FromGitter<xDotDash> I suppose I could just switch to an array
04:27:51FromGitter<Quelklef> hmm, not working for me either
04:27:57FromGitter<Quelklef> but the echo declaration is `proc echo(x: varargs[typed, `$`]) {..}`
04:28:09FromGitter<xDotDash> interesting
04:28:44FromGitter<Quelklef> doesn't work even with only ``args: varargs[typed, `$`]``
04:28:53FromGitter<Quelklef> maybe echo is an exceptional case?
04:29:06FromGitter<xDotDash> seems like that might be the case
04:29:21FromGitter<Quelklef> I'm gonna look at the documentation for varargs
04:30:00FromGitter<Quelklef> we're all dumb
04:30:06FromGitter<Quelklef> ``varargs[string, `$`]``
04:30:17FromGitter<Quelklef> because `` `$` `` converts to string
04:31:01FromGitter<xDotDash> is varargs just an array underneath?
04:31:09FromGitter<Quelklef> yeah
04:31:21FromGitter<Quelklef> `f("a", "b", "c")` gets translated to `f("a", ["b", "c"])`
04:31:38FromGitter<Quelklef> for `f(string, varargs[string])`
04:31:52FromGitter<xDotDash> Can't seem to find anything about nim having a spread operator either hm
04:32:01FromGitter<Quelklef> it doesn't
04:32:05FromGitter<xDotDash> rip
04:32:06FromGitter<Quelklef> iirc there's a macro
04:32:15FromGitter<Quelklef> alternatively, you create a seq, and pass it as the varargs
04:32:33FromGitter<Quelklef> ala `f("first arg", @["second arg"] & rest_args)`
04:33:06FromGitter<xDotDash> my preference would have been being able to do `varargs[any]`
04:33:47FromGitter<Quelklef> I... don't know if that works with the type system
04:33:51FromGitter<Quelklef> are they homogenous?
04:33:57FromGitter<Quelklef> can you do `fT (x: varargs[T])`?
04:34:24FromGitter<xDotDash> I don't think that'll work for my usecase
04:34:55FromGitter<Quelklef> what's your usecase
04:34:58FromGitter<xDotDash> but ah yea I think `array[any]` will work
04:35:08FromGitter<Quelklef> also the `echo` decl is wrapped in a `when(nimvarargstyped)` so idk what's going on there
04:35:18FromGitter<xDotDash> being able to call an arbitrary function from Java
04:35:23FromGitter<Quelklef> oh wow I didn't know `any` is a thing
04:35:38FromGitter<Quelklef> but it's a typeclass, not a type?
04:36:41FromGitter<xDotDash> nim's type system certainly is interesting
04:36:48FromGitter<xDotDash> not something I'm particularly used to
04:36:55FromGitter<Quelklef> yeah, I agree. I quite like it though
04:37:35FromGitter<xDotDash> but it's definitely something I've always wanted, python syntax with static types
04:37:49FromGitter<Quelklef> yes! That's actually how I found Nim
04:37:54FromGitter<Quelklef> by looking for a "typed Python"
04:38:03FromGitter<xDotDash> hah we are in the same boat :)
04:38:58shashlickvarriount: I mentioned the failing builds earlier in the day, https://irclogs.nim-lang.org/07-07-2018.html#18:30:38
04:39:35shashlickone of my PRs are also impacted
04:40:22CodeVancedotdash unpackVarargs
04:41:01FromGitter<xDotDash> where can I find that?
04:42:42CodeVanceimport macros
04:43:07CodeVancedoes your proc need to be a proc?
04:43:24CodeVancemake it a macro
04:43:36CodeVancethen you can change it at compile time
04:43:39FromGitter<xDotDash> I definitely need a proc somewhere, just haven't fully figured out at which level
04:44:09FromGitter<Quelklef> Are you working with a lib or doing everything yourself
04:44:31FromGitter<xDotDash> no nim libs
04:44:46FromGitter<Quelklef> sounds like a code smell in my opinion
04:44:48FromGitter<xDotDash> besides the basic stuff
04:44:53*leorize joined #nim
04:44:54FromGitter<Quelklef> right
04:44:59FromGitter<xDotDash> I'm doing some java <-> nim interaction
04:45:08FromGitter<Quelklef> at runtime?
04:45:14CodeVanceI think its better as a macro
04:45:23FromGitter<xDotDash> at runtime yes
04:45:27CodeVanceThen build the call from the macro
04:45:35FromGitter<Quelklef> aw geez
04:45:36FromGitter<Quelklef> how
04:45:48CodeVanceor nvm
04:46:24FromGitter<xDotDash> through JNI
04:46:30CodeVanceI think you should look at the js lib. it can call undefined functions at runtime
04:47:15CodeVancewait .
04:47:33CodeVanceAre you importing the java code
04:47:33CodeVance?
04:47:55FromGitter<xDotDash> The java code is importing the nim code, I'm seeing if I could use nim as a scripting language
04:48:34CodeVancelol. is it working?
04:48:43FromGitter<Quelklef> Dunno but maybe check out https://github.com/yglukhov/jnim ?
04:49:21FromGitter<xDotDash> Yea I've checked out jnim, but that's more of the other way around I think
04:49:32FromGitter<xDotDash> importing java into nim
04:49:59FromGitter<xDotDash> it's further on the nim-side than the java-side
04:50:08FromGitter<Quelklef> Ah
04:50:24FromGitter<Quelklef> I've never dealt with anything like this before, so I can't help much, but good luck!
04:50:32FromGitter<xDotDash> Thanks :)
04:51:30CodeVanceusing nim as a scripting language will be difficult. If you aren't afraid to do the work it should be possible
04:52:04FromGitter<xDotDash> It certainly *looks* possible from what I've looked at so far
04:52:40CodeVanceTell me if you can call a nim proc from java
04:52:44CodeVanceI'm going to go sleep
04:53:47FromGitter<xDotDash> Well I know for sure you can call a proc from Java using JNI, as long as you export it to C
05:04:29*donlzx joined #nim
05:33:47*miran joined #nim
05:47:18*Trustable joined #nim
05:57:11FromGitter<Varriount> @xDotDash But the JNI isn't a transparent interface, right? I've heard there are a lot of complexities that need to be kept in mind.
06:16:45Araqdevel is red :-(
06:16:58Araqshashlick: the method failures landed in devel
06:17:16Araqnot sure how that happened... I only merge green stuff
06:35:53FromGitter<bevo009> Have you guys seen this recent Eudonix page on Nim? It's quite well presented ⏎ The installing guide is actually pretty good ⏎ https://blog.eduonix.com/web-programming-tutorials/nim-programming-language-syntaxes/
06:39:08*ng0 joined #nim
06:40:01*Trustable quit (Remote host closed the connection)
06:40:07ng0is there a way to build koch, after building nim, more verbose? I'm trying to understand where exactly the failure comes from.
06:40:37ng0so far I have a couple of guesses.
06:57:51Araqng0: edit koch.nim, proc 'boot'
06:58:06Araqdon't be scared, koch.nim is not black magic
06:59:06ng0okay, koch.nim was one source I thought of for the failure
06:59:19ng0because in the build chroot it fails, but outside of it it works
07:00:58ng0I did not start editing because I'm still reading into the language. I can paste the error in a while, I'll have breakfast first.
07:13:30*nsf joined #nim
07:18:35*nasusiro joined #nim
07:25:07ng0https://d.n0.is/pub/tmp/nim_fail.txt the odd thing is, /bin/sh exists. it's one of the elements which exist in our rather strict build chroot.
07:25:35ng0the message itself made me assume it is not koch.nim, but external from it
07:26:09ng0although you have an opinionated PATH reset in koch.nim which could be a problem for us
07:36:05*miran quit (Ping timeout: 276 seconds)
07:41:22ng0although this is not used in boot and release
07:52:41ng0the order: sh build.sh ; ./bin/nim c koch ; ./koch boot -d:release -d:useGnuReadLine -d:nativeStacktrace ; ./koch tools -d:release is in general okay, right?
07:52:55ng0the goal is to have a full-featured nim
07:55:44ng0what I did not consider so far was that the last 3 commands could maybe succeed post-install.
07:55:49ng0with a wrapped nim
08:00:47*rokups joined #nim
08:08:28ng0because I think it's much better to ask and learn from people than to guess: when I invoke "nim c koch", what exactly does happen internally, breaking it down to "expected file locations, files touched and assumptions on OS side"?
08:09:11ng0it's a clear language, but implementors often have their ways to explain more than just code
08:10:32*leorize quit (Ping timeout: 265 seconds)
08:11:12*leorize joined #nim
08:23:40FromGitter<Varriount> ng0: What are you aiming to do?
08:24:02ng0complete the nim package for Guix
08:26:32*yglukhov[i] joined #nim
08:31:22*skrylar joined #nim
08:36:04FromGitter<mratsim> @DotDash invokeFunction should be a template: `proc invokeFunction(name: untyped, args: varargs[typed, '$’]) = name(args)`
08:37:42*nsf quit (Quit: WeeChat 2.1)
08:39:08FromGitter<kayabaNerve> I think Koch is black magic. Change my mind.
08:40:50*fjvallarino joined #nim
08:43:16FromGitter<kayabaNerve> It's possible to use nimx without its AST, right?
08:43:39FromGitter<kayabaNerve> Can you do that with any Nim AST, even it makes the code ugly as hell? 🤔
08:45:04FromGitter<mratsim> Usually Macro are just a way for lazy programmers to avoid having to do type declaration, proc declaration, calling them and so ;)
08:45:21*fjvallarino quit (Ping timeout: 248 seconds)
08:46:33*Vladar joined #nim
08:52:21FromGitter<kayabaNerve> Is AST done through macros?
08:52:35FromGitter<kayabaNerve> Tbh I don't know. I haven't studied macros/AST
08:53:44*Hotkeys quit ()
08:56:32FromGitter<kayabaNerve> I probably should
09:01:51*rosshadden quit (Read error: Connection reset by peer)
09:03:52*rosshadden joined #nim
09:03:59*yglukhov[i] quit (Remote host closed the connection)
09:05:06*17WABPVIA joined #nim
09:05:46FromGitter<tim-st> when I wrap a file "header.h" this file is expected inside the nimcache folder when comiling, can I change the folder to look in the same folder for the "header.h" file like the wrapping "wrapper.nim" is?
09:21:25*donlzx quit (Quit: Leaving)
09:25:44FromGitter<diegogub> guys, anyone using jester? I'm trying to compile it but I get "jester.nim(5, 38) Error: cannot open 'macrocache'"
09:25:48FromGitter<diegogub> @dom96
09:26:48FromGitter<dom96> You need Nim devel
09:41:26FromGitter<mratsim> @tim-st look into status-im C library on Github: https://github.com/status-im/nim-secp256k1/blob/master/secp256k1.nim#L4
09:41:58FromGitter<mratsim> https://github.com/status-im/nim-decimal/blob/master/decimal/decimal_lowlevel.nim#L14
09:42:59FromGitter<mratsim> Alternatively you can use stb image approach of having a C file that just include the .h header: https://github.com/define-private-public/stb_image-Nim/blob/master/stb_image/read.c#L2
09:47:48*skrylar quit (Remote host closed the connection)
09:49:25*NimBot joined #nim
10:14:54*17WABPVIA quit (Remote host closed the connection)
10:19:30*PMunch joined #nim
10:30:20*yglukhov[i] joined #nim
10:32:29*Perkol joined #nim
10:33:46FromGitter<tim-st> @mratsim thanks!
10:37:31*dddddd joined #nim
10:46:53PerkolIn here https://github.com/zielmicha/libsodium.nim/blob/master/sodium/common.nim What does {.passl:"-lsodium".} mean?
10:48:03FromGitter<tim-st> described here: https://nim-lang.org/docs/nimc.html#compiler-usage
10:51:44YardanicoPerkol, it's a C compiler option
10:51:58Yardanicoit means - link the program with libsodium
10:53:04*TheLemonMan joined #nim
10:53:25*yglukhov[i] quit (Remote host closed the connection)
10:54:04TheLemonManwhat happened to the CI? the recent builds are all red
10:54:54FromGitter<kayabaNerve> Araq noticed yet said he only merges green ones...
10:56:25TheLemonManwhat if he's colorblind?
11:00:54FromGitter<kayabaNerve> He isn't afaik. I'm just saying he knows about the issue, said it wasn't his fault, and that's all I know. I don't know what deviant trying to sabotage Nim caused this. Was Dom jealous due to how much effort he's put in? Was Varriount paid off by the Rust team? 🤔
11:02:17Yardanicowhat happened?
11:04:55Yardanicoah, I checked gitter, nvm
11:04:57FromGitter<kayabaNerve> Someone merged code into devel that doesn't pass all the CI tests. I'm being dramatic af about it and trying to see if I can write a new spy thriller on the level of Digital Fortress
11:05:26Yardanico@kayabaNerve no one expected that such a fix would cause CI failures
11:06:20FromGitter<kayabaNerve> I'm not blaming anyone :p just trying to make some humor out of it. I'm sorry if it came across differently.
11:06:36Yardanicohttps://github.com/nim-lang/Nim/pull/8239 (PR) https://github.com/nim-lang/Nim/issues/8246 (code which fails with the PR )if someone is interested
11:08:26FromGitter<kayabaNerve> Weird. Thanks for the info
11:13:46*xet7 joined #nim
11:20:23FromGitter<dom96> Yeah. I don't get how that's causing the failure.
11:22:23FromGitter<kayabaNerve> Is it compile or runtime?
11:23:00Yardanicointernal compiler error is compile-time
11:23:36FromGitter<kayabaNerve> Got it.
11:23:50PMunchUgh, I thought I had found my issue with dynlibs and the GC. But trying to replicate it today it doesn't happen..
11:23:55FromGitter<kayabaNerve> Sorry. I forgot what it said. Probably should've just checked.
11:24:20FromGitter<kayabaNerve> @dom96 don't you generally use IRC?
11:26:16Yardanico@kayabaNerve he does
11:26:25YardanicoAraq mostly uses IRC too
11:26:43FromGitter<dom96> Yeah. But not when I'm using my phone
11:31:49*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
11:45:29*yglukhov[i] joined #nim
11:50:07*elrood joined #nim
12:15:13PMunchAh, I think that was just my mistake..
12:16:14*yglukhov[i] quit (Remote host closed the connection)
12:17:29*ng0 quit (Quit: Alexa, when is the end of world?)
12:25:50*Perkol quit (Remote host closed the connection)
12:26:27*nsf joined #nim
12:27:33*bevo quit (Ping timeout: 252 seconds)
12:36:32PMunchAraq, how is the rtl supposed to be used for libraries that are dynamically loaded?
13:08:38*miran joined #nim
13:52:57*krux02 joined #nim
13:55:17*yglukhov[i] joined #nim
13:59:24*PMunch quit (Quit: leaving)
14:16:22*krux02 quit (Remote host closed the connection)
14:25:47*krux02 joined #nim
14:31:05*find0x90 joined #nim
14:36:18*find0x90_ joined #nim
14:36:30*find0x90 quit (Ping timeout: 268 seconds)
14:55:18*fjvallarino joined #nim
14:59:45*fjvallarino quit (Ping timeout: 264 seconds)
15:03:56*krux02 quit (Quit: Leaving)
15:05:22*krux02 joined #nim
15:18:26nasusiroAraq: I have just read your article https://nim-lang.org/araq/concurrency.html and I wanted to ask: what's your opinion about Go's Goroutines that deal with channels?
15:24:23*find0x90_ quit (Quit: find0x90_)
15:32:21*fjvallarino joined #nim
15:40:01*edcragg quit (Quit: ZNC - http://znc.in)
15:40:13*edcragg joined #nim
15:42:16*smt joined #nim
15:52:33*smt quit (Quit: Leaving)
16:05:32*dorelix joined #nim
16:14:40Yardanicodo we really need packages like https://github.com/nim-lang/packages/pull/788/files ?
16:15:09Yardanicohttps://github.com/k0pernicus/compare/blob/master/src/compare.nim
16:15:39FromGitter<k0pernicus> @Yardanico It's very not useful :p ⏎ It was just a test to upload packages ;)
16:15:46Yardanicoah, ok, sorry :)
16:15:56*nc-x joined #nim
16:16:10YardanicoI just mean that usually only somewhat medium/big packages are submitted to nimble
16:16:48*dorelix quit (Quit: Leaving)
16:16:54*dorelix_ joined #nim
16:20:12*nc-x quit (Ping timeout: 252 seconds)
16:25:44FromGitter<k0pernicus> Actually, it can be pretty "dangerous" to submit minimalistic libraries, I agree… ⏎ I remembered when a NPM user removed very used minimalistic libraries: a high number of libraries/binaries failed to work :/
16:26:18Yardanicowell, that's NPM :)
16:26:21FromGitter<k0pernicus> But, minimalistic libraries can be pretty useful to test future syntax improvements for example… 🤔
16:27:34nasusiroplease no...no NPM nonsense with Nim O.o
16:28:55nasusirojust...just look at their code https://github.com/jonschlinkert/is-odd/blob/master/index.js
16:29:05nasusirowas this even necessary to be created as a package?!
16:30:10*yglukhov[i] quit (Remote host closed the connection)
16:30:22FromGitter<mratsim> @k0pernicus it was “leftpad” that crashed NPM
16:30:56FromGitter<mratsim> `(n % 2) === 1` huh? is it PHP?
16:31:00FromGitter<k0pernicus> @mratsim exactly!
16:35:06*fjvallarino quit (Remote host closed the connection)
16:35:33*fjvallarino joined #nim
16:37:48shashlickI wonder what motivated them to make such packages
16:38:18Yardanicoshashlick, that's JS :)
16:40:10*fjvallarino quit (Ping timeout: 256 seconds)
16:50:26*nsf quit (Quit: WeeChat 2.1)
17:15:47*fjvallarino joined #nim
17:41:10*Trustable joined #nim
17:50:23*rokups quit (Quit: Connection closed for inactivity)
17:57:06LyndsySimonI’m consider writing a fairly simple Tetris-like game. I’d like it to support iOS, Android, and web. Is Nim mature enough to do this, and what UI library should I consider? I’m looking at nimx right now, but it seems focused on forms.
18:04:38Araqmature enough? definitely.
18:04:58AraqUI library is always a tough question.
18:05:14AraqSDL2 seems most appropriate
18:07:54pydsignerSomeone made bindings for a nice-looking single-header GUI lib that could be used with SDL but I'm blanking on the name
18:12:45LyndsySimonnimx looks like it uses SDL2
18:14:04LyndsySimonA big problem I have is that I’m not familiar with the C ecosystem. I’m a Python dev by trade and used to having a single list of resources in PyPI.
18:14:23krux02LyndsySimon, for a tetris like game the UI is so simple that any UI library would be overkill
18:14:23LyndsySimonI’ve historically found it very difficult to know what is out there for me to use in nim.
18:14:48krux02the game as three menue entries, start quit and highscore
18:14:56LyndsySimonkrux02: I don’t even know how to draw to the screen, much less build to target iOS.
18:15:35krux02LyndsySimon, well forget iOS. Apple deprecated OpenGL the only cross platform API for performance rendering
18:16:35krux02you can use SDL2 to render to the screen, but the performance of the immediate draw calls for spriets isn't good, even if it has a "Metal" backend.
18:17:00LyndsySimonI’d really rather not “forget iOS”, consider all of my mobile devices run it.
18:17:28krux02And Metal only has an Objective C and Swift binding. So you would also need to write your own wrapper to it.
18:17:41Araqkrux02: for tetris SDL's performance will be fine
18:17:49Araqeven on OSX, with "Metal"
18:18:09Araqalso ... who knows if OpenGL stays deprecated
18:18:23Araqit was an insane move from Apple
18:18:58krux02yes it was. But it was not out of nothing.
18:19:41krux02OpenGL version on Apple devices is locked to version 4.1 that version is from 2010. Pretty old if you ask me. And they don't support any improvements that have been made since then.
18:20:40krux02I know what their plan is. If they would keep updating OpenGL, then Metal would not have any purpose or performance benefit. And people would not invest in porting to Metal.
18:21:20Araqwell sure, tie devs to the platform by forcing platform specific APIs down their throat
18:21:35*dorelix_ quit (Ping timeout: 240 seconds)
18:22:05Araqbut it's only bad when MS does it :P
18:22:19krux02I don't have a Mac so you could think I am not affected. But I develop a system for GPU programming that is built on OpenGL so I am affected.
18:22:19*nsf joined #nim
18:25:12krux02Well I don't know too much about the internal of DirectX and how everything is tied together. But as far as I know. OpenGL only runs on Windows because third parties want it supported. GPU drivers just support it. There is no Microsof involvement in it. A different thing is Mac. On a mac the OpenGL drivers are tied to the Openrating system. That is good if the operating system wants to keep the drivers up to date, bad
18:25:12krux02if the operating system wants to keep the drivers on an outdated level to push their Metal stuff.
18:25:43*Araq shrugs
18:26:44krux02And the hardware on a Mac and on a Linux machine is exactly the same.
18:26:57AraqI would use SDL2 and call it a day
18:27:20Araqit will be ported to any bullshit they'll throw at us
18:27:27krux02yea sdl2 solves the issue for you. At least that is what you think. But it really lacks a sprite batch drawing routine.
18:28:07Araqit definitely solves the problem for Tetris.
18:28:10Araqcome on.
18:28:56krux02I thought the same when I wanted to do 2d. Yea just do SDL2 and call it a day. For this simple scene it doesn't need high performance. But the performance was not just slow. It was horrible. I enabled software rendering and I got a 10 times porformance boost. It is that slow.
18:29:27Araqyes, use software rendering
18:29:34krux02but yes tetris in software rendering. Yes. It will do the job.
18:30:09*fjvallarino quit (Remote host closed the connection)
18:30:09krux02but normally you don't program tetris to program tetris. It is the first step in learing graphics programming. And 2d rendering with sdl, you will stop there.
18:30:16*fjvallarino joined #nim
18:30:55krux02btw for tetris I really think Processing is a cool environment to implement it. I did it, and it works great.
18:31:03Araqthere are also lots of 3D engines that are pretty good at 2D
18:31:06krux02(Sorry it is not Nim).
18:32:17Araqspeaking of which ... what's the difference between a camera and a viewport?
18:33:55Araqit's like they are stuck in the 80ies of OO software design. underline the nouns in your informal description and turn them into classes. The more nouns, the better.
18:36:39krux02for me a viewport is 4 integers, and a camera is 8 floats
18:37:15krux02position+size, position+orientation
18:37:57krux02but that doesn't matter for tetris at all. There it is just rendering with rect(...)
18:38:04krux02it's is very non OO
18:40:09FromGitter<Quelklef> Anyone know if there's a statically typed language that allows a definition of `someFun : A -> B` and `someFun : A -> C`?
18:41:43krux02Quelklef: you mean static dispatch on the return type?
18:42:08FromGitter<Quelklef> I think so, yes
18:43:32AraqQuelklef: Scala might allow it
18:43:56krux02I don't think so
18:44:18krux02Scala is on the JVM and what the JVM doesn't allow Scala also won't allow
18:44:40krux02(that is my scala 2.8 knowledge
18:46:08FromGitter<Quelklef> IIRC C++ allows it for some very particular cases
18:47:04krux02Quelklef: not really
18:47:35*yglukhov[i] joined #nim
18:47:36FromGitter<Quelklef> Huh, I must have been mistaken. I thought doing `a = f()` vs `const a = f()` could result in different calls
18:47:41FromGitter<Quelklef> I only used C++ for a bit, though
18:47:56krux02Quelklef: no it doesn't
18:48:11FromGitter<Quelklef> oops
18:48:13krux02well let me test it
18:48:21krux02i think you men the costness of iterators
18:49:23FromGitter<Quelklef> it was in `bitset`
18:49:38FromGitter<Quelklef> `bitset` has both `bool operator[] (size_t pos) const;` and `reference operator[] (size_t pos);`
18:50:55krux02Quelklef: do you see the const in the end
18:51:11krux02that is the const-ness of the `this` pointer that is in fact an argument
18:51:27FromGitter<Quelklef> Ah
18:51:51FromGitter<Quelklef> So it's not on return type then
18:52:03krux02yes
18:52:18FromGitter<Quelklef> Sorry, I had only used C++ for a hot second :P
18:52:35krux02well it is some advandced knowledge.
18:52:46krux02I would not blame anybody for not knowing
18:53:07krux02same with the abs error that I continue to see in project that use math.
18:53:24krux02there are cases where abs just turns the argument into integers
18:53:39krux02and that is not what you want
18:53:40FromGitter<Quelklef> ????
18:54:33FromGitter<Quelklef> Why though
18:55:06krux02http://ix.io/1gvp
18:55:09krux02try it
18:55:35krux02my output on my machine is 123.000000
18:55:49krux02I let you figure that out on your own.
18:55:58krux02One of the reasons I abandon C++
18:56:24krux02btw on Windows it does return 123.456
18:56:30FromGitter<Quelklef> `123.000000` for me as well
18:56:51krux02write "using namespace std" before main and test it again.
18:57:41FromGitter<Quelklef> Well that means im calling `std::abs` instead of `cmath::abs` right?
18:58:08krux02there is no cmath::abs
18:58:25krux02but yes it means you are calling std::abs
18:58:31FromGitter<Quelklef> oh
18:58:34FromGitter<Quelklef> what am I calling before?
18:58:37FromGitter<gemath> Hi, somebody here who knows sth anout the AppVeyor and Travis tests for Nim on github?
19:00:04krux02Quelklef, try the version in C as well
19:00:08krux02it will surprise you
19:00:22FromGitter<Quelklef> Ok, my guess is the following: apparently the default `abs` is `int abs(int x)` as well as other integral types, so it's (for some reason) implicitly converting my float to an int before calling `abs`?
19:00:23FromGitter<Quelklef> Sure
19:00:27krux02so with math.h and a c compiler
19:00:31krux02and no namespace
19:01:25FromGitter<Quelklef> `1.000000`
19:01:30krux02what?
19:01:37krux02that is not what my result is
19:01:45krux02http://ix.io/1gvs
19:01:50krux02try that on a c compiler
19:02:03FromGitter<Quelklef> Yeah that's what I have
19:02:28FromGitter<Quelklef> with gcc, gives 1.000000
19:02:33krux02well I have 123.456 on gcc
19:02:42FromGitter<Quelklef> huh
19:03:20Yardanicoit's 1.000000 for me on gcc 8.1
19:03:23Yardanicokrux02, what's your gcc version?
19:03:39Yardanicolol, it's 123.000000 with clang
19:03:40FromGitter<Quelklef> im gcc 7.2.0
19:03:40nasusiroyou do realize that abs() returns an integer value, don't you?
19:03:45Yardanico(on linux)
19:03:57nasusirowhich gets implicitly type cast to float thanks to %f flag
19:04:00Yardaniconasusiro, but how the results can be so different?
19:04:09krux02nasusiro, yes it does return an integer value and it is implicitly converted to double
19:04:23Yardanico123.000000 with clang and 1.000000 with gcc, is that UB?
19:04:49krux02nasusiro, no it gets converted to a double because of "double y = abs(...)"
19:04:55krux02y is of type double
19:04:57miran1.000 here too
19:05:02FromGitter<Quelklef> But why does it call the `int abs(int)` instead of erroring? yuck
19:05:41nasusirokrux02: yep, correct.
19:06:04krux02on a C compiler it will call "double fabs(double)" because of a macro abs that checks the type of the first argument
19:06:07nasusiroconfusion happens from use multiple languages at the same time
19:06:10krux02that is a C only feature
19:06:32krux02introduced in c99
19:06:39krux02to implement static dispatch
19:06:39FromGitter<Quelklef> But shouldn't cpp complain?
19:06:53krux02well with -Wconversion yes it does complain
19:07:18krux02the problem, when you call -Wall it doesn't complain, you explicitly have to add -Wconversion as well
19:07:20Araqnasusiro: message passing is not my cup of tea.
19:07:28FromGitter<Quelklef> Aw man
19:07:39FromGitter<Quelklef> And then it's just a warning
19:07:42Araqcreates hard to debug situations
19:07:45FromGitter<Quelklef> That's pretty yikes
19:08:01nasusirowith GCC 7.3.0 I get 123.000000
19:08:09nasusiroAraq: no worries mate.
19:08:23nasusiroI'm studying Go's concurrency for educational purposes
19:09:00nasusiroI would like to see how we could some useful tips and tricks from Go's internals for Nim's use
19:09:16nasusirothe concept of Goroutines looks really cool to me
19:10:33krux02I made a mistake I thought calling test.cpp with gcc compiles with the c compiler. it doesn't
19:10:55krux02gcc is the entire gnu compiler collection and it picks the compiler on the file ending
19:11:02krux02gcc -x c is a c compiler
19:13:55FromGitter<k0pernicus> @nasusiro goroutines aren't "just" a "pretty-cool-name-for-the-community" name for green threading?
19:14:09Araqnasusiro: I still believe in Nim's "guards"
19:14:21nasusirok0pernicus: nope
19:14:32nasusiroit's an advanced mechanism that is so cool in use
19:14:47nasusiroyou can have countless goroutines for a single OS thread
19:15:02Araqthat is green threading.
19:15:20FromGitter<k0pernicus> That is green threading, yep
19:15:28nasusironot really. Green threads emulate OS threads, but do not depend on actual OS threads
19:16:53Araq?
19:17:19AraqI guess these terms are not well defined, as usual.
19:17:41Araqfor me green threads is exactly that, you map X green thread onto an OS thread
19:18:45krux02Goroutines are not like threads. Threads can be interrupted at any state and then the state of the thread is stored and at a later state resumend. Goroutines are more light weight, because they are more like returning from a resumable function when they yield
19:18:56nasusirothe runtime handles the threads instead of letting the OS do so
19:19:10nasusiroso, Go's runtime handles N green threads with M OS threads
19:19:19Araqhuh? a Goroutine can be interrupted at any state.
19:19:58Araqin fact, that's how the shared GC works, it interrupts the goroutine(s)
19:21:09krux02Araq: thought goroutines are not interrupted at any state, when they go to a yield or a possible blocking, the actual system thread that is executing that goroutine continues to execute the next goroutine
19:21:29Araqwhat is a 'yield'? Go has no such keyword
19:21:48krux02with yield I mean a possible blocking operation such as reading from a channel
19:21:57Araqit's not cooperative threading
19:22:13Araqa goroutine can be interrupted by Go's scheduler.
19:22:48krux02well then I have no idea of Go works
19:23:56AraqI studied its GC a bit. I stopped reading when I figured its write barrier relies on "benign" data races
19:24:20Araqthough to be fair Haskell does that too iirc
19:24:32Araqbut it's just nothing I ever want to write and debug
19:24:35krux02I am still confused by the word benign
19:24:47krux02it looks like a typo of begin
19:25:25krux02well I don't believe in a global gc.
19:25:37nasusirokrux02: think of it as "kind, good"
19:26:28krux02I can agree that a gc is helpful to have an easier job at solving certain kinds of problems. But a global gc that has to stop the word and collect everything can really get in the way of real time applications.
19:26:53nasusiroyou mean the work or the world?
19:26:55krux02so I really like the Nim model with thread local gc
19:27:09krux02world
19:27:15nasusiroah cool
19:28:07krux02during gc nothing can operate on the data that is being cleaned up. But in thread local GC there is the possibility that the GC just collects one thread while the other threads just continue what they are doing.
19:28:16krux02so the program isn't interrupdet just the thread
19:28:35krux02removing most of the problems a gc comes with.
19:29:40nasusiroI don't disagree with you krux02, but what I like about Go is how it handles thousands of concurrent operations without a fuss. I haven't played with Nim's concurrency model yet, but I'm getting there
19:29:56nasusiroif I can push Nim's limits the same way Go let me do so, I will be more than pleased
19:30:56nasusiroGo's LWPs are the real power that handle so many concurrent operations and that is something I would like to see in a Nim demo.
19:32:39krux02nasusiro, well you can also create lots of objects of type Problem and call the `handle` method in a loop
19:33:10nasusiroI'm still learning Nim, but I'm taking notes and I will do so as soon as I get there. thank you for letting me know
19:34:09elroodsometimes this channel just randomly generates comedy gold
19:34:35nasusirodo you mind to share the fun part elrood?
19:36:49*lompik quit (Ping timeout: 268 seconds)
19:36:58elroodtoo brain-thread-local to be shared, sorry
19:38:42nasusiroso you just pass by and implicitly offend people with your comments and then you don't justify your sayings? Are you a troll or something?
19:44:58dom96whoa, why is what elrood said offensive?
19:45:10elroodapologies if you feel offended by that, that certainly wasn't intended
19:45:59nasusirodom96: if you consider this line "sometimes this channel just randomly generates comedy gold" innocent, I don't know what to say...seriously now.
19:46:21nasusiroeven if I am talking bullshit here, just justify your statement(s) by point me at the right direction
19:46:22livcdelrood: fascinating. You already apologized to him yesterday as well
19:46:41nasusirolivcd: you see, that's where you are wrong
19:46:46nasusiroI was the one who apologized
19:46:58dom96I didn't read any of the previous conversation, so maybe I'm completely missing context here
19:47:23livcdnasusiro: oh true sorry
19:47:38shashlickwhen does nim decide to pass -DWIN32_LEAN_AND_MEAN to gcc?
19:48:20nasusiroyou people are so quick to judge anything and everything behind a monitor...bloody hell, I can't find a decent channel without SJWs and public defenders...I have started losing interest in Nim right now -_-
19:48:59krux02 shashlick have you tried using "grep -i WIN32_LEAN_AND_MEAN" in the nim folder?
19:49:17Araqnasusiro: relax, there are no SLWs around
19:50:08Araqand wasn't it you you started with "offensive!" anyway
19:50:21livcdnasusiro: I would say #go-nuts is more opinionated than #nim
19:50:47nasusiroI haven't had such problems with #go-nuts so far
19:50:50nasusiroanyway
19:51:02livcdyou had problems in #nim ?
19:51:15Araqwhich problems? it's like I missed some crucial part of the conversation
19:51:22FromDiscord<exelotl> I'm so confused haha
19:52:37dom96This isn't something we should be discussing here. For those who want to discuss this further please jump onto PM with me
19:52:51nasusirolivcd: did you see me say "#nim"? I said "I haven't had such problems with #go-nuts so far", that is about opinionated issues under Go's channel
19:52:52shashlickkrux02: i searched on github but it was pointless - nimgrep found it in a second locally
19:54:04shashlickit is included if you import winlean
19:54:05krux02yea I also prefer to search locally
19:54:20shashlickthing is that I don't have that import anywhere and yet it gets added
19:54:34krux02github search is not completely useless though I don't want to clone everytghing that I search on
19:55:38livcdis it only me or gh search became worse ?
19:56:56Araqthat regression is so weird
19:57:11nasusirolivcd: yeah, it is. let's hope they will fix it eventually. people opened a ticket suggesting Microsoft to open the Github platform as open source so people can start fixing issues and add support to important mechanisms such as a proper search engine for GH
19:57:35Araqnowhere in tmultim2.nim any typetrait is used
19:58:13*TheLemonMan joined #nim
19:58:19FromGitter<xDotDash> where can this ticket be found?
19:58:30TheLemonManAraq, yo, #8249 fixes the regression
19:58:51AraqTheLemonMan: huh? did you fix it?
19:58:51livcdnasusiro: i hope microsoft invests in Ruby instead :P
19:59:10TheLemonManAraq, of course, that's what I'm paid to do
19:59:37nasusirolivcd: haven't they added the experimental JIT support yet and so incredible performance improvements?
19:59:45Araqah ok. mind to share who is paying you?
19:59:46nasusironot Microsoft that is, but the Ruby team
20:00:54*krux02 quit (Remote host closed the connection)
20:01:49dom96livcd: Ruby? Blasphemy
20:02:01nasusirolivcd: now that you mentioned Ruby...I wonder whether they use Crystal for some of their critical parts
20:03:50nasusiroAraq: you know what it would be cute? To codename Nim's threading mechanism as nima. νήμα in Greek means thread :D
20:03:53FromGitter<k0pernicus> Ruby, Crystal… It's not the same thing at all… ⏎ Crystal's syntax is inspired by Ruby, but the back-end, libraries and all other stuff are different
20:04:05FromGitter<k0pernicus> It's like comparing Python and Nim
20:04:17Araqexept we have py2nim ...
20:04:20*Araq coughs
20:05:03nasusirok0pernicus: I meant in case they want to move some critical parts of GH's infrastructure to a static typed language
20:05:06FromGitter<k0pernicus> Cython to Nim is included?
20:05:21nasusiroif Crystal resembles to Ruby, logically it would be easier to learn it in no time
20:05:39FromGitter<k0pernicus> Think that critical libraries of Python (numpy, scipy, sklearn, …) are written using Cython
20:05:47nasusiroCython is a C-extension for Python, so technically does not count
20:07:33*fjvallarino quit (Ping timeout: 264 seconds)
20:08:12nasusiroAraq: I'm reading this article of yours https://nim-lang.org/araq/destructors.html and I'm really impressed by the way you write.
20:08:43nasusiroI wanted to ask you about this article; why you choose the name "destructor" if you are not dealing with actual objects? why not eliminator?
20:11:09*miran quit (Ping timeout: 264 seconds)
20:11:27*zahary joined #nim
20:12:30*xet7 quit (Quit: Leaving)
20:18:15Araqoh yeah, that article was rather well received, it has follow up posts in the form of RFCs on github
20:19:07nasusirooh yeah, I forgot to look at GH
20:20:13livcddom96: i just like ruby
20:21:16*yglukhov[i] quit (Remote host closed the connection)
20:24:11*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
20:24:16FromGitter<dom96> @zacharycarter ping
20:26:40FromGitter<citycide> has anyone implemented a "safe call" operator? something to make `if someProc != nil: someProc(...)`nicer when I've got procs dealing with optional proc parameters
20:27:26Araqnasusiro: a destructor is attached to an object type in Nim. the design is really close to C++'s
20:27:34nasusiroAraq: ah I see
20:27:49Araqbut now I'm intrigued
20:28:00nasusiroabout what exactly?
20:28:08Araqdo you have an idea what your 'eliminators' could look like?
20:28:27nasusirowell, think of RAII in a lightweight way
20:29:03nasusirosometimes we think in a complex way by default, but the real virtue comes with simplicity
20:29:25nasusiroif I'm not mistaken, Nim has a try - finally mechanism, am I correct?
20:32:57*find0x90 joined #nim
20:33:48nasusiroAraq: so, what happens to variables that go out of scope? do they get freed by the GC or do they get released immediately?
20:33:59*PMunch joined #nim
20:43:42FromGitter<Varriount> @citycide Look at the `options` module.
20:44:47FromGitter<Varriount> @citycide For my command shell program, I have a function that returns a procedure wrapped in an option. It works pretty well.
20:48:00Araqnasusiro: well the variables themselves are on the stack and get released immediately
20:48:13nasusirothat's a plus then.
20:48:20Araqbut what they point to - if it's on the GC'ed heap - is GC'ed
20:51:31*find0x90 quit (Quit: find0x90)
20:52:07nasusirohmm...
20:52:42nasusirohow fast is Nim's GC?
20:53:39FromGitter<Varriount> nasusiro: Pretty fast.
20:54:05nasusiroAraq: another question. Is Nim's move mechanism the same as C++11's?
20:54:35*nsf quit (Quit: WeeChat 2.1)
20:59:25FromGitter<kayabaNerve> Araq What's up with ref?
21:00:03FromGitter<kayabaNerve> In that linked article you mentioned a dislike/avoidance/behavior change
21:00:26FromGitter<kayabaNerve> Has that happened, will that happen... Or did your thoughts change?
21:03:13FromGitter<kayabaNerve> I'm guessing 1/3 :p
21:03:44FromGitter<kayabaNerve> If 3, I am curious to know your thoughts/how ref has evolved/reasons to avoid
21:07:36*Vladar quit (Quit: Leaving)
21:09:20shashlickaraq: when was the tmultim2.nim issue fixed?
21:10:07Araqshashlick: a couple of hours ago
21:10:21shashlickok
21:10:33shashlickany idea why this is failing: https://travis-ci.org/nim-lang/Nim/jobs/401484249#L3576
21:12:47shashlickok, I had to merge those fixes into my branch anyway, hoping for the best
21:16:41dom96Araq: What was the problem?
21:16:46dom96That failure puzzles me
21:19:45FromGitter<Varriount> Has the notation that allows templates to accept code blocks been changed to special-case `else` following the template invocation?
21:21:59FromGitter<Varriount> I'm receiving errors from the compiler after trying this: https://gist.github.com/Varriount/2b1f0c02db5bdd03574c967924bacd75
21:25:00nasusiroAraq: in the aforementioned article that I shared before, in section Strings, where you show how proc `move`*(...) is implemented, why is b.data nil-ed and not dealloc()-ated first and then nil-ed? Is this behavior safe?
21:26:35Araq'move' is an ownership transfer, nothing gets destroyed.
21:26:51Araqwell except if 'a' already had data...
21:27:12nasusirobut we assigned b.data inside a.data...
21:27:20nasusirotherefore b.data is useless to us now.
21:28:58PMunchAraq, did you see my request for information about dynlib and GC?
21:29:03PMunchI really can't get it to work
21:29:38PMunchSometimes it works with one plugin, sometimes it just fails, sometimes combinations of plugins fails, but each plugin separately works.
21:29:40AraqPMunch: https://nim-lang.org/docs/nimc.html#dll-generation read this?
21:30:02Araqevery plugin needs to use 'nimrtl.dll' (which need to build first)
21:30:07PMunchYeah I've read that
21:30:23Araqdom96: system.nim changed the compiler's hash table order
21:30:33Araqand the compiler never was correct, but lucky
21:30:42dom96I see
21:30:43Araqso a wrong symbol was bound
21:30:46PMunchAnd compiled nimrtl and compiled the program with -d:useNimRtl along with all the plugins
21:32:37Araqnasusiro: move(a, b) means a is the owner of what b used to hold
21:32:51Araqand so a steals the pointers from b
21:33:04nasusiroAraq: true. but b has no use anymore, correct?
21:33:14Araqbut b's destructor needs to be prevented from doing bad things, and so b gets nil'ed
21:33:47nasusirowait a minute...when you dealloc() b.data, the destructor gets called?
21:35:20PMunchAraq, this is what I have so far: http://ix.io/1gws
21:40:14*krux02 joined #nim
21:41:55dom96PSA: CVE-2018-13034 in Jester: https://forum.nim-lang.org/t/4028 (our first ever CVE :D)
21:42:06shashlickmany failures on travis mac - is there any plan to get all tests passing on mac? https://travis-ci.org/nim-lang/Nim/jobs/401534177
21:42:54*Trustable quit (Remote host closed the connection)
21:47:33nasusirodom96: bloody hell...so I guess we should open a champagne now?
21:48:24dom96totally
21:49:04nasusirolol, I have managed to crash the search inside https://nim-lang.org/docs/manual.html
21:49:27nasusiroI was typing fast and had a typo; I pressed backspace and it froze now
21:50:06nasusirothat's under waterfox 56.2.1
21:52:28PMunchLoving the way you ended up implementing the modular routes by the way dom96 :)
21:52:49dom96PMunch: Yay, glad you like them :)
21:53:40Araqshashlick: yup
21:53:54AraqPMunch: hmm tough nut. post it on the forum please
21:54:40nasusiroAraq: wait a minute...what am I thinking? Indeed by nil-ing b.data you no longer point at the same location where now a.data points. That's exactly how C or C++ do it. Oh man...I've got brain damage with so many languages in my head lol
21:57:15dom96Araq: Did you fix this manually?
21:57:16dom96https://github.com/nim-lang/Nim/pull/7234#event-1500957290
21:57:18dom96or what?
21:58:01Araqno. I decided there is nothing to fix.
21:58:11Araqthe way math.nim does it makes sense.
21:58:55dom96Oh, I missed your comment
21:59:16CodeVanceAraq: Would using the C++ backend effect compilation speed? Or speed overall.
21:59:54Araqfrom my latest experiments compilation times are unaffected
22:00:20Araqand overall speed increases because of the better exception handling implementation
22:00:37dom96Araq: In what world should float ^ float fail?
22:01:06FromGitter<kayabaNerve> What's the differences between the two anyways? 99.99% of C is valid C++. I doubt we are using any c++ specific features as something that high level would cause slow doesn't
22:01:13Araqit's pow() and uses a totally different algorithm than ^
22:01:26dom96so?
22:01:35FromGitter<kayabaNerve> *mainly thinking stl than features *downs
22:01:39dom96I and most people really don't care what algorithm it uses
22:01:46dom96we just want to apply `^` to two floats
22:01:54Araqyeah but you don't.
22:02:11Araqyou don't even know what x ^ 0.3 means
22:02:14Araq:P
22:02:43FromGitter<kayabaNerve> Whats the difference between ^ and pow?
22:03:17FromGitter<kayabaNerve> I think a quick sumup would be better than "yeah but you don't" :p
22:03:23CodeVancespeed
22:03:26CodeVanceperformance
22:03:31CodeVancethe performance is bad
22:03:49dom96Araq: who are these "others" that agreed with you?
22:04:03Araqjust read the issue
22:04:13dom96Two people thought it was important enough to create a PR for it
22:06:04Araqand not important enough to create a PR for it that would even pass the CIs
22:06:38dom96lol ok
22:06:47dom96I'll recreate the PR if I run into this again
22:07:15PMunchHmm, the reset password mail for the forums never arrived..
22:07:17FromGitter<kayabaNerve> But do they return different results? If not, why not just use the overall better algorithm. Most people won't care, expect both, and will have a 50/50 chance of picking the slower one...
22:07:44dom96PMunch: Spam?
22:08:14PMunchNot on Gmails end, but my mail forwarder has a really aggressive spam filter..
22:08:27PMunchI really should set up something else..
22:09:55nasusiroAraq: about using C++ backend, as long as you don't use anything with templates, the speed should be on a par with C
22:14:58CodeVanceIf I want to include an "asset" folder. is there a way to do that with nimble
22:16:27FromGitter<xDotDash> How should I supply a default string if the provided one is nil?
22:17:57CodeVanceif val.isNil: "" else: val
22:21:10FromGitter<xDotDash> Ah ok
22:22:02CodeVanceis that what you want?
22:22:54*PMunch quit (Quit: leaving)
22:23:19FromGitter<xDotDash> Yea, I was just wondering if there was a standard proc for supplying a default value for an arbitrary type/value
22:25:50*fjvallarino joined #nim
22:28:06dom96bah PMunch, why leave now? I just got you your password reset link
22:28:08*find0x90 joined #nim
22:34:32nasusirodom96: don't you have his email?
22:35:20dom96true, but if he's gone to sleep by the time he wakes up the link will be expired
22:39:23nasusiroyou have nothing to lose.
22:42:14shashlickgemath: what you looking for?
22:48:33FromDiscord<exelotl> hey what color scheme do you use for the code sample on https://nim-lang.org/
22:51:12*crem quit (Ping timeout: 256 seconds)
22:52:43nasusiroexeoltl: it took me a couple of seconds to view the website's source code and it's called dracula
22:53:03nasusirohttps://nim-lang.org/assets/css/highlight/dracula.css
22:53:15*crem joined #nim
22:53:20nasusirohere's the actual link for it https://github.com/zenorocha/dracula-theme
22:55:58FromDiscord<exelotl> oh nice, thanks
22:57:27FromGitter<kayabaNerve> @xDotDash CodeVance `proc x(y: int = 0) =` ???
22:57:54FromGitter<xDotDash> hmm?
22:57:56CodeVancekayabaNerve?
22:58:07FromGitter<kayabaNerve> Default values?
22:58:21FromGitter<kayabaNerve> Why use a if statement when you can just define it in the process declaration?
22:58:44CodeVancefor a proc sure
22:58:51FromGitter<xDotDash> I was thinking more along the usage of this `"my possibly nil string".elseIfNil("my default")`
22:59:15FromGitter<kayabaNerve> @xDotDash is it in a proc?
22:59:25FromGitter<xDotDash> It's in a proc but not an argument for it
22:59:25FromGitter<kayabaNerve> If so, just use what I said
22:59:58FromGitter<kayabaNerve> If it's user input, then what CodeVance said
23:00:04*elrood quit (Quit: Leaving)
23:00:17FromGitter<xDotDash> yea it's user input, so I am using what he suggested
23:00:36CodeVanceAre you talking about optional?
23:02:08FromGitter<kayabaNerve> Never mind
23:02:22FromGitter<kayabaNerve> Optional arguments can be used to prove default values
23:02:34FromGitter<kayabaNerve> Both terms apply
23:03:39FromGitter<kayabaNerve> Just trying to help :p sorry I misunderstood the context. I'm happy you found what you needed
23:05:22krux02xDotDash: don't use nil strings. It is inteded to remove the nil state of th strins
23:05:45FromGitter<xDotDash> 👍
23:07:19krux02xDotDash: but for nilable types you can overload the ``or`` operator.
23:08:00krux02``proc `or`[T](a,b: ref T): ref T = if a.isNil: b else: a
23:08:45CodeVanceI thought strings aren't nilable
23:08:59krux02that code won't work for strings
23:09:10krux02and strings are nilable in the past version of Nim
23:19:33nasusiroDoes Nim has a help() command like Python does? I want to read more about the builtin types and manual does not say almost anything...https://nim-lang.org/docs/system.html#string
23:21:48krux02nasusiro: no it does not, and it does not really have a repl, even though there is "nim secret"
23:22:02nasusirois that a command?
23:22:16nasusiroor you mean the TCC repl attempt?
23:22:29krux02nasusiro, secret is an argument to the nim compiler
23:22:58krux02but it does not use readline at all
23:23:05krux02so I recommend to use it with rlwrap
23:23:27krux02"rlwarp nim secret" on the command line if you are on linux and have nim on the path and have rlwrap on the path
23:24:18nasusiroI don't have rlwrap installed, whatever that is...
23:24:50nasusiroreadline line wrapper, cool.
23:24:50krux02it is a command line sulution to use 'gnu readlibe' with any program that does not have readline support
23:25:11nasusiroI'm OK with compiling my code for the moment :)
23:25:25nasusirothanks for your kind suggestions though, I appreciate it.
23:25:36krux02the problem is readline is gpl, and rlwrap works around that issue and there is basically no integration work needed
23:27:22krux02link gpl to something, this something has to be gpl, too. Unless you never release that something at all at any license.
23:32:47nasusirowhat about LGPL then?
23:33:55krux02well I don't know a lot about lgpl, but I know Nim isn't LGPL
23:34:07krux02and readline is GPL
23:34:21krux02so I don't know what lgpl should solve
23:39:07krux02I just looked at lgpl. It means that the end user should always be allowed to inspect modify and relink the lpgl part of the program.
23:47:28nasusiroso, what exactly is the problem with readline's license again?
23:47:49krux02nasusiro, well it is gpl
23:48:00nasusiroagain, what's wrong with GPL?
23:48:07krux02and gpl basically says, whatever you link with gpl has to be gpl, too.
23:48:27nasusirosays who?
23:48:31krux02the gpl
23:48:50nasusiroso if I have a source that is under MIT, I'm not allowed to compile it with GPL code?
23:49:08krux02well you are allowed
23:49:24krux02but the project then has to be gpl
23:49:30krux02in simple words
23:50:25krux02individual parts may be mit or other licenses, but the whole preject is the logical `and` of all the restrictions the licenses put on the project
23:50:58krux02so to say it is gpl is not entirely correct, but being said that gpl is the most restrictive open source license it is practically correct.
23:51:04nasusiroI still don't understand how readline's license affects its use with any program
23:51:14krux02well readline is gpl
23:51:27krux02so when you have a project and call link it with readline
23:51:48krux02that project has to be licensed as gpl as well.
23:52:16nasusiroare you referring at char * readline(const char *prompt); or the actual urxvt-readline which is licensed under GPL?
23:53:09krux02nasusiro, isn't that function you just reffered to the core function of the gnu readline library?
23:54:32nasusiroyes
23:55:19krux02and when you use that function you inevitably have to link to readline
23:57:33krux02it is possible though to split the program into gpl-licensed-part. mit-licensod-part and the union of both parts that is then gpl again.
23:58:48nasusiroso that's why people are complaining so much about GPL
23:58:59krux02probably
23:59:12nasusirointeresting
23:59:57nasusirobut I still don't understand your concern about using readline...unless you meant the cases of someone wanting to build a proprietary application