00:03:41 | leorize | kinkinkijkin: https://github.com/nim-lang/Nim/commit/9079517d71a010e38a700870abf0703165e08b8b |
00:03:48 | leorize | looks like it's not even released yet |
00:45:10 | * | find0x90 quit (Quit: find0x90) |
00:46:44 | kinkinkijkin | https://dpaste.de/39NG this code doesn't seem to create a working named pipe, any idea why? |
00:47:19 | kinkinkijkin | oh forgot something in the uploading |
00:48:00 | kinkinkijkin | https://dpaste.de/uOvo this is what the code is |
00:48:10 | kinkinkijkin | sorry I'm copying these between laptop and desktop |
00:50:32 | leorize | kinkinkijkin: that's not how you use startProcess() |
00:51:08 | kinkinkijkin | how is it used? |
00:51:50 | leorize | you would want startProcess("mkfifo", ["/tmp/knsess"], {poUsePath}) |
00:51:59 | leorize | see https://nim-lang.org/docs/osproc.html#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption] for more details |
00:54:36 | leorize | kinkinkijkin: actually, for your use case, execCmd would be a better alternative |
00:54:44 | kinkinkijkin | got (string, array[0..0, string], set[ProcessOption]) but expeced one of etc etc |
00:55:31 | leorize | sorry, it's startProcess("mkfifo", args = ["/tmp/knsess"], options = {poUsePath}) |
00:55:59 | leorize | if you wanted to use execCmd, its execCmd("mkfifo /tmp/knsess") |
00:56:10 | leorize | again, reading osproc documentation would help |
01:12:08 | * | arnetheduck quit (Ping timeout: 276 seconds) |
01:19:29 | kinkinkijkin | what is "TArg"? I can't find it in the documentation |
01:20:34 | * | noonien quit (Quit: Connection closed for inactivity) |
01:21:37 | leorize | kinkinkijkin: if you're asking about procs in the thread module, they are just generics |
01:22:06 | leorize | similiar to `proc name[T]` |
01:22:19 | leorize | Just that T here is TArg, no functional changes |
01:23:38 | kinkinkijkin | so how would I initialize a thread of execShellCmd with an argument of getEnv("SHELL")? |
01:32:53 | leorize | kinkinkijkin: something like this: https://pastebin.com/zjEKWVJm |
01:37:36 | kinkinkijkin | ugh, I got a gcc error |
01:38:23 | kinkinkijkin | something about __ATOMIC_RELAXED undeclared (first use in this function) |
01:38:46 | kinkinkijkin | using nim 0.16.whatever is provided in openbsd's okg |
01:38:48 | kinkinkijkin | pkg |
01:39:25 | leorize | kinkinkijkin: https://github.com/nim-lang/Nim/issues/4046 |
01:40:32 | kinkinkijkin | jesus why is openbsd using such an old version of gcc |
01:43:42 | leorize | kinkinkijkin: I think it's due to some licensing issues, IIRC that's also why FreeBSD stuck w gcc 4.2 |
01:44:14 | kinkinkijkin | I see |
01:49:11 | * | MJCaley quit (Quit: MJCaley) |
01:58:55 | * | arnetheduck joined #nim |
01:59:48 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:17:09 | * | arnetheduck quit (Ping timeout: 264 seconds) |
02:29:15 | * | arnetheduck joined #nim |
02:36:31 | * | leorize quit (Ping timeout: 268 seconds) |
02:58:05 | * | S1t1Schu joined #nim |
03:01:30 | * | S1tiSchu quit (Ping timeout: 246 seconds) |
03:02:08 | * | dddddd quit (Remote host closed the connection) |
03:02:13 | * | vlad1777d_ quit (Quit: Leaving) |
03:15:57 | * | arnetheduck quit (Ping timeout: 264 seconds) |
03:30:39 | * | DarkArctic_ joined #nim |
03:34:34 | * | DarkArctic quit (Ping timeout: 264 seconds) |
04:03:36 | * | gangstacat quit (Ping timeout: 256 seconds) |
04:04:02 | * | gangstacat joined #nim |
04:11:45 | * | DarkArctic_ quit (Ping timeout: 248 seconds) |
04:14:08 | * | DarkArctic joined #nim |
04:16:40 | * | mal`` quit (Quit: Leaving) |
04:17:35 | * | endragor joined #nim |
04:21:49 | * | mal`` joined #nim |
04:36:34 | * | cyraxjoe quit (Quit: No Ping reply in 180 seconds.) |
04:37:42 | * | cyraxjoe joined #nim |
05:15:46 | * | arnetheduck joined #nim |
05:30:42 | * | arnetheduck quit (Remote host closed the connection) |
05:50:56 | * | nsf joined #nim |
06:03:50 | * | kinkinkijkin quit (Read error: Connection reset by peer) |
06:04:42 | * | kinkinkijkin joined #nim |
06:10:06 | * | arnetheduck joined #nim |
07:15:45 | * | Vladar joined #nim |
07:19:21 | * | yglukhov quit (Ping timeout: 240 seconds) |
07:21:14 | * | xkapastel quit (Quit: Connection closed for inactivity) |
07:24:33 | * | yglukhov joined #nim |
07:29:54 | * | gokr joined #nim |
07:51:50 | FromGitter | <mratsim> don’t they also propose clang on BSD? |
07:59:16 | * | jaco60 joined #nim |
08:02:29 | * | rokups joined #nim |
08:15:22 | * | PMunch joined #nim |
08:25:28 | FromGitter | <mratsim> @alehander42 for loopfusion I’m trying to implement for-expression. Did you compare the performance profile between lambda and template for zero_functional? When I look at the C code of the following, it seems like the lambda won’t be inlined: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5ab4b9f87685a046389cf040] |
08:28:34 | FromGitter | <mratsim> Not sure if GCC/Clang inlines the N_CLOSURE calls even if they are called only once |
08:38:38 | * | gokr left #nim (#nim) |
08:39:33 | * | floppydh_ joined #nim |
08:45:01 | * | sendell joined #nim |
08:57:39 | FromGitter | <alehander42> @mratsim I benchmarked zero_functional foreach 1) generating an anon proc 2) generating a template and they seemed equal on speed under all flags |
09:17:43 | FromGitter | <mratsim> cool, thanks |
09:29:05 | * | Ven`` joined #nim |
09:37:56 | FromGitter | <alehander42> Araq: can one hint that a custom tag leads to side effects, so when a function is marked with it, it can't be noSideEffects ? |
09:39:07 | FromGitter | <alehander42> I inherit from RootEffect: is there SideEffect that I can inherit from to hint that |
09:45:57 | Araq | impossible, sorry :-) |
09:51:56 | * | MJCaley joined #nim |
09:52:33 | * | floppydh_ quit (Quit: WeeChat 2.0.1) |
09:57:46 | * | yglukhov quit (Read error: Connection reset by peer) |
09:58:20 | * | yglukhov joined #nim |
10:02:20 | * | MJCaley quit (Quit: MJCaley) |
10:03:12 | FromGitter | <alehander42> hmmmm |
10:03:19 | FromGitter | <alehander42> no |
10:03:21 | * | brainproxy quit (Ping timeout: 264 seconds) |
10:04:46 | FromGitter | <narimiran> i'm reading https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement and i'm still confused when should i use `{.inline.}` or `{.closure.}`, and/or which to prefer.... |
10:23:23 | FromGitter | <alehander42> ok Araq: I almost made this work with a custom type and pragma: I define my own SideEffect, and a noSideEffectTag macro that checks the pragma tags for inheritance of SideEffect. the only problem is I can't really add a `noSideEffect` pragma for my macro and run the type checking again |
10:24:27 | FromGitter | <alehander42> If I produce a new untyped node from my typed node with noSideEffect pragma, for some reason it isn't checked? |
10:31:44 | Araq | it should be checked |
10:35:24 | FromGitter | <alehander42> ok, probably I am doing something weird: https://gist.github.com/alehander42/6603b972dd485ac1d9304002b2da6de8 |
10:35:46 | * | r3d9u11 joined #nim |
10:35:58 | FromGitter | <alehander42> I also had to replace sym with ident, because otherwise I get unresolved symbol errors |
10:36:02 | r3d9u11 | hello! |
10:36:09 | FromGitter | <alehander42> no generated name* |
10:37:46 | r3d9u11 | Does method Channel.send copy data (object, array, etc...)? |
10:40:16 | r3d9u11 | >sends a message to a thread. msg is deeply copied |
10:41:58 | * | brainproxy joined #nim |
10:46:50 | FromGitter | <mratsim> channel copies yes, multithreading with shared data structure is hard. (locking, mutexes, atomics, or things like OpenMP). |
10:53:12 | FromGitter | <alehander42> https://gist.github.com/alehander42/8698c15fe8bc5a6cb11fc88d12a1a6b3 |
10:53:14 | FromGitter | <alehander42> ok @Araq I have another version which uses only untyped macros ^ |
10:53:21 | FromGitter | <alehander42> and it seems to work for all cases |
10:53:35 | FromGitter | <alehander42> but it needs this additional sideEffect <Name> macro |
10:53:47 | FromGitter | <alehander42> and it uses a static global set of names which I am not sure is nice |
10:55:15 | FromGitter | <alehander42> (I know string == isn't the best possible check, but I'd usually use just a handful of tags in a project, with probably unique names) |
11:02:37 | * | Snircle joined #nim |
11:02:40 | PMunch | alehander42, maybe an enum would be better? |
11:06:48 | FromGitter | <alehander42> I don't think I can use one, because the user might define new effects after I've checked previous ones |
11:07:15 | FromGitter | <alehander42> and all this checks happen on compile time anyway, so I don't think it's possible to "generate" enum that I can use in the same time |
11:07:31 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:08:20 | * | aziz joined #nim |
11:14:51 | * | brainproxy quit (Ping timeout: 240 seconds) |
11:20:39 | * | brainproxy joined #nim |
11:42:25 | FromGitter | <alehander42> @Araq is there a switch which enables the `func` <=> `{.noSideEffect.}` thing? |
11:43:02 | Araq | no, you need to patch the compiler |
11:43:30 | FromGitter | <alehander42> ah, I see, is it in the roadmap for 0.19? |
11:47:51 | * | jaco60 quit (Ping timeout: 240 seconds) |
11:50:51 | * | athenot quit (Ping timeout: 240 seconds) |
11:53:21 | * | brainproxy quit (Ping timeout: 240 seconds) |
11:55:49 | * | brainproxy joined #nim |
12:00:59 | Yardanico | @zacharycarter about case statements - https://github.com/nim-lang/Nim/pull/6954 |
12:01:06 | * | r3d9u11 quit (Remote host closed the connection) |
12:04:00 | * | r3d9u11 joined #nim |
12:08:45 | * | r3d9u11 quit (Ping timeout: 264 seconds) |
12:11:48 | * | floppydh quit (Remote host closed the connection) |
12:12:37 | * | floppydh joined #nim |
12:22:23 | PMunch | Should func also have gcSafe? |
12:22:51 | PMunch | Functions don't typically take any other input than what they are given |
12:26:31 | * | noonien joined #nim |
12:26:40 | * | yglukhov quit (Read error: Connection reset by peer) |
12:26:43 | * | leorize joined #nim |
12:27:13 | * | yglukhov joined #nim |
12:28:21 | * | brainproxy quit (Ping timeout: 240 seconds) |
12:34:32 | PMunch | So making them GC safe (unable to use globals) would help this |
12:35:05 | * | brainproxy joined #nim |
12:41:34 | * | nsf quit (Quit: WeeChat 2.0.1) |
12:42:09 | FromGitter | <narimiran> PMunch: that would be a nice addition, IMO! |
12:50:53 | Araq | .noSideEffect implies .gcsafe |
12:51:09 | PMunch | Oh it does? Nice |
12:52:48 | FromGitter | <alehander42> but it doesn't imply `.tags: []`, right? or does it imply it and one can override it? |
12:54:04 | Araq | no, .tags are independent |
12:56:23 | * | Ven`` joined #nim |
12:57:20 | * | DarkArctic quit (Quit: Leaving) |
12:57:38 | * | DarkArctic joined #nim |
13:07:51 | * | brainproxy quit (Ping timeout: 240 seconds) |
13:13:04 | * | SenasOzys_ quit (Read error: Connection reset by peer) |
13:13:27 | * | SenasOzys joined #nim |
13:19:02 | * | brainproxy joined #nim |
13:22:56 | * | athenot joined #nim |
13:23:06 | FromGitter | <zacharycarter> -d:useRealtimeGC always seems to cause this error for me on OSX - /Users/zachcarter/projects/nim-wasm/nimcache/stdlib_system.c:15:10: fatal error: 'mach/mach.h' file not found ⏎ ⏎ #include <mach/mach.h> |
13:23:47 | FromGitter | <zacharycarter> whenever I'm compiling code with emscripten |
13:24:32 | PMunch | Someone mis-spelled math.h? |
13:24:56 | PMunch | Or is mach.h something emscripten related? |
13:26:26 | FromGitter | <zacharycarter> I think maybe it's an osx specific header? I'm not sure |
13:27:42 | FromGitter | <zacharycarter> https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KernelProgramming/Mach/Mach.html |
13:32:12 | FromGitter | <mratsim> mach is the name of macOS kernel |
13:34:47 | * | mjanssen joined #nim |
13:36:47 | FromGitter | <zacharycarter> would anyone else with a mac be willing to try to reproduce? |
13:36:55 | FromGitter | <zacharycarter> I can give you a simple config / and Nim source file to test with |
13:37:00 | FromGitter | <zacharycarter> all you'd need to do is install emsdk |
13:44:54 | FromGitter | <zacharycarter> guessing it has something to do with - https://github.com/nim-lang/Nim/blob/3e33668abc496e0b45183804b9b2d70963869a6a/lib/system/timers.nim#L35-L64 |
13:45:43 | * | dddddd joined #nim |
13:51:57 | * | brainproxy quit (Ping timeout: 240 seconds) |
13:52:19 | FromGitter | <zacharycarter> so I guess - clock_gettime(CLOCK_MONOTONIC) - should probably be used for emscripten instead |
13:52:58 | FromGitter | <zacharycarter> but emscripten isn't an official compiler flag so :shrug: |
13:54:41 | FromGitter | <zacharycarter> Araq / dom96? |
13:55:01 | dom96 | I guess emscripten doesn't support that? |
13:55:46 | FromGitter | <zacharycarter> dom96: I don't think so - I think emscripten should be using - clock_gettime(CLOCK_MONOTONIC) |
13:56:27 | FromGitter | <zacharycarter> https://github.com/floooh/sokol/blob/master/sokol_time.h#L54 |
13:57:20 | dom96 | does Nim even have special conditionals for emscripten in its stdlib? |
13:58:01 | FromGitter | <zacharycarter> nope |
13:58:04 | FromGitter | <zacharycarter> not to my knowledge |
13:58:34 | FromGitter | <zacharycarter> but this is definitely problematic for people that want to use Nim for WASM on osx |
13:59:57 | FromGitter | <abijahm> yesterday i had a problem with asynchttpserver ,thanks to @dom96 this is how i solved it ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ i think this method of sending chuncks can be used to solve (large file issue)[https://github.com/nim-lang/Nim/issues/5589] [https://gitter.im/nim-lang/Nim?at=5ab5085dbb1018b37a18bb36] |
14:00:39 | * | brainproxy joined #nim |
14:02:21 | FromGitter | <zacharycarter> dom96: I think it makes sense for the stdlib lib to have emscripten flags - after all, it is a legitimate compiler |
14:03:40 | * | endragor quit (Remote host closed the connection) |
14:04:07 | * | endragor joined #nim |
14:05:07 | dom96 | abijahm: so what was it that fixed it? |
14:06:43 | FromGitter | <zacharycarter> dom96: modifying two conditionals in system/timers.nim to have checks for emscripten fixes the issue FYI |
14:06:47 | FromGitter | <zacharycarter> just tested locally |
14:09:02 | * | endragor quit (Ping timeout: 268 seconds) |
14:11:21 | * | wavemode joined #nim |
14:12:46 | * | SenasOzys quit (Ping timeout: 256 seconds) |
14:14:54 | * | floppydh_ joined #nim |
14:16:35 | * | cspar_ joined #nim |
14:17:17 | * | SenasOzys joined #nim |
14:18:34 | FromGitter | <abijahm> @dom96 removing the flags,yesterday i was not handling the exception properly |
14:19:34 | * | cspar quit (Ping timeout: 256 seconds) |
14:29:51 | * | endragor joined #nim |
14:33:42 | * | brainproxy quit (Ping timeout: 268 seconds) |
14:34:53 | * | endragor quit (Ping timeout: 276 seconds) |
14:35:31 | * | brainproxy joined #nim |
14:45:51 | * | smt quit (Read error: Connection reset by peer) |
15:06:34 | * | gokr joined #nim |
15:06:41 | FromGitter | <alehander42> can I somehow produce ints for enums of variant objects with json `to` |
15:06:43 | FromGitter | <alehander42> ? |
15:07:19 | FromGitter | <alehander42> currently I always get strings, which is useless, when I reinterpret them as variants (in the js backend) |
15:08:17 | * | brainproxy quit (Ping timeout: 248 seconds) |
15:09:42 | FromGitter | <alehander42> ok, I can patch `%`*(o: enum) in json.nim, sorry |
15:09:54 | FromGitter | <alehander42> still, what would be a good way to make that configurable? |
15:13:11 | FromGitter | <alehander42> maybe `to` can accept some options? |
15:13:46 | * | brainproxy joined #nim |
15:16:13 | * | aziz quit (Remote host closed the connection) |
15:20:42 | * | jjido joined #nim |
15:25:24 | * | miran joined #nim |
15:27:20 | * | WhiskeyNick joined #nim |
15:33:26 | * | GitDisc joined #nim |
15:33:32 | * | GitDisc quit (Remote host closed the connection) |
15:34:27 | * | FromDiscord joined #nim |
15:37:02 | * | xkapastel joined #nim |
15:39:25 | * | Zevv joined #nim |
15:47:09 | * | brainproxy quit (Ping timeout: 264 seconds) |
15:52:43 | * | brainproxy joined #nim |
15:59:48 | * | PMunch quit (Quit: Leaving) |
16:00:21 | * | jjido quit (Read error: Connection reset by peer) |
16:07:34 | * | JacobEdelman quit (Quit: Ping timeout (120 seconds)) |
16:07:52 | * | jjido joined #nim |
16:07:55 | * | JacobEdelman joined #nim |
16:08:23 | * | sendell quit (Ping timeout: 276 seconds) |
16:10:28 | * | nsf joined #nim |
16:15:23 | * | r2 joined #nim |
16:21:50 | Yardanico | what is better for a proc which takes a dictionary of variables and their values - Table or TableRef ? |
16:26:03 | * | brainproxy quit (Ping timeout: 256 seconds) |
16:27:03 | Yardanico | ah, nvm, Table is better :) |
16:28:24 | Yardanico | or hmm.. which is more efficient - having one empty table initalised once at runtime (so I can use it as a default value for argument), or using TableRef with default value being nil? |
16:29:29 | leorize | Yardanico: IIRC the devs are going to move away from nil, so avoiding it should be better? |
16:30:21 | Yardanico | leorize, well, yeah, that's a good point, I would probably use Table |
16:36:13 | * | brainproxy joined #nim |
16:36:30 | * | gokr quit (Quit: Leaving.) |
16:39:02 | * | r2 quit (Ping timeout: 276 seconds) |
16:46:03 | * | r2 joined #nim |
16:51:13 | * | r2 quit (Ping timeout: 268 seconds) |
17:01:51 | * | Trustable joined #nim |
17:08:51 | * | brainproxy quit (Ping timeout: 240 seconds) |
17:11:36 | * | brainproxy joined #nim |
17:21:33 | * | nsf quit (Quit: WeeChat 2.0.1) |
17:31:45 | * | hyp3rbor3a joined #nim |
17:39:08 | FromGitter | <Varriount> @zacharycarter I drink tea. :3 |
17:45:14 | * | brainproxy quit (Ping timeout: 276 seconds) |
17:45:20 | dom96 | hey Varriount, seeing as you already have an account on notabug, think you could ping vktec about my fork of NimBox? https://notabug.org/vktec/nimbox |
17:45:34 | dom96 | I've fixed some things: https://github.com/dom96/nimbox |
17:45:42 | dom96 | would be nice if vktec pulled it |
17:46:01 | * | icebattle joined #nim |
17:46:55 | dom96 | alehander42: can't remember if `to` supports enums, but have you tried just specifying the enum type? |
17:47:55 | dom96 | abijahm: awesome :) |
17:48:07 | * | r2 joined #nim |
17:49:50 | * | brainproxy joined #nim |
17:51:22 | * | jjido quit (Ping timeout: 264 seconds) |
17:52:27 | * | r2 quit (Ping timeout: 240 seconds) |
17:55:35 | * | hyp3rbor3a quit (Quit: Leaving) |
18:03:28 | * | nsf joined #nim |
18:05:16 | FromGitter | <zacharycarter> @Varriount :P that works too |
18:15:38 | * | PMunch joined #nim |
18:18:46 | * | r2 joined #nim |
18:20:34 | * | floppydh quit (Quit: WeeChat 2.0.1) |
18:20:47 | * | floppydh_ quit (Quit: WeeChat 2.0.1) |
18:23:06 | * | brainproxy quit (Ping timeout: 268 seconds) |
18:27:13 | * | yglukhov_ joined #nim |
18:27:14 | * | yglukhov quit (Read error: Connection reset by peer) |
18:31:47 | miran | is there a way to make a zip of two iterators? |
18:33:27 | * | brainproxy joined #nim |
18:35:50 | PMunch | Something like this: https://github.com/numforge/loop-fusion |
18:35:56 | PMunch | miran^ |
18:37:14 | PMunch | And then there's this: https://forum.nim-lang.org/t/2769 |
18:37:47 | FromGitter | <Varriount> dom96: I have an account? |
18:38:00 | dom96 | yeah? You reported an issue in that repo |
18:39:01 | miran | PMunch: thanks for the links! |
18:39:25 | FromGitter | <Varriount> dom96: Done. |
18:39:32 | miran | i've seen people in the forum mentioning that it is doable with closure iterators |
18:39:32 | dom96 | thanks |
18:39:45 | dom96 | if there is no reply I will switch the URL to my fork |
18:40:14 | miran | i guess that answers my earlier question about my dilemma about {.closure.} vs {.inline.} iterators :) |
18:40:54 | miran | (i have read the manual, but still don't understand which version should i prefer, or in which situations to consider one or the other) |
18:41:53 | FromGitter | <mratsim> closure for async/networking. For scientific computation use inline, always. |
18:42:14 | miran | mratsim: this is for nim's version of python's itertools :) |
18:42:20 | FromGitter | <mratsim> closure iterator needs to copy their arguments. |
18:42:32 | FromGitter | <mratsim> use zero_functional ;) |
18:44:15 | FromGitter | <mratsim> several people tried to use closure iterator but those are not for perf: see Peter Mora’s posts on the forum and his lib: https://github.com/petermora/nimLazy, also I benchmarked my own version for project euler: https://github.com/mratsim/nim-projecteuler/blob/master/src/lib/functional.nim |
18:45:40 | miran | mratsim: thanks for the informations and the links! |
18:45:50 | FromGitter | <mratsim> Or use loopfusion ;): https://github.com/numforge/loop-fusion it’s not functional but it’s fast. the only thing it can do is “filter” and reduction (it takes 3 lines to preallocate the result instead of 2 lines) |
18:46:06 | FromGitter | <mratsim> not functional as in functional programming* |
18:46:14 | FromGitter | <mratsim> it can’t do* |
18:46:28 | miran | i might use some of those, but i'm trying to make my first ever nimble package :) |
18:46:29 | * | yglukhov_ quit (Read error: Connection reset by peer) |
18:46:30 | * | yglukhov joined #nim |
18:48:21 | FromGitter | <mratsim> Now I have to tune loopfusion so that it works with OpenMP mmmh |
18:51:05 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:03:19 | miran | mratsim: looking at your project euler and nimLazy - both of you wrap iterators inside of a proc - why not have just an iterator? |
19:04:19 | miran | i have done it also like that, so i use it like `let a = myiter(x, y); for i in a(): ....`, but now i'm thinking if might be better to have only `for i in myiter(x, y): ....` |
19:06:53 | * | brainproxy quit (Ping timeout: 268 seconds) |
19:14:39 | * | brainproxy joined #nim |
19:19:50 | FromGitter | <Varriount> @mratsim Has anyone told you how amazing your work is? |
19:20:08 | miran | +1 |
19:20:19 | Yardanico | from nim forum - https://github.com/tbrand/which_is_the_fastest |
19:20:46 | Yardanico | they only have nim with jester, so it's not very fast :( |
19:20:58 | FromGitter | <Varriount> Why is jester not fast? |
19:21:27 | * | nibp_ joined #nim |
19:21:34 | * | nibp_ left #nim ("Leaving") |
19:22:11 | miran | Yardanico: last time some similar benchmarks were posted, Araq said that nim libraries (i can't remember if it was jester or something else, but it was also among the slowest) are fast enough for practical purposes |
19:23:02 | Yardanico | yes they are |
19:23:20 | Araq | no I said that networking stuff becomes an issue after you got rich |
19:24:12 | Yardanico | only ones slower than jester in this microbenchmark are sinatra (ruby), tornado (python), rails (ruby) |
19:24:27 | Yardanico | lol |
19:24:43 | Yardanico | we can just use https://github.com/2vg/mofuw then |
19:26:11 | FromGitter | <BontaVlad> Do these microbenchmark's have any real world value? Taking decisions based on *micro*benchmarks can bite you in the ass later on. |
19:26:23 | FromGitter | <Varriount> Unfortunately, they do. |
19:26:47 | Yardanico | second place in this benchmarks is https://github.com/squeaky-pl/japronto |
19:27:05 | Araq | varriount: how so? |
19:27:11 | Yardanico | it's a python framework which is mostly written using C, picohttpparser, and uvloop :D |
19:27:41 | Araq | c2nim it. |
19:28:09 | FromGitter | <Varriount> Araq: When people are choosing a tool to use (especially something like an HTTP framework) three things factor into the decision: Performance, familiarity, and usability. |
19:28:17 | Yardanico | Araq, unfortunately it heavily uses CPython C API |
19:28:50 | Araq | varriount: that's not an answer. |
19:29:19 | FromGitter | <BontaVlad> Also for a tool -> documentation, and comunity, django is not the best web framework, but sure I will find everything I need for my project and have a kick ass documentation on top of that. |
19:30:06 | FromGitter | <Varriount> Since people base their decisions partially on how performant a prospective tool is, benchmarks like this are used to make quick decisions on a tools possible performance. |
19:30:42 | Araq | the question was not "do we want good benchmark results" |
19:30:52 | Araq | the question was "are these benchmarks relevant" |
19:33:25 | FromGitter | <Varriount> Araq: What's your definition of relevant? And related to what? |
19:35:12 | FromGitter | <Varriount> They are relevant to the public perception of Nim. Whether they are practically relevant is another matter. Unfortunately, human beings aren't always practical in their outlook. |
19:36:11 | Araq | if your website gets 3 requests a second and you can serve 50_000 it's pointless to optimize it further so that it can serve 100_000 |
19:36:49 | Araq | I agree on the public perception point but that was not the point. |
19:36:59 | Araq | read the history. |
19:37:09 | Araq | > Do these microbenchmark's have any real world value? |
19:37:16 | Araq | <Varriount> Unfortunately, they do. |
19:38:32 | Araq | which made it look like you have some real world insights that I lack. so I asked. :-) |
19:39:19 | FromGitter | <Varriount> Ah, well I'm sorry. I misinterpreted your question. |
19:39:21 | FromGitter | <BontaVlad> I agree with Varriount here, while these microbenchmarks might not have any value, people still make decisions based on that. Just remember the mongodb phase. |
19:40:33 | Araq | we all agree with Varriount here. |
19:42:04 | miran | sorry to interrupt - i have just run `nimble init` and made some function `foo` inside a `src` folder. now i try to test it with the `test1.nim` file (automatically created) and i get "undeclared identifier" error. any guesses what am i doing wrong? |
19:42:53 | FromGitter | <Varriount> miran: Did you import the module containing the function? |
19:43:27 | miran | i have tried import ../src/name, import ./name, import name - and nothing seems to work |
19:45:46 | miran | oooooooooh, i forgot the * at the end of the func name |
19:47:57 | * | brainproxy quit (Ping timeout: 240 seconds) |
19:49:56 | * | brainproxy joined #nim |
19:53:24 | * | Vladar quit (Quit: Leaving) |
19:57:29 | * | poopBot joined #nim |
19:57:51 | poopBot | teoreticly if nim comples to c can i use nim to write linux drivers? |
19:58:59 | * | wavemode quit (Ping timeout: 260 seconds) |
20:00:07 | dom96 | > Why is jester not fast? |
20:00:21 | dom96 | Because I never got a chance to optimise it |
20:01:39 | dom96 | And also because people suck at benchmarking: https://github.com/tbrand/which_is_the_fastest/blob/master/Makefile#L229 |
20:01:42 | dom96 | Can you see the problem? |
20:01:59 | dom96 | It's compiled without -d:release, no wonder it's at the bottom |
20:02:25 | FromGitter | <alehander42> well, that's why one can PR it |
20:03:25 | FromGitter | <alehander42> the sad truth is max 5% of the people that read the results will say "wait, let's see the exact commands for each language and check if that benchmark is actually reasonable" |
20:04:50 | dom96 | Well, I submitted a PR https://github.com/tbrand/which_is_the_fastest/pull/168 |
20:07:08 | FromGitter | <alehander42> otherwise, are there some known bottlenecks in jester, or it just needs a bit more fine tuning and dogfooding? |
20:07:14 | dom96 | But Jester is by no means perfect |
20:07:26 | dom96 | So please don't be afraid to write something better |
20:07:48 | dom96 | The main bottleneck is that it's single threaded |
20:08:30 | dom96 | My focus first is to create an optimised HTTP server: https://github.com/dom96/httpbeast |
20:09:02 | dom96 | But even adding parallelism to asynchttpserver will make it go much faster |
20:09:48 | dom96 | But all these benchmarks should really be taken with a grain of salt |
20:10:18 | dom96 | Maybe I just suck at benchmarking, but I spent a hell of a time testing httbeast |
20:10:21 | dom96 | *httpbeast |
20:10:28 | dom96 | on two Digital Ocean droplets |
20:10:36 | miran | dom96: i'm trying to use the new `runnableExamples` - how do i test that they are correct? |
20:10:38 | dom96 | and the test results always varied wildly |
20:10:44 | dom96 | miran: nim doc2 file |
20:11:29 | miran | it doesn't raise any error (and i introduced one on purpose) |
20:12:10 | dom96 | well, see some of the examples of its use in the stdlib |
20:12:15 | dom96 | see what you're doing differently |
20:12:58 | Araq | that's 'nim doc file' now btw |
20:13:12 | Araq | doc2 still works but is an alias for 'doc' |
20:13:14 | FromGitter | <alehander42> I think having several web frameworks competing would be healthy for the ecosystem |
20:13:37 | FromGitter | <alehander42> but jester is well developed, so maybe it's better to put effort there |
20:13:59 | FromGitter | <alehander42> having a very fast http server would be beautiful |
20:14:11 | * | poopBot quit (Remote host closed the connection) |
20:15:45 | FromGitter | <alehander42> benchmarking is hard, when I worked on zero_functional I tried to make a suite comparing tens of languages and it was so hard to always test the same behavior with the most optimal flags (but not dead code 0.00s optimal) |
20:15:57 | miran | hmmm, copying the example from release notes, and making it fail raises the error. for my example, it doesn't catch the error. i guess i'm stupid again |
20:15:59 | FromGitter | <alehander42> always write* the same behavior |
20:16:46 | * | poopBot joined #nim |
20:16:54 | dom96 | I just got really annoyed when I couldn't reliably see whether my changes improved the performance or made it worse |
20:17:00 | poopBot | sorry i crashed did anyone replyed me |
20:17:16 | dom96 | poopBot: You can use Nim to write anything |
20:17:37 | dom96 | miran: So look at the stdlib :) |
20:17:44 | Araq | alehander42: you need to read input and produce output. |
20:17:46 | dom96 | miran: It definitely works there, so you can see what the problem is |
20:18:03 | poopBot | cuz i plan to risk buy a xp-pen tablet and they have no linux driver , so want to learn both same time :) |
20:18:08 | Araq | so that the compiler has no chance of evaluating it completely at compiletime |
20:18:30 | Araq | and is not subject to dead code removal |
20:19:30 | Araq | hmmm, is result = f(result) memory safe when result is of type 'var T' ? |
20:19:39 | poopBot | somone should make some turtorial on sololearn or similar sites to attract more people , and pls add CaseSensitve :) |
20:21:01 | Araq | I see enough bad code all day long, we don't need to support FOO foo = Foo() to feel more manly, thanks |
20:22:12 | poopBot | dont mind me i am just a bot :) |
20:22:37 | miran | dom96: i took a look at stdlib and it seems all the examples have only onliners with `doAssert`, and i have written a block of code.... could this be the reason why my thing is not working as expected? |
20:22:54 | dom96 | probably |
20:23:22 | Araq | miran: the reason is that it is in a template or generic, you need to instantiate it |
20:23:56 | * | brainproxy quit (Ping timeout: 276 seconds) |
20:24:57 | FromGitter | <alehander42> @Araq yes, I finally did that |
20:25:03 | miran | i just tried `doAssert 33 == 55` (so no calling of my function, no other code), and it didn't raise an error.... |
20:26:14 | * | gokr joined #nim |
20:27:06 | Araq | gist it |
20:27:08 | dom96 | Again, play spot the difference between stdlib code and your code |
20:27:21 | * | SenasOzys quit (Ping timeout: 240 seconds) |
20:28:08 | poopBot | what doAssert does i sow it in some turrtorial i think but didet get it at all |
20:30:03 | dom96 | poopBot: Do you know what assertions are? |
20:30:27 | Yardanico | poopBot, you can always check docs :) |
20:30:32 | poopBot | no am reading docs |
20:30:38 | poopBot | just found it under System |
20:30:44 | dom96 | poopBot: https://en.wikipedia.org/wiki/Assertion_(software_development) |
20:30:55 | miran | Araq: dom96: here's a gist: https://gist.github.com/narimiran/d684ffd1b8857e4e96887aa7e228147a |
20:31:12 | miran | foo raises an error, bar does not |
20:31:26 | poopBot | oh tats like for execption hendling |
20:31:44 | dom96 | miran: Tried adding a doc comment above the 'runnableExamples'? |
20:31:56 | poopBot | or not i first read whole article then come back :) |
20:32:40 | miran | dom96: yep, it is the same. (even if i don't call bar, and just assert 111 == 999) |
20:33:06 | * | brainproxy joined #nim |
20:36:15 | miran | it seems that if bar is defined as `bar[something](...)` asserts don't work, but `bar(...)` is ok |
20:36:52 | poopBot | i think i got it |
20:37:27 | poopBot | just 1 question will assertation kill program istnatly if hepend |
20:37:45 | miran | Araq said i should instantiate it - how do i do that? |
20:41:02 | Yardanico | poopBot, "assert" will be turned off for optimized (release) build, but doAssert wouldn't |
20:41:27 | poopBot | ye got that part |
20:41:34 | Yardanico | and yes, it will kill your program unless you catch AssertionError |
20:41:48 | Yardanico | AFAIK you can catch it |
20:41:55 | poopBot | just asked when asert heppends it shows msg but does it kill app instant |
20:42:09 | poopBot | oh so its like c# throw new exeption |
20:42:13 | poopBot | and try catch |
20:42:37 | Yardanico | poopBot, you should probably firstly read tut1, tut2 and manual :) |
20:42:44 | Yardanico | they contain a lot of info you're asking |
20:43:01 | Araq | miran: call it in a 'when isMainModule' section |
20:43:05 | * | SenasOzys joined #nim |
20:43:39 | Araq | Yardanico: actually catching an AssertionError is only semi-valid. The spec doesn't allow it, the implementation does. |
20:43:51 | Yardanico | Araq, oh, didn't knew that, thanks for the info |
20:44:19 | poopBot | Yardanico, sorry you are right, issue is i am w8 for godot to finish c# so i plan evry game i do in c# do same in nim , i started reading manula 2-3 times just dident work on anything to use it proper so i remmeber stuff :) |
20:44:59 | Yardanico | poopBot, you want to do a benchmark or just comparasion how one game would look in different languages? |
20:45:26 | miran | Araq: "when isMainModule: runnableExamples: doAssert 111 = 999"? because this doesn't work |
20:45:43 | * | yglukhov quit (Read error: Connection reset by peer) |
20:45:48 | poopBot | Yardanico, i want to learn nim |
20:45:49 | miran | i guess i could do it separately, but i wanted to have both documentation and tests at one place |
20:45:51 | FromGitter | <data-man> https://github.com/timotheecour/D_vs_nim ⏎ Why -1 for Nim? :) |
20:46:00 | * | yglukhov joined #nim |
20:46:32 | Yardanico | docs seem to say nim can only use CTFE (via 'const') on functions 'without side-effects' wait what |
20:46:55 | Yardanico | I don't really get the point system here |
20:47:09 | dom96 | that is an initially confusing point system heh |
20:47:28 | dom96 | but it makes sense when you think about it |
20:47:40 | Yardanico | "D ranges are faster than nim's iterators CHECKME" hmm |
20:48:17 | Yardanico | also compile speed "faster (via dmd) CHECKME" |
20:48:22 | dom96 | A better presentation would just be to write "Nim" or "D" in those boxes though |
20:48:28 | Yardanico | I doubt about compile speed - you can use different C compilers |
20:49:47 | dom96 | In any case, it's 8 vs 16 for Nim |
20:50:12 | Yardanico | "similar code comparison" this code is from 2014, lol :) |
20:50:27 | Yardanico | well, still pretty interesting |
20:51:42 | Yardanico | also why did D take a point for `style`? we have NEP-1 too :) |
20:52:56 | FromGitter | <data-man> D's open bugs 4566 (currently) :) |
20:53:32 | dom96 | that really shouldn't be a deciding factor |
20:54:28 | Araq | miran: when isMainModule: yourGenericWithRunnableExamples() |
20:56:11 | Araq | "D ranges are faster than Nim's iterators" -- wishful thinking detected |
20:57:01 | shashlick | dom96: I've offered before, have real servers I can benchmark on if you need |
20:57:38 | dom96 | shashlick: That'd be great. Feel free to grab the current source and see how it performs. |
20:57:59 | miran | Araq: thanks, it seems to work! i guess i will be able to kill two birds with one stone :) |
20:58:20 | shashlick | Araq: would be cool if compiler could suggest that proc is not exported with * |
20:58:40 | shashlick | dom96: do you have a benchmarking script in the repo? |
20:58:45 | * | nsf quit (Quit: WeeChat 2.0.1) |
20:59:52 | dom96 | shashlick: Nope. I've just been using wrk |
21:01:30 | shashlick | Ok I'll have to see how that works |
21:09:22 | * | brainproxy quit (Ping timeout: 264 seconds) |
21:09:25 | FromGitter | <zacharycarter> I did a Nim / WASM demo at work today |
21:09:45 | FromGitter | <zacharycarter> we compiled sass in the browser with nim-sass via wasm |
21:10:37 | FromGitter | <zacharycarter> dom96 / Araq: any thoughts on fixing the emscripten issue? |
21:10:46 | miran | wow, whoever added this runnableExamples - what a great addition!! |
21:10:50 | FromGitter | <zacharycarter> and adding emscripten as a stdlib define? |
21:11:15 | Araq | zacharycarter wait for yglukhov maybe |
21:11:21 | FromGitter | <zacharycarter> ok |
21:11:29 | Araq | he used emscripten with Nim and its realtime GC in production |
21:11:39 | Araq | maybe it's as simple as --os:linux |
21:11:41 | yglukhov | hey guys, whats up? |
21:11:47 | FromGitter | <zacharycarter> Araq: maybe |
21:11:59 | FromGitter | <zacharycarter> hi yglukhov! |
21:12:11 | Araq | miran: thanks, that was me. :-) |
21:12:26 | FromGitter | <zacharycarter> so I was playing w/ emcc today and Nim and notice if I used realtime gc on osx, I got an error about mach/mach.h not being able to be found |
21:12:53 | yglukhov | yes, i use --os:linux -d:emscripten ;) |
21:12:57 | FromGitter | <zacharycarter> gotcha |
21:12:59 | FromGitter | <zacharycarter> okay thanks |
21:13:03 | yglukhov | np |
21:13:08 | FromGitter | <zacharycarter> you guys are so sneaky / smart |
21:13:23 | yglukhov | thanks =) |
21:14:09 | * | rokups quit (Quit: Connection closed for inactivity) |
21:14:26 | * | athenot quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:14:58 | miran | Araq: there should be bells and whistles about it, it is really great!! makes life so much easier |
21:15:29 | Araq | the issues with it have been reported and will be fixed |
21:15:45 | FromGitter | <zacharycarter> sorry but dafuq is runnableExamples? |
21:15:46 | dom96 | yglukhov: perhaps you could write a nice article about working with emscripten in Nim? :) |
21:16:25 | FromGitter | <zacharycarter> dom96: I'm about to put up a blog in the next week(ish) - if yglukhov is busy - I could write one |
21:16:34 | FromGitter | <zacharycarter> I've gotten pretty good at using Nim / emscripten / wasm |
21:16:45 | dom96 | sure |
21:16:46 | miran | btw, when i run `nim doc myfile.nim`, it creates .html with docs, but there are no links to the source, as it is in nim's stdlib - do i need to pass something to it to create it? |
21:16:47 | yglukhov | zacharycarter: thumbs up! |
21:17:05 | FromGitter | <zacharycarter> sweet! I'll begin working on it thanks! |
21:17:52 | FromGitter | <zacharycarter> also dom96 - for my blog I'm going to try out - https://tailwindcss.com/ |
21:18:00 | * | Trustable quit (Remote host closed the connection) |
21:18:55 | dom96 | zacharycarter: nice :) |
21:19:14 | * | dom96 adds it to his huge list of CSS frameworks |
21:19:30 | FromGitter | <zacharycarter> lol |
21:20:41 | FromGitter | <zacharycarter> well... I'm writing the entire project w/ Nim - I'm trying to develop some standards around how you might structure a 12-factor app w/ Nim, at least on the front end |
21:21:18 | FromGitter | <zacharycarter> so I'm leveraging karax and using nimble as the build system and avoiding just writing everything in package.json |
21:21:22 | dom96 | 12-factor? |
21:21:22 | FromGitter | <zacharycarter> only thing I |
21:21:40 | FromGitter | <zacharycarter> https://12factor.net/ |
21:22:36 | dom96 | That seems like overkill for a blog |
21:22:54 | * | riidom joined #nim |
21:22:57 | FromGitter | <zacharycarter> I'm only considering the front-end |
21:23:01 | dom96 | But do whatever makes you happy :) |
21:23:09 | * | r2 quit (Ping timeout: 264 seconds) |
21:23:13 | dom96 | I created a static blog generator a long time ago: https://github.com/dom96/ipsumgenera |
21:23:13 | FromGitter | <zacharycarter> but like - let's say you're checking out Nim and you want to write a blog w/ it? |
21:23:17 | dom96 | Still need to revive that project |
21:23:45 | FromGitter | <zacharycarter> how do you structure your project? how do you build it? how do you compile sass? how do you accomplish all the things you'd normally do w/ something like nodejs and webpack? |
21:24:06 | FromGitter | <zacharycarter> front-end developers these days don't just write html and js and css |
21:24:13 | FromGitter | <zacharycarter> they have the most convoluted ecosystem on the planet |
21:24:39 | dom96 | yeah, JS developers sure love tools that just magically process all this crap |
21:24:52 | dom96 | Writing a tool for Nim that does the same would be brilliant :) |
21:25:01 | FromGitter | <zacharycarter> well that's why I wrote the nim-sass project |
21:25:09 | FromGitter | <zacharycarter> so we have a sass compiler for Nim now potentially |
21:25:13 | dom96 | awesome |
21:25:29 | FromGitter | <zacharycarter> if we can produce a lot of frontend related tooling for Nim |
21:25:47 | FromGitter | <zacharycarter> it could be come an alternative to typescript |
21:25:58 | FromGitter | <zacharycarter> moreso than it already is anyway |
21:26:09 | FromGitter | <zacharycarter> typescript has the benefit of being able to leverage the node ecosystem - not that Nim can't |
21:26:16 | FromGitter | <zacharycarter> it's just - it's easier w/ typescript |
21:27:03 | dom96 | What would be a killer app is something that marries the Nim backend and front end |
21:27:16 | dom96 | If I had the time I would write it |
21:27:16 | FromGitter | <zacharycarter> how so? |
21:27:33 | dom96 | Most webapps involve passing data between a front end and back end |
21:27:47 | FromGitter | <zacharycarter> via http |
21:27:51 | dom96 | You could make that transparent with Nim |
21:28:09 | FromGitter | <zacharycarter> can you explain how at a high level> |
21:28:11 | FromGitter | <zacharycarter> ? |
21:29:17 | Araq | Ormin does it by producing frontend and backend code at the same time |
21:29:19 | dom96 | I'm not 100% sure what the best approach for it would be |
21:29:31 | dom96 | But I envision calling a "backend" procedure from the front end |
21:29:52 | Araq | check how Ormin does it. it kinda sucks but has the right ideas IMO :P |
21:29:52 | dom96 | The library takes care of the HTTP calls in between |
21:30:03 | FromGitter | <zacharycarter> oh I see |
21:30:23 | dom96 | Araq: The fact that a database library is trying to do this really turns me off it :( |
21:30:33 | dom96 | I still want a simple ORM library |
21:30:41 | Araq | it's an optional part of Ormin. |
21:30:58 | Araq | the next time please be turned off by something you took a closer look at. |
21:31:24 | FromGitter | <zacharycarter> I still vote for graphql |
21:33:32 | dom96 | Araq: Yeah, you're right. I need to try it. |
21:33:47 | dom96 | You need more small and approachable examples in the ormin readme |
21:34:21 | dom96 | I'm unsure about graphql |
21:34:23 | Araq | I also need to change how the model building works :-) |
21:34:40 | dom96 | Araq: Argh. Why? |
21:34:51 | dom96 | I was about to try it but that discourages me :( |
21:35:17 | Araq | sorry, but I'm not sure I want to encourage you to try it |
21:35:41 | dom96 | why? |
21:36:03 | * | brainproxy joined #nim |
21:36:05 | Araq | because I used it extensively and now know its pain points |
21:36:06 | miran | iterators and openArrays don't like each other, or is it again some my fault? :) |
21:36:55 | Araq | I mean, sure, go ahead and try it. PMunch seems to use and like it. |
21:37:12 | dom96 | Araq: What actual advantages does it have over a more traditional ORM lib? |
21:38:02 | Araq | dunno what "traditional ORM" means |
21:38:28 | Araq | I've used a couple and they were all awful performance-wise |
21:38:36 | Araq | and memory hogs |
21:38:41 | Araq | but that was for C#. |
21:38:53 | PMunch | Wait, what does I seem to enjoy? |
21:39:26 | Araq | Ormin. |
21:39:38 | Araq | and if you say sqlalchemy I'll ragequit. |
21:40:06 | Araq | sqlalchemy is totally untyped. you can't port it to Nim. |
21:40:20 | PMunch | Oh right. I was actually just learning it to make a small series of video tutorials on web development in Nim |
21:40:34 | * | gangstacat quit (Quit: Ĝis!) |
21:40:43 | FromGitter | <data-man> https://github.com/fnc12/sqlite_orm C++ |
21:40:55 | PMunch | And so far I haven't really used any more than the regular SQL query part, not the actual set up Ormin as a server part |
21:44:39 | dom96 | I was thinking more like, you define an object type and the ORM figures out how to store it in the DB for you. |
21:45:17 | * | gangstacat joined #nim |
21:46:59 | * | r2 joined #nim |
21:48:16 | Araq | not a fan. data is more important than code and 'objects' are not appropriate for foreign key relationships etc. |
21:49:57 | * | gangstacat quit (Client Quit) |
21:49:57 | Araq | PMunch: "ormin as a server part" is probably the least developed part of Ormin :-) |
21:50:50 | Araq | the SQL DSL is pretty sweet and I'll keep it |
21:52:20 | * | r2 quit (Ping timeout: 276 seconds) |
21:53:29 | PMunch | Ah okay, guess I won't be adding a Ormin with Karax tutorial then |
21:53:59 | PMunch | Stick with Jester+Ormin+Source code filter templates (or emerald) |
21:54:05 | PMunch | Or Jester+Ormin+Karax |
21:57:58 | dom96 | add Emerald in there and you've got yourself a nice acronym |
21:58:19 | dom96 | well, maybe not :P |
22:00:58 | PMunch | Haha, the joke stack |
22:02:03 | Araq | huh? you can use Ormin with Karax without Ormin's protocol generation |
22:03:21 | Araq | oh you just said that, my bad |
22:03:45 | Araq | yeah add an 'E', the-JOKE-is-on-you-stack |
22:04:03 | PMunch | Not sure what you would use emerald for though with Karax |
22:04:22 | Araq | no, write a library you use that starts with an E |
22:04:32 | FromGitter | <cabhishek> hi, has anyone used https://github.com/nitely/nim-regex and installed via nimble? |
22:04:55 | FromGitter | <cabhishek> https://github.com/nitely/nim-regex/issues/5 is what I am seeing |
22:05:23 | FromGitter | <krux02> Araq: Is there is `divmod` function now in nim? |
22:06:09 | FromGitter | <krux02> I think about just implementing it, because C provides this function already as `div` and `ldiv` |
22:06:56 | Araq | no. |
22:06:57 | dom96 | cabhishek: that's odd, try `nimble install regex@#head` |
22:07:12 | Araq | cabhishek: https://github.com/nitely/nim-regex/blob/master/tests/utils.nim |
22:07:29 | Araq | isMatch is in utils only used for testing, you should use 'match' |
22:13:48 | FromGitter | <cabhishek> @Araq I see, thanks. I should have looked into docs rather than tests 😟 |
22:15:07 | FromGitter | <zacharycarter> dom96: why are you unsure about gql? |
22:15:57 | FromGitter | <zacharycarter> also please no more stack acroynms |
22:16:10 | dom96 | The JOKE stack is the best though! |
22:16:32 | * | gangstacat joined #nim |
22:16:34 | FromGitter | <zacharycarter> lol |
22:16:53 | FromGitter | <mratsim> @miran, Peter and me used proc because that is the way to get closure iterators. We used closure iterators because currently it’s not possible to chain inline iterators: https://github.com/nim-lang/Nim/issues/4516 and do something like foo.map(bar).filter(bar).reduce(sum) |
22:17:01 | dom96 | Jester+Oracle+KDE+(e)nginX |
22:17:46 | FromGitter | <mratsim> @krux02 feel free to take this code for your divmod: https://github.com/numforge/number-theory/blob/5ac4b23dbdcd406e53e1a5faefec81b9dc73c67f/src/integer_math.nim#L26-L49 |
22:18:09 | FromGitter | <mratsim> @Varriount Thanks :) |
22:18:10 | FromGitter | <krux02> thanks |
22:18:11 | dom96 | zacharycarter: Again, feels like a bit of an overhyped technology |
22:18:49 | FromGitter | <krux02> but according to the specification, the order of the members of div_t is not specified |
22:18:51 | miran | mratsim: oh, chaining would be nice thing to have. ok, i'll use procs too then! |
22:18:56 | FromGitter | <krux02> it can be in any order |
22:19:37 | FromGitter | <mratsim> ah? that’s bad :/ |
22:20:43 | FromGitter | <mratsim> @miran, for chaining use zero_functional or templates, otherwise each new iterator you add will add a new loop. you might get 3 loops+ over your data with 3 iterators chained |
22:21:08 | dom96 | Good news everyone. Async pcap works, and with the objective C backend too |
22:21:14 | FromGitter | <zacharycarter> dom96: all I'll say to that is - people are using gql at the office. I'm the only one tmk using Nim :( |
22:21:23 | Araq | https://www2.cs.arizona.edu/icon/docs/ipd266.htm |
22:22:21 | Araq | check it out, if you want to know how to design foo.map(bar).filter(bar).reduce(sum) |
22:22:33 | dom96 | On a side note, it's awesome to see nitely so actively working on that regex lib :D |
22:22:53 | Araq | without an ever growing set of "primitives" |
22:25:31 | FromGitter | <mratsim> by the way Araq, I’ve updated loopfusion so that it can work as a better list comprehension I think. It can also be a “forEach expression” now. |
22:27:51 | * | poopBot quit (Remote host closed the connection) |
22:29:29 | dom96 | Sucks that iterators can't be used for loopfusion |
22:29:51 | dom96 | I must admit even after reading your explanation I do not understand the problem |
22:31:16 | FromGitter | <mratsim> basically `for i, x, y, z in customZip(a, b, c):` —> customZip must be predefined before the for loop |
22:32:26 | FromGitter | <mratsim> that would mean that I have to generate `iterator customZipT, U V (s1: seq[T], s2: seq[U], s3: seq[V]): (int, T, U, V) = ... |
22:33:21 | FromGitter | <mratsim> before the for loop. hence hardcoding customZip from 1 to a reasonable number of argument |
22:33:41 | dom96 | is that really a problem? |
22:35:43 | FromGitter | <mratsim> if you want to return `var` in some or the other you get combination explosion, but you can probably generate from 1 to 6 and cover 90% of use case |
22:37:37 | FromGitter | <mratsim> in Arraymancer I probably have something like 1000+ lines of code for zip2,3 enumerateZip2,3 (aka zip with index), map, map2, map3, apply1,2,3 (in-place) that I can remove with those 300 lines of macro |
22:41:55 | * | miran_ joined #nim |
22:42:51 | FromGitter | <mratsim> oh @dom96 you meant `forEach x in fooIterator(a), y in b:` ? |
22:43:41 | dom96 | oh no |
22:44:05 | Araq | zip2,3, enumerateZip2,3, map, map2, map3, apply1,2,3 |
22:44:12 | * | endragor joined #nim |
22:44:21 | Araq | but what about foldr, foldl? |
22:45:05 | * | miran quit (Ping timeout: 240 seconds) |
22:46:31 | Araq | told you it is like epicycles. |
22:48:33 | * | endragor quit (Ping timeout: 256 seconds) |
22:53:15 | * | miran_ quit (Quit: Konversation terminated!) |
22:55:36 | FromGitter | <zacharycarter> does Nim feature any sort of recursive file watcher? |
22:59:02 | * | WhiskeyNick quit (Read error: Connection reset by peer) |
23:00:00 | FromGitter | <krux02> @mratsim zip is what I am really missing in the nim standard library |
23:00:25 | FromGitter | <krux02> zipping two itearators is way too hard in pure Nim |
23:00:47 | * | dom96 <3s the logging module |
23:00:56 | FromGitter | <krux02> most of the time I have something like openarray anyway, so I use index, but if I don't then it is really bad |
23:01:03 | dom96 | If there is one reason for multimethods, that module is it |
23:02:13 | FromGitter | <krux02> dom96: how does logging need multimethods? |
23:02:15 | FromGitter | <mratsim> I think inline iterator chaining working would help a lot already |
23:02:59 | dom96 | krux02: inheritance? |
23:03:25 | FromGitter | <krux02> @mratsim well chaining is not that much of a problem. I can define a local function and then write two for loops that just call this function |
23:04:33 | FromGitter | <krux02> dom96 well I don't use inheritance, so I don't know what exactly you mean |
23:04:40 | FromGitter | <krux02> (anymore) |
23:05:34 | dom96 | You can easily define your own loggers |
23:05:49 | * | PMunch quit (Quit: leaving) |
23:06:02 | FromGitter | <krux02> my loggers are most of the time just "echo" |
23:06:19 | FromGitter | <krux02> but I am not writing server code |
23:06:28 | dom96 | I'm playing around with a TUI |
23:06:36 | FromGitter | <krux02> so I have little experience with actually writing useful logging fucntions |
23:06:36 | dom96 | and I just wrote a logger that puts my logs into a TUI window |
23:06:56 | FromGitter | <krux02> terminal user interface? |
23:07:01 | dom96 | yep |
23:19:37 | FromGitter | <krux02> with import cpp I can do the following: ``proc rem(arg: ldiv_t): clong {.importcpp: "#.rem".}`` but it causes that nim compiles to c++ instead of c. What would be the equivalent of C? |
23:20:25 | FromGitter | <krux02> do I need an emit statement? |
23:23:16 | * | find0x90 joined #nim |
23:28:24 | FromGitter | <zacharycarter> hrm.... I'm not finding a straightforward way to watch a directory for file changes |
23:28:47 | FromGitter | <zacharycarter> and being able to figure out what file changed |
23:30:21 | FromGitter | <zacharycarter> I found https://github.com/Varriount/Filemon - yay! thanks @Varriount ! hopefully your 4 year old code is workable! |
23:30:38 | dom96 | https://forum.nim-lang.org/t/1179 |
23:30:39 | FromGitter | <Varriount> It works on Windows |
23:31:08 | FromGitter | <Varriount> @zacharycarter It was never completed to work on Mac/Linux. There is/was a standard library module for those platforms. |
23:31:25 | dom96 | Yes, bringing both together is a great project |
23:32:35 | FromGitter | <zacharycarter> hrm okay - I'll work on it - thanks guys LD |
23:32:39 | FromGitter | <zacharycarter> :D |
23:33:10 | * | gangstacat quit (Ping timeout: 246 seconds) |
23:35:40 | * | r2 joined #nim |
23:36:22 | FromGitter | <zacharycarter> so dom96 - would the idea be to add osx / windows support to: https://github.com/nim-lang/Nim/blob/master/lib/packages/fsmonitor.nim ? |
23:36:45 | dom96 | yes |
23:36:56 | dom96 | This should be done in a Nimble package for now though |
23:37:12 | * | gangstacat joined #nim |
23:37:17 | FromGitter | <zacharycarter> okay |
23:37:26 | FromGitter | <zacharycarter> should I name it fsmonitor? |
23:37:39 | dom96 | Ideally you'd have OS-specific modules |
23:37:49 | FromGitter | <zacharycarter> ok |
23:37:49 | dom96 | and then a generic cross-platform module on top of that |
23:38:03 | dom96 | name it something else please |
23:38:25 | FromGitter | <zacharycarter> ok |
23:39:50 | FromGitter | <krux02> how is the best way to implement platform dependent versions of certain functions |
23:40:14 | * | r2 quit (Ping timeout: 260 seconds) |
23:40:23 | FromGitter | <krux02> I think all this branching with `when` very ugly |
23:41:32 | FromGitter | <zacharycarter> I agree - and am curious |
23:45:03 | * | gangstacat quit (Quit: Ĝis!) |
23:45:57 | FromGitter | <krux02> well I don't have a nice solution |
23:46:16 | dom96 | anddd I praised logging too early |
23:46:21 | dom96 | Getting a crash in the GC :/ |
23:46:23 | FromGitter | <krux02> sometimes I think that Nim should provide a standard way for handling basic platforms |
23:46:51 | * | gokr quit (Ping timeout: 268 seconds) |
23:46:58 | FromGitter | <krux02> dom96: I am still waiting that I cal finally disable the GC once and for all. |
23:47:00 | dom96 | oh, my bad |
23:47:37 | FromGitter | <krux02> how do I check if I am compiling to a C/C++ backend? |
23:47:41 | dom96 | seeing a stack trace that goes into gc.nim is always far too suspicious |
23:51:51 | * | find0x90_ joined #nim |
23:51:57 | * | find0x90 quit (Ping timeout: 263 seconds) |
23:54:01 | FromGitter | <krux02> @zacharycarter would be nice if you orient yourself on something that already exists. For example this one here: https://github.com/fsnotify/fsnotify |
23:54:08 | FromGitter | <krux02> (it is for go) |