<< 19-04-2018 >>

00:15:41*xet7 quit (Read error: Connection timed out)
00:16:24*xet7 joined #nim
00:22:11*arecaceae quit (Remote host closed the connection)
00:22:33*arecaceae joined #nim
00:23:29*user1101 quit (Quit: user1101)
01:02:36FromGitter<amscotti> Hi, if I have a proc like so `proc is_something*(a, b, c: float): bool =` I can call it with all ints, like `is_something(1,2,3)` and all is good. But, if I change `proc is_something*(s: array[3, float]): bool =` I get a type mismatch error when calling it like `is_something([1,2,3])`. Is there a way of making this work or is this just how arrays work?
01:07:54FromGitter<zacharycarter> @amscotti I'm guessing type inference is making [1,2,3] into an Array[int]
01:08:13FromGitter<zacharycarter> so you could do
01:08:28FromGitter<zacharycarter> is_something([1,2,3].Array[float]) I think?
01:08:32FromGitter<zacharycarter> or
01:08:50FromGitter<zacharycarter> is_something([1.0,2.0,3.0])
01:10:40FromGitter<amscotti> Ok, that's good to know! Sadly both are not ideal for my project. Thanks for the help!
01:16:01FromGitter<zacharycarter> well
01:16:05FromGitter<zacharycarter> you could also try using varags
01:16:07FromGitter<zacharycarter> or openarray
01:16:33FromGitter<zacharycarter> not sure either of those would help - but please keep in mind - the Nim compiler doesn't know that you intend 1 to = a floating point numeral
01:16:42FromGitter<zacharycarter> without any kind of type specification
01:17:10FromGitter<zacharycarter> I don't think many strongly-typed programming languages would allow for this - you'd need a looser language to handle what you're describing
01:17:23FromGitter<zacharycarter> like Python or JS, etc...
01:17:34FromGitter<zacharycarter> @amscotti ^
01:18:03FromGitter<zacharycarter> but then you lose type safety so...
01:22:40*SenasOzys__ joined #nim
01:23:25*SenasOzys_ quit (Remote host closed the connection)
01:25:46FromGitter<amscotti> @zacharycarter Yup, I understand and it's all good. I just don't have much control over how people are going to be writing the code, I'm trying to update one of the exercises for Nim track on Exercism, so giving the inputs from there data set I don't want to change things too much as it should be easy to understand. I can drop the need for floats which help out so I'm all set. :)
01:26:34FromGitter<zacharycarter> ah okay, cool!
01:29:44*onionhammer1 joined #nim
01:31:44*onionhammer quit (Ping timeout: 260 seconds)
01:32:16*xkapastel quit (Quit: Connection closed for inactivity)
01:35:58*xet7 quit (Read error: Connection timed out)
01:36:25*xet7 joined #nim
01:46:48*user1101 joined #nim
01:54:20*xet7 quit (Read error: Connection timed out)
01:55:02*xet7 joined #nim
01:56:18*xet7 quit (Max SendQ exceeded)
01:56:40*xet7 joined #nim
02:07:59*xkapastel joined #nim
02:14:34*xet7 quit (Read error: Connection timed out)
02:14:57*xet7 joined #nim
02:18:21*yglukhov_ quit (Ping timeout: 264 seconds)
03:21:16FromGitter<gogolxdong> How to del a key of `var userTable* = newOrderedTablestring, User ()`
03:22:21shashlickuserTable.del(key)
03:23:02FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ad80b955f188ccc157d9e4a]
03:23:16FromGitter<gogolxdong> `del(userTable,users.id)`
03:23:50shashlickdid you import tables?
03:24:19*xet7 quit (Read error: Connection timed out)
03:24:53FromGitter<gogolxdong> realized as soon as I sent last message
03:25:03*xet7 joined #nim
03:32:09*SenasOzys__ quit (Ping timeout: 264 seconds)
03:35:40*nigredo-tori joined #nim
03:37:22nigredo-tori@Araq, could you take a look at this, please? https://github.com/nim-lang/Nim/issues/7653
03:43:35*dddddd quit (Remote host closed the connection)
04:05:42*MyMind joined #nim
04:06:58*Sembei quit (Ping timeout: 240 seconds)
04:24:42FromGitter<gogolxdong> What's the difference between read() and await on Future type?
04:47:09*xet7 quit (Read error: Connection timed out)
04:47:56*xet7 joined #nim
05:19:44*nsf joined #nim
05:35:46*xet7 quit (Read error: Connection timed out)
05:36:25*xet7 joined #nim
06:10:39FromDiscord<claude> uh, i know this was 5 hours ago, but why did no one mention sequtils.mapLiterals for the float array question
06:26:35*yglukhov joined #nim
06:44:48*PMunch joined #nim
07:12:41*yglukhov quit (Remote host closed the connection)
07:20:34*yglukhov joined #nim
07:23:15*NimBot joined #nim
07:36:13*Vladar joined #nim
07:38:44*xet7 quit (Read error: Connection timed out)
07:39:25*xet7 joined #nim
07:41:17FromGitter<alehander42> enum arrays are very unfriendly to define
07:42:15*xkapastel quit (Quit: Connection closed for inactivity)
07:48:21FromGitter<mratsim> are they? I found them as easy to use as a Table
07:48:51*Torro joined #nim
07:50:46FromGitter<alehander42> no, I had an error :D still, maybe I should try to improve the error message a bit
07:50:55*floppydh quit (Quit: WeeChat 2.1)
07:51:13FromGitter<mratsim> How about you write a Elm2Nim translator and get all their error messages ;)
07:53:04FromGitter<alehander42> that's my plan indeed, but Elm2Nim is right after Cobol2Nim in my 2Nim backlog
07:53:37FromGitter<mratsim> I’d rather have asm2nim before
07:54:11FromGitter<mratsim> or even better, english2nim
07:54:19FromGitter<alehander42> well you have asm2c (decompiler) and c2nim :D
07:54:42FromGitter<mratsim> https://www.commitstrip.com/en/2016/08/25/a-very-comprehensive-and-precise-spec/
07:54:46FromGitter<alehander42> yeah, debugging english would make literature class wild again
07:55:19*Pisuke joined #nim
07:55:27*MyMind quit (Ping timeout: 240 seconds)
07:55:46FromGitter<alehander42> :D you're brainwashed mamy, we just need self-adaptable IOT braininterface prolog
07:56:10FromGitter<mratsim> English FPGA
07:56:43FromGitter<alehander42> btw did you manage to try nim-quicktest ? it has some gotchas, but I think it should be easy to adapt for your usecase
07:57:36FromGitter<mratsim> I’m trying not to fail obvious tests like 2^64 / 3 first :P
07:58:51*floppydh joined #nim
07:59:40FromGitter<alehander42> :D good
07:59:49FromGitter<mratsim> You have some weird FactoryBeanVisitor stuff in nim-quickcheck by the way: `proc generateGenerator(generator: NimNode, names: seq[string]): (NimNode, NimNode, NimNode) =`
08:00:40FromGitter<mratsim> As DiCaprio said “We have to go deeper” (Inception neural network joke)
08:01:55FromGitter<alehander42> ah unfortunate naming :D I am used to call my macro helpers `generateStuff` and I probably found this poetic
08:06:04*simonsolnes joined #nim
08:07:04*onionhammer1 quit (Ping timeout: 265 seconds)
08:09:00FromGitter<mratsim> call it “inceptionGenerator"
08:10:42*onionhammer1 joined #nim
08:13:16*sendell joined #nim
08:15:12FromGitter<alehander42> you should be happy I was not inspired by the predestination movie
08:24:34*xet7 quit (Read error: Connection timed out)
08:25:03*xet7 joined #nim
08:26:09FromGitter<mratsim> I didn’t watch it :/
08:52:48*xet7 quit (Read error: Connection timed out)
08:53:14Araqyou didn't miss much
08:53:21Araqit's a pretty bad movie IMO.
08:53:25*xet7 joined #nim
08:58:27PMunchHmm, I'm having some trouble with the experimental `.` and `.=` operators. http://ix.io/18bf/ it works fine up until line 41 where it complains that the statement is not a variable
09:23:55PMunchWrapping the result in a proc seems to work..
09:24:43PMunchhttp://ix.io/18bl/
09:25:08PMunchBut then I need to know the type
09:30:39*silver10911 joined #nim
09:35:19*craigger quit (Ping timeout: 260 seconds)
09:37:44FromGitter<dandevelo> Is there any way to split forward declarations of exported functions in multiple files? I tried to do this and use "include" the files to merge them into one file but I get an error saying that the implementation needs to be in the included file
09:38:13*craigger joined #nim
09:41:05*user1101 quit (Quit: user1101)
09:48:39FromGitter<dandevelo> To put it another way: can I have forward declarations of functions in a separate file that is merged into the source file using "include"?
09:49:03Araqyeah and it's easy, I think you simply misunderstand the error message
09:49:11Araq# main file
09:49:15FromGitter<diegogub> Guys, for a driver whats the nim way of handling errors? Exceptions or returning struct with error?
09:49:27Araqproc forwarded() {.gcsafe.}
09:49:34Araqinclude other
09:49:36Araq# other file
09:49:47Araqproc forwarded() = discard "implementation here"
09:49:58Araqyou cannot forward the same proc twice though
09:51:04FromGitter<dandevelo> @Araq can I have my declarations in a forward.nim file, my implementation in a impl.nim file and have a main.nim file that includes forward.nim and impl.nim ?
09:53:04Araqyeah, that is supposed to work
09:53:16Araqnever tried it though :-)
09:53:19FromGitter<dandevelo> Doesn't seem to work for me
09:53:32FromGitter<dandevelo> forward.nim complains that it needs the implementation
09:53:46Araqinclude forward.nim first
09:54:12FromGitter<dandevelo> That's what I did
09:54:30Araqcheck the proc headers are the same, but only the forwarded gets the export marker and the pragmas
10:29:31FromGitter<alehander42> predestination is good, come on it had good twists
10:32:19*vantage joined #nim
10:32:46FromGitter<arnetheduck> Araq, planning to revive the libc idea? 😲
10:32:51Araqpredestination? it's called "Inception"
10:32:58FromGitter<ephja> I've been writing some F# code again. it's a decent language, but I wonder if it's at all possible to optimize the loops because of all the virtual calls and the runtime code residing in DLL's etc
10:34:29Araqephja: there is a JIT/hope.
10:35:56FromGitter<ephja> maybe it gets more complicated if you output javascript
10:40:08FromGitter<ephja> lots of calls and allocations when recursing
10:40:57Araqthe FP people call this an "implementation detail", I think.
10:41:24Araqand wait for compiler technology to catch up. They have been waiting for 40 years now.
10:43:28Araqarnetheduck; what do you mean?
10:43:35FromGitter<ephja> so, in 2020 perhaps?
10:44:20Araqwell with Rust they now have it. more or less. probably more less.
10:44:51FromGitter<krux02> well I heared Rust has slow compilation times
10:45:07FromGitter<krux02> slow compilation is one reason I don't do scala anymore
10:45:36FromGitter<krux02> btw, how does nimble test work?
10:45:49FromGitter<krux02> I wrote a test that imports my library at the top level
10:45:50Araqit runs the a task called 'test'
10:45:57AraqI think.
10:45:59FromGitter<krux02> and when I call nimble test it says it can't find it
10:46:17Araqin your .nimble file you write a 'task test'
10:47:29FromGitter<krux02> well I just did default nimble init
10:47:35FromGitter<krux02> and it made a test for me
10:47:42FromGitter<krux02> I put my test in that file
10:47:48FromGitter<krux02> and nimble test
10:47:53euantorephja: check out https://github.com/dotnet/corert
10:47:57FromGitter<krux02> exists as a task, I did not define it
10:48:22Araqyou need to edit the task?
10:48:43euantorMy tests with core RT so far haven't gone great though - I've compiled apps before, then when it came to running them they've failed
10:48:52FromGitter<krux02> I don't have a task that I can edit
10:49:09FromGitter<arnetheduck> Araq, https://github.com/nim-lang/Nim/pull/5698/commits/7dcc8e8396de043d2e8d3f837206c8a4a532c774
10:51:56Araqarnetheduck: yeah, want to postpone that to after v1
10:52:51FromGitter<krux02> I duplicated the nims file for my other test. No modification and it works now
10:53:09FromGitter<krux02> not a fan of code duplication though
10:54:29Araqconfig.nims ?
10:54:44Araqwill get picked by all project files in the same directory
10:54:50Araq*picked up
10:55:42FromGitter<krux02> ok, thanks.
10:56:03FromGitter<krux02> maybe the project template should generate that instead of test1.nims
11:01:49FromGitter<alehander42> @Araq no, predestination is a different movie, a better one !
11:02:39AraqI talked about Inception :-)
11:03:02FromGitter<alehander42> @krux02 can you clarify the sentence in my issue, you don't "like how they work" or "know if they would work" for the extension?
11:03:59FromGitter<alehander42> @Araq I agree, I still think prestige is the best nolan movie, inception is overrated
11:04:31*SenasOzys__ joined #nim
11:06:02FromGitter<dom96> @krux02 IIRC there is a bug with the default `test` task
11:06:11FromGitter<dom96> See Nimble's .nimble file for an example of how to define your own
11:08:49*simonsolnes quit (Ping timeout: 248 seconds)
11:13:22*endragor joined #nim
11:14:33*user1101 joined #nim
11:17:12livcdthere's no fsmonitor for windows right ?
11:20:28*simonsolnes joined #nim
11:23:04FromGitter<krux02> I think enum arrays are a mistake
11:23:39FromGitter<krux02> oh I was a bit in the past with my history
11:24:56*yglukhov quit (Remote host closed the connection)
11:25:43*yglukhov joined #nim
11:26:43Araqcan I create a Socket() from a socket handle?
11:27:27*yglukhov quit (Remote host closed the connection)
11:27:43*yglukhov joined #nim
11:28:43*yglukhov quit (Read error: Connection reset by peer)
11:29:18*yglukhov joined #nim
11:32:38FromGitter<arnetheduck> @alehander42 batman trilogy, hands down
11:33:34*nigredo-tori quit (Ping timeout: 260 seconds)
11:37:18FromGitter<data-man> @livcd: https://github.com/snowlt23/nimwatch
11:37:37livcdoh nice
11:38:28FromGitter<alehander42> @arnetheduck nah, I also loved the dark knight and I agree what he did with a superhero story was amazing, but I still rate prestige higher, even memento
11:39:30FromGitter<arnetheduck> I'm a sucker for trilogies :)
11:40:12*dddddd joined #nim
11:42:31FromGitter<alehander42> then you either love or hate star wars :D (depending on the view: 4 trilogies or potentially 12logy )
11:50:37FromGitter<data-man> The Matrix trilogy is awesome!
11:53:16dom96Star Trek > Star Wars :P
11:54:15Araqheresy
11:54:39dom96Araq: https://nim-lang.org/docs/net.html#newSocket,SocketHandle,Domain,SockType,Protocol
11:54:49Araqdom96: already found it, thanks
11:57:26FromGitter<ephja> is star wars any good?
12:00:04Araqthe real star wars is.
12:00:27FromGitter<krux02> dom96: I was looking for the ``task`` template in nimble, beause I wanted to know what it does. I could not find it
12:00:48dom96it's a nimscript thing
12:01:11FromGitter<krux02> nimscript?
12:01:21FromGitter<krux02> should I then look in Nim?
12:01:37Araqlib/system/nimscript.nim iirc
12:06:03FromGitter<krux02> Araq: thank you I found it
12:06:04*Torro quit (Read error: Connection reset by peer)
12:06:42FromGitter<krux02> aparenetly it does not register the task at all, it just executes it if it is an argument. that is efficient
12:06:55*Torro joined #nim
12:13:27*Torro quit (Read error: Connection reset by peer)
12:25:05Araqthis makes me sad: https://github.com/nim-lang/Nim/pull/7652/files :-)
12:26:10Araq> 100 nested macro/template instantiations
12:26:22Araqpeople are pushing Nim to its limits...
12:26:37dom96of course
12:26:41dom96It's what people do :)
12:27:02dom96How much nesting does a stack support?
12:27:44Araqnot sure, roughly 2 million calls on a 2MB stack?
12:28:20dom96so up the limit to that :P
12:28:56Araqno. I like arbitrary limits
12:29:27FromDiscord<mraxilus> lmao
12:29:33FromDiscord<mraxilus> what's the limit currently?
12:29:40Araq100.
12:30:45*Torro joined #nim
12:31:00*Torro left #nim (#nim)
12:31:18FromGitter<AxDSan> hey guys... looking into calling a function by its name? is it possible?
12:31:46FromGitter<AxDSan> was looking at https://nim-lang.org/docs/manual.html#types-procedural-type
12:31:57Araqfunction: say my name.
12:32:04AraqAxDSan: Heisenberg.
12:32:05FromDiscord<mraxilus> you mean from a string?
12:32:08FromGitter<AxDSan> ^
12:32:11FromGitter<AxDSan> yup string
12:32:25Araqfunction: You're god damn right.
12:32:30FromGitter<AxDSan> legit :D
12:32:30dom96You can only do that at compile-time
12:33:05FromGitter<alehander42> you can usually create some kind of mapping and use that on runtime
12:33:23FromGitter<alehander42> I don't think you need to be able to call every possible function
12:33:29FromGitter<AxDSan> mm
12:33:37FromGitter<AxDSan> yeah I want to call only 2
12:33:44Araqyou need to know the involved parameter types too.
12:33:56FromGitter<krux02> I think nim has too many calling conventions
12:34:22Araqkrux02: the only thing Nim added was .closure.
12:34:33Araqthe others we inherited from Win32...
12:34:47shashlickIf you were to embed the VM in a Nim application to allow nimscript / eval at runtime, how much more would it add to the binary in terms of size?
12:35:11vantageshash i too want to know that
12:35:31shashlickI guess nimble basically does that
12:35:40dom96yes, it adds a lot
12:35:59dom96makes the binary bigger than the compiler IIRC :(
12:36:14Araqdom96: but we are also doing it pretty stupidly
12:36:26FromGitter<krux02> Araq: yea you are right
12:36:31Araqlots of things could be stripped out for nimscript
12:36:47FromGitter<krux02> maybe those conventions should be put in the os specific sections?
12:36:53shashlickWould be a cool feature to simply pass a flag, orgasms
12:36:55FromGitter<krux02> because on linux such stuff doesn't exist
12:36:56vantagein the docs it mentions nim having an interactive mode... but i dont see it anywhere
12:37:03FromGitter<krux02> nut sure though
12:37:06shashlick!
12:37:33FromGitter<krux02> vantage: well it's a secret, but there is an interactive nim version
12:37:35shashlickPragma I meant to say, or import even
12:37:44FromGitter<krux02> it's a nim secret!
12:38:17vantagekrux would an interactive version need to compile?
12:38:20dom96I wonder how close the LLVM backend arnetheduck is working on is to giving us a proper REPL
12:38:21Araqkrux02: the calling convention concept is a useful one but we can move the documentation of stdcall vs fastcall vs cdecl into nimc.html
12:38:23FromGitter<alehander42> @shashlick orgasms would be a very weird pragma
12:38:35Araqnot sure what would it buy us though.
12:39:14FromGitter<krux02> Araq: us, maybe nothing
12:40:09FromGitter<krux02> it just makes things simpler when they can, but still allow calling conventions when needed
12:40:23vantagecalling conventions confuse me, and it not like id use any of them... but why do there need to be explicit calling conventions?
12:41:23FromGitter<alehander42> I wondered if one can somehow generate only C snippets and abuse a C interpreter like cling for a repl
12:42:05FromGitter<krux02> one can also use "nim secret"
12:42:55vantagecant you just compile the snippet then run it? would that be too slow?
12:43:17FromGitter<krux02> vantage: no it would totally be possible
12:43:43FromGitter<krux02> vantage: but for that you don't need a reple, a text editor where you can hit "run" already does the thing
12:44:08FromGitter<krux02> it's the incremental thing that is compicated
12:44:28vantagei like the idea that nlvm has its compiler built in. no external dependancy, (that i know of)
12:44:31FromGitter<krux02> changing fucntion definitions in a running executable is ont easy
12:44:49FromGitter<krux02> nlvm?
12:44:59shashlickVantage that's how I use snip, to build simple snippets that can then be copied into a real editor
12:45:16Araqnim playground is also a thing
12:45:17FromGitter<krux02> national library of virtual manipulatives
12:45:18FromGitter<alehander42> the funny thing is one can probably make something like a nim repl for the js backend using techniques similar to the hotreloading feature
12:45:56FromGitter<krux02> @alehander42 there is a nim repl
12:46:00shashlickI think a repl is only useful when you have a db connection or similar
12:46:15FromGitter<krux02> using the nim virtual machine
12:46:19shashlickBut for most of my cases, I've not needed it
12:46:32FromGitter<alehander42> @krux02 I know about nim secreet
12:46:38FromGitter<alehander42> and nimscript
12:46:45vantagekrux, ive thought about the incremental thing, make a script which imports packages, then compile to linked lib, then another script importing the linked lib, but im not sure it would even work that well...
12:46:49FromGitter<krux02> shashlick a repl is very useful to test out statements in the language
12:46:53shashlickEven on python, it's painful using it cause you make mistakes and have to keep editing
12:47:30shashlickKrux02 but you don't need a repl for that, Nim compiles fast enough that it's almost real-time with snip
12:47:36vantagekrux the llvm nim branch.
12:47:44shashlickYou get results as you type
12:48:15FromGitter<krux02> vantage: how does the llvm branch all the C backend stuff?
12:48:25FromGitter<krux02> a lot of things in nim are implemented in C
12:48:28vantagekrux it doesnt
12:48:36FromGitter<mratsim> A quote from yesterday from a data science slack I’m in "just spent ~4hours trying to understand why my perfectly working keras model was crashing python all of a sudden. Reinstalled everything (twice), just to finally find a f*** typo... "
12:48:38FromGitter<krux02> so it can't do echo?
12:48:52shashlickTry it out, I auto compile on every key stroke and it's good enough for most stuff, no need to manually hit compile
12:48:54vantagekrux no stdlib stuff
12:49:34FromGitter<mratsim> Rust and Crystal are slow to compile, apparently because of multiple LLVM pass. Though Clang is really fast on C code
12:49:48Araqkrux02: nothing in Nim is implemented in C.
12:50:09FromGitter<krux02> yes true
12:50:12shashlickIsn't there a -d:speed flag?
12:50:30FromGitter<mratsim> release implies speed
12:50:38FromGitter<krux02> it is implemented calling into c
12:50:41shashlickWell I mean compile time
12:50:45FromGitter<mratsim> though I would love if we could remove the fn-strict-aliasing
12:50:45FromGitter<krux02> cstdlib
12:50:51FromGitter<mratsim> foo*
12:50:53vantagearaq, as soon as a lang can compile itself i consider it mature
12:50:54FromGitter<mratsim> foo
12:50:56FromGitter<mratsim> fno
12:51:02FromGitter<mratsim> grrrr autocorrect
12:51:12FromGitter<krux02> @mratsim disable it
12:51:16FromGitter<krux02> I did that, too
12:52:21FromGitter<krux02> @mratsim what is fn-strict-aliasing
12:53:00FromGitter<krux02> vantages: I would disagree, it just proofes that the language can do one task, writing a compiler in it.
12:53:06FromGitter<krux02> but that doesn't make it mature at all
12:53:07FromGitter<mratsim> no-strict-aliasing prevents C from reaching Fortran speed because GCC/Clang will always assume that pointers can alias
12:53:27FromGitter<krux02> ah that thing
12:53:29FromGitter<krux02> I remember
12:53:39FromGitter<mratsim> with strict-aliasing by default GCC/Fortran assume that pointers to different types cannot alias and will produce optimal code
12:53:58FromGitter<mratsim> for Tensor code it’s quite important so I use restrict everywhere.
12:54:02FromGitter<krux02> well C has a declaration for that
12:54:05vantagekrux, if it can write its own compiler, like nim does, then it is diverse enough, and also structured enough
12:54:45FromGitter<krux02> vantage: it is usable but not mature
12:55:15FromGitter<mratsim> “Faster than C” who cares, Nim is faster than Fortran!
12:55:20vantagewell its not super ultra perfect, but it wont break
12:55:21FromGitter<krux02> maturity also requires for example good error messages and no compiler crashes on syntax errors
12:55:29*SenasOzys__ quit (Ping timeout: 248 seconds)
12:55:38vantagekrux true
12:55:49*couven92 joined #nim
12:56:09livcddid anyone try to write eg a ruby extension in Nim ?
12:56:38FromGitter<mratsim> @livcd, there was this: http://www.rubyflow.com/p/1j08ef-nim-for-the-discerning-rubyist
12:56:52FromGitter<mratsim> sorry direct link: http://www.bootstrap.me.uk/bootstrapped-blog/nim-for-the-discerning-rubyist
12:57:02FromGitter<krux02> and for some people an ide with a class browser, uml diagrams, and uml wizards for code generation
12:57:35FromGitter<mratsim> or a crossplatform GUI toolkit (good luck with that)
12:57:41vantagekrux now your talking about icing
12:57:52vantageuml comes before imo
12:57:58*athenot joined #nim
12:58:03vantagenot that i use uml
12:58:16FromGitter<krux02> I am sad to say html is your cross platform UI, even though, it is for text documents not for UI programming
12:58:29FromGitter<mratsim> I don’t understand the point of UML though, some famous general “No plan survives contact with the enemy”.
12:58:32vantagerocketlib!
12:58:53vantagehtml feels much more future proof
12:59:11FromGitter<krux02> well, the best way to use UML is not
12:59:18FromGitter<mratsim> Javascript is probably future-proof, but in this case the future is bleak :D
12:59:58livcdthat's impressive :)
13:00:08vantagei think the most usable uml ive seen was a flow chart describing unity's main loop
13:00:10FromGitter<ephja> https://marketplace.visualstudio.com/items?itemName=patrys.vscode-code-outline having a side pane helps a lot
13:00:30livcdmratsim: why do you think it's future-proof ?
13:01:15vantagemratsim html not js, there is a lot of effort going into subverting js
13:01:32*xet7 quit (Read error: Connection timed out)
13:01:43FromGitter<krux02> all you need is a text editor that does not fuck up, some highlighting, and fast navigation
13:01:52FromGitter<ephja> the built in stuff doesn't have an API so it explicit language support is needed. well, maybe soon
13:01:55*xet7 joined #nim
13:02:10FromGitter<krux02> putting errors in the editor also helps a lot
13:02:29FromGitter<alehander42> well how do they do the code outline? based on AST ?
13:02:38FromGitter<alehander42> this should be doable with a nim extension
13:02:55FromGitter<krux02> @alehander42 that stuff is overrated
13:03:00FromGitter<krux02> you don't need an outline
13:03:09FromGitter<krux02> especially not a general outline
13:03:16vantagei do
13:03:22FromGitter<ephja> I have a terrible memory
13:03:24vantagei need an outline
13:03:31FromGitter<ephja> unlike some
13:03:34FromGitter<alehander42> @krux02 I don't use an outline
13:03:36FromGitter<krux02> the outline has 0 information on what actually is important
13:03:40FromGitter<alehander42> just saying what's needed to implement it
13:04:09vantagebut if you have zero idea of the structure
13:04:17FromGitter<krux02> so yes maybe you need a good outline, but it should be one you have written on your own and that you update manually, so that it doesn't get automatically cluttered with unimportant stuff
13:04:23vantageor if you want to edit something
13:04:30*SenasOzys__ joined #nim
13:04:44FromGitter<krux02> vantage: for that, you use grep
13:04:52FromGitter<alehander42> well no, I agree that if it can be generated automatically, it should
13:04:55Araqno, nimgrep
13:05:06FromGitter<krux02> I configured my editor, so that it finds instantly everything that i name
13:05:08vantagekrux is grep on ms?
13:05:26Araqnimgrep is.
13:05:26FromGitter<mratsim> @livcd, inertia
13:05:30FromGitter<krux02> vantage: if you have git, then yes, because grep is in git
13:05:32FromGitter<krux02> git grep
13:05:42vantagelol
13:05:44FromGitter<krux02> Araq: is nimgrep in git?
13:05:46vantageok
13:06:13Araqkrux02: why the fuck would I care what git ships with.
13:06:30FromGitter<alehander42> hm I just installed outline for sublime, this is great stuff
13:06:33Araqgit for Windows probably ships with Perl for all I know
13:06:38FromGitter<alehander42> I've been missing out
13:06:52FromGitter<krux02> Araq: because git grep is a bit more intelligent that normal grep, because it just takes files that are part of the project
13:06:54vantagearaq why u hate on git?
13:07:00FromGitter<andreaferretti> Hi all, is there a way to check that no allocations are performed in a certain section?
13:07:15FromGitter<andreaferretti> I would like to use something like gc:none
13:07:24Araqvantage: I don't but 'grep' is worse than 'nimgrep'
13:07:24FromGitter<krux02> Araq: or in other words "git grep" usese ".gitignore"
13:07:32*athenot_ joined #nim
13:07:34FromGitter<andreaferretti> except that the initialization part of the program actually does allocate
13:07:47FromGitter<andreaferretti> after this part, no other allocations should appear
13:08:02Araqnimgrep --ext:nim --recursive --stdin .
13:08:09FromGitter<andreaferretti> I was wondering whether I can get the warning as with gc:none
13:08:15FromGitter<andreaferretti> but only for a section of code
13:08:32*athenot quit (Ping timeout: 255 seconds)
13:08:40Araqnimgrep is grep+find+sed or something
13:09:03FromGitter<krux02> Araq: nimgrep is all fine, but I still prefer 'git grep' because that works on non nim projects as well, and it is fast. And the that sombody actually changes the style of an identifier almost never happens.
13:09:27Araqnimgrep works for non Nim projects too. and is fast enough.
13:09:41Araqand the styling feature can savely be ignored
13:10:53dom96'git grep' supports regex right?
13:11:06dom96If so you could easily create a tool on top of it to search style insensitively
13:11:09FromGitter<krux02> nimgrep returns results in binares
13:11:35FromGitter<ephja> the name 'grep' would be very misleading otherwise
13:11:37dom96also, nimgrep should be a nimble package
13:11:55FromGitter<krux02> dom96: agree
13:12:27FromGitter<ephja> "lib\pure\times.nim(486, 20) Error: wrong number of arguments" I wonder why travis doesn't fail with that
13:12:41dom96nice to see you again ephja :)
13:13:40FromGitter<krux02> dom96: git grep supports regular expressions as well as case insensitive search
13:13:47Araqkrux02: --ext:nim
13:13:57Araqit's a thing, maybe learn nimgrep before dissing it
13:14:22Araq--ext:c --ext:h is useful for C projects
13:14:32FromGitter<ephja> the only inconvenience is the argument order, for when you need to adjust something :-P
13:14:56FromGitter<krux02> Araq: well git grep works like that, just that I don't need to remember such parameters
13:15:11FromGitter<ephja> but you could just create a couple of shell aliases
13:15:44FromGitter<krux02> "git grep" does the righ thing, "nimgrep" could do the right thing if I would hassle with the spec
13:15:54FromGitter<krux02> it's a clear win for "git grep" here
13:16:08FromGitter<krux02> and when it is not a git project, then I use "ag"
13:16:12FromGitter<krux02> the silver seracher
13:16:15Araqkrux02: 'git grep' doesn't do the right thing at all, it doesn't support --stdin or --replace or --confirm
13:16:46FromGitter<krux02> Araq: I am not using grep for replacing
13:16:46FromGitter<alehander42> @Araq the problem with nimgrep is that even if it's the most perfect tool on earth, it's a custom tool
13:16:48FromGitter<krux02> that is sed
13:17:01Araqbut shrug have fun with your fragile Unix pipelines.
13:17:07FromGitter<alehander42> so if people use 3-4 languages, they need to remember the nuances of a custom tool for just one lang
13:17:12FromGitter<alehander42> otherwise nimgrep is great
13:17:39Araqas I said, I have nimgrep on all my machines and use it for everything
13:17:50Araq"custom tool" my ass.
13:17:55Araq:P
13:18:05FromGitter<alehander42> :D
13:18:08FromGitter<data-man> Just try Ag (The Silver Searcher) :)
13:18:13FromGitter<krux02> before I knew about nim I used `ag` and it worked for everything
13:18:38FromGitter<krux02> but it doesn't work on the Nim project because it has a bug in partisg the gitignore file
13:19:21livcdI want to try to compile nimgrep for those hpux machines I have here
13:20:03dom96alehander42 makes a good point
13:20:27FromGitter<mratsim> “Araq assigned @data-man an hour ago”: https://github.com/nim-lang/Nim/issues/7653 :D?
13:20:28dom96we should make a PR for style insensitive searching in Ag and other such grep tools ;)
13:21:53AraqSI is just not an issue for Nim code, that's not why I use nimgrep.
13:22:15AraqSI is pretty much ignored by the Nim community afaict
13:22:45FromGitter<data-man> @mratsim: Oh! I think he accidentally pressed a wrong button.
13:22:50FromGitter<ephja> dom96: yo what's up
13:23:15Araqdata-man: nope. it's for you to fix.
13:23:54FromGitter<ephja> I'll target js with Nim. I can only assume that it will allocate less than F# does
13:24:29FromGitter<ephja> JS should be replaced with a VM
13:24:42dom96ephja: webasm :)
13:30:42FromGitter<krux02> @ephja I would not assume that the JS target will be memory efficient at all
13:34:48*rokups joined #nim
13:39:43FromGitter<ephja> a lot of recursion would be replaced by loops
13:41:14Araqdata-man: you touched sighashes.nim already, I suspect the bug is in there
13:42:37FromGitter<data-man> @Araq: Thanks!
13:42:58Araqcan guide you further
13:43:01*endragor quit (Remote host closed the connection)
13:43:04Araqjust ask here in #nim
13:43:28*endragor joined #nim
13:44:44shashlickOnly complaint for nimgrep is the long flag names
13:44:52shashlickElse I prefer it
13:45:02shashlickRecursive should be default perhaps
13:45:21*endragor_ joined #nim
13:47:54*endragor quit (Ping timeout: 260 seconds)
13:48:15AraqI have an alias 'gg' for it...
13:49:53*endragor_ quit (Ping timeout: 248 seconds)
13:57:53*endragor joined #nim
13:58:45FromGitter<narimiran> forum post "Is there a way to specify byte order when reading a binary file?" - we don't see the OP
13:59:19FromGitter<mratsim> Probably an Endian bot
14:01:59*endragor quit (Remote host closed the connection)
14:03:29*xet7 quit (Read error: Connection timed out)
14:03:56*xet7 joined #nim
14:05:10Araqnarimiran: spam protection at work...
14:06:21FromGitter<narimiran> spam protection "is too damn high"!
14:07:05FromGitter<alehander42> it's high on viagra
14:08:03*endragor joined #nim
14:20:45*simonsolnes quit (Ping timeout: 264 seconds)
14:28:10*endragor quit (Remote host closed the connection)
14:31:06*endragor joined #nim
14:31:07*endragor quit (Remote host closed the connection)
14:31:45*endragor joined #nim
14:40:52*Pwntus quit (Remote host closed the connection)
14:41:18shashlickAliases in Windows... some day
14:42:56Araq.bat files ftw lol
14:43:55*pwntus joined #nim
14:44:21*pwntus quit (Changing host)
14:44:21*pwntus joined #nim
14:50:48PMunchYeah just create a folder C:/batcave and put all your aliases in bat files there.
14:52:10*pwntus quit (Remote host closed the connection)
14:54:05Araqlol 'batcave', brilliant
14:55:35*PMunch quit (Quit: Leaving)
14:56:24FromGitter<data-man> Batman's cave :)
14:57:25Araqhttps://www.youtube.com/watch?v=QELRiIeJY1U
14:58:03*pwntus joined #nim
14:58:50*pwntus quit (Changing host)
14:58:50*pwntus joined #nim
15:00:06FromGitter<data-man> @Araq: Have you seen my message in gitter's PM?
15:00:31*endragor quit (Remote host closed the connection)
15:05:14*miran joined #nim
15:05:41*r3d9u11 joined #nim
15:07:22*endragor joined #nim
15:23:11*endragor quit (Remote host closed the connection)
15:32:23*xet7 quit (Read error: Connection timed out)
15:32:55*xet7 joined #nim
15:33:21*c0ntribut0r joined #nim
15:36:21vantagewhen do you need to worry about safe/unsafe code?
15:36:47miranwhen it is too late :P
15:37:45vantageif ur being serious it would be funny
15:38:21Araqworry about it from the start, newcomers need to worry more than others.
15:38:43Araqif you don't know the heap/stack distinction, don't use unsafe code.
15:39:04*nsf quit (Quit: WeeChat 2.0.1)
15:39:06Araqshould be a good guideline.
15:39:26vantagei thought it was only a concern if you use multithreading
15:40:41Araqno. threading uses the same unsafe/safe split.
15:41:38vantageim lost i think
15:42:01*endragor joined #nim
15:42:10Araqunsafe features: addr/ptr/cast
15:42:16vantagelet me put it this way. can i use typeinfo
15:42:32Araqunsafe features for --threads:on: addr/ptr/cast
15:42:55*endragor quit (Remote host closed the connection)
15:43:02Araqplus don't have channels or threads on the stack :P
15:43:15Araqneed to patch the compiler to prevent these...
15:43:16vantagei need soe
15:43:35vantagei need some articles to read if i want to do that
15:43:59*endragor joined #nim
15:48:17*endragor quit (Ping timeout: 248 seconds)
15:52:14*xkapastel joined #nim
15:59:39*Vantage_ joined #nim
16:00:09*simonsolnes joined #nim
16:02:42*c0ntribut0r quit (Ping timeout: 256 seconds)
16:03:08*c0ntribut0r joined #nim
16:16:52*c0ntribut0r quit (Ping timeout: 256 seconds)
16:18:36*c0ntribut0r joined #nim
16:23:07FromGitter<alehander42> what is `set` in js backend? js object ?
16:25:48*sendell quit (Remote host closed the connection)
16:27:50FromGitter<alehander42> yeah, wrapper around js object mapping true to existing elements
16:29:57*floppydh quit (Quit: WeeChat 2.1)
16:34:14Vantage_proc arity(t: typedesc): int {..}
16:34:15Vantage_ Returns the arity of the given type
16:34:21Vantage_What is arity?
16:37:01FromGitter<alehander42> how many args does something take
16:37:13*user1101 quit (Quit: user1101)
16:37:18FromDiscord<claude> arity(Obj[X, Y, Z]) = 3
16:37:28*user1101 joined #nim
16:38:53Vantage_Much more meaningful... should I change the source...
16:39:16Vantage_or is this supposed to be common knowledge. and I'm just special
16:42:21*c0ntribut0r quit (Ping timeout: 264 seconds)
16:43:04*c0ntribut0r joined #nim
16:49:35FromGitter<alehander42> adding an example would be better I think
16:49:41FromGitter<alehander42> (or several)
16:51:26Vantage_I just added the one
16:52:45FromGitter<alehander42> actually that's a great catch
16:53:01FromGitter<alehander42> @Araq what should `arity` actually return ?
16:53:19FromGitter<alehander42> the results doesn't make any sense to me
16:53:35FromGitter<alehander42> don't *
17:00:13*xet7 quit (Read error: Connection timed out)
17:00:55*xet7 joined #nim
17:01:46FromDiscord<claude> https://github.com/nim-lang/Nim/blob/devel/compiler/semmagic.nim#L136
17:10:51FromGitter<diegogub> Hello, I'm having trouble with the package system in nim...How can I install sub packages from lib?
17:10:56*Trustable joined #nim
17:11:58Vantage_What you want to install?
17:12:12*couven92 quit (Quit: Client disconnecting)
17:12:40FromGitter<diegogub> I have a package evento, its lib ..where I have : src/evento.nim and src/evento/aggregate.nim
17:12:54FromGitter<diegogub> from evento.nim I call: import evento/aggregate
17:13:12FromGitter<diegogub> but..from external pkg I cant find evento/aggreate
17:13:13*r3d9u11 quit (Ping timeout: 256 seconds)
17:15:32FromGitter<diegogub> but I can import evento
17:18:08Vantage_did you run `nimble install`
17:19:08FromGitter<diegogub> yes, I did
17:19:22*Trustable quit (Remote host closed the connection)
17:20:02Vantage_import it try to compile and run it
17:20:27*nsf joined #nim
17:23:20shashlickare you sure you're following the nimble library package structure? https://github.com/nim-lang/nimble#libraries
17:23:38FromGitter<data-man> From Wikipedia: "the arity of a function or operation is the number of arguments or operands that the function takes." Function, not type.
17:24:02dom96diegogub: ls ~/.nimble/pkgs/evento-ver/
17:24:15dom96replace 'ver' with whatever the version is
17:26:23*r3d9u11 joined #nim
17:29:40FromGitter<mratsim> There is no arity for proc :/
17:29:46*max3 joined #nim
17:30:06FromGitter<mratsim> that would be a super useful additions to generate variadic proc or iterators (say Zip)
17:31:36FromDiscord<claude> what do you mean
17:31:47FromDiscord<claude> you could probably do `arity(procVar.type)`
17:35:19FromDiscord<claude> i think my post where i said `arity(Obj[X, Y, Z]) = 3` was wrong, i think arity is specifically meant for proc types https://gist.github.com/hlaaftana/957b8502ce298280178481616fa0baad
17:36:23FromGitter<mratsim> I’m amazed no one catched this bug before: https://github.com/nim-lang/Nim/issues/7657
17:39:25shashlickI think most folks follow this but can we all make it a practice to put fully functional code snippets in issues submitted on github? Marked clearly as ` ` ` nim and not mixed up with output and other stuff. we are now able to pull these snippets out and test automatically
17:39:46shashlickI'm also working on automating the creation of test cases once an issue is fixed based on these snippets
17:41:27*xet7 quit (Read error: Connection timed out)
17:41:55*xet7 joined #nim
17:44:23miranshashlick: https://github.com/nim-lang/Nim/community - we might add that here
17:44:36miranto be issue template
17:45:58shashlickyes that will be helpful
17:47:32miran1. state your nim version, 2. post the minimum example (using backticks, ...), etc.
17:50:24FromGitter<data-man> https://github.com/nim-lang/Nim/pull/6630
17:51:52FromGitter<data-man> GitHub templates :)
17:52:19mirandata-man: he might change his mind this time, if that would lead to better automatization of checks that shashlick is doing
17:53:24FromGitter<data-man> Maybe
18:01:03FromGitter<data-man> @mratsim: #7393 Close?
18:03:15FromGitter<mratsim> done thanks
18:03:41*xet7 quit (Read error: Connection timed out)
18:04:25*xet7 joined #nim
18:07:14Vantage_say I have a object of type Room, that inherits from GameObject
18:07:32Vantage_say I have a proc called repr
18:07:59Vantage_and I want to have different fuctionality for Room and GameObject
18:08:23Vantage_but I still want Room to call repr as if it was a GameObject
18:08:24Vantage_how would I do that?
18:08:32*Senketsu joined #nim
18:08:59FromGitter<mratsim> Is it possible to use threadpool in an async manner at the moment? It seems like the actor stdlib module is deprecated. Basically I want a master thread that dispatch to workers, which report back asynchronously.
18:09:55FromGitter<mratsim> @Vantage_ `type GameObject {.inheritable.} = ref object` `type Room = ref object of GameObject`
18:09:59*Senketsu quit (Remote host closed the connection)
18:10:15FromGitter<mratsim> use proc foo(x: GameObject) when it applies to both
18:10:33FromGitter<mratsim> use method if it applies only to a specific instance
18:10:38FromGitter<mratsim> that is known only at runtime
18:11:08shashlickmratsim: I worked on a duplicate file finder a while back which did spawn and async together, was harrowing but it worked
18:11:12shashlicki can post it as a gist
18:11:41FromGitter<mratsim> I’ll have to open the Nim in Action book as well, I’m pretty sure the messaging part has something related
18:12:30*Ven`` joined #nim
18:12:58*simonsolnes quit (Ping timeout: 264 seconds)
18:13:20shashlickhttps://gist.github.com/genotrance/ef84e2ee7daab54c0a385e92c0a2757d
18:13:21Vantage_mratsim, I want to do foo(room) and foo(GameObject(room))
18:14:57*simonsolnes joined #nim
18:15:59*Lord_Nightmare2 joined #nim
18:16:33*c0ntribut0r quit (Ping timeout: 248 seconds)
18:16:54*c0ntribut0r joined #nim
18:18:03dom96mratsim: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim
18:18:09dom96TL;DR: Use isReady
18:18:23FromGitter<mratsim> @Vantage_ ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ad8dd6f2dfcfffd2b2c932c]
18:18:36FromGitter<data-man> @mratsim: Something like this? https://github.com/yglukhov/nimx/blob/master/nimx/private/worker_queue.nim
18:19:33*Lord_Nightmare quit (Ping timeout: 264 seconds)
18:19:33*Lord_Nightmare2 is now known as Lord_Nightmare
18:20:59shashlickaraq: for https://github.com/nim-lang/nim/issues/835, I think this is fixed right? no longer crashes but gives an error. I can create a test case if you agree
18:21:12FromGitter<mratsim> thanks @shashlick @data-man @dom96, I think the isReady is probably the best
18:21:58Vantage_mratsim. If you add `ProcCall bar(GameObject(b))` gives you method: GameObject
18:22:07Vantage_thanks for the help though
18:22:25FromGitter<mratsim> Basically it’s always the same task: simulating the go game, and report the result back. THan asking what is the next move to explore (for Monte Carlo simulations). So I was thinking of having a pool of worker/actor that communicates with a master thread through channels
18:22:26*Vantage_ quit (Quit: Leaving)
18:23:19*yglukhov quit (Ping timeout: 265 seconds)
18:23:34FromGitter<mratsim> @Vantage_ GameObject(b) converts it to GameObject so it’s normal I think, unless I’m missing something
18:24:23*Vantage_ joined #nim
18:27:32FromGitter<data-man> @mratsim: http://rosettacode.org/wiki/Dining_philosophers#Nim :)
18:27:47FromGitter<mratsim> by the way @data-man will that poll the CPU to 100%: https://github.com/dom96/nim-in-action-code/blob/b63d8111b65ea4dcb1321a4c4f64807ee0ea62b5/Chapter3/ChatApp/src/client.nim#L42 ?
18:27:53FromGitter<mratsim> @dom96 *
18:28:16dom96no, `poll` blocks
18:28:40dom96if you're doing this inside an async proc then you can use sleepAsync
18:28:49*c0ntribut0r quit (Ping timeout: 248 seconds)
18:29:08FromGitter<krux02> dom96: isn't poll defined as non-blocking?
18:29:27FromGitter<mratsim> I was talking about “isReady” actually not poll ;)
18:30:14FromGitter<krux02> ouch, isReady is also bad naming
18:30:14*yglukhov joined #nim
18:30:25FromGitter<krux02> isReady should also return instantly with a bool
18:30:53FromGitter<krux02> a function that waits for something to happen should be called with `wait` in the name
18:31:01*c0ntribut0r joined #nim
18:31:03FromGitter<krux02> otherwise it is a bad name
18:31:14dom96It's a good thing that it does return immediately then
18:31:37dom96mratsim: if you have isReady on its own then yes
18:31:44FromGitter<krux02> sdl_WaitEvent for example is a good name
18:31:55dom96but like I said, poll blocks, so in that code it doesn't peg the core
18:32:18FromGitter<krux02> no poll may not block, because that would conflict the definition of polling
18:32:21FromGitter<mratsim> cool, so I can have a seq of Thread, do a while loop until one `isReady`, do whatever, rince and repeat.
18:32:45*Lord_Nightmare quit (Ping timeout: 264 seconds)
18:33:08*yglukhov_ joined #nim
18:34:05FromGitter<krux02> I was going to pull up Wikipedia for citing, but aparently Wikipedia has a different definition of polling that I learned at University.
18:34:28FromGitter<mratsim> In University they say don’t trust wikipedia ;)
18:34:55*yglukhov quit (Ping timeout: 265 seconds)
18:35:38*Lord_Nightmare joined #nim
18:36:19FromGitter<mratsim> regarding bad names, seems like `spawn`doesn’t spawn a thread, but wait for one to be available
18:36:23FromGitter<ephja> universities with their pedantry ;)
18:37:22FromGitter<krux02> well polling is to ask if there is something ready, but immediateley return.
18:37:27*yglukhov_ quit (Read error: Connection reset by peer)
18:38:04*Serenitor joined #nim
18:38:13FromGitter<krux02> and then you can do it in regular intervals to get all events.
18:40:20*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:41:02dom96krux02: unfortunately system APIs disagree with that definition
18:41:39dom96I guess you could argue that poll should by default be immediate
18:41:56dom96technically the system APIs just provide a way to specify a timeout
18:42:31*Serenitor quit (Client Quit)
18:44:54*yglukhov joined #nim
18:45:22Araqshashlick: nah, it's simply not a "crash" anymore. it should compile.
18:45:41Araq"good enough for now" was referring to some release
18:46:02*Serenitor joined #nim
18:47:19*Vantage_ quit (Read error: Connection reset by peer)
18:51:42*Vantage_ joined #nim
18:52:23*yglukhov quit (Ping timeout: 256 seconds)
18:54:01*Ven`` joined #nim
19:00:09*yglukhov joined #nim
19:00:15*r3d9u11 quit (Remote host closed the connection)
19:01:54shashlickokay so issue should stay open, understood
19:07:14*Ven` joined #nim
19:07:14*Ven`` quit (Read error: Connection reset by peer)
19:07:29*nsf quit (Quit: WeeChat 2.0.1)
19:07:57*Ven`` joined #nim
19:09:03*Ven`` quit (Client Quit)
19:10:57*yglukhov quit (Ping timeout: 248 seconds)
19:11:58*Ven` quit (Ping timeout: 256 seconds)
19:16:01Vantage_whats a baseless method?
19:16:56FromGitter<mratsim> It’s a method with no corresponding method for the base class
19:18:11FromGitter<mratsim> at least your base class should have `method foo(x: BaseClass) {.base.} = raise newException(ValueError, “This method is not implemented for this class”)` I think.
19:19:10Vantage_It isn't described in the manual. Is it in the tutorial?
19:19:24*silver10911 quit (Quit: Leaving)
19:19:32*yglukhov joined #nim
19:19:41FromGitter<mratsim> it’s there but the example can be improved: https://nim-lang.org/docs/manual.html#multi-methods
19:19:51FromGitter<mratsim> feel free to submit a PR
19:27:58FromGitter<diegogub> @FromIRC @dom96 , solved the issue, basically It was syntax error: import evento / aggregate , Is this a bug or its supposed to be like that?
19:28:35dom96what's the syntax error?
19:29:05FromGitter<diegogub> to import a sub-pgk I was doing: import evento/aggregate
19:29:12FromGitter<diegogub> but it should be : evento / aggregate
19:29:14FromGitter<diegogub> with spaces
19:29:18FromGitter<diegogub> I was not aware of that..
19:29:47dom96without spaces should work
19:30:38FromGitter<diegogub> I see..now it's working..weird, I did nim install again
19:30:44FromGitter<diegogub> nimble install
19:31:13*yglukhov quit (Ping timeout: 248 seconds)
19:32:21dom96use `nimble devel`
19:32:29dom96er
19:32:30dom96nimble develop
19:32:39dom96otherwise you'll need to reinstall with each change
19:47:16*yglukhov joined #nim
19:48:49FromGitter<zetashift> Ah godot-nim ain't that beginner friendly as I thought, I might just enter with godot + gdscript :(
19:52:02*mal`` quit (Quit: Leaving)
19:53:59Araqor nim + sdl2
19:55:59*yglukhov quit (Ping timeout: 260 seconds)
19:56:09*SenasOzys__ quit (Ping timeout: 264 seconds)
19:56:13FromGitter<krux02> I really recommend sdl2 for their input API, but the drawing primitives are not the best.
19:56:43FromGitter<krux02> but it probably doesn't matter for a first game
19:57:09*mal`` joined #nim
19:59:25FromGitter<zetashift> Any tips on doing physics with sdl2? do I use a thing like chipmunk?
20:01:52Vantage_chipmunk is best
20:01:58FromGitter<krux02> @zetashift my tip is, don't use physics, it doesn't solve anything
20:02:05Vantage_well I don't know how it is in nim
20:02:16Vantage_but its better than box2d..
20:02:18FromGitter<krux02> but if you really want physics, yea chipmunk probably is a good choice
20:02:25Vantage_krux is right
20:03:06FromGitter<krux02> make your game about simple rules, for example turn based
20:03:42FromGitter<krux02> always think about what happens every turn, how you want to solve "time passing by" and what problems you get into
20:03:59FromGitter<krux02> a physics engine is like a "gui framework"
20:04:03*rokups quit (Quit: Connection closed for inactivity)
20:04:07*SenasOzys__ joined #nim
20:04:41FromGitter<krux02> well probably a bad example, but it has similar problems
20:05:09FromGitter<krux02> when you have your datastructures that define your gamestate, a physics angine defines it's own state and doesn't care about your game state
20:05:25*Ven`` joined #nim
20:06:50FromGitter<krux02> so it's a horrible mess to synchronize it.
20:07:24FromGitter<krux02> by the way, box2D was not intended to be "the physics engine" for everybody
20:07:55FromGitter<krux02> it was inteded as a teaching tool to show people how to structure a custom physics engine for your game
20:08:09FromGitter<krux02> it kind of diverged from this original idea thogh
20:10:27*yglukhov joined #nim
20:13:13*DarkArctic quit (Read error: Connection reset by peer)
20:15:34*yglukhov quit (Read error: Connection reset by peer)
20:16:04FromGitter<zetashift> alright thanks
20:16:18*yglukhov joined #nim
20:21:48Araqkrux02: interesting comparison
20:24:33Vantage_games == data oriented
20:28:02FromGitter<krux02> Vantage_: at least that is how it works the best.
20:28:19FromGitter<krux02> OO for games is not good, at least not in my experience
20:28:47FromGitter<krux02> and I really like Nim for not putting this "OO" on top of everything.
20:29:23FromGitter<krux02> Nim makes it easy to just stay out of this OO word. And really it feels good and how it should be.
20:29:25Vantage_theres a saying in eve, 10% spreadsheet 90% propoganda... I think that could go for a lot of games actually
20:29:32*user1101 quit (Quit: user1101)
20:29:44Vantage_Plus its way more intuative to use DataOriented approach
20:29:51*user1101 joined #nim
20:30:20Vantage_But I don't like how much hassle I have to go through to use a `base classes` method :(
20:31:22Araqmethod foo(a: MyBase) {.base.}
20:32:01Vantage_what is a base method even
20:32:14Vantage_I've got base class methods working sorta
20:32:22Vantage_But I don't really know WHY that is
20:33:02*athenot_ quit (Remote host closed the connection)
20:33:18Vantage_nvm, I ask way too many questions here
20:33:42*athenot joined #nim
20:37:39*nsf joined #nim
20:41:00*miran quit (Quit: Konversation terminated!)
20:46:09*yglukhov quit (Read error: Connection reset by peer)
20:46:42*yglukhov joined #nim
20:55:13*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:55:45*Vantage_ quit (Read error: Connection reset by peer)
20:57:24*Ven`` joined #nim
21:00:22*Vladar quit (Quit: Leaving)
21:01:27*smt` joined #nim
21:03:36*smt quit (Ping timeout: 256 seconds)
21:04:26*smt_ joined #nim
21:08:17*smt` quit (Ping timeout: 248 seconds)
21:08:53*xet7 quit (Read error: Connection timed out)
21:09:25*xet7 joined #nim
21:14:07*Vantage_ joined #nim
21:18:15FromGitter<Bennyelg> Hey I installed Inim but It dont added into my path so I cannot run inim in the terminal. where it's located in-order to add this to my path
21:18:31shashlickdid you install with nimble?
21:18:38FromGitter<Bennyelg> yep
21:18:53shashlickis ~/.nimble/bin in your path?
21:19:04FromGitter<Bennyelg> 1 sec I'll check :|
21:19:48FromGitter<Bennyelg> oh now yes :P and all works great
21:19:49FromGitter<Bennyelg> thanks
21:19:57*endragor joined #nim
21:24:27*endragor quit (Ping timeout: 240 seconds)
21:26:51*nsf quit (Quit: WeeChat 2.0.1)
21:35:12*c0ntribut0r left #nim ("Leaving")
21:51:06FromDiscord<geckojsc> oh I missed the gamedev discussion :(
21:53:19Araqwell revive it
21:53:26FromDiscord<geckojsc> I'm on it xD
21:55:16FromDiscord<geckojsc> zetashift: at this point so close to Ludum Dare, I'd probably recommend going with something like Godot because it will lift a lot of the gritty work like physics and rendering, and you can just focus on making your game do the things you want it to do
21:56:58dom96Last Ludum Dare I used sfml
21:58:13FromDiscord<geckojsc> how did you find it?
21:59:49dom96Fairly good
22:00:01dom96Wished the wrapper was more true to the C
22:00:08dom96but other than that it all worked as expected
22:00:17dom96https://ldjam.com/events/ludum-dare/40/coastal-postal
22:01:39FromDiscord<geckojsc> ohh I didn't realise csfml was a separate thing, that's cool
22:02:10FromDiscord<geckojsc> I always kinda stayed away from it because I don't like C++
22:09:12*xet7 quit (Read error: Connection timed out)
22:10:03*xet7 joined #nim
22:10:51FromGitter<mratsim> @Vantage_ you don’t need a base method, it will just raise a warning. I don’t know in other language but in Python it’s idiomatic to put a base method with “raise newException(NotImplementedError, …)” if a base method is not overloaded
22:11:06*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:12:42Vantage_abstract base class
22:12:53FromGitter<mratsim> Now if you want max performance, I agree with Krux, avoid object orientation, I remember some blog post about people having to implement memory pool to recycle bullets in some games :P otherwise everything slow down to a crawl
22:12:54Vantage_abstract classes
22:13:42dom96There is a reason Nim was designed to discourage OOP ;)
22:14:00Vantage_i just want to share instatiation :( nim isn't OO, not really.
22:14:14Vantage_Well what is NIM?
22:14:22FromGitter<mratsim> Sometimes you are forced too :/, for neural net it’s too painful not to use methods to represent the graph of tensor operations :/
22:14:25Vantage_I know C wasn't really OO
22:14:27dom96I've been using Nim for many years, and I only reached for methods maybe once.
22:14:37FromGitter<mratsim> C and Nim are procedural
22:15:27FromGitter<mratsim> I tried with closures instead of methods but meeeh ...
22:16:19Vantage_Why can't types have default values?
22:16:47FromGitter<mratsim> they do, it’s binary 0
22:17:08Vantage_Why can't I change the default value :P
22:17:10FromGitter<mratsim> var foo: YourType will have binary 0
22:17:28FromGitter<mratsim> oh, yeah put a feature request, sometimes I want that too
22:17:29*Ven`` joined #nim
22:17:43dom96That seems bloaty to me
22:17:48dom96Just create a constructor proc
22:17:54FromGitter<mratsim> but ^
22:17:57Vantage_type Object:...=variable:string="string value not binary 0"
22:19:16Vantage_lol
22:19:35Vantage_I think there was already talk about a constructor proc
22:20:05Vantage_but theres no way to ensure that the constructor proc is used
22:26:01*xet7 quit (Remote host closed the connection)
22:29:53dom96That's a good point
22:30:51Vantage_but I'll see. At first it might feel like nim's difficult...
22:31:02Vantage_I won't know until I try
22:31:36dom96in practice if you're using a Nim library and see a type, writing LibraryType() isn't what you start with
22:31:52dom96Because the fields of LibraryType are likely not exposed
22:31:55*vlad1777d joined #nim
22:39:03Vantage_what do you mean?
22:46:21FromGitter<ephja> that they have not been exported (annotated with *), such that the fields in question can't be accessed from other modules
22:47:56*yglukhov quit (Remote host closed the connection)
22:56:08FromGitter<Bennyelg> easiest way to get variable type in runtime?
23:00:15shashlickso testament doesn't run unless you are in the nim root directory?
23:06:10FromGitter<Bennyelg> nvm I managed to figure it out. ⏎ another question. ⏎ building AST for array,
23:08:28FromGitter<Bennyelg> or, better question, how I can see for my self how nim parse some variable I create in-order to learn by see
23:34:25*Lord_Nightmare quit (Ping timeout: 248 seconds)
23:35:32*endragor joined #nim
23:37:54FromGitter<honewatson> OO in Nim is basically redundant when you have Concepts, Proc overloading, and Object Variants
23:39:57*endragor quit (Ping timeout: 240 seconds)
23:40:13dom96Bennyelg: import macros: dumpTree: echo("foobar")
23:40:24dom96s/macros:/macros;/
23:40:32FromGitter<Bennyelg> yea I found it
23:40:39FromGitter<Bennyelg> it's brilliant :) thanks
23:43:58*Lord_Nightmare joined #nim
23:44:58FromGitter<Bennyelg> anyone can try to explain to me what does ⏎ ⏎ ```illformed AST: {"ace": "data"}.<<1th child missing for nkDotExpr >>``` [https://gitter.im/nim-lang/Nim?at=5ad929f91130fe3d36f6d449]
23:48:07dom96It means your AST is missing a child?
23:48:29FromGitter<Bennyelg> I add an ident toTable
23:48:34FromGitter<Bennyelg> but now I get ⏎ illformed AST: {"ace": "data"}
23:48:38FromGitter<Bennyelg> without nothinghehe
23:48:44Vantage_honewatson, Concepts?
23:51:20FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ad92b78270d7d3708e63d28]
23:53:45FromGitter<Bennyelg> all works ;]
23:53:52*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:56:13*user1101 quit (Quit: user1101)
23:56:48FromGitter<honewatson> @Vantage_ here is an example of concepts
23:57:52*Serenitor quit (Quit: Leaving)
23:58:01FromGitter<honewatson> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ad92d095d7286b43a493cc7]