00:07:58 | * | vlad1777d quit (Ping timeout: 250 seconds) |
00:38:53 | * | theelous3 joined #nim |
00:42:29 | * | deansher_ joined #nim |
00:46:04 | * | deansher_ quit (Client Quit) |
00:48:37 | * | Sentreen joined #nim |
00:53:23 | * | theelous3 quit (Ping timeout: 245 seconds) |
01:17:23 | * | wildlander quit (Quit: Konversation terminated!) |
01:26:09 | * | zachk quit (Quit: Leaving) |
01:47:40 | * | leorize joined #nim |
02:57:19 | * | Tyresc quit (Quit: WeeChat 2.4-dev) |
03:00:03 | * | banc quit (Quit: Bye) |
03:17:03 | * | banc joined #nim |
03:17:58 | * | abm quit (Quit: Leaving) |
04:20:05 | * | nsf joined #nim |
04:40:42 | * | steshaw joined #nim |
05:21:45 | * | kapil____ quit (Quit: Connection closed for inactivity) |
05:31:18 | * | shashlick quit (Remote host closed the connection) |
05:31:38 | * | shashlick joined #nim |
05:33:22 | FromDiscord_ | <AregevDev> Hi |
05:34:05 | shashlick | what's up |
05:34:58 | FromDiscord_ | <AregevDev> Is this Discord dead? |
05:35:17 | FromDiscord_ | <AregevDev> Should I switch to Gitter? |
05:38:04 | shashlick | you are bridged into gitter and irc |
06:17:09 | * | kinkinkijkin quit (Remote host closed the connection) |
06:17:34 | * | kinkinkijkin joined #nim |
06:47:57 | * | d10n-work quit (Ping timeout: 252 seconds) |
06:50:54 | * | d10n-work joined #nim |
07:06:48 | * | plushie quit (Quit: plushie) |
07:28:23 | * | dddddd quit (Remote host closed the connection) |
08:07:26 | FromGitter | <xmonader> https://pastebin.com/J2QjEbw6 hi i tried to support nim here ⏎ https://github.com/BenBrock/reple it's kinda working |
08:20:38 | * | kapil____ joined #nim |
09:42:18 | * | vlad1777d joined #nim |
09:42:49 | * | Vladar joined #nim |
10:00:18 | * | steshaw quit (Quit: Connection closed for inactivity) |
10:02:20 | * | stefanos82 joined #nim |
10:41:46 | * | tdc quit (Quit: Leaving) |
11:08:03 | * | nsf quit (Quit: WeeChat 2.3) |
11:24:10 | * | xet7 joined #nim |
11:33:20 | * | OrganicAnywhere joined #nim |
11:54:42 | * | dddddd joined #nim |
12:03:35 | FromGitter | <zacharycarter> @xmonader - isn't this basically what iNim is? |
12:04:03 | FromGitter | <zacharycarter> either way - cool :) |
12:25:35 | * | nsf joined #nim |
13:11:49 | FromGitter | <xmonader> @zacharycarter yeah indeed, just sounded easy to do with some json config :) |
13:13:22 | * | PrimHelios quit (Remote host closed the connection) |
13:15:37 | FromGitter | <mratsim> @dom96 @c-blake This was merged too fast: https://github.com/nim-lang/Nim/pull/10072 |
13:16:04 | * | enthus1ast quit (Quit: WeeChat 1.6) |
13:17:23 | dom96 | Okay, elaborate |
13:19:07 | * | OrganicAnywhere quit (Quit: See you in hell, madafaka~) |
13:19:17 | FromGitter | <mratsim> opening an issue |
13:25:47 | * | whaletechno quit (Quit: ha det bra) |
13:25:52 | FromGitter | <deech> These PRs seem like they can be merged. I addressed the comments. https://github.com/nim-lang/Nim/pull/10001 https://github.com/nim-lang/Nim/pull/9934 |
14:06:19 | * | filcuc joined #nim |
14:06:53 | filcuc | should i fill a bug report for "if expressions" not compiling with operators |
14:06:54 | filcuc | ? |
14:07:18 | filcuc | temp &= if true: "foo" else: "bar" |
14:07:22 | filcuc | where temp is string |
14:08:06 | FromGitter | <alehander42> does it work with (if true: ..) ? |
14:09:41 | filcuc | is it work with () |
14:09:43 | filcuc | yes |
14:10:21 | * | noonien quit (Quit: Connection closed for inactivity) |
14:10:28 | FromGitter | <alehander42> hm |
14:36:47 | * | xet7 quit (Quit: Leaving) |
15:11:34 | * | kapil____ quit (Quit: Connection closed for inactivity) |
15:27:29 | * | filcuc quit (Quit: Konversation terminated!) |
15:40:20 | * | nsf quit (Quit: WeeChat 2.3) |
16:26:22 | * | smitop joined #nim |
16:30:18 | * | Subspice joined #nim |
16:35:24 | FromGitter | <mratsim> I think this is a parsing issue |
16:35:43 | FromGitter | <mratsim> I remember with “block:” you have to wrap then in double parenthesis in the past |
16:53:56 | * | azur_kind joined #nim |
16:58:11 | * | nsf joined #nim |
16:59:56 | Subspice | What does it mean when I run a program successfully but get the message "[Done] exited with code=null in X seconds"? |
17:02:52 | * | Subspice quit (Quit: See you in hell, madafaka~) |
17:09:31 | * | Tyresc joined #nim |
17:09:36 | * | Vladar quit (Remote host closed the connection) |
17:17:21 | crashbjorn | I can't seem to find any documentation on the lambda syntax provided with the futures module - is there none available? |
17:18:35 | * | kapil____ joined #nim |
17:20:16 | leorize | doesn't that module document the syntax itself? |
17:21:10 | crashbjorn | where should i be looking for this? in the source code? |
17:21:24 | crashbjorn | I'm sorry if this is a dumb question :) just haven |
17:21:37 | crashbjorn | *...havent been able to find anything with my google-fu |
17:21:39 | leorize | in the module reference :P |
17:22:00 | leorize | https://nim-lang.org/docs/sugar.html |
17:22:40 | leorize | ^ `futures` is now named `sugar` |
17:22:45 | crashbjorn | perfect! thank you :) |
17:25:57 | * | azur_kind quit (Remote host closed the connection) |
17:32:33 | * | wildlander joined #nim |
17:35:51 | * | mal`` quit (Ping timeout: 252 seconds) |
17:55:51 | shashlick | Nice when @xmonader - https://github.com/BenBrock/reple/pull/2 |
17:55:54 | shashlick | Work |
17:57:08 | * | fthe joined #nim |
18:00:37 | fthe | hi. Know how in java/python, the default `hash()` of an object is its memory address? Is there a way to get similar behavior in nim? Or to check if two ref vars point to the same value? |
18:02:16 | leorize | `==` :) |
18:02:30 | * | OrganicAnywhere joined #nim |
18:03:56 | fthe | leorize: I though I read in the manual that ==, for ref types, actually does a deep comparison of fields? |
18:06:37 | leorize | !eval echo new(RootObj) == new(RootObj) |
18:06:41 | NimBot | false |
18:06:52 | leorize | fthe: ^ doesn't look like that |
18:07:57 | fthe | hm, interesting, thanks' |
18:09:33 | fthe | https://github.com/nim-lang/Nim/blob/master/lib/system.nim#L388 confirms this |
18:10:52 | fthe | The deep-compare thing is for non-ref object types I see |
18:11:36 | fthe | !eval new(RootObj)[] == new(RootObj)[] |
18:11:38 | NimBot | Compile failed: in.nim(1, 16) Error: expression 'new(RootObj)[] == new(RootObj)[]' is of type 'bool' and has to be discarded |
18:11:56 | fthe | !eval echo new(RootObj)[] == new(RootObj)[] |
18:11:59 | NimBot | true |
18:13:00 | * | OrganicAnywhere quit (Read error: Connection reset by peer) |
18:13:14 | * | OrganicAnywhere joined #nim |
18:13:14 | fthe | so, is there a way to use this `==` behavior for refs as a hash for tables or sets? |
18:13:22 | * | OrganicAnywhere left #nim (#nim) |
18:14:48 | fthe | I see the hashes modules has `hash` for pointer, so maybe one could use `addr(obj[]).hash()`? |
18:17:10 | leorize | not the best thing to do, but sure, it works I think |
18:23:30 | fthe | yeah, that's my thoughts, was wondering if there was a better/idiomatic way |
18:24:14 | leorize | I think people don't usually use `ref` as table key |
18:25:05 | leorize | it can be risky since you could leak the pointer with the `pairs` iterator |
18:36:31 | * | nsf quit (Quit: WeeChat 2.3) |
18:41:19 | * | azur_kind joined #nim |
18:42:59 | * | jacereda joined #nim |
18:46:02 | * | smitop quit (Quit: Connection closed for inactivity) |
18:46:42 | jacereda | What's the C backend supposed to generate? c99? |
18:47:53 | leorize | it generates whatever the compiler understands |
18:48:23 | leorize | if you use compiler=gcc, the compiler will generate gcc tailored code |
18:48:39 | FromGitter | <timotheecour> how can `(buf, exitCode) = execCmdEx("./megatest”)` work on windows? |
18:49:06 | leorize | does it not work or something? |
18:49:55 | FromGitter | <timotheecour> haven’t noticed any failure, but doesn't windows use `.exe` extension? |
18:49:59 | jacereda | I guess https://github.com/nim-lang/Nim/commit/2fd522cf58e40064747e52e0eeb53f28e67d3243 will break some compilers, anonymous struct unions aren't very standard |
18:50:00 | jacereda | |
18:50:08 | jacereda | I think it's c11 |
18:50:24 | leorize | it generates whatever the backend compiler understands |
18:50:34 | leorize | if the backend is gcc, it generates gcc-specific code |
18:50:58 | leorize | at least that's what I remember :P |
18:51:13 | jacereda | leorize: I don't think that commit is gcc-specific |
18:51:59 | * | mal`` joined #nim |
18:52:03 | jacereda | also, anonymous structs will make implementing https://github.com/nim-lang/Nim/issues/3629 quite hard |
18:53:03 | Araq | jacereda: I tried visual C++ and it supports it. all other compilers are usually more C99-friendly |
18:53:29 | FromGitter | <timotheecour> @araq : how can `(buf, exitCode) = execCmdEx("./megatest”)` work on windows? doesn’t it require .exe ? |
18:54:02 | jacereda | Araq: c99 didn't allow anonymous structs, I think it's c11 |
18:54:16 | jacereda | if c99 compilers are ruled out I guess it's ok |
18:54:16 | leorize | timotheecour: `execCmdEx` use `cmd` to execute commands |
18:54:30 | jacereda | but the other problem is what really worries me |
18:54:39 | Araq | jacereda: interesting I simply assumed structs and unions are treated consistently |
18:55:10 | Araq | timotheecour: usually the Win API deals with these things |
18:56:01 | jacereda | Araq: with named struct unions, having fields with the same name in different branch is ok, but that's not the case when the fields are anonymous |
18:56:07 | FromGitter | <timotheecour> ok |
18:57:13 | Araq | and why would https://github.com/nim-lang/Nim/issues/3629 be hard? some field names will be mangled then if we implement it |
19:00:12 | FromGitter | <mratsim> @fthe, just cast the ref to `Hash` |
19:00:58 | jacereda | because mangling will be necessary |
19:01:14 | jacereda | it will be a bit more confusing when examining the generated code (field names won't be the same) |
19:01:30 | Araq | it already is, in C 'far' is a keyword and in Nim it isn't |
19:03:21 | Araq | and strictly speaking, generating C is impossible (what a great "portable assembler", give me a break, it's a bad joke) because it's impossible to know what has been #define'd and the preprocessor doesn't know C's scoping rules |
19:09:02 | jacereda | so, if I attempt to implement #3629 backing out that commit, chances are it won't be accepted? |
19:10:27 | * | fthe quit (Ping timeout: 240 seconds) |
19:11:35 | * | plushie joined #nim |
19:14:15 | stefanos82 | Araq: sounds like a good Nim project for you; a genuinely portable assembler implemented in Nim ;)p |
19:14:58 | Araq | stefanos82: LLVM already exists though ;-) |
19:15:02 | jacereda | stefanos82: there're lots of decent solutions around |
19:15:21 | stefanos82 | Araq: touché |
19:16:49 | stefanos82 | jacereda: don't interrupt my teasing please. Araq is a grumpy "old" man that likes to moan about everything...except a good beer |
19:17:37 | Araq | jacereda: PRs are always welcome. Ideally they don't reintroduce old cruft though. |
19:18:58 | Araq | stefanos82: I try to keep my moaning to stuff that's not as widely known to be deeply flawed. |
19:19:26 | stefanos82 | Araq: you know I rarely disagree with you, don't you that already mate? |
19:19:49 | Araq | which is why I rarely bash Windows, everybody already knows it's crap. |
19:20:03 | stefanos82 | I personally call them WinBlows |
19:20:03 | Araq | stefanos82: yeah I know but others might read this too. |
19:20:09 | stefanos82 | because literally it blows everything |
19:20:33 | stefanos82 | someone uploaded a picture *of a coffee maker* updating its Windows 10 |
19:20:42 | stefanos82 | ON A FREAKING COFFEE MACHINE! |
19:20:46 | stefanos82 | bloody hell man |
19:20:51 | FromGitter | <zacharycarter> our coffee machines at work run android |
19:21:01 | stefanos82 | for FAQ's sake man |
19:21:09 | FromGitter | <alehander42> jacereda: we discussed https://github.com/nim-lang/Nim/issues/3629 a lot weeks ago, but it was somewhere in the chat |
19:21:20 | jacereda | Araq: generating something like this would be acceptable? https://gist.github.com/jacereda/716a4a2cc1840f3ce30d0393c6179b3a |
19:21:56 | stefanos82 | it wouldn't work with C |
19:21:58 | jacereda | now, the branch identifiers are missing and avoiding those would mean introducing some mangling to the field names... that feels odd |
19:22:04 | stefanos82 | it does not support anonymous structs |
19:22:12 | stefanos82 | at least not until C11 if I'm not mistaken |
19:22:39 | FromGitter | <zacharycarter> stefanos82: should read up a bit |
19:23:00 | Araq | jacereda: if you put it behind a conditional |
19:23:18 | Araq | see extccomp.TInfoCCProp |
19:23:28 | stefanos82 | @zacharycarter: shoot, i didn't see that line |
19:23:30 | Araq | a new flag should be used for this |
19:23:34 | stefanos82 | apologies jacereda |
19:24:47 | jacereda | Araq: but a flag would imply implementing both approaches... or do you mean a flag to enable repeated field names? |
19:25:19 | Araq | the flag generates the struct names or not |
19:25:45 | jacereda | and what is it supposed to do when you don't pass the flag to generate struct names and have repeated field names? |
19:27:09 | Araq | well you conflate two separate issues |
19:27:25 | Araq | 1. C compiler doesn't support anon structs. Covered by the flag. |
19:28:00 | jacereda | that's the part I don't care about that much |
19:28:01 | Araq | 2. Can't use anon structs because identifiers would clash. Compiler would always generate struct names then to disambiguate. Or it would mangle the names. |
19:28:34 | Araq | I don't care which of these two you do |
19:29:31 | FromGitter | <Clyybber> Araq: You would like to remove static T? |
19:29:44 | Araq | hell yes |
19:29:53 | jacereda | that's the part that I'm interested in and I would be willing to implement it, but I don't want to implement 2 separate approaches |
19:30:08 | Araq | well obviously you implement what's easier :P |
19:30:20 | FromGitter | <Clyybber> Araq: So no more compile time arguments for a proc? |
19:30:46 | FromGitter | <Clyybber> Only if the proc is {.compiletime.} ? |
19:36:22 | Araq | use a macro |
19:36:29 | Araq | or template |
19:37:27 | FromGitter | <Clyybber> What purpose does the {.compiletime.} pragma have? |
19:37:43 | * | Trustable joined #nim |
19:37:44 | FromGitter | <Clyybber> Templates should be capable of the same stuff don't they? |
19:42:53 | FromGitter | <Clyybber> @timotheecour I see you just opened a issue for removing static T |
19:44:18 | FromGitter | <Clyybber> Araq: Do you have an Idea how the problem in https://github.com/nim-lang/Nim/issues/10085 would be solved without static T? |
19:57:02 | * | azur_kind quit (Ping timeout: 250 seconds) |
20:00:12 | * | stefanos82 quit (Remote host closed the connection) |
20:12:36 | * | onionhammer quit (Quit: WeeChat 1.9.1) |
20:12:53 | * | onionhammer joined #nim |
20:15:10 | * | jjido joined #nim |
20:33:18 | FromGitter | <deech> If the following is equivalent to `proc foo(...) {.compileTime.} = ` I suggest removing the `{.compileTime.}` pragma as well: ⏎ ⏎ ```static: ⏎ proc foo(..) = ...``` [https://gitter.im/nim-lang/Nim?at=5c1ff10d2863d8612b7bc7ca] |
20:38:42 | FromGitter | <mratsim> no, I need either the static result or the compile-time pragma |
20:39:22 | FromGitter | <deech> In what cases is one better than the other? |
20:40:31 | FromGitter | <mratsim> there is work to merge them and remove one of them |
20:40:47 | FromGitter | <deech> Oh, had no idea. Sorry. |
20:44:02 | * | kungtotte joined #nim |
20:46:47 | * | jacereda quit (Ping timeout: 240 seconds) |
20:47:42 | * | nsf joined #nim |
20:49:06 | * | jacereda joined #nim |
20:52:48 | FromGitter | <mratsim> you can read up here: https://github.com/nim-lang/Nim/pull/9686 |
20:57:00 | * | filcuc joined #nim |
20:57:26 | filcuc | what's the correct way to use nimsuggest con command? |
21:00:05 | * | Trustable quit (Remote host closed the connection) |
21:00:13 | filcuc | i'm testing it with --tester but i get EOF |
21:01:47 | * | jacereda quit (Ping timeout: 240 seconds) |
21:02:58 | * | Trustable joined #nim |
21:06:13 | FromGitter | <mratsim> After cooking for seven months, I’m proud to release the latest v0.5 release of Arraymancer: https://github.com/mratsim/Arraymancer/releases/tag/v0.5.0 ⏎ ⏎ Special highlights: Featuring recurrent neural networks in sequence/timeseries classification and text generation with examples in Shakespeare and Jane Austen (Pride & Prejudice) style |
21:09:31 | jjido | Where are the examples? |
21:16:57 | * | Trustable quit (Remote host closed the connection) |
21:18:11 | * | Trustable joined #nim |
21:18:13 | * | Trustable quit (Remote host closed the connection) |
21:18:18 | FromGitter | <mratsim> https://github.com/mratsim/Arraymancer/tree/master/examples |
21:19:15 | * | fthe joined #nim |
21:23:12 | FromGitter | <alehander42> congrat!! |
21:26:31 | Araq | mratsim: When I am talking about removing static T this doesn't mean that your libs become impossible to write. |
21:27:53 | * | jacereda joined #nim |
21:28:43 | FromGitter | <mratsim> i hope so |
21:28:55 | FromGitter | <mratsim> I really like the static enums |
21:29:03 | filcuc | https://github.com/nim-lang/Nim/issues/10087 |
21:32:43 | dom96 | mratsim: Awesome, is this the input or the output: https://github.com/mratsim/Arraymancer/blob/master/examples/ex06_pride_and_prejudice.txt ? |
21:35:21 | FromGitter | <mratsim> the input |
21:35:48 | FromGitter | <mratsim> output is here: https://github.com/mratsim/Arraymancer/blob/ebb3f8325ed2af61398bb946657ad093b5dba386/examples/ex06_shakespeare_generator.nim#L644-L811 |
21:36:37 | FromGitter | <mratsim> we can train it on Nim code as well ;) |
21:37:06 | Araq | yay, can we get an even better tabnine? |
21:38:15 | FromGitter | <mratsim> I don’t think so :P |
21:39:01 | dom96 | You should train it on Nim IRC logs and integrate it into NimBot ;) |
21:39:13 | FromGitter | <mratsim> lol |
21:39:33 | FromGitter | <mratsim> “FromGitter" |
21:39:39 | FromGitter | <mratsim> in every sentence |
21:40:21 | dom96 | nah, but it might include random nicknames in replies |
21:41:02 | FromGitter | <mratsim> I’ve also started on reinforcement learning on Atari games though I need a new machine because my GPU is on a headless server - https://github.com/numforge/agent-smith |
21:41:14 | FromGitter | <mratsim> I plan to add Starcraft 2 bindings |
21:51:32 | * | OrganicAnywhere joined #nim |
21:51:49 | OrganicAnywhere | Hi everyone. I'm thinking of reading this <http://maplant.com/gc.html> and implement the code in Nim. An exercise in working with pointers and memory (stacks, heap). Good idea? |
21:53:04 | FromGitter | <mratsim> I think it’s a great idea |
21:53:07 | * | jacereda quit (Ping timeout: 240 seconds) |
21:55:37 | FromGitter | <mratsim> The GC_init proc will only work on Unix though as it calls: /proc/self/stat I hope you’re not on windows |
21:55:48 | Araq | OrganicAnywhere: ok but notice that this exists in gc_ms.nim |
21:56:38 | Araq | and mark&sweep is a terrible algorithm ;-) |
21:57:32 | OrganicAnywhere | Araq: Pretty sure nim's gc is much, much better. The point of this would be just to get a bit better at progamming (I'm not new to it, but never really got past the early stages). |
21:59:27 | crashbjorn | Uncalled-for-recommendation: but I was really glad that I did the advent of code challenges to improve my programming skills. They mostly focus on algorithms, but they're a great way to get backbone experience, and to get to know a language really well. |
21:59:42 | crashbjorn | @OrganicAnywhere |
21:59:50 | OrganicAnywhere | Other ideas for exercises I have are implementing some efficient algorithm for multiplying large matrices, implementing a hash table, or writing that Brainfuck interpreter that's on the nim-lang.org website. |
22:00:21 | FromGitter | <mratsim> GC sounds fine |
22:00:27 | OrganicAnywhere | crashbjorn: I'm doing AoC 2015! I started a few days ago and I'm on day 4 now. I took a break today to write Conway's Game of Life. |
22:00:38 | FromGitter | <mratsim> Multiplying large matrices is a pain. I did that twice ;) |
22:00:52 | FromGitter | <mratsim> Brainfuck is quite fun. |
22:01:01 | FromGitter | <mratsim> Never did a hash table. |
22:01:02 | crashbjorn | Awesome! Sounds like you're being really productive OrganicAnywhere :D |
22:01:45 | Araq | OrganicAnywhere: I have an alternative for you |
22:02:34 | FromGitter | <mratsim> For Brainfuck and VM here is my experimental code: https://github.com/mratsim/jitterland |
22:03:15 | FromGitter | <mratsim> For matrix multiplication, everything you need is here: https://github.com/numforge/laser/blob/master/research/matrix_multiplication_optimisation_resources.md |
22:03:28 | FromGitter | <mratsim> (I reach OpenBLAS performance) |
22:03:42 | OrganicAnywhere | crashbjorn: Long story short: I decided to not pick up C againa and give Nim a go, and I've never been this excited about programming. I'm actually looking forward to writing things I used to think sounded really boring. |
22:03:56 | OrganicAnywhere | FromGitter: Thank you! |
22:03:57 | FromGitter | OrganicAnywhere, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
22:04:01 | OrganicAnywhere | Oh |
22:04:07 | OrganicAnywhere | haha |
22:04:35 | OrganicAnywhere | Araq: What's your alternative? |
22:04:37 | Araq | http://arctrix.com/nas/python/gc/ implement this cycle collector algorithm |
22:04:53 | OrganicAnywhere | Ohhh |
22:04:58 | Araq | or alternatively the more traditional variant of "trial deletion" |
22:05:30 | FromGitter | <mratsim> ah actually my matrix multiplication optimization resources are missing the first steps, they are here: https://github.com/numforge/laser/blob/master/laser/primitives/matrix_multiplication/gemm_tiling.nim#L12-L30, I encourage you to start with this step by step tutorial - http://apfel.mathematik.uni-ulm.de/~lehn/sghpc/gemm/index.html |
22:05:42 | * | fthe quit (Ping timeout: 246 seconds) |
22:06:13 | Araq | use a BTree (compiler/btree.nim) to attach more data to a 'ref' |
22:06:49 | OrganicAnywhere | Oh, right. So I've never really worked with algorithms and data structures like that. |
22:07:17 | OrganicAnywhere | But that's on my list of things to do parallel to AoC |
22:07:34 | Araq | stay in "user land" as long as possible, that's what I do too when I play with new GC algorithms |
22:07:55 | OrganicAnywhere | what's "user land"? |
22:08:26 | Araq | don't touch system.nim or gc.nim, write a Nim program that uses an array or a seq as the heap |
22:08:51 | Araq | and when you're sure the algorithm does it properly port it to a lower level |
22:09:25 | OrganicAnywhere | Sounds good. I'm not particularly interested in GC's, but it sounded like an interesting way to exercise working with pointers and stacks and heaps. |
22:10:46 | OrganicAnywhere | mratsim: So I should do the links you sent in reverse order? |
22:11:02 | Araq | it's a minefield and when you start in the lower level you'll never get anything done |
22:11:53 | Araq | and these algorithms all tend to be underspecified, leaving out important edge cases or even buggy |
22:11:55 | OrganicAnywhere | mratsim: Wait, that last like is about implementing a kernel...? |
22:13:38 | OrganicAnywhere | Araq: What kind of exercise or small project would you recommend if one wanted to actually become more familiar with the heap? |
22:13:43 | FromGitter | <mratsim> kernel is a unit of computation in high performance computing |
22:14:00 | OrganicAnywhere | mratsim: Ahh, ok! :) |
22:14:37 | FromGitter | <mratsim> for efficient matrix multiplication you do what we call `tiling` or `blocking` to reuse data in CPU cache |
22:15:02 | FromGitter | <mratsim> a simple scheme is to do matrix multiplication by splitting matrices into 32 by 32 block |
22:16:10 | filcuc | Araq: not asking to fix it but do you think that https://github.com/nim-lang/Nim/issues/10087 is a valid bug report? or is it correct behaviour of the con command? |
22:16:12 | FromGitter | <mratsim> To see how blocking works live, I suggest you try your hand at fast transposition first |
22:16:44 | OrganicAnywhere | mratsim: Do you mean looking into algorithms to do fast transpositions fast in code? |
22:16:49 | FromGitter | <mratsim> This is an example of transposition with blocking: https://github.com/numforge/laser/blob/master/benchmarks/transpose/transpose_bench.nim#L187-L192 |
22:17:07 | OrganicAnywhere | Why not. Matrix theory is fun. |
22:17:14 | FromGitter | <mratsim> This improves speed 2x compared to naive transposition |
22:17:54 | FromGitter | <brentp> I am using a stream to read binary data from a zip file. I currently extract the file to disk and the read the binary data as such: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ how would I do this without the temp file? [https://gitter.im/nim-lang/Nim?at=5c2009926649aa1f82beae87] |
22:18:00 | FromGitter | <mratsim> And here is an example of 2D tiling for matrix multiplication: https://github.com/numforge/laser/blob/master/benchmarks/gemm/gemm_bench_float32.nim#L110-L127 |
22:18:15 | FromGitter | <mratsim> this should be much faster (but still very slow) compared to triple for loops. |
22:18:55 | FromGitter | <mratsim> @brentp I think `zip` package offers ZipStream no? |
22:19:21 | OrganicAnywhere | mratsim: You're into this stuff. Is it something you do just out of interest or do you use this stuff in your work or projects? |
22:19:26 | FromGitter | <brentp> @mratsim congrats on the release. that's pretty impressive you got to BLAS speed. At some point, I'll have to see if I can use laser to parallelize some of my stuff. |
22:19:55 | Araq | filcuc: the bug report seems fine |
22:20:12 | FromGitter | <mratsim> I’m a data scientist and i hated waiting on Numpy/Scikit learn and stuff ;) |
22:20:28 | FromGitter | <mratsim> I plan to use it for data science competitions as well. |
22:20:34 | OrganicAnywhere | Aaah! |
22:21:06 | FromGitter | <mratsim> And I’m planning on doing a Starcraft 2 AI. Currently I did a wrapper for the Arcade learning Environment, so you can do bot for Atari games |
22:22:12 | FromGitter | <mratsim> @brentp ssue for the primitives you would like to see. I probably won’t implement too much manually but some are just too slow |
22:22:22 | OrganicAnywhere | That sounds very interesting! I'll keep myself updated. I have a close relative who does AI research. |
22:22:27 | Araq | hmm the copying GC that I wrote is in a file called 'temp.nim' |
22:22:34 | Araq | that can't be right... |
22:22:46 | FromGitter | <mratsim> like `exp` and `log`. I don’t understand why math.h can be improved 10x upon |
22:23:08 | FromGitter | <mratsim> open an issue* bad keyboard ignoring characters |
22:23:51 | FromGitter | <brentp> @mratsim. will do. I mostly mean using the openmp stuff for loop parallelization. |
22:24:09 | FromGitter | <brentp> also, I see now there is a getStream() in zipfiles, that should get me started. |
22:24:17 | FromGitter | <mratsim> oh I see |
22:24:27 | Araq | https://gist.github.com/Araq/e0c5603cb9d318512bb63554c3e03ec2 here, have a copying GC |
22:24:45 | Araq | wanted to make this Nim's "async" collector |
22:25:19 | FromGitter | <mratsim> @OrganicAnywhere, everything I’m working on regarding AI in Nim is in the “ecosystem” section of my release notes: https://github.com/mratsim/Arraymancer/releases/tag/v0.5.0 |
22:25:25 | Araq | it's more low level than I advised you to do it |
22:25:45 | Araq | but it seems to work |
22:26:58 | OrganicAnywhere | Araq: Well, at the very least I can look at it and learn something. :) |
22:28:21 | OrganicAnywhere | mratsim: I'll save this for sure. I have an idea for a game involving an AI that learns. In a few years ;) |
22:28:35 | Araq | it's a completely precise GC btw, not what Nim does |
22:28:54 | OrganicAnywhere | I will be looking at your laser folder |
22:29:14 | FromGitter | <mratsim> @brentp, yeah the BLAS speed is cool, and thanks to Nim metaprogramming, supporting a new architecture or SIMD (like SSE, AVX) is very easy: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c200c3a93cce97d3b89a1cf] |
22:30:01 | FromGitter | <mratsim> ^ code for the fastest int32 BLAS (well no one has one so …) |
22:30:58 | * | filcuc quit (Quit: Konversation terminated!) |
22:31:05 | Araq | OrganicAnywhere: and the code had a bug which took me about 4 hours to figure out :-) |
22:31:23 | Araq | even though it's a textbook algorithm |
22:31:48 | Araq | so yeah ... better start with something else |
22:31:57 | * | filcuc joined #nim |
22:32:09 | FromGitter | <mratsim> Actually people from Facebook are now asking me to run benchmarks on their matrix multiplication implementation for their neural network compiler: https://github.com/pytorch/glow/issues/1749#issuecomment-447401410 |
22:32:47 | OrganicAnywhere | Hmmm... so no copying gc? But you still recommend the cycle gc? |
22:34:13 | FromGitter | <zacharycarter> @mratsim - when I toyed with SIMD, I found the most annoying bit getting all of the compiler flags right |
22:34:28 | Araq | OrganicAnywhere: yeah but only because I need it :P |
22:34:35 | FromGitter | <zacharycarter> and understanding what was available on what hardware |
22:35:23 | FromGitter | <zacharycarter> but I also didn't try very hard before I decided all of the complexity required to sort all of that all out wasn't worth it given the time constraint I was working with |
22:35:25 | FromGitter | <mratsim> SIMD have a descriptive name once you used them for a weekend |
22:35:41 | FromGitter | <zacharycarter> errr no - it wasn't the instructions |
22:35:59 | FromGitter | <zacharycarter> it was like - this cpu and os support this SIMD instruction set |
22:36:03 | FromGitter | <zacharycarter> and this other cpu and OS supports this one |
22:36:18 | FromGitter | <zacharycarter> and you have to get all of these flags correct (at least I think that's what was giving me trouble when I attempted it) |
22:36:18 | FromGitter | <mratsim> it’s only a question of CPU, the OS isn’t part of that. |
22:36:22 | FromGitter | <zacharycarter> ah okay |
22:37:50 | FromGitter | <zacharycarter> I guess I'm trying to make the point that I had difficulty figuring out how to adapt an example to some code in Nim on my machine is all |
22:38:34 | FromGitter | <zacharycarter> not Nim's fault at all - just my inexperience in the subject matter |
22:39:10 | FromGitter | <mratsim> for matrix multiplication SIMD makes a huge difference. ⏎ ⏎ With AVX + FMA (Fused multiply add), I reach 135 GFLOPs/s on float32 (with 176.4 theoretical peak) ⏎ With AVX only I reach ~80 GFLOPs/s ⏎ With SSE I reach ~40 GFLOPs/s [https://gitter.im/nim-lang/Nim?at=5c200e8d93cce97d3b89ae06] |
22:40:04 | FromGitter | <zacharycarter> yeah these are all of the acronyms I had trouble with |
22:40:21 | FromGitter | <mratsim> but the basic rule is that you need to do more than one compute per byte of data. |
22:40:42 | FromGitter | <mratsim> otherwise you will be bound by the speed of memory accesses |
22:41:08 | FromGitter | <mratsim> i.e. don’t try to SIMD a for loop. |
22:41:28 | Araq | /Users/travis/build/nim-lang/Nim/tests/stdlib/tmath.nim(98, 52): Check failed: abs(float(histo[values[i]]) - expected) <= 3.0 * stdDev |
22:41:41 | Araq | yay new flaky tests in the suite |
22:42:26 | FromGitter | <mratsim> why is this tmath and not trandom :? |
22:44:15 | * | nsf quit (Quit: WeeChat 2.3) |
22:46:35 | * | filcuc quit (Ping timeout: 268 seconds) |
22:52:19 | Araq | iirc there is no trandom |
23:05:25 | OrganicAnywhere | Thank you Araq and mratsim for your time and advice. Good night and merry christmas :) |
23:05:56 | * | OrganicAnywhere quit (Quit: See you in hell, madafaka~) |
23:07:21 | * | kapil____ quit (Quit: Connection closed for inactivity) |
23:16:12 | * | abm joined #nim |
23:39:44 | FromGitter | <Clyybber> @mratsim Let's introduce trandom, the test failures will be hilarious :P |