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:36 | FromGitter | <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:54 | FromGitter | <zacharycarter> @amscotti I'm guessing type inference is making [1,2,3] into an Array[int] |
01:08:13 | FromGitter | <zacharycarter> so you could do |
01:08:28 | FromGitter | <zacharycarter> is_something([1,2,3].Array[float]) I think? |
01:08:32 | FromGitter | <zacharycarter> or |
01:08:50 | FromGitter | <zacharycarter> is_something([1.0,2.0,3.0]) |
01:10:40 | FromGitter | <amscotti> Ok, that's good to know! Sadly both are not ideal for my project. Thanks for the help! |
01:16:01 | FromGitter | <zacharycarter> well |
01:16:05 | FromGitter | <zacharycarter> you could also try using varags |
01:16:07 | FromGitter | <zacharycarter> or openarray |
01:16:33 | FromGitter | <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:42 | FromGitter | <zacharycarter> without any kind of type specification |
01:17:10 | FromGitter | <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:23 | FromGitter | <zacharycarter> like Python or JS, etc... |
01:17:34 | FromGitter | <zacharycarter> @amscotti ^ |
01:18:03 | FromGitter | <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:46 | FromGitter | <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:34 | FromGitter | <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:16 | FromGitter | <gogolxdong> How to del a key of `var userTable* = newOrderedTablestring, User ()` |
03:22:21 | shashlick | userTable.del(key) |
03:23:02 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ad80b955f188ccc157d9e4a] |
03:23:16 | FromGitter | <gogolxdong> `del(userTable,users.id)` |
03:23:50 | shashlick | did you import tables? |
03:24:19 | * | xet7 quit (Read error: Connection timed out) |
03:24:53 | FromGitter | <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:22 | nigredo-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:42 | FromGitter | <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:39 | FromDiscord | <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:17 | FromGitter | <alehander42> enum arrays are very unfriendly to define |
07:42:15 | * | xkapastel quit (Quit: Connection closed for inactivity) |
07:48:21 | FromGitter | <mratsim> are they? I found them as easy to use as a Table |
07:48:51 | * | Torro joined #nim |
07:50:46 | FromGitter | <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:13 | FromGitter | <mratsim> How about you write a Elm2Nim translator and get all their error messages ;) |
07:53:04 | FromGitter | <alehander42> that's my plan indeed, but Elm2Nim is right after Cobol2Nim in my 2Nim backlog |
07:53:37 | FromGitter | <mratsim> I’d rather have asm2nim before |
07:54:11 | FromGitter | <mratsim> or even better, english2nim |
07:54:19 | FromGitter | <alehander42> well you have asm2c (decompiler) and c2nim :D |
07:54:42 | FromGitter | <mratsim> https://www.commitstrip.com/en/2016/08/25/a-very-comprehensive-and-precise-spec/ |
07:54:46 | FromGitter | <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:46 | FromGitter | <alehander42> :D you're brainwashed mamy, we just need self-adaptable IOT braininterface prolog |
07:56:10 | FromGitter | <mratsim> English FPGA |
07:56:43 | FromGitter | <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:36 | FromGitter | <mratsim> I’m trying not to fail obvious tests like 2^64 / 3 first :P |
07:58:51 | * | floppydh joined #nim |
07:59:40 | FromGitter | <alehander42> :D good |
07:59:49 | FromGitter | <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:40 | FromGitter | <mratsim> As DiCaprio said “We have to go deeper” (Inception neural network joke) |
08:01:55 | FromGitter | <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:00 | FromGitter | <mratsim> call it “inceptionGenerator" |
08:10:42 | * | onionhammer1 joined #nim |
08:13:16 | * | sendell joined #nim |
08:15:12 | FromGitter | <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:09 | FromGitter | <mratsim> I didn’t watch it :/ |
08:52:48 | * | xet7 quit (Read error: Connection timed out) |
08:53:14 | Araq | you didn't miss much |
08:53:21 | Araq | it's a pretty bad movie IMO. |
08:53:25 | * | xet7 joined #nim |
08:58:27 | PMunch | Hmm, 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:55 | PMunch | Wrapping the result in a proc seems to work.. |
09:24:43 | PMunch | http://ix.io/18bl/ |
09:25:08 | PMunch | But then I need to know the type |
09:30:39 | * | silver10911 joined #nim |
09:35:19 | * | craigger quit (Ping timeout: 260 seconds) |
09:37:44 | FromGitter | <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:39 | FromGitter | <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:03 | Araq | yeah and it's easy, I think you simply misunderstand the error message |
09:49:11 | Araq | # main file |
09:49:15 | FromGitter | <diegogub> Guys, for a driver whats the nim way of handling errors? Exceptions or returning struct with error? |
09:49:27 | Araq | proc forwarded() {.gcsafe.} |
09:49:34 | Araq | include other |
09:49:36 | Araq | # other file |
09:49:47 | Araq | proc forwarded() = discard "implementation here" |
09:49:58 | Araq | you cannot forward the same proc twice though |
09:51:04 | FromGitter | <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:04 | Araq | yeah, that is supposed to work |
09:53:16 | Araq | never tried it though :-) |
09:53:19 | FromGitter | <dandevelo> Doesn't seem to work for me |
09:53:32 | FromGitter | <dandevelo> forward.nim complains that it needs the implementation |
09:53:46 | Araq | include forward.nim first |
09:54:12 | FromGitter | <dandevelo> That's what I did |
09:54:30 | Araq | check the proc headers are the same, but only the forwarded gets the export marker and the pragmas |
10:29:31 | FromGitter | <alehander42> predestination is good, come on it had good twists |
10:32:19 | * | vantage joined #nim |
10:32:46 | FromGitter | <arnetheduck> Araq, planning to revive the libc idea? 😲 |
10:32:51 | Araq | predestination? it's called "Inception" |
10:32:58 | FromGitter | <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:29 | Araq | ephja: there is a JIT/hope. |
10:35:56 | FromGitter | <ephja> maybe it gets more complicated if you output javascript |
10:40:08 | FromGitter | <ephja> lots of calls and allocations when recursing |
10:40:57 | Araq | the FP people call this an "implementation detail", I think. |
10:41:24 | Araq | and wait for compiler technology to catch up. They have been waiting for 40 years now. |
10:43:28 | Araq | arnetheduck; what do you mean? |
10:43:35 | FromGitter | <ephja> so, in 2020 perhaps? |
10:44:20 | Araq | well with Rust they now have it. more or less. probably more less. |
10:44:51 | FromGitter | <krux02> well I heared Rust has slow compilation times |
10:45:07 | FromGitter | <krux02> slow compilation is one reason I don't do scala anymore |
10:45:36 | FromGitter | <krux02> btw, how does nimble test work? |
10:45:49 | FromGitter | <krux02> I wrote a test that imports my library at the top level |
10:45:50 | Araq | it runs the a task called 'test' |
10:45:57 | Araq | I think. |
10:45:59 | FromGitter | <krux02> and when I call nimble test it says it can't find it |
10:46:17 | Araq | in your .nimble file you write a 'task test' |
10:47:29 | FromGitter | <krux02> well I just did default nimble init |
10:47:35 | FromGitter | <krux02> and it made a test for me |
10:47:42 | FromGitter | <krux02> I put my test in that file |
10:47:48 | FromGitter | <krux02> and nimble test |
10:47:53 | euantor | ephja: check out https://github.com/dotnet/corert |
10:47:57 | FromGitter | <krux02> exists as a task, I did not define it |
10:48:22 | Araq | you need to edit the task? |
10:48:43 | euantor | My 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:52 | FromGitter | <krux02> I don't have a task that I can edit |
10:49:09 | FromGitter | <arnetheduck> Araq, https://github.com/nim-lang/Nim/pull/5698/commits/7dcc8e8396de043d2e8d3f837206c8a4a532c774 |
10:51:56 | Araq | arnetheduck: yeah, want to postpone that to after v1 |
10:52:51 | FromGitter | <krux02> I duplicated the nims file for my other test. No modification and it works now |
10:53:09 | FromGitter | <krux02> not a fan of code duplication though |
10:54:29 | Araq | config.nims ? |
10:54:44 | Araq | will get picked by all project files in the same directory |
10:54:50 | Araq | *picked up |
10:55:42 | FromGitter | <krux02> ok, thanks. |
10:56:03 | FromGitter | <krux02> maybe the project template should generate that instead of test1.nims |
11:01:49 | FromGitter | <alehander42> @Araq no, predestination is a different movie, a better one ! |
11:02:39 | Araq | I talked about Inception :-) |
11:03:02 | FromGitter | <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:59 | FromGitter | <alehander42> @Araq I agree, I still think prestige is the best nolan movie, inception is overrated |
11:04:31 | * | SenasOzys__ joined #nim |
11:06:02 | FromGitter | <dom96> @krux02 IIRC there is a bug with the default `test` task |
11:06:11 | FromGitter | <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:12 | livcd | there's no fsmonitor for windows right ? |
11:20:28 | * | simonsolnes joined #nim |
11:23:04 | FromGitter | <krux02> I think enum arrays are a mistake |
11:23:39 | FromGitter | <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:43 | Araq | can 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:38 | FromGitter | <arnetheduck> @alehander42 batman trilogy, hands down |
11:33:34 | * | nigredo-tori quit (Ping timeout: 260 seconds) |
11:37:18 | FromGitter | <data-man> @livcd: https://github.com/snowlt23/nimwatch |
11:37:37 | livcd | oh nice |
11:38:28 | FromGitter | <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:30 | FromGitter | <arnetheduck> I'm a sucker for trilogies :) |
11:40:12 | * | dddddd joined #nim |
11:42:31 | FromGitter | <alehander42> then you either love or hate star wars :D (depending on the view: 4 trilogies or potentially 12logy ) |
11:50:37 | FromGitter | <data-man> The Matrix trilogy is awesome! |
11:53:16 | dom96 | Star Trek > Star Wars :P |
11:54:15 | Araq | heresy |
11:54:39 | dom96 | Araq: https://nim-lang.org/docs/net.html#newSocket,SocketHandle,Domain,SockType,Protocol |
11:54:49 | Araq | dom96: already found it, thanks |
11:57:26 | FromGitter | <ephja> is star wars any good? |
12:00:04 | Araq | the real star wars is. |
12:00:27 | FromGitter | <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:48 | dom96 | it's a nimscript thing |
12:01:11 | FromGitter | <krux02> nimscript? |
12:01:21 | FromGitter | <krux02> should I then look in Nim? |
12:01:37 | Araq | lib/system/nimscript.nim iirc |
12:06:03 | FromGitter | <krux02> Araq: thank you I found it |
12:06:04 | * | Torro quit (Read error: Connection reset by peer) |
12:06:42 | FromGitter | <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:05 | Araq | this makes me sad: https://github.com/nim-lang/Nim/pull/7652/files :-) |
12:26:10 | Araq | > 100 nested macro/template instantiations |
12:26:22 | Araq | people are pushing Nim to its limits... |
12:26:37 | dom96 | of course |
12:26:41 | dom96 | It's what people do :) |
12:27:02 | dom96 | How much nesting does a stack support? |
12:27:44 | Araq | not sure, roughly 2 million calls on a 2MB stack? |
12:28:20 | dom96 | so up the limit to that :P |
12:28:56 | Araq | no. I like arbitrary limits |
12:29:27 | FromDiscord | <mraxilus> lmao |
12:29:33 | FromDiscord | <mraxilus> what's the limit currently? |
12:29:40 | Araq | 100. |
12:30:45 | * | Torro joined #nim |
12:31:00 | * | Torro left #nim (#nim) |
12:31:18 | FromGitter | <AxDSan> hey guys... looking into calling a function by its name? is it possible? |
12:31:46 | FromGitter | <AxDSan> was looking at https://nim-lang.org/docs/manual.html#types-procedural-type |
12:31:57 | Araq | function: say my name. |
12:32:04 | Araq | AxDSan: Heisenberg. |
12:32:05 | FromDiscord | <mraxilus> you mean from a string? |
12:32:08 | FromGitter | <AxDSan> ^ |
12:32:11 | FromGitter | <AxDSan> yup string |
12:32:25 | Araq | function: You're god damn right. |
12:32:30 | FromGitter | <AxDSan> legit :D |
12:32:30 | dom96 | You can only do that at compile-time |
12:33:05 | FromGitter | <alehander42> you can usually create some kind of mapping and use that on runtime |
12:33:23 | FromGitter | <alehander42> I don't think you need to be able to call every possible function |
12:33:29 | FromGitter | <AxDSan> mm |
12:33:37 | FromGitter | <AxDSan> yeah I want to call only 2 |
12:33:44 | Araq | you need to know the involved parameter types too. |
12:33:56 | FromGitter | <krux02> I think nim has too many calling conventions |
12:34:22 | Araq | krux02: the only thing Nim added was .closure. |
12:34:33 | Araq | the others we inherited from Win32... |
12:34:47 | shashlick | If 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:11 | vantage | shash i too want to know that |
12:35:31 | shashlick | I guess nimble basically does that |
12:35:40 | dom96 | yes, it adds a lot |
12:35:59 | dom96 | makes the binary bigger than the compiler IIRC :( |
12:36:14 | Araq | dom96: but we are also doing it pretty stupidly |
12:36:26 | FromGitter | <krux02> Araq: yea you are right |
12:36:31 | Araq | lots of things could be stripped out for nimscript |
12:36:47 | FromGitter | <krux02> maybe those conventions should be put in the os specific sections? |
12:36:53 | shashlick | Would be a cool feature to simply pass a flag, orgasms |
12:36:55 | FromGitter | <krux02> because on linux such stuff doesn't exist |
12:36:56 | vantage | in the docs it mentions nim having an interactive mode... but i dont see it anywhere |
12:37:03 | FromGitter | <krux02> nut sure though |
12:37:06 | shashlick | ! |
12:37:33 | FromGitter | <krux02> vantage: well it's a secret, but there is an interactive nim version |
12:37:35 | shashlick | Pragma I meant to say, or import even |
12:37:44 | FromGitter | <krux02> it's a nim secret! |
12:38:17 | vantage | krux would an interactive version need to compile? |
12:38:20 | dom96 | I wonder how close the LLVM backend arnetheduck is working on is to giving us a proper REPL |
12:38:21 | Araq | krux02: 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:23 | FromGitter | <alehander42> @shashlick orgasms would be a very weird pragma |
12:38:35 | Araq | not sure what would it buy us though. |
12:39:14 | FromGitter | <krux02> Araq: us, maybe nothing |
12:40:09 | FromGitter | <krux02> it just makes things simpler when they can, but still allow calling conventions when needed |
12:40:23 | vantage | calling conventions confuse me, and it not like id use any of them... but why do there need to be explicit calling conventions? |
12:41:23 | FromGitter | <alehander42> I wondered if one can somehow generate only C snippets and abuse a C interpreter like cling for a repl |
12:42:05 | FromGitter | <krux02> one can also use "nim secret" |
12:42:55 | vantage | cant you just compile the snippet then run it? would that be too slow? |
12:43:17 | FromGitter | <krux02> vantage: no it would totally be possible |
12:43:43 | FromGitter | <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:08 | FromGitter | <krux02> it's the incremental thing that is compicated |
12:44:28 | vantage | i like the idea that nlvm has its compiler built in. no external dependancy, (that i know of) |
12:44:31 | FromGitter | <krux02> changing fucntion definitions in a running executable is ont easy |
12:44:49 | FromGitter | <krux02> nlvm? |
12:44:59 | shashlick | Vantage that's how I use snip, to build simple snippets that can then be copied into a real editor |
12:45:16 | Araq | nim playground is also a thing |
12:45:17 | FromGitter | <krux02> national library of virtual manipulatives |
12:45:18 | FromGitter | <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:56 | FromGitter | <krux02> @alehander42 there is a nim repl |
12:46:00 | shashlick | I think a repl is only useful when you have a db connection or similar |
12:46:15 | FromGitter | <krux02> using the nim virtual machine |
12:46:19 | shashlick | But for most of my cases, I've not needed it |
12:46:32 | FromGitter | <alehander42> @krux02 I know about nim secreet |
12:46:38 | FromGitter | <alehander42> and nimscript |
12:46:45 | vantage | krux, 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:49 | FromGitter | <krux02> shashlick a repl is very useful to test out statements in the language |
12:46:53 | shashlick | Even on python, it's painful using it cause you make mistakes and have to keep editing |
12:47:30 | shashlick | Krux02 but you don't need a repl for that, Nim compiles fast enough that it's almost real-time with snip |
12:47:36 | vantage | krux the llvm nim branch. |
12:47:44 | shashlick | You get results as you type |
12:48:15 | FromGitter | <krux02> vantage: how does the llvm branch all the C backend stuff? |
12:48:25 | FromGitter | <krux02> a lot of things in nim are implemented in C |
12:48:28 | vantage | krux it doesnt |
12:48:36 | FromGitter | <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:38 | FromGitter | <krux02> so it can't do echo? |
12:48:52 | shashlick | Try 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:54 | vantage | krux no stdlib stuff |
12:49:34 | FromGitter | <mratsim> Rust and Crystal are slow to compile, apparently because of multiple LLVM pass. Though Clang is really fast on C code |
12:49:48 | Araq | krux02: nothing in Nim is implemented in C. |
12:50:09 | FromGitter | <krux02> yes true |
12:50:12 | shashlick | Isn't there a -d:speed flag? |
12:50:30 | FromGitter | <mratsim> release implies speed |
12:50:38 | FromGitter | <krux02> it is implemented calling into c |
12:50:41 | shashlick | Well I mean compile time |
12:50:45 | FromGitter | <mratsim> though I would love if we could remove the fn-strict-aliasing |
12:50:45 | FromGitter | <krux02> cstdlib |
12:50:51 | FromGitter | <mratsim> foo* |
12:50:53 | vantage | araq, as soon as a lang can compile itself i consider it mature |
12:50:54 | FromGitter | <mratsim> foo |
12:50:56 | FromGitter | <mratsim> fno |
12:51:02 | FromGitter | <mratsim> grrrr autocorrect |
12:51:12 | FromGitter | <krux02> @mratsim disable it |
12:51:16 | FromGitter | <krux02> I did that, too |
12:52:21 | FromGitter | <krux02> @mratsim what is fn-strict-aliasing |
12:53:00 | FromGitter | <krux02> vantages: I would disagree, it just proofes that the language can do one task, writing a compiler in it. |
12:53:06 | FromGitter | <krux02> but that doesn't make it mature at all |
12:53:07 | FromGitter | <mratsim> no-strict-aliasing prevents C from reaching Fortran speed because GCC/Clang will always assume that pointers can alias |
12:53:27 | FromGitter | <krux02> ah that thing |
12:53:29 | FromGitter | <krux02> I remember |
12:53:39 | FromGitter | <mratsim> with strict-aliasing by default GCC/Fortran assume that pointers to different types cannot alias and will produce optimal code |
12:53:58 | FromGitter | <mratsim> for Tensor code it’s quite important so I use restrict everywhere. |
12:54:02 | FromGitter | <krux02> well C has a declaration for that |
12:54:05 | vantage | krux, if it can write its own compiler, like nim does, then it is diverse enough, and also structured enough |
12:54:45 | FromGitter | <krux02> vantage: it is usable but not mature |
12:55:15 | FromGitter | <mratsim> “Faster than C” who cares, Nim is faster than Fortran! |
12:55:20 | vantage | well its not super ultra perfect, but it wont break |
12:55:21 | FromGitter | <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:38 | vantage | krux true |
12:55:49 | * | couven92 joined #nim |
12:56:09 | livcd | did anyone try to write eg a ruby extension in Nim ? |
12:56:38 | FromGitter | <mratsim> @livcd, there was this: http://www.rubyflow.com/p/1j08ef-nim-for-the-discerning-rubyist |
12:56:52 | FromGitter | <mratsim> sorry direct link: http://www.bootstrap.me.uk/bootstrapped-blog/nim-for-the-discerning-rubyist |
12:57:02 | FromGitter | <krux02> and for some people an ide with a class browser, uml diagrams, and uml wizards for code generation |
12:57:35 | FromGitter | <mratsim> or a crossplatform GUI toolkit (good luck with that) |
12:57:41 | vantage | krux now your talking about icing |
12:57:52 | vantage | uml comes before imo |
12:57:58 | * | athenot joined #nim |
12:58:03 | vantage | not that i use uml |
12:58:16 | FromGitter | <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:29 | FromGitter | <mratsim> I don’t understand the point of UML though, some famous general “No plan survives contact with the enemy”. |
12:58:32 | vantage | rocketlib! |
12:58:53 | vantage | html feels much more future proof |
12:59:11 | FromGitter | <krux02> well, the best way to use UML is not |
12:59:18 | FromGitter | <mratsim> Javascript is probably future-proof, but in this case the future is bleak :D |
12:59:58 | livcd | that's impressive :) |
13:00:08 | vantage | i think the most usable uml ive seen was a flow chart describing unity's main loop |
13:00:10 | FromGitter | <ephja> https://marketplace.visualstudio.com/items?itemName=patrys.vscode-code-outline having a side pane helps a lot |
13:00:30 | livcd | mratsim: why do you think it's future-proof ? |
13:01:15 | vantage | mratsim 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:43 | FromGitter | <krux02> all you need is a text editor that does not fuck up, some highlighting, and fast navigation |
13:01:52 | FromGitter | <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:10 | FromGitter | <krux02> putting errors in the editor also helps a lot |
13:02:29 | FromGitter | <alehander42> well how do they do the code outline? based on AST ? |
13:02:38 | FromGitter | <alehander42> this should be doable with a nim extension |
13:02:55 | FromGitter | <krux02> @alehander42 that stuff is overrated |
13:03:00 | FromGitter | <krux02> you don't need an outline |
13:03:09 | FromGitter | <krux02> especially not a general outline |
13:03:16 | vantage | i do |
13:03:22 | FromGitter | <ephja> I have a terrible memory |
13:03:24 | vantage | i need an outline |
13:03:31 | FromGitter | <ephja> unlike some |
13:03:34 | FromGitter | <alehander42> @krux02 I don't use an outline |
13:03:36 | FromGitter | <krux02> the outline has 0 information on what actually is important |
13:03:40 | FromGitter | <alehander42> just saying what's needed to implement it |
13:04:09 | vantage | but if you have zero idea of the structure |
13:04:17 | FromGitter | <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:23 | vantage | or if you want to edit something |
13:04:30 | * | SenasOzys__ joined #nim |
13:04:44 | FromGitter | <krux02> vantage: for that, you use grep |
13:04:52 | FromGitter | <alehander42> well no, I agree that if it can be generated automatically, it should |
13:04:55 | Araq | no, nimgrep |
13:05:06 | FromGitter | <krux02> I configured my editor, so that it finds instantly everything that i name |
13:05:08 | vantage | krux is grep on ms? |
13:05:26 | Araq | nimgrep is. |
13:05:26 | FromGitter | <mratsim> @livcd, inertia |
13:05:30 | FromGitter | <krux02> vantage: if you have git, then yes, because grep is in git |
13:05:32 | FromGitter | <krux02> git grep |
13:05:42 | vantage | lol |
13:05:44 | FromGitter | <krux02> Araq: is nimgrep in git? |
13:05:46 | vantage | ok |
13:06:13 | Araq | krux02: why the fuck would I care what git ships with. |
13:06:30 | FromGitter | <alehander42> hm I just installed outline for sublime, this is great stuff |
13:06:33 | Araq | git for Windows probably ships with Perl for all I know |
13:06:38 | FromGitter | <alehander42> I've been missing out |
13:06:52 | FromGitter | <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:54 | vantage | araq why u hate on git? |
13:07:00 | FromGitter | <andreaferretti> Hi all, is there a way to check that no allocations are performed in a certain section? |
13:07:15 | FromGitter | <andreaferretti> I would like to use something like gc:none |
13:07:24 | Araq | vantage: I don't but 'grep' is worse than 'nimgrep' |
13:07:24 | FromGitter | <krux02> Araq: or in other words "git grep" usese ".gitignore" |
13:07:32 | * | athenot_ joined #nim |
13:07:34 | FromGitter | <andreaferretti> except that the initialization part of the program actually does allocate |
13:07:47 | FromGitter | <andreaferretti> after this part, no other allocations should appear |
13:08:02 | Araq | nimgrep --ext:nim --recursive --stdin . |
13:08:09 | FromGitter | <andreaferretti> I was wondering whether I can get the warning as with gc:none |
13:08:15 | FromGitter | <andreaferretti> but only for a section of code |
13:08:32 | * | athenot quit (Ping timeout: 255 seconds) |
13:08:40 | Araq | nimgrep is grep+find+sed or something |
13:09:03 | FromGitter | <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:27 | Araq | nimgrep works for non Nim projects too. and is fast enough. |
13:09:41 | Araq | and the styling feature can savely be ignored |
13:10:53 | dom96 | 'git grep' supports regex right? |
13:11:06 | dom96 | If so you could easily create a tool on top of it to search style insensitively |
13:11:09 | FromGitter | <krux02> nimgrep returns results in binares |
13:11:35 | FromGitter | <ephja> the name 'grep' would be very misleading otherwise |
13:11:37 | dom96 | also, nimgrep should be a nimble package |
13:11:55 | FromGitter | <krux02> dom96: agree |
13:12:27 | FromGitter | <ephja> "lib\pure\times.nim(486, 20) Error: wrong number of arguments" I wonder why travis doesn't fail with that |
13:12:41 | dom96 | nice to see you again ephja :) |
13:13:40 | FromGitter | <krux02> dom96: git grep supports regular expressions as well as case insensitive search |
13:13:47 | Araq | krux02: --ext:nim |
13:13:57 | Araq | it's a thing, maybe learn nimgrep before dissing it |
13:14:22 | Araq | --ext:c --ext:h is useful for C projects |
13:14:32 | FromGitter | <ephja> the only inconvenience is the argument order, for when you need to adjust something :-P |
13:14:56 | FromGitter | <krux02> Araq: well git grep works like that, just that I don't need to remember such parameters |
13:15:11 | FromGitter | <ephja> but you could just create a couple of shell aliases |
13:15:44 | FromGitter | <krux02> "git grep" does the righ thing, "nimgrep" could do the right thing if I would hassle with the spec |
13:15:54 | FromGitter | <krux02> it's a clear win for "git grep" here |
13:16:08 | FromGitter | <krux02> and when it is not a git project, then I use "ag" |
13:16:12 | FromGitter | <krux02> the silver seracher |
13:16:15 | Araq | krux02: 'git grep' doesn't do the right thing at all, it doesn't support --stdin or --replace or --confirm |
13:16:46 | FromGitter | <krux02> Araq: I am not using grep for replacing |
13:16:46 | FromGitter | <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:48 | FromGitter | <krux02> that is sed |
13:17:01 | Araq | but shrug have fun with your fragile Unix pipelines. |
13:17:07 | FromGitter | <alehander42> so if people use 3-4 languages, they need to remember the nuances of a custom tool for just one lang |
13:17:12 | FromGitter | <alehander42> otherwise nimgrep is great |
13:17:39 | Araq | as I said, I have nimgrep on all my machines and use it for everything |
13:17:50 | Araq | "custom tool" my ass. |
13:17:55 | Araq | :P |
13:18:05 | FromGitter | <alehander42> :D |
13:18:08 | FromGitter | <data-man> Just try Ag (The Silver Searcher) :) |
13:18:13 | FromGitter | <krux02> before I knew about nim I used `ag` and it worked for everything |
13:18:38 | FromGitter | <krux02> but it doesn't work on the Nim project because it has a bug in partisg the gitignore file |
13:19:21 | livcd | I want to try to compile nimgrep for those hpux machines I have here |
13:20:03 | dom96 | alehander42 makes a good point |
13:20:27 | FromGitter | <mratsim> “Araq assigned @data-man an hour ago”: https://github.com/nim-lang/Nim/issues/7653 :D? |
13:20:28 | dom96 | we should make a PR for style insensitive searching in Ag and other such grep tools ;) |
13:21:53 | Araq | SI is just not an issue for Nim code, that's not why I use nimgrep. |
13:22:15 | Araq | SI is pretty much ignored by the Nim community afaict |
13:22:45 | FromGitter | <data-man> @mratsim: Oh! I think he accidentally pressed a wrong button. |
13:22:50 | FromGitter | <ephja> dom96: yo what's up |
13:23:15 | Araq | data-man: nope. it's for you to fix. |
13:23:54 | FromGitter | <ephja> I'll target js with Nim. I can only assume that it will allocate less than F# does |
13:24:29 | FromGitter | <ephja> JS should be replaced with a VM |
13:24:42 | dom96 | ephja: webasm :) |
13:30:42 | FromGitter | <krux02> @ephja I would not assume that the JS target will be memory efficient at all |
13:34:48 | * | rokups joined #nim |
13:39:43 | FromGitter | <ephja> a lot of recursion would be replaced by loops |
13:41:14 | Araq | data-man: you touched sighashes.nim already, I suspect the bug is in there |
13:42:37 | FromGitter | <data-man> @Araq: Thanks! |
13:42:58 | Araq | can guide you further |
13:43:01 | * | endragor quit (Remote host closed the connection) |
13:43:04 | Araq | just ask here in #nim |
13:43:28 | * | endragor joined #nim |
13:44:44 | shashlick | Only complaint for nimgrep is the long flag names |
13:44:52 | shashlick | Else I prefer it |
13:45:02 | shashlick | Recursive should be default perhaps |
13:45:21 | * | endragor_ joined #nim |
13:47:54 | * | endragor quit (Ping timeout: 260 seconds) |
13:48:15 | Araq | I have an alias 'gg' for it... |
13:49:53 | * | endragor_ quit (Ping timeout: 248 seconds) |
13:57:53 | * | endragor joined #nim |
13:58:45 | FromGitter | <narimiran> forum post "Is there a way to specify byte order when reading a binary file?" - we don't see the OP |
13:59:19 | FromGitter | <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:10 | Araq | narimiran: spam protection at work... |
14:06:21 | FromGitter | <narimiran> spam protection "is too damn high"! |
14:07:05 | FromGitter | <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:18 | shashlick | Aliases in Windows... some day |
14:42:56 | Araq | .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:48 | PMunch | Yeah 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:05 | Araq | lol 'batcave', brilliant |
14:55:35 | * | PMunch quit (Quit: Leaving) |
14:56:24 | FromGitter | <data-man> Batman's cave :) |
14:57:25 | Araq | https://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:06 | FromGitter | <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:21 | vantage | when do you need to worry about safe/unsafe code? |
15:36:47 | miran | when it is too late :P |
15:37:45 | vantage | if ur being serious it would be funny |
15:38:21 | Araq | worry about it from the start, newcomers need to worry more than others. |
15:38:43 | Araq | if 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:06 | Araq | should be a good guideline. |
15:39:26 | vantage | i thought it was only a concern if you use multithreading |
15:40:41 | Araq | no. threading uses the same unsafe/safe split. |
15:41:38 | vantage | im lost i think |
15:42:01 | * | endragor joined #nim |
15:42:10 | Araq | unsafe features: addr/ptr/cast |
15:42:16 | vantage | let me put it this way. can i use typeinfo |
15:42:32 | Araq | unsafe features for --threads:on: addr/ptr/cast |
15:42:55 | * | endragor quit (Remote host closed the connection) |
15:43:02 | Araq | plus don't have channels or threads on the stack :P |
15:43:15 | Araq | need to patch the compiler to prevent these... |
15:43:16 | vantage | i need soe |
15:43:35 | vantage | i 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:07 | FromGitter | <alehander42> what is `set` in js backend? js object ? |
16:25:48 | * | sendell quit (Remote host closed the connection) |
16:27:50 | FromGitter | <alehander42> yeah, wrapper around js object mapping true to existing elements |
16:29:57 | * | floppydh quit (Quit: WeeChat 2.1) |
16:34:14 | Vantage_ | proc arity(t: typedesc): int {..} |
16:34:15 | Vantage_ | Returns the arity of the given type |
16:34:21 | Vantage_ | What is arity? |
16:37:01 | FromGitter | <alehander42> how many args does something take |
16:37:13 | * | user1101 quit (Quit: user1101) |
16:37:18 | FromDiscord | <claude> arity(Obj[X, Y, Z]) = 3 |
16:37:28 | * | user1101 joined #nim |
16:38:53 | Vantage_ | Much more meaningful... should I change the source... |
16:39:16 | Vantage_ | 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:35 | FromGitter | <alehander42> adding an example would be better I think |
16:49:41 | FromGitter | <alehander42> (or several) |
16:51:26 | Vantage_ | I just added the one |
16:52:45 | FromGitter | <alehander42> actually that's a great catch |
16:53:01 | FromGitter | <alehander42> @Araq what should `arity` actually return ? |
16:53:19 | FromGitter | <alehander42> the results doesn't make any sense to me |
16:53:35 | FromGitter | <alehander42> don't * |
17:00:13 | * | xet7 quit (Read error: Connection timed out) |
17:00:55 | * | xet7 joined #nim |
17:01:46 | FromDiscord | <claude> https://github.com/nim-lang/Nim/blob/devel/compiler/semmagic.nim#L136 |
17:10:51 | FromGitter | <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:58 | Vantage_ | What you want to install? |
17:12:12 | * | couven92 quit (Quit: Client disconnecting) |
17:12:40 | FromGitter | <diegogub> I have a package evento, its lib ..where I have : src/evento.nim and src/evento/aggregate.nim |
17:12:54 | FromGitter | <diegogub> from evento.nim I call: import evento/aggregate |
17:13:12 | FromGitter | <diegogub> but..from external pkg I cant find evento/aggreate |
17:13:13 | * | r3d9u11 quit (Ping timeout: 256 seconds) |
17:15:32 | FromGitter | <diegogub> but I can import evento |
17:18:08 | Vantage_ | did you run `nimble install` |
17:19:08 | FromGitter | <diegogub> yes, I did |
17:19:22 | * | Trustable quit (Remote host closed the connection) |
17:20:02 | Vantage_ | import it try to compile and run it |
17:20:27 | * | nsf joined #nim |
17:23:20 | shashlick | are you sure you're following the nimble library package structure? https://github.com/nim-lang/nimble#libraries |
17:23:38 | FromGitter | <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:02 | dom96 | diegogub: ls ~/.nimble/pkgs/evento-ver/ |
17:24:15 | dom96 | replace 'ver' with whatever the version is |
17:26:23 | * | r3d9u11 joined #nim |
17:29:40 | FromGitter | <mratsim> There is no arity for proc :/ |
17:29:46 | * | max3 joined #nim |
17:30:06 | FromGitter | <mratsim> that would be a super useful additions to generate variadic proc or iterators (say Zip) |
17:31:36 | FromDiscord | <claude> what do you mean |
17:31:47 | FromDiscord | <claude> you could probably do `arity(procVar.type)` |
17:35:19 | FromDiscord | <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:23 | FromGitter | <mratsim> I’m amazed no one catched this bug before: https://github.com/nim-lang/Nim/issues/7657 |
17:39:25 | shashlick | I 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:46 | shashlick | I'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:23 | miran | shashlick: https://github.com/nim-lang/Nim/community - we might add that here |
17:44:36 | miran | to be issue template |
17:45:58 | shashlick | yes that will be helpful |
17:47:32 | miran | 1. state your nim version, 2. post the minimum example (using backticks, ...), etc. |
17:50:24 | FromGitter | <data-man> https://github.com/nim-lang/Nim/pull/6630 |
17:51:52 | FromGitter | <data-man> GitHub templates :) |
17:52:19 | miran | data-man: he might change his mind this time, if that would lead to better automatization of checks that shashlick is doing |
17:53:24 | FromGitter | <data-man> Maybe |
18:01:03 | FromGitter | <data-man> @mratsim: #7393 Close? |
18:03:15 | FromGitter | <mratsim> done thanks |
18:03:41 | * | xet7 quit (Read error: Connection timed out) |
18:04:25 | * | xet7 joined #nim |
18:07:14 | Vantage_ | say I have a object of type Room, that inherits from GameObject |
18:07:32 | Vantage_ | say I have a proc called repr |
18:07:59 | Vantage_ | and I want to have different fuctionality for Room and GameObject |
18:08:23 | Vantage_ | but I still want Room to call repr as if it was a GameObject |
18:08:24 | Vantage_ | how would I do that? |
18:08:32 | * | Senketsu joined #nim |
18:08:59 | FromGitter | <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:55 | FromGitter | <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:15 | FromGitter | <mratsim> use proc foo(x: GameObject) when it applies to both |
18:10:33 | FromGitter | <mratsim> use method if it applies only to a specific instance |
18:10:38 | FromGitter | <mratsim> that is known only at runtime |
18:11:08 | shashlick | mratsim: I worked on a duplicate file finder a while back which did spawn and async together, was harrowing but it worked |
18:11:12 | shashlick | i can post it as a gist |
18:11:41 | FromGitter | <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:20 | shashlick | https://gist.github.com/genotrance/ef84e2ee7daab54c0a385e92c0a2757d |
18:13:21 | Vantage_ | 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:03 | dom96 | mratsim: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim |
18:18:09 | dom96 | TL;DR: Use isReady |
18:18:23 | FromGitter | <mratsim> @Vantage_ ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ad8dd6f2dfcfffd2b2c932c] |
18:18:36 | FromGitter | <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:59 | shashlick | araq: 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:12 | FromGitter | <mratsim> thanks @shashlick @data-man @dom96, I think the isReady is probably the best |
18:21:58 | Vantage_ | mratsim. If you add `ProcCall bar(GameObject(b))` gives you method: GameObject |
18:22:07 | Vantage_ | thanks for the help though |
18:22:25 | FromGitter | <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:34 | FromGitter | <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:32 | FromGitter | <data-man> @mratsim: http://rosettacode.org/wiki/Dining_philosophers#Nim :) |
18:27:47 | FromGitter | <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:53 | FromGitter | <mratsim> @dom96 * |
18:28:16 | dom96 | no, `poll` blocks |
18:28:40 | dom96 | if you're doing this inside an async proc then you can use sleepAsync |
18:28:49 | * | c0ntribut0r quit (Ping timeout: 248 seconds) |
18:29:08 | FromGitter | <krux02> dom96: isn't poll defined as non-blocking? |
18:29:27 | FromGitter | <mratsim> I was talking about “isReady” actually not poll ;) |
18:30:14 | FromGitter | <krux02> ouch, isReady is also bad naming |
18:30:14 | * | yglukhov joined #nim |
18:30:25 | FromGitter | <krux02> isReady should also return instantly with a bool |
18:30:53 | FromGitter | <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:03 | FromGitter | <krux02> otherwise it is a bad name |
18:31:14 | dom96 | It's a good thing that it does return immediately then |
18:31:37 | dom96 | mratsim: if you have isReady on its own then yes |
18:31:44 | FromGitter | <krux02> sdl_WaitEvent for example is a good name |
18:31:55 | dom96 | but like I said, poll blocks, so in that code it doesn't peg the core |
18:32:18 | FromGitter | <krux02> no poll may not block, because that would conflict the definition of polling |
18:32:21 | FromGitter | <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:05 | FromGitter | <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:28 | FromGitter | <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:19 | FromGitter | <mratsim> regarding bad names, seems like `spawn`doesn’t spawn a thread, but wait for one to be available |
18:36:23 | FromGitter | <ephja> universities with their pedantry ;) |
18:37:22 | FromGitter | <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:13 | FromGitter | <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:02 | dom96 | krux02: unfortunately system APIs disagree with that definition |
18:41:39 | dom96 | I guess you could argue that poll should by default be immediate |
18:41:56 | dom96 | technically 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:22 | Araq | shashlick: nah, it's simply not a "crash" anymore. it should compile. |
18:45:41 | Araq | "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:54 | shashlick | okay 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:01 | Vantage_ | whats a baseless method? |
19:16:56 | FromGitter | <mratsim> It’s a method with no corresponding method for the base class |
19:18:11 | FromGitter | <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:10 | Vantage_ | 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:41 | FromGitter | <mratsim> it’s there but the example can be improved: https://nim-lang.org/docs/manual.html#multi-methods |
19:19:51 | FromGitter | <mratsim> feel free to submit a PR |
19:27:58 | FromGitter | <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:35 | dom96 | what's the syntax error? |
19:29:05 | FromGitter | <diegogub> to import a sub-pgk I was doing: import evento/aggregate |
19:29:12 | FromGitter | <diegogub> but it should be : evento / aggregate |
19:29:14 | FromGitter | <diegogub> with spaces |
19:29:18 | FromGitter | <diegogub> I was not aware of that.. |
19:29:47 | dom96 | without spaces should work |
19:30:38 | FromGitter | <diegogub> I see..now it's working..weird, I did nim install again |
19:30:44 | FromGitter | <diegogub> nimble install |
19:31:13 | * | yglukhov quit (Ping timeout: 248 seconds) |
19:32:21 | dom96 | use `nimble devel` |
19:32:29 | dom96 | er |
19:32:30 | dom96 | nimble develop |
19:32:39 | dom96 | otherwise you'll need to reinstall with each change |
19:47:16 | * | yglukhov joined #nim |
19:48:49 | FromGitter | <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:59 | Araq | or nim + sdl2 |
19:55:59 | * | yglukhov quit (Ping timeout: 260 seconds) |
19:56:09 | * | SenasOzys__ quit (Ping timeout: 264 seconds) |
19:56:13 | FromGitter | <krux02> I really recommend sdl2 for their input API, but the drawing primitives are not the best. |
19:56:43 | FromGitter | <krux02> but it probably doesn't matter for a first game |
19:57:09 | * | mal`` joined #nim |
19:59:25 | FromGitter | <zetashift> Any tips on doing physics with sdl2? do I use a thing like chipmunk? |
20:01:52 | Vantage_ | chipmunk is best |
20:01:58 | FromGitter | <krux02> @zetashift my tip is, don't use physics, it doesn't solve anything |
20:02:05 | Vantage_ | well I don't know how it is in nim |
20:02:16 | Vantage_ | but its better than box2d.. |
20:02:18 | FromGitter | <krux02> but if you really want physics, yea chipmunk probably is a good choice |
20:02:25 | Vantage_ | krux is right |
20:03:06 | FromGitter | <krux02> make your game about simple rules, for example turn based |
20:03:42 | FromGitter | <krux02> always think about what happens every turn, how you want to solve "time passing by" and what problems you get into |
20:03:59 | FromGitter | <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:41 | FromGitter | <krux02> well probably a bad example, but it has similar problems |
20:05:09 | FromGitter | <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:50 | FromGitter | <krux02> so it's a horrible mess to synchronize it. |
20:07:24 | FromGitter | <krux02> by the way, box2D was not intended to be "the physics engine" for everybody |
20:07:55 | FromGitter | <krux02> it was inteded as a teaching tool to show people how to structure a custom physics engine for your game |
20:08:09 | FromGitter | <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:04 | FromGitter | <zetashift> alright thanks |
20:16:18 | * | yglukhov joined #nim |
20:21:48 | Araq | krux02: interesting comparison |
20:24:33 | Vantage_ | games == data oriented |
20:28:02 | FromGitter | <krux02> Vantage_: at least that is how it works the best. |
20:28:19 | FromGitter | <krux02> OO for games is not good, at least not in my experience |
20:28:47 | FromGitter | <krux02> and I really like Nim for not putting this "OO" on top of everything. |
20:29:23 | FromGitter | <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:25 | Vantage_ | 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:44 | Vantage_ | Plus its way more intuative to use DataOriented approach |
20:29:51 | * | user1101 joined #nim |
20:30:20 | Vantage_ | But I don't like how much hassle I have to go through to use a `base classes` method :( |
20:31:22 | Araq | method foo(a: MyBase) {.base.} |
20:32:01 | Vantage_ | what is a base method even |
20:32:14 | Vantage_ | I've got base class methods working sorta |
20:32:22 | Vantage_ | But I don't really know WHY that is |
20:33:02 | * | athenot_ quit (Remote host closed the connection) |
20:33:18 | Vantage_ | 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:15 | FromGitter | <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:31 | shashlick | did you install with nimble? |
21:18:38 | FromGitter | <Bennyelg> yep |
21:18:53 | shashlick | is ~/.nimble/bin in your path? |
21:19:04 | FromGitter | <Bennyelg> 1 sec I'll check :| |
21:19:48 | FromGitter | <Bennyelg> oh now yes :P and all works great |
21:19:49 | FromGitter | <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:06 | FromDiscord | <geckojsc> oh I missed the gamedev discussion :( |
21:53:19 | Araq | well revive it |
21:53:26 | FromDiscord | <geckojsc> I'm on it xD |
21:55:16 | FromDiscord | <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:58 | dom96 | Last Ludum Dare I used sfml |
21:58:13 | FromDiscord | <geckojsc> how did you find it? |
21:59:49 | dom96 | Fairly good |
22:00:01 | dom96 | Wished the wrapper was more true to the C |
22:00:08 | dom96 | but other than that it all worked as expected |
22:00:17 | dom96 | https://ldjam.com/events/ludum-dare/40/coastal-postal |
22:01:39 | FromDiscord | <geckojsc> ohh I didn't realise csfml was a separate thing, that's cool |
22:02:10 | FromDiscord | <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:51 | FromGitter | <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:42 | Vantage_ | abstract base class |
22:12:53 | FromGitter | <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:54 | Vantage_ | abstract classes |
22:13:42 | dom96 | There is a reason Nim was designed to discourage OOP ;) |
22:14:00 | Vantage_ | i just want to share instatiation :( nim isn't OO, not really. |
22:14:14 | Vantage_ | Well what is NIM? |
22:14:22 | FromGitter | <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:25 | Vantage_ | I know C wasn't really OO |
22:14:27 | dom96 | I've been using Nim for many years, and I only reached for methods maybe once. |
22:14:37 | FromGitter | <mratsim> C and Nim are procedural |
22:15:27 | FromGitter | <mratsim> I tried with closures instead of methods but meeeh ... |
22:16:19 | Vantage_ | Why can't types have default values? |
22:16:47 | FromGitter | <mratsim> they do, it’s binary 0 |
22:17:08 | Vantage_ | Why can't I change the default value :P |
22:17:10 | FromGitter | <mratsim> var foo: YourType will have binary 0 |
22:17:28 | FromGitter | <mratsim> oh, yeah put a feature request, sometimes I want that too |
22:17:29 | * | Ven`` joined #nim |
22:17:43 | dom96 | That seems bloaty to me |
22:17:48 | dom96 | Just create a constructor proc |
22:17:54 | FromGitter | <mratsim> but ^ |
22:17:57 | Vantage_ | type Object:...=variable:string="string value not binary 0" |
22:19:16 | Vantage_ | lol |
22:19:35 | Vantage_ | I think there was already talk about a constructor proc |
22:20:05 | Vantage_ | but theres no way to ensure that the constructor proc is used |
22:26:01 | * | xet7 quit (Remote host closed the connection) |
22:29:53 | dom96 | That's a good point |
22:30:51 | Vantage_ | but I'll see. At first it might feel like nim's difficult... |
22:31:02 | Vantage_ | I won't know until I try |
22:31:36 | dom96 | in practice if you're using a Nim library and see a type, writing LibraryType() isn't what you start with |
22:31:52 | dom96 | Because the fields of LibraryType are likely not exposed |
22:31:55 | * | vlad1777d joined #nim |
22:39:03 | Vantage_ | what do you mean? |
22:46:21 | FromGitter | <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:08 | FromGitter | <Bennyelg> easiest way to get variable type in runtime? |
23:00:15 | shashlick | so testament doesn't run unless you are in the nim root directory? |
23:06:10 | FromGitter | <Bennyelg> nvm I managed to figure it out. ⏎ another question. ⏎ building AST for array, |
23:08:28 | FromGitter | <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:54 | FromGitter | <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:13 | dom96 | Bennyelg: import macros: dumpTree: echo("foobar") |
23:40:24 | dom96 | s/macros:/macros;/ |
23:40:32 | FromGitter | <Bennyelg> yea I found it |
23:40:39 | FromGitter | <Bennyelg> it's brilliant :) thanks |
23:43:58 | * | Lord_Nightmare joined #nim |
23:44:58 | FromGitter | <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:07 | dom96 | It means your AST is missing a child? |
23:48:29 | FromGitter | <Bennyelg> I add an ident toTable |
23:48:34 | FromGitter | <Bennyelg> but now I get ⏎ illformed AST: {"ace": "data"} |
23:48:38 | FromGitter | <Bennyelg> without nothinghehe |
23:48:44 | Vantage_ | honewatson, Concepts? |
23:51:20 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ad92b78270d7d3708e63d28] |
23:53:45 | FromGitter | <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:48 | FromGitter | <honewatson> @Vantage_ here is an example of concepts |
23:57:52 | * | Serenitor quit (Quit: Leaving) |
23:58:01 | FromGitter | <honewatson> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ad92d095d7286b43a493cc7] |