00:02:00 | FromGitter | <Araq> yes |
00:02:07 | FromGitter | <Araq> `let foo = case ...` |
00:21:03 | * | Serenitor quit (Quit: Leaving) |
00:24:20 | * | noonien quit (Quit: Connection closed for inactivity) |
00:35:14 | * | PrimHelios joined #nim |
00:35:39 | PrimHelios | Does anyone here know anything about ormin? |
00:36:35 | FromGitter | <bung87> hi guys, I want port a Minhash library Neo or Arraymancer should I consider first ? |
00:40:57 | * | ftsf joined #nim |
00:56:32 | FromGitter | <Araq> @PrimHelios I do, but it's late here, see you later. |
01:00:16 | * | krux02 quit (Remote host closed the connection) |
01:01:08 | * | krux02 joined #nim |
01:02:59 | * | krux02 quit (Remote host closed the connection) |
01:41:07 | vivus | how do I search a string? looking for keywords |
01:50:44 | * | icasdri joined #nim |
01:53:35 | * | icasdri quit (Remote host closed the connection) |
01:54:01 | * | kungtotte quit (Ping timeout: 246 seconds) |
01:54:08 | * | kungtotte joined #nim |
02:14:42 | FromGitter | <ephja> vivus: https://nim-lang.org/docs/system.html#find,T,S |
02:14:45 | FromGitter | <ephja> https://nim-lang.org/docs/strutils.html#find,string,string,Natural,Natural |
02:15:11 | vivus | I saw that 1 from strutils, but it returns an int |
02:19:20 | FromGitter | <bung87> then what else expect to return ? |
02:22:51 | * | dddddd quit (Remote host closed the connection) |
02:26:39 | FromGitter | <ephja> slice? |
02:27:38 | vivus | im seeing what a returned int means to understand. |
02:27:55 | vivus | Does nim have something like: if mystring exists: ... |
02:28:09 | vivus | in Python, it's: if mystring: |
02:29:54 | leorize | you mean check if a string is not empty? |
02:29:58 | FromGitter | <bung87> well, you first problem in js is .indexOf in python is .find |
02:30:40 | FromGitter | <bung87> second question, not clear to me what you're asking |
02:36:24 | * | leorize quit (Ping timeout: 252 seconds) |
02:49:52 | * | leorize joined #nim |
03:11:56 | FromGitter | <bung87> `cdef int32_t INT32_MAX = 4294967295` I see this in a cython file, why this is double and plus 1 to https://github.com/nim-lang/Nim/blob/27b081d1f77604ee47c886e69dbc52f53ea3741f/tinyc/win32/include/stdint.h#L85 |
03:19:08 | vivus | leorize: yeah, check if the string is not empty |
03:19:22 | leorize | if string != "" |
03:19:29 | leorize | no fancy functions needed |
03:19:32 | vivus | *mindblown* |
03:26:52 | leorize | but do note that for older versions of Nim you might need to check for nil as well |
03:27:21 | * | endragor joined #nim |
03:44:08 | FromGitter | <bung87> (https://files.gitter.im/nim-lang/Nim/9pB3/Screen-Shot-2018-09-03-at-11.43.31-AM.png) |
03:46:47 | FromGitter | <bung87> how to avoiding this? it treats as proc should as a function |
03:49:08 | FromGitter | <bung87> I meant to call `MurmurHash3_x64_128(str, char_ngram, seeds[s], hashes)` |
03:50:38 | leorize | looks like a codegen bug |
03:51:02 | leorize | can you try with the latest compiler from devel? |
03:52:33 | leorize | it would be great if you can include some example code as well |
03:52:33 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8cb00160f9ee7aa4cc51eb] |
03:53:03 | FromGitter | <bung87> ok hold on I push it to github |
03:55:49 | FromDiscord | <emekoi> can we get macro pragmas? |
03:55:59 | FromGitter | <bung87> https://github.com/bung87/minhash/tree/master/src |
03:57:13 | FromGitter | <bung87> maybe my cpp wraps wrong |
04:02:33 | * | cspar_ joined #nim |
04:05:43 | leorize | bung87: the hash takes an untyped pointer, not a cstring |
04:06:54 | leorize | but it shouldn't cause any problem... |
04:06:59 | leorize | I'll take a closer look |
04:08:31 | leorize | bung87: change importcpp to importc |
04:08:57 | FromGitter | <bung87> you mean here `const void * key` ? I only have a little experience in QT framework, so may have big mistake |
04:09:11 | FromGitter | <bung87> ok I try it |
04:11:45 | FromGitter | <bung87> you mean just replace `importcpp ` -> `importc ` no further work to do ? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8cb481c2bd5d117a0ebebf] |
04:12:08 | FromGitter | <bung87> it will raise symbol not found error |
04:12:40 | leorize | ok you still need importcpp, but you need to crack the syntax |
04:12:43 | leorize | https://nim-lang.org/docs/manual.html#importcpp-pragma-importcpp-for-procs |
04:13:10 | leorize | since importcpp is mainly used for importing methods, it's default behavior cause the issue you met |
04:13:43 | leorize | the problem is... I don't know how to properly use it for importing normal procs |
04:16:18 | * | gangstacat quit (Quit: Ĝis!) |
04:17:01 | FromGitter | <bung87> wow ..difficult for me to understand |
04:23:02 | leorize | looks like you can `importcpp: "MurmurHash3_x64_128(@)"` |
04:23:24 | leorize | it will generate the correct code, but it doesn't generate the necessary `externs` |
04:25:25 | vivus | what is the best way to store data in a file such that I can split the content according to different categories? |
04:26:57 | FromGitter | <bung87> it will raise link error I just tried |
04:27:36 | leorize | bung87: it raise "Murmur3... is not defined in this scope" for me |
04:28:22 | * | suspiciouswombat quit (Ping timeout: 246 seconds) |
04:28:51 | FromGitter | <bung87> hmm I see two nim package that wraps c version murmur3 .. maybe I just need to try c version :( |
04:29:17 | leorize | :p you can try to reimplement the hash itself in Nim |
04:29:29 | leorize | vivus: what do you mean? |
04:29:39 | leorize | or to be precise, what are you trying to do |
04:32:04 | vivus | leorize: I am trying to make a human readable file that can store data according to categories. like this: https://www.zerobin.net/?13a5335515237687#cxogxWTIW69TYmgOCt3nf8spiOeZjt7YnwNvH38i5n0= |
04:33:56 | FromGitter | <bung87> @leorize I see some go implements seems easy to port but not sure I can really understand it :( I'll try c version first |
04:34:13 | vivus | leorize: is there a better way to store that data so I can index/search it? |
04:34:33 | leorize | vivus: I can only think of tables right now |
04:34:58 | vivus | I want to avoid a DB, as it's overkill |
04:35:08 | FromGitter | <bung87> that depends on what kind of data |
04:35:22 | leorize | vivus: tables is pretty lightweight |
04:35:41 | leorize | it's a simple hashmap |
04:35:41 | vivus | what do you mean tables? I thought you were referring to DB tables |
04:35:50 | leorize | the tables module |
04:36:52 | leorize | bung87: I don't think it's possible to call ordinary functions in C++ from Nim |
04:37:07 | leorize | c2nim can't generate anything useful from your header |
04:37:53 | vivus | oh yes this might work. ty |
04:39:42 | FromGitter | <bung87> so that's why document only introduce method,namespace,class ? |
04:41:13 | vivus | leorize: when I try to run the example on the modules page, it gives me this error: Error: A module cannot import itself |
04:41:28 | leorize | did you name the file tables.nim? |
04:42:05 | FromGitter | <bung87> probably |
04:42:10 | vivus | yeah 0_o oops |
04:43:23 | leorize | bung87: it will work if you use it with {.header: "/path/to/header".} |
04:43:27 | leorize | I've just tried |
04:43:49 | leorize | c2nim can only generate useful code when you pass both --cpp and --header |
04:44:06 | FromGitter | <bung87> @leorize I change it to c version it just worked |
04:45:03 | leorize | C interface will work for everything :) |
04:46:12 | FromGitter | <bung87> thanks ! I will try it next time I'll keep that in mind:) |
05:19:44 | FromDiscord | <emekoi> whats the difference between doc and doc2? or are they the same on devel? |
05:33:20 | * | nsf joined #nim |
05:46:56 | FromDiscord | <emekoi> nvm, i figured it out. |
05:47:55 | FromDiscord | <emekoi> should documentation be built doc2 style? because all the stuff in system/atomics isn't in any of the docs. |
06:16:19 | * | gogolxdong quit (Quit: Page closed) |
06:39:29 | vivus | does nim have the Python equivalent of enumerate? |
06:42:22 | FromGitter | <narimiran> yes, you just do `for i, element in mySeq:` |
06:42:29 | FromGitter | <narimiran> vivus ^ |
06:43:26 | vivus | @narimiran can I do this like so: for keys, line in lines filename: ? |
06:50:02 | FromGitter | <narimiran> it seems that you can't |
06:51:05 | * | koppeh quit (Quit: koppeh) |
06:51:11 | * | copygirl joined #nim |
06:52:19 | FromGitter | <narimiran> my quick workaround (probably there is a better way) is to use `let contents = readFile(filename).splitLines; for i, line in contents: ....` (splitLines is from strutils) |
06:53:08 | FromGitter | <narimiran> http://ix.io/1lUw/ |
06:55:06 | vivus | @narimiran this is using that each line will have something like ... key:value in it? |
06:55:12 | vivus | *this is assuming |
06:56:04 | FromGitter | <narimiran> no, this is how i usually read contents from a multi-line file |
07:01:15 | * | kapil___ joined #nim |
07:01:36 | Araq | enumerate needs to be added to sugar.nim |
07:05:18 | FromGitter | <codem4ster> Hi all, there are recv procs in net module. I want to read bytes instead of string from a tcp connection. Which one do you suggest? recv with low-level with a pointer version or string version. If latter, is this a good and performant approach to convert string to bytecode? |
07:07:07 | * | diogenese5 joined #nim |
07:09:51 | * | diogenese5 quit (Remote host closed the connection) |
07:10:21 | FromGitter | <codem4ster> I want use recv in thread. Is pointer version leads to unsafe code and leak memory or do smt bad? |
07:17:30 | FromGitter | <mratsim> pointers lead to unsafe code, that means you’re on your own. It won’t leak memory if you o not make it leak. |
07:18:01 | FromGitter | <mratsim> unsafe doesn’t mean bad, it means that Nim won’t cleanup your mess (or even tell you you are in a mess) |
07:19:07 | FromGitter | <mratsim> but tbh, the Nim net module is using string wrongly and should accept `seq[byte]` instead of strings |
07:20:00 | FromDiscord | <emekoi> `recv` and `send` in the net module make sure that their socket is open, is there a reason asyncnet doesn't? |
07:20:46 | FromGitter | <mratsim> debate about `string` vs `seq[byte]` starts here: https://github.com/nim-lang/Nim/issues/7337#issuecomment-373398341 |
07:21:38 | leorize | /urlselect |
07:21:44 | leorize | oops, sorry |
07:23:03 | * | halirc joined #nim |
07:26:13 | FromGitter | <codem4ster> I totally agree with you Mamy. I first tried |
07:27:06 | * | cspar joined #nim |
07:27:23 | FromGitter | <mratsim> even if you delete on Gitter, your message will still appear on IRC and in irc logs.nim-lang.org @codem4ster ;) |
07:28:00 | * | cspar_ quit (Ping timeout: 252 seconds) |
07:28:28 | FromGitter | <codem4ster> I totally agree with you @mratsim. I first looked for uint8 and byte types. Its interesting Nim works with strings in socket streams. |
07:28:46 | FromGitter | <codem4ster> sorry for the mistake irc channel :P |
07:29:11 | vivus | Araq: hope im not disturbing, but maybe you can help me figure out how to get my proc to display the output as shown: https://www.zerobin.net/?4b90a03babbf5784#VZ2/wkoAB4TgwRJ9+IHVVtoG/1aaZrb8AFg3r2ZtL04= |
07:30:24 | FromGitter | <mratsim> @vivus, can you use NimYAML instead? https://nimyaml.org/ |
07:31:23 | FromGitter | <codem4ster> the last question @mratsim. How can I convert [1, 5, 0] to string (I mean bytecode to string) :) I need to use this string in send proc. |
07:32:22 | FromGitter | <mratsim> `cast[string](@[byte 1, 5, 0]` |
07:32:24 | vivus | @mratsim can the outputted yaml file be converted back to nim structures? |
07:32:31 | FromGitter | <mratsim> @vivus yes |
07:32:42 | vivus | it looks so complicated though |
07:33:03 | FromGitter | <mratsim> @codem4ster not sure if intentional or relying on implementation details but you can cast between string and sequence of uint8/bytes |
07:33:21 | FromGitter | <mratsim> @vivus, because NimYAML adds some comment for serialization |
07:33:31 | Araq | sorry to say that but YAML is way too complex and it's the kind of complexity that can introduce security problems |
07:34:14 | FromGitter | <mratsim> but for config, check both toml and yams @vivus, pick one that you like and you will not have to parse by hand: https://gist.github.com/cdsousa/9c98897595177ed322b24643af4b68ce |
07:34:27 | FromGitter | <mratsim> yaml not yams* |
07:34:45 | vivus | ive been sitting on this for a few hours. I think my brain will need a timeout before jumping into nimyaml :D unless Araq saves the day :D |
07:35:41 | FromGitter | <mratsim> Otherwise for serialization that does not need to be human-readable this is nice: https://xomachine.gitlab.io/NESM/ |
07:36:19 | FromGitter | <codem4ster> @mratsim I'm using the stable version 0.18 it gives SIGSEGV: Illegal storage access. (Attempt to read from nil?) for `caststring (@[byte 1, 5, 0])` |
07:36:29 | * | ftsf quit (Read error: Connection reset by peer) |
07:36:47 | FromGitter | <mratsim> the @foo need to be assigned to a variable first I think |
07:36:57 | FromGitter | <mratsim> otherwise the GC will collect it |
07:38:14 | FromGitter | <codem4ster> it says: the cast keyword, which is unsafe and should be used only where you know what you are doing, such as in interfacing with C here; https://nim-by-example.github.io/variables/type_casting_inference/ |
07:38:47 | FromGitter | <mratsim> alternatively just use copyMem, that will b sure to work whatever the future implementations of string and seq\[byte\] |
07:39:18 | FromGitter | <mratsim> I know what I’m doing :P |
07:40:06 | FromGitter | <codem4ster> ahaha :D but I'm not, exactly in threads. :P |
07:44:15 | * | ven473 quit (Remote host closed the connection) |
07:44:32 | * | ven473 joined #nim |
07:50:41 | * | PMunch joined #nim |
07:51:50 | FromGitter | <alehander42> in NimYAML to just use `load`to convert to nim objects |
07:52:04 | FromGitter | <alehander42> they have good examples here https://nimyaml.org/ |
07:53:47 | FromGitter | <alehander42> yeah, if you just use a resonable subset of yaml, it's unbeatable for me |
07:58:36 | vivus | I was hoping to avoid using OOP and objects in general |
07:59:28 | FromGitter | <alehander42> what do you mean? |
07:59:35 | FromGitter | <alehander42> there is no OOP here |
07:59:49 | vivus | type Person = object |
07:59:59 | FromGitter | <alehander42> well, that's not OOP |
08:00:11 | FromGitter | <alehander42> that's just a struct basically |
08:00:15 | * | Vladar joined #nim |
08:00:21 | FromGitter | <alehander42> but it's just an example |
08:00:29 | FromGitter | <alehander42> if you use only seq-s/builtin types |
08:00:34 | FromGitter | <alehander42> you pass them to load |
08:00:55 | vivus | fair enough |
08:00:58 | FromGitter | <alehander42> e.g. `load(f, int)` |
08:01:03 | FromGitter | <alehander42> (at least I think so) |
08:02:55 | * | gmpreussner_ quit (Ping timeout: 246 seconds) |
08:03:25 | * | gmpreussner joined #nim |
08:03:32 | FromGitter | <alehander42> otherwise toml seems hyped these days, but isn't `[[]]` vs `[]` a little bit confusing |
08:03:54 | FromGitter | <alehander42> I find it assymetrical (1 indentation for two levels of data) |
08:07:53 | Araq | everything is always confusing. ;-) |
08:08:36 | vivus | Araq: is my problem above easy? I kind of feel like I am not getting the logic right, maybe cause im tired :D |
08:12:45 | Araq | what's your problem? |
08:15:04 | Araq | can you place this around the calls to epochTime() |
08:15:04 | Araq | {.push posix: off.} |
08:15:04 | Araq | # calls to epochTime() here |
08:15:04 | Araq | {.pop.} |
08:15:13 | Araq | what? lol |
08:15:36 | Araq | TIL there is a 'posix: off' switch |
08:15:48 | vivus | are you telling me? |
08:18:03 | * | SenasOzys quit (Remote host closed the connection) |
08:19:20 | Araq | no it was offtopic, I'm reading old bug reports |
08:19:30 | Araq | vivus, so ... what's your problem again? |
08:19:42 | vivus | Araq: https://www.zerobin.net/?4b90a03babbf5784#VZ2/wkoAB4TgwRJ9+IHVVtoG/1aaZrb8AFg3r2ZtL04= |
08:22:17 | * | SenasOzys joined #nim |
08:22:18 | * | SenasOzys quit (Remote host closed the connection) |
08:22:23 | Araq | yes, that's not clear enough |
08:22:39 | * | SenasOzys joined #nim |
08:23:26 | vivus | ill come back later. need to think about this problem as pseudocode first. |
08:23:32 | vivus | ty all |
08:23:38 | vivus | will look into nimyaml also |
08:23:56 | * | SenasOzys quit (Remote host closed the connection) |
08:24:22 | * | SenasOzys joined #nim |
08:25:06 | * | Elronnd is now known as s |
08:25:29 | * | s is now known as Elronnd |
08:25:32 | FromGitter | <alehander42> you just need to use ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8ceffbcff55e56179cf471] |
08:27:59 | * | stefanos82 joined #nim |
08:27:59 | FromGitter | <alehander42> but I'd also recommend doing something similar and directly parsing it first , e.g. ⏎ `parse(source) -> seq[Category] or Table[string, Category] # not sure which is better for you` ⏎ after that writing all kinds of filter etc functions will be very easy |
08:28:26 | Araq | isn't this problem covered by dom's book |
08:28:39 | * | dadabidet joined #nim |
08:28:50 | FromGitter | <alehander42> of course it depends, if your files are huge you might want to directly iterate them for interactive output i guess |
08:28:54 | vivus | @alehander42 you mean I should parse everything from the file into a nim data structure? |
08:29:29 | vivus | the files will be small. at max, a few thousand lines I predict |
08:29:30 | FromGitter | <alehander42> well if you do a lot of different operations with it, yeah, if you just filter it a loop is good enough I guess |
08:30:03 | vivus | your pseudocode is awesome btw. ty for giving me another angle to look at it |
08:30:51 | FromGitter | <alehander42> i hope it helps |
08:32:04 | Araq | hmm 67 bugs left to close for today... |
08:32:22 | Araq | "3,933 Closed" |
08:37:41 | * | vivus quit (Remote host closed the connection) |
08:48:44 | FromGitter | <xmonader> wow |
08:54:27 | * | zachcarter quit (Ping timeout: 240 seconds) |
08:59:16 | stefanos82 | Araq: what -_- |
08:59:23 | stefanos82 | are you even a human being?! |
09:01:03 | Araq | stefanos82, nah, I'm not serious. |
09:01:18 | stefanos82 | bloody hell, you got me worried for a moment ^_^ |
09:01:40 | stefanos82 | I planned to nicknamed you "The Bug Terminator" |
09:01:42 | Araq | on the other hand, what I'm about to implement might close 10 bugs at the same time... |
09:03:31 | * | TheLemonMan joined #nim |
09:03:52 | Araq | and yeah, I know I made the CIs red :-( |
09:04:29 | TheLemonMan | Travis is blushing |
09:10:39 | * | sz0 joined #nim |
09:14:28 | * | couven92 quit (Read error: Connection reset by peer) |
09:17:26 | stefanos82 | Araq: I have no fear about your expertise around programming, let alone bug fixes and new implementation. |
09:17:30 | stefanos82 | you will sort things out |
09:17:46 | Araq | that makes two of us |
09:20:27 | FromGitter | <admin0day> i am still can't figure out why my csv file can't upload succeed to the website backend when i am added an nginx reverse proxy in front of my backend. |
09:21:03 | * | gangstacat joined #nim |
09:21:55 | FromGitter | <admin0day> i can saw the nginx hand out the package to the backend. |
09:24:14 | FromGitter | <admin0day> upstream prematurely closed connection while reading response header from upstream |
09:26:00 | FromGitter | <admin0day> still print out this fault in my nginx's error.log |
09:31:28 | FromGitter | <admin0day> here is the code of the upload http://ix.io/1lUG |
09:32:00 | FromGitter | <alehander42> has uint changes default sizes in any of the versions? |
09:32:20 | Araq | no. |
09:33:15 | FromGitter | <alehander42> hm I hit a memory overflow bug because I used sizeof(uint) instead of sizeof(uint16) |
09:33:22 | FromGitter | <alehander42> so I guess uint was always uint32 |
09:33:30 | FromGitter | <alehander42> just wondering why I didn't hit that before |
09:35:54 | FromGitter | <mratsim> uint is the size of a pointer |
09:36:05 | FromGitter | <mratsim> uint64 on a 64 bit machine |
09:47:45 | FromGitter | <alehander42> thanks |
09:48:00 | FromGitter | <alehander42> anyway, I am full of the dumbest bugs today |
09:48:18 | FromGitter | <alehander42> just filled a log file with 10 gb of data because of a wrong `while` |
09:48:41 | FromGitter | <alehander42> gcc really has so start solving the halting problem |
09:52:59 | TheLemonMan | fuckin travis creates more problems than it solves |
09:53:48 | TheLemonMan | welp, there's a missing comma in there heh |
09:54:34 | * | captainkraft quit (Ping timeout: 246 seconds) |
09:55:10 | * | captainkraft joined #nim |
09:59:30 | Araq | TheLemonMan, without the CIs we would be doomed. |
10:00:16 | * | norok2 joined #nim |
10:02:34 | norok2 | hi all again! is there a cheat sheet for quick `nim` syntax? |
10:03:24 | TheLemonMan | sure thing, I just found that Travis is the one service that has to be restarted more than the others |
10:12:33 | FromGitter | <bung87> how to declare a type member could be `uint32` or `int64` ? |
10:13:02 | TheLemonMan | in a object? use a generic parameter |
10:13:07 | Araq | you use int64 because every uint32 value fits in an int64 |
10:18:40 | Araq | it's like saying "I need a type that can hold a char and 'A'..'Z'" |
10:21:14 | FromGitter | <bung87> ```code paste, see link``` ⏎ ⏎ so I make all out_hashes to `var array[2, int64]` not sure I'm right [https://gitter.im/nim-lang/Nim?at=5b8d0b1a1d3a5711b6d9539b] |
10:26:01 | FromGitter | <vivekimsit> Hi, I am new to Nim and this is my first message :) |
10:26:44 | FromGitter | <vivekimsit> I want to be a collaborator and learn system programming |
10:27:29 | FromGitter | <vivekimsit> how can I get started? |
10:28:15 | Araq | follow my git commits. |
10:29:22 | leorize | norok2: the Manual |
10:34:47 | FromGitter | <bung87> ```code paste, see link``` ⏎ ⏎ Do I need two version, or just ues the `minhash_64` one? [https://gitter.im/nim-lang/Nim?at=5b8d0e4711b41f69dbb2d923] |
10:35:24 | FromGitter | <bung87> since `self.seeds` declare as `seeds:seq[int64]` |
10:48:18 | * | Zeno[m] joined #nim |
10:55:27 | norok2 | @leorize it seems I have some trouble in finding the equivalent of MATLAB's `start:step:stop` method for generating an array |
10:57:30 | FromGitter | <bung87> https://nim-lang.org/docs/system.html#countup.i,T,T,int |
10:58:49 | norok2 | countup is a generator, it will not give me an array |
10:59:33 | TheLemonMan | toSeq(countup(...)) |
11:01:01 | FromGitter | <vivekimsit> @FromIRC sure |
11:01:20 | norok2 | Error: undeclared identifier: 'toSeq' |
11:02:22 | TheLemonMan | come on, you're not even trying, import sequtils first |
11:08:42 | FromGitter | <mratsim> Araq get out of TheLemonMan’s body |
11:09:35 | FromGitter | <mratsim> @vivekimsit, I suggest you start with: https://narimiran.github.io/nim-basics/, then find a project that you would enjoy doing and do it in Nim |
11:09:44 | FromGitter | <mratsim> pick something that you can wind but is not too trivial |
11:10:42 | FromGitter | <mratsim> win not wind |
11:13:06 | * | couven92 joined #nim |
11:13:46 | FromGitter | <vivekimsit> @mratsim sure, right now I am watching some couple of videos on youtube |
11:14:29 | * | Guest46449 is now known as avsej |
11:14:52 | FromGitter | <bung87> https://nim-lang.org/documentation.html Tutorials on left side always there |
11:15:19 | FromGitter | <mratsim> in my case I wanted to build a scientific ecosystem in Nim and had greater and greater needs, then I become much better at Nim internals while debugging and raised hundreds of bugs |
11:20:57 | Araq | hundreds? |
11:23:31 | TheLemonMan | thousands! |
11:24:23 | * | dddddd joined #nim |
11:27:20 | Araq | https://ci.appveyor.com/project/dom96/nim/build/4573/tests this is interesting to see |
11:27:58 | Araq | if we make the compilation phases saner, "only" about 100 tests fail |
11:28:42 | FromGitter | <narimiran> @vivekimsit if you follow @mratsim's suggestion, you would be one of the first people reading redesigned Nim basics tutorial :) I've planned to "publish" that, but I forgot |
11:29:21 | FromGitter | <narimiran> The content is the same as before, so if you find anything confusing/not working/wrong, please report it. |
11:36:38 | FromGitter | <narimiran> looking at today's commits — @Araq is on fire! :) |
11:37:08 | * | seni joined #nim |
11:37:21 | * | Ovius joined #nim |
11:40:49 | FromGitter | <zetashift> you know `type Person = object` is basically a struct why was object keyword chosen and not struct? |
11:40:57 | FromGitter | <zetashift> Just curious don't really mind it |
11:42:06 | * | Ovius quit (Remote host closed the connection) |
11:42:49 | FromGitter | <bung87> they dont have mush diffriences |
11:43:05 | Araq | because 'struct' is not even a word? |
11:43:11 | * | kapil___ quit (Quit: Connection closed for inactivity) |
11:43:23 | Araq | the full English term is 'structure' iirc |
11:43:58 | Araq | I don't know why C didn't use the term that was common at that time, 'record' |
11:44:39 | Araq | probably because they were too busy with removing vowels from their alphabet |
11:45:13 | FromGitter | <bung87> that would let database thing come to my head... |
11:47:50 | PMunch | Well you kept "int" |
11:47:57 | PMunch | Those are actually called integers |
11:48:22 | PMunch | And int is not a word either |
11:50:22 | PMunch | To be honest I think it was just to save on typing. Overall consonants carry more information than vowels in words, so vowels are easier to remove if you want to shorten something. Plus a string of consonants are pretty easy to pronounce, but a string of vowels is a bit harder. |
11:51:04 | * | zachcarter joined #nim |
11:51:07 | PMunch | float is also really a shortening, but having a type "floating_point_number" in C would just be silly :P |
11:51:24 | PMunch | "char" is also in Nim, and it's short for character |
11:51:37 | Araq | thank you for this lecture. |
11:51:49 | PMunch | I'm with zetashift by the way, I don't mind them being called "object" |
11:52:23 | Araq | and now please note that 'record' and 'struct' have the same amount of letters |
11:53:24 | PMunch | Oh yeah, I'm not saying that structure vs. record was a better choice |
11:54:09 | PMunch | But calling it a structure maybe makes a bit more sense since the data is structured that way in memory. A record doesn't really have to imply any underlying storage format |
11:54:45 | PMunch | But that's just how I tend to think about them, Wikipedia seems to disagree with me :P |
11:55:19 | * | zachcarter quit (Ping timeout: 246 seconds) |
12:03:27 | * | cspar quit (Ping timeout: 252 seconds) |
12:06:00 | FromGitter | <alehander42> @mratsim talking about scientific, I started a simple symbolic nim lib in the weekend , i've always wanted to do something related to symbolic comp ⏎ i know I can just write a wrapper around a c one, but writing one from scratch is cooler obviously |
12:07:09 | FromGitter | <alehander42> (i saw somebody was looking for sympy in the forum :D probably one should be able to wrap their c engine, but I haven't looked into it) |
12:26:10 | norok2 | perhaps I am doing something wrong, but I was really expecting this simple code to print some numbers... it compiles, but it hangs indefinitely |
12:26:29 | norok2 | import sequtils |
12:26:31 | norok2 | var a = toSeq(0..<10000) |
12:26:32 | norok2 | proc sum(arr: openArray[SomeNumber]): SomeNumber = |
12:26:34 | norok2 | result = 0 |
12:26:35 | norok2 | for x in arr: |
12:26:37 | norok2 | result += x |
12:26:38 | norok2 | echo sum(a) |
12:26:47 | norok2 | sorry I made it even simpler |
12:26:53 | norok2 | import sequtils |
12:26:54 | norok2 | var a = toSeq(0..10) |
12:26:56 | norok2 | echo a |
12:27:09 | norok2 | hangs indefinitely |
12:27:20 | FromGitter | <mratsim> @alehander42 cool, there was someone asking for Sympy like in the forum |
12:29:37 | FromGitter | <vivekimsit> @narimiran sure |
12:30:00 | norok2 | @alehander42 but sympy does not have a C engine, it's pure Python, according to their home page: https://www.sympy.org/en/index.html |
12:31:00 | norok2 | @alehander42 perhaps you could look into Maxima.. granted that it is written in LISP, perhaps with the metaprogramming facilities of Nim it is not too difficult to take inspiration from that |
12:31:47 | FromGitter | <alehander42> @mratsim exactly, that reminded me I wanted to do something like that |
12:32:17 | FromGitter | <alehander42> @norok2 very strange |
12:32:22 | FromGitter | <alehander42> I saw https://github.com/symengine/symengine |
12:32:26 | FromGitter | <alehander42> which leads to sympy page |
12:32:38 | FromGitter | <alehander42> so I thought they use it somehow |
12:33:22 | FromGitter | <alehander42> i see, so it can be a custom backend |
12:34:14 | FromGitter | <alehander42> yeah, my plan was to initially build some core functionality, with mostly sympy-like API |
12:34:40 | FromGitter | <alehander42> and to think of a better nim dsl for the functionality in the meantime |
12:34:56 | FromGitter | <mratsim> I’d love to help but too many project :p |
12:35:21 | FromGitter | <alehander42> thanks for the maxima idea, i'll take a look at it later |
12:36:07 | FromGitter | <alehander42> @mratsim i'll probably use some of your libs, e.g. stint anyway :D |
12:37:56 | FromGitter | <mratsim> why do you need stint for symbolic computation? |
12:37:57 | FromGitter | <alehander42> nah, actually one would need arbitrary precision here |
12:38:00 | PMunch | norok2, seems to work fine on the playground |
12:38:10 | * | elrood joined #nim |
12:38:33 | FromGitter | <mratsim> I have an arbitrary precision integer lib for crypto but it’s ony in my head for the moment |
12:38:41 | PMunch | And please use a paste service like pastebin or ix.io when sharing code snippets |
12:38:42 | FromGitter | <alehander42> no, I might want to support very big numbers, but I forgot stint is only N-bit |
12:39:02 | PMunch | They are easier to copy from and it reduces the noise in the IRC room |
12:39:11 | FromGitter | <mratsim> you can use ref Stint\[1384\] if you want ;) |
12:39:17 | FromGitter | <mratsim> 16384* |
12:39:25 | FromGitter | <alehander42> @mratsim if nimble can download it from your head, i am going to install it |
12:39:43 | FromGitter | <mratsim> afraid no |
12:40:01 | FromGitter | <alehander42> imagine npm with brain-to-push-package bionic interface |
12:40:13 | FromGitter | <alehander42> the future is bright |
12:40:44 | FromGitter | <narimiran> norok2: your example works on my end. what is your nim version? |
12:40:57 | norok2 | 0.18.0 |
12:41:26 | FromGitter | <alehander42> yeah, i'll just let people live with `2343589 * 3287423874` |
12:41:56 | FromGitter | <narimiran> norok2 i have tried both 0.18.0 and 0.18.1 (devel), and it works |
12:42:22 | PMunch | norok2, try to run nim --version just to be sure |
12:42:26 | FromGitter | <narimiran> (the second, simple, example) |
12:42:42 | norok2 | Nim Compiler Version 0.18.0 [Linux: amd64] |
12:42:49 | PMunch | norok2, and you don't have a local file named sequtils with another implementation of toSeq? |
12:43:06 | norok2 | not that I am aware of |
12:43:12 | PMunch | Which switches do you use to compile? |
12:43:20 | norok2 | nim c -d:release sum.nim |
12:43:48 | norok2 | sum.nim contains the code |
12:44:16 | norok2 | lol |
12:44:18 | norok2 | nvm |
12:44:36 | PMunch | What was it? |
12:44:52 | norok2 | there was another bin with that name and was executing that |
12:45:03 | PMunch | Ah :P |
12:45:49 | * | endragor quit (Remote host closed the connection) |
12:46:24 | norok2 | is there anything similar to %timeit for nim? |
12:46:48 | norok2 | (ipython magic) |
12:47:03 | PMunch | Well on linux you can just use `time ./sum` |
12:47:12 | norok2 | @narimiran, @PMunch thanks for helping out |
12:47:45 | norok2 | I was hoping to have something that would run it multiple times, and do some stats on top |
12:48:06 | norok2 | and perhaps within the code itself |
12:48:10 | PMunch | Hmm |
12:48:24 | PMunch | Well a template should be able to do that |
12:48:39 | * | krux02 joined #nim |
12:48:51 | * | elrood quit (Quit: Leaving) |
12:49:28 | FromGitter | <alehander42> there were several libs for that |
12:49:29 | FromGitter | <alehander42> https://github.com/winksaville/nim-benchmark |
12:49:45 | FromGitter | <alehander42> but it is not updated, it might need a fix for new nim |
12:50:17 | FromGitter | <mratsim> This is the latest and greatest: https://github.com/LemonBoy/criterion.nim |
12:50:36 | FromGitter | <alehander42> http://htmlpreview.github.io/?https://github.com/ivankoster/nimbench/blob/master/nimbench.html |
12:50:39 | FromGitter | <alehander42> aaah yeah |
12:50:47 | FromGitter | <alehander42> that's it, it had a weeeird name |
12:50:55 | FromGitter | <alehander42> criterion ^ |
12:51:19 | FromGitter | <mratsim> Because it’s from Haskell ;) |
12:51:35 | PMunch | norok2, http://ix.io/1lVg/ |
12:51:38 | PMunch | Something like that |
12:55:42 | TheLemonMan | yeah, it follows the great tradition of criterion.{hs,nim,rust} :) |
12:55:51 | * | Vladar quit (Remote host closed the connection) |
12:59:17 | Araq | it violates Nim's Zen though, "copying a bad name does not make it a good name" |
12:59:51 | PMunch | norok2, and if you want to be able to pass a number of times to run it: http://ix.io/1lVh/ |
13:00:23 | krux02 | Araq: I see an issues list that actually becomes shorter rather than longer |
13:01:35 | Araq | PMunch, btw an 'int' is not an integer. it's a caricature of an integer because it can overflow |
13:01:51 | * | Vladar joined #nim |
13:01:55 | TheLemonMan | after all naming things is the hardest part heh |
13:02:02 | Araq | but Pascal got it worse with 'real' which has nothing to do with real numbers |
13:02:43 | krux02 | Araq: so that is wher this "SomeReal" came from. |
13:02:52 | PMunch | Are you talking about C ints? |
13:03:03 | TheLemonMan | 'real' reeks of x86's 80-bit fp |
13:03:21 | * | MyMind joined #nim |
13:03:45 | krux02 | 80-bit fp is still not a real |
13:03:55 | * | Sembei quit (Ping timeout: 250 seconds) |
13:04:39 | FromGitter | <tim-st> is there a http server in nim that is not async? |
13:04:41 | Araq | and 'string' always felt salacious to me, I should have called it 'text' |
13:04:47 | TheLemonMan | yeah, the whole world pretends it's never been real :P |
13:05:15 | Araq | but then 'text' would consist of letters, not of stupid octets... |
13:05:27 | TheLemonMan | stash all those ideas for Nim2 |
13:05:45 | Araq | I'm not serious. |
13:06:25 | FromGitter | <tim-st> what's the downsides of this: https://nim-lang.org/docs/httpserver.html ? Is says it will be deprecated soon |
13:06:51 | krux02 | I think the worst part of unicode is the ambiguety. |
13:07:03 | Araq | asynchttpserver received more security related bugfixes, tim-st |
13:07:31 | FromGitter | <tim-st> ok, thanks, can I access a shared string or something using asynchttpserver? |
13:08:01 | krux02 | you can have an a with ¨ on top or the character ä |
13:08:06 | krux02 | not the same thing |
13:08:23 | FromGitter | <timotheecour> @mratsim thx for suggestion, I changed title in https://github.com/nim-lang/Nim/issues/8432 |
13:09:32 | FromGitter | <alehander42> text is good indeed, i always struggle to explain what is string to beginners |
13:10:16 | PMunch | alehander42, it's a string of characters :) |
13:10:43 | FromGitter | <tim-st> when I use async things I always get "not gcsafe" errors |
13:10:46 | Araq | or a rope, or a thread, a twine |
13:10:57 | FromGitter | <alehander42> @pmunch yeah exactly, why `string` ? |
13:11:03 | FromGitter | <alehander42> why not just a list of characters |
13:11:03 | Araq | a chain. |
13:11:13 | PMunch | A sequence of similar items or events. ‘a string of burglaries’ |
13:11:15 | FromGitter | <alehander42> a labyrinth .. |
13:11:18 | krux02 | Araq: I finally understand your naming conventions |
13:11:21 | norok2 | @alehander42, @mratsim, @PMunch thanks |
13:11:23 | PMunch | From Oxford dictionary on string |
13:11:28 | PMunch | That's probably what it's from |
13:11:48 | FromGitter | <timotheecour> @araq thanks for fixing all those pesky runnableExamples issues! now we can start making more use of runnableExamples finally |
13:11:51 | krux02 | when I just started to do programming and I needed more names without name collisions, I put different languages in the mix |
13:11:51 | FromGitter | <alehander42> yeah, but the point is that people usually use "list" to name a sequence |
13:11:54 | FromGitter | <alehander42> in programming |
13:12:00 | krux02 | identifiers in German and English |
13:12:09 | FromGitter | <alehander42> also, e.g. in bulgarian i don't see a clearly equivalent word to string |
13:12:53 | FromGitter | <alehander42> and finally, with unicode even a list/string starts to not make fully sense |
13:12:59 | * | agree joined #nim |
13:13:14 | krux02 | alehander42: I learned programming with scheme. For me a list will always be a single linked list. And the Java ArrayList is an oxymoron |
13:13:15 | norok2 | I think string is closer to an array than to a list |
13:13:31 | FromGitter | <alehander42> as it's a superposition of several lists |
13:13:36 | FromGitter | <alehander42> ok, arrays |
13:13:40 | FromGitter | <alehander42> python broke me for life :D |
13:13:47 | Araq | 'chain' is the much better term for singly/doubly linked "lists" |
13:13:50 | krux02 | I think string is a good name, because it doesn't imply that you can index into it. |
13:14:13 | krux02 | Araq: I agree |
13:14:36 | FromGitter | <alehander42> but the only reason it exists is that people make sense of its visual representation |
13:14:43 | norok2 | chain is still a sensitive word in south US :'D |
13:14:44 | FromGitter | <alehander42> which is basically text |
13:14:58 | FromGitter | <alehander42> otherwise you just use some kind of a binary format |
13:15:21 | FromGitter | <alehander42> the fact that we use text to interoperate with everything is just a side effect :D |
13:15:39 | Araq | but the worst offender is 'vector' for a variable length thing. In math vectors always have a fixed size, you cannot grow them. |
13:15:55 | * | agree quit (Remote host closed the connection) |
13:16:14 | Araq | not too mention that the term clashes with the real vectors you might want to use in your program... |
13:16:33 | krux02 | Araq: put c++ valarrray to the mix |
13:17:32 | Araq | what's a valarray? |
13:17:35 | krux02 | if they would just swap the names of valarray and vector, c++ would be a better language |
13:17:54 | krux02 | you can see it as a vector |
13:18:09 | krux02 | with operators like + |
13:18:17 | FromGitter | <tim-st> is there a reason why the following works and in one line it doesnt? |
13:18:28 | FromGitter | <tim-st> ```var s {.threadvar.}: string ⏎ s = ""``` [https://gitter.im/nim-lang/Nim?at=5b8d34a311b41f69dbb3dab7] |
13:18:37 | PMunch | Well a chain is always double linked |
13:18:42 | * | cspar joined #nim |
13:18:50 | PMunch | A single linked chain wouldn't make much sense |
13:19:08 | PMunch | And having already used Array a linked list kinda makes sense |
13:19:15 | krux02 | PMunch I would lisagree |
13:19:53 | krux02 | you can have a cain of hangers |
13:20:07 | krux02 | and that is "single linked" |
13:20:14 | PMunch | Huh? |
13:20:16 | Araq | tim-st: yeah, read the error message |
13:21:44 | krux02 | PMunch, you put a hanger in another hanger. It is asymetric |
13:21:57 | krux02 | not like double linked which is symmetric |
13:22:00 | PMunch | If you think of the C style "string" which is just a pointer to a character with the implication that other characters "string" along until a NULL byte occurs then the name kinda makes sense |
13:22:03 | krux02 | and still I would call it a chain |
13:22:30 | PMunch | A hanger like a clothes hanger? |
13:22:55 | krux02 | PMunch, C has full support for 0 terminated strings and strings with explicit size. |
13:23:01 | Araq | C doesn't name it 'string' though, it's 'char*' |
13:23:12 | FromGitter | <tim-st> When I open a file as `threadvar` does it mean it is opened again in each thread? |
13:23:13 | Araq | but string.h is a header file, so... |
13:23:15 | krux02 | it is just that 0 terminated strings are more popular. But not when you look and standard library alone |
13:23:23 | PMunch | krux02, yeah I know |
13:23:52 | krux02 | Araq, and ``strstr`` |
13:24:03 | krux02 | best name ever |
13:24:08 | PMunch | I was just just saying that if someone wanted to name the concept of a series of characters pointed to by something a "string" would be a decent word |
13:24:16 | PMunch | As it is really a string of characters |
13:24:34 | Araq | 'strstr' is my favorite too |
13:24:44 | PMunch | What's strstr? |
13:25:22 | krux02 | http://www.cplusplus.com/reference/cstring/strstr/ |
13:26:30 | PMunch | Oh yeah, that thing.. |
13:26:31 | Araq | a result of serious drug problems |
13:26:45 | PMunch | Who thought that was a good name.. |
13:27:57 | Araq | and now it's FP time. 'map'. WTF? 'fold'? 'foldr'? |
13:28:25 | FromGitter | <alehander42> well map seems obvious |
13:28:30 | FromGitter | <alehander42> mapping |
13:28:40 | TheLemonMan | fold is also obvious because it folds a sequence into a single element |
13:28:47 | FromGitter | <alehander42> i mean, look at linq, that is crazy |
13:28:55 | krux02 | well fold is actually a good name. |
13:29:01 | TheLemonMan | and foldl/foldr tell you the traversal direction |
13:29:01 | FromGitter | <alehander42> filter is also good |
13:29:16 | krux02 | I just don't like foldl foldLeft foldRight. |
13:29:21 | Araq | really? I think it's terrible. 'fold' is 'accumulate' |
13:29:21 | FromGitter | <zetashift> I asked why it was named object and it devolved into a whole naming discussion |
13:29:42 | Araq | and 'map' ... well a map is something you use to get from point A to point B. |
13:29:52 | krux02 | when it say foldLeft, I don't know is it from left or towards left |
13:30:13 | Araq | or maybe 'fold' is 'collect' |
13:30:27 | FromGitter | <alehander42> reduce |
13:30:28 | PMunch | Well in the broader sense a map is just something that "maps" one thing to another. In the case of a terrain map it maps the terrain around you onto a piece of paper |
13:30:38 | Araq | oh yeah, forgot about 'reduce'. |
13:30:52 | krux02 | fold isn't a term that was invented by functional programming. |
13:30:56 | FromGitter | <Vindaar> @Araq nah, map in the mathematical sense is perfectly fitting |
13:30:59 | FromGitter | <alehander42> i think we just have many good names for fold |
13:31:12 | FromGitter | <data-man> @alehander42 Thanks for winksaville/nim-benchmark ! Why I don't know it. :) ⏎ ⏎ > but it is not updated, it might need a fix for new nim ⏎ ⏎ First attempt: https://github.com/data-man/nim-benchmark/tree/modern_Nim [https://gitter.im/nim-lang/Nim?at=5b8d37a0c9500b4bab76ebc4] |
13:31:12 | * | fredrik92 joined #nim |
13:31:16 | FromGitter | <alehander42> collect is not good, it doesn't seem obvious |
13:31:37 | FromGitter | <alehander42> @data-man i found it on the forum with google, np |
13:31:41 | Araq | Vindaar: probably hints at a problem of the English language :P |
13:31:56 | FromGitter | <mratsim> We should biject instead of map :P |
13:32:09 | FromGitter | <mratsim> and morphism instead of function |
13:32:09 | * | couven92 quit (Disconnected by services) |
13:32:13 | Araq | yup. 'biject'. perfect. |
13:32:20 | * | fredrik92 is now known as couven92 |
13:32:47 | krux02 | collect is already used in functional programming |
13:32:56 | krux02 | it is not fold, but related |
13:33:11 | FromGitter | <alehander42> i tried to use injective in a PR |
13:33:16 | FromGitter | <alehander42> and araq hated it :D |
13:33:29 | krux02 | but biject is also not good, a bijective function is reversable |
13:33:36 | FromGitter | <alehander42> i kind agree with him for the particular pr |
13:33:38 | FromGitter | <mratsim> collect means “toSeq” in Rust |
13:33:41 | krux02 | a map normaaly does not have that requirement |
13:34:01 | FromGitter | <zetashift> @mratsim holy shit really |
13:34:02 | FromGitter | <mratsim> the main thing about bijections is that it preserves cardinality, like map |
13:34:11 | FromGitter | <zetashift> toSeq is a lot easier to grasp lmao |
13:34:25 | FromGitter | <mratsim> yeah in Rust you put collect after a chain of iterators to build a new container |
13:34:27 | FromGitter | <zetashift> I was like "collect into what!?" |
13:35:08 | FromGitter | <mratsim> but at least Rust inline iterator chaining works ;) |
13:35:18 | krux02 | collect in scala is "filter" with pattern matching and map the result |
13:36:00 | FromGitter | <mratsim> oh, Haskell has mapAccumlL and mapAccumR btw and it’s different from fold |
13:36:12 | FromGitter | <mratsim> It’s more of scanl and scant with map |
13:36:25 | FromGitter | <mratsim> scanr |
13:36:27 | krux02 | scala has a fold operator |
13:37:20 | krux02 | (myarrar /: Nil) ( _ :: _ ) |
13:37:39 | krux02 | transforms any collection in a single linked list |
13:37:43 | krux02 | with a fold |
13:37:44 | FromGitter | <alehander42> and in sympy collect transforms a polynom to its ugh normal(sorted by power of x) state |
13:38:24 | FromGitter | <alehander42> just to add another random meaning |
13:38:29 | krux02 | alehander42 isn't that rather a normalization step? |
13:38:43 | FromGitter | <mratsim> “normal” means too much things as well |
13:40:31 | krux02 | "normal" means a lot, but "normalize" not |
13:40:44 | * | cspar quit (Ping timeout: 272 seconds) |
13:40:44 | Araq | "normal" is politically incorrect and has been deprecated. |
13:41:34 | krux02 | I was very confused when I learned in computer graphics about the vertex normal. |
13:41:46 | Araq | Use "special snowflake" instead. |
13:42:11 | krux02 | I can't is it called normal everywhere |
13:42:34 | krux02 | it is an orthogonal vector to the surface |
13:44:40 | PMunch | Hmm, is there a way to borrow everything from the base type when creating a distinct type? |
13:46:05 | PMunch | I was looking at this: https://www.reddit.com/r/nim/comments/9c5cf9/noob_confused_with_overloading_functions/ and I came to realize that if you want to be able to work on both your Oranges and Apples as strings but have two different peel procedures you would need to use distinct and then convert back and fro between the type and a string, or borrow everything you think you will need, which wouldn't work for imported modules. |
13:46:10 | FromGitter | <arnetheduck> so nim is supposed to be good at dsl's.. why all the sarcasm around domain specific names then? |
13:46:12 | * | Ambroisie joined #nim |
13:46:14 | krux02 | PMunch: when you find good use for distinct type, tell me about it, I didn't |
13:46:43 | krux02 | arnetheduck: I am not sarcastic about domain specific names. |
13:46:50 | * | cspar joined #nim |
13:47:22 | krux02 | I am just sarcastic about obvious bad namings. |
13:47:38 | PMunch | arnetheduck, we were just discussing names we thought were strange |
13:47:47 | krux02 | like the already mentioned "strstr" |
13:48:06 | krux02 | I think functional programming is quite good names. |
13:48:17 | krux02 | C has "distinct" names |
13:48:37 | Araq | I think clarity of words is a precondition for clarity of thoughts |
13:48:41 | FromGitter | <mratsim> @Pmunch `type Foo = object; data: int` -> everything from int is borrowed -> ??? -> Profit |
13:48:44 | FromGitter | <arnetheduck> well, `strstr` follows a pattern in the c library - would it be better to break the pattern? |
13:48:53 | krux02 | and javascript libraries like to let anything end on js |
13:49:06 | PMunch | krux02, well I used `distinct` in my jsonschema module and nimlsp |
13:49:20 | krux02 | arnetheduck: the is no pattern in "strstr" |
13:49:34 | PMunch | To indicate a JsonNode that followed a certain schema |
13:49:34 | krux02 | strfind would be fine |
13:49:44 | FromGitter | <arnetheduck> there is - it's the string counterpart for `strchr` |
13:49:54 | krux02 | and it is also within the imaginary 8 character limit of identifiers |
13:49:58 | PMunch | So I could be sure that it had some values but wouldn't have to create a new object for everything |
13:50:36 | FromGitter | <mratsim> @krux02 it was 6 in old Fortran |
13:50:42 | FromGitter | <tim-st> this httpserver works really good, it's the only one without memory leaks: https://nim-lang.org/docs/httpserver.html |
13:50:45 | FromGitter | <arnetheduck> it's also part of another pattern: all string functions in c start with `str` which denotes the string you're operating on.. the latter half of the name tells you about other arguments |
13:50:54 | * | Ambroisie quit (Remote host closed the connection) |
13:51:01 | Araq | 'strcmp'? |
13:51:54 | FromGitter | <arnetheduck> yeah, compare this string with the other.. even that is a hint as to what the return value will be (ie in which order the comparison is done) |
13:52:22 | PMunch | mratsim, then you would need to use .data everywhere |
13:52:56 | FromGitter | <alehander42> @arnetheduck well even strfindc and strfinds would be better |
13:53:02 | FromGitter | <alehander42> and still in the 8 char limi |
13:53:16 | FromGitter | <alehander42> obviously in this case we can ask "why strchr" |
13:53:20 | FromGitter | <arnetheduck> there is a system - it might not necessarily be a perfect one, and what's really hard is to add a name to an existing system for a new use case you didn't consider at the beginning - then you're faced with two unpalatable choices - break the system or break compatibility by changing the system |
13:54:02 | Araq | the only pattern here is that the thing starts with 'str'. 'strsub' (gimme me the substring) isn't exactly hard to come up |
13:54:08 | FromGitter | <alehander42> and often breaking compatibility is better: if C decided to depracate(but still save for compat) strchr and strstr in the 80s, and add equivalents with better names |
13:54:14 | FromGitter | <alehander42> it would save probably mandecades |
13:54:15 | krux02 | I don't care for the reasons as long as we all agree that c naming conventions suck. |
13:54:17 | FromGitter | <alehander42> of confusion |
13:54:33 | krux02 | the only good thing about them is they didn't change for as long as I live |
13:55:15 | FromGitter | <tim-st> Is it possible to turn off deprecated warning for a module? |
13:55:16 | * | noonien joined #nim |
13:55:25 | FromGitter | <arnetheduck> @alehander42 not really.. there's a reason why c is popular and other langs are not (in the sense that it's survived 40 years and still remains the *lingua franca* of compsci) - one thing is that it's stable |
13:55:53 | Araq | yeah, we can take a lesson here, don't bikeshed around for a decade just because "it's inconsistent/different from Python/I couldn't be bothered to read the docs" |
13:56:26 | krux02 | the good thing about C is, it doesn't do shit like "everything is an object" |
13:56:42 | krux02 | "all functions are virtual" |
13:56:49 | FromGitter | <alehander42> @arnetheduck and if one has to explain the actual reasons why the names are like this with such ь detail, you can see how this convention actually sucks |
13:56:56 | krux02 | "everything is garbage collected" |
13:57:53 | krux02 | In a lot of ways C is just sane syntax for assembler instructions. |
13:58:12 | FromGitter | <alehander42> @arnetheduck i am not saying why didn't they break it, but `strfind` instead of `strstr` is not "breaking", for every "wait strchr .. i expected strstr"guy you'll have 20 "ahhhh strfind .. that makes sense" people |
13:58:21 | Araq | oh not that again... my assembler had a way to detect overflows... |
13:58:33 | krux02 | Araq: sorry |
13:58:47 | FromGitter | <mratsim> And carry |
13:59:25 | krux02 | But that is my perspective on C. |
13:59:35 | FromGitter | <alehander42> and c remained a lingua franca thanks to the stability and *despite* the weeird conventions |
13:59:35 | krux02 | I don't know if what I say is true |
13:59:51 | Araq | and when C came along, register allocators were far from perfect and structured programming also had some overhead. |
14:00:10 | krux02 | But for me it feels tha language was designed to have a better syntax for what assembly programmers were doing anyway, just with assembler syntax. |
14:00:15 | Araq | C was considered a high level language. |
14:00:39 | FromGitter | <mratsim> Even assembly was considered higher level than hex edit :P |
14:00:40 | krux02 | But of course that doesn't cover every style of assembler programmers or all the tricks of assembler programmers |
14:00:52 | krux02 | just what they were used to as good pattern. |
14:01:31 | krux02 | Araq: Ever heared of HLSL |
14:01:36 | krux02 | high level shader language? |
14:01:56 | krux02 | it is basically just C |
14:02:23 | * | PrimHelios quit (Quit: Leaving) |
14:04:25 | ldlework | is really much like C? |
14:04:29 | ldlework | HLSL that is |
14:04:43 | Araq | really? so why does it lack 'goto' then? |
14:05:03 | Araq | and what does 'float4 Position : POSITION;' mean? |
14:10:03 | krux02 | float4 Position : POSITION doesn't mean much more than float4 Position |
14:10:31 | krux02 | and float4 is a simd data type with four 32bit float values |
14:20:55 | * | halirc quit (Ping timeout: 246 seconds) |
14:23:59 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
14:24:30 | * | pwntus quit (Remote host closed the connection) |
14:30:52 | norok2 | I got my `nim` executable from `nimble`... where am I supposed to find `nim.cfg`? |
14:38:29 | * | PMunch quit (Quit: Leaving) |
14:46:29 | Araq | norok2, usually you get your 'nimble' from 'nim' via 'koch nimble' |
14:46:46 | Araq | well for some definition of "usually" |
14:54:37 | FromDiscord | <Armaldio> Hello everyone |
14:54:37 | FromDiscord | <Armaldio> Do you know if it's possible to use case of with a regex ? |
14:55:13 | FromGitter | <mratsim> use strscan |
14:55:25 | FromGitter | <mratsim> https://nim-lang.org/docs/strscans.html |
14:55:50 | FromGitter | <mratsim> and do a if:elif chain |
14:56:38 | Araq | use the new experimental match macros with a case statement... |
15:01:24 | FromDiscord | <Armaldio> match returns a boolean from the doc, right ? |
15:01:48 | FromDiscord | <Armaldio> I think i'll go with a simple if elif |
15:05:58 | * | dadabidet quit (Remote host closed the connection) |
15:17:13 | FromGitter | <alehander42> how can i declare a signature for inline asm emit ? |
15:17:20 | * | endragor joined #nim |
15:17:28 | FromGitter | <alehander42> nodecl doesn't seem enough |
15:21:43 | yglukhov[m] | Araq: hey, should push:experimental work? |
15:23:30 | * | cspar quit (Ping timeout: 244 seconds) |
15:24:28 | Araq | yglukhov[m], I have a test case for that |
15:24:37 | Araq | {.push experimental: "feature".} is the syntax |
15:24:38 | norok2 | @Araq sorry, I got it messed up, I installed it a long time ago, I am not sure how I actually got it, I just saw it was in some `nimble` directory, anyway I found the solution: it did find my `nim.cfg` in `$HOME/.config`... the FAQ (https://nim-lang.org/faq.html) did help but was not really accurate |
15:25:29 | yglukhov[m] | Araq: cool, thanks! |
15:25:35 | * | PrimHelios joined #nim |
15:35:36 | * | endragor quit (Remote host closed the connection) |
15:35:38 | FromGitter | <mratsim> @alehander42 you don’t need to put a decl convention, just use {.emit: “””asm `result`”””.} |
15:36:37 | * | zachcarter joined #nim |
15:36:43 | FromGitter | <mratsim> or *asm* |
15:37:05 | FromGitter | <mratsim> here you go: https://github.com/LemonBoy/criterion.nim/blob/master/src/criterion/cycles.nim#L6-L12 |
15:40:33 | * | SenasOzys quit (Ping timeout: 244 seconds) |
15:42:46 | * | nsf quit (Quit: WeeChat 2.2) |
15:44:41 | * | DarkMukke joined #nim |
15:45:33 | * | SenasOzys joined #nim |
15:47:34 | * | DarkMukke quit (Remote host closed the connection) |
15:48:50 | * | cspar joined #nim |
15:54:27 | * | PrimHelios quit (Ping timeout: 240 seconds) |
16:38:32 | * | Jesin quit (Quit: Leaving) |
16:40:28 | * | flyx quit (Quit: ZNC - http://znc.in) |
16:56:05 | yglukhov[m] | Araq: i'll look into https://github.com/nim-lang/Nim/issues/8851 if youre not there yet? |
16:56:56 | Araq | yeah please |
16:57:07 | Araq | I'm working on the docgen. |
16:57:24 | Araq | that's what I wanted to do the whole day long and then I got side-tracked and fixed a billion bugs instead |
17:02:20 | * | Trustable joined #nim |
17:02:25 | * | Trustable_2 joined #nim |
17:02:41 | * | Trustable_2 quit (Remote host closed the connection) |
17:02:41 | * | Trustable quit (Remote host closed the connection) |
17:03:29 | * | Trustable joined #nim |
17:12:16 | FromGitter | <alehander42> @mratsim i also wanted to inline rdtsc .. how surprising :D |
17:12:23 | FromGitter | <alehander42> thanks |
17:12:37 | FromGitter | <alehander42> yeah i meant `{.inline.}` nice, i didnt know it exists |
17:13:48 | * | JStoker quit (Ping timeout: 252 seconds) |
17:14:18 | * | JStoker joined #nim |
17:20:10 | FromGitter | <bung87> please help me fix the code https://github.com/bung87/minhash/blob/master/src/minhash.nim cant pass third assert |
17:23:23 | * | cspar quit (Ping timeout: 245 seconds) |
17:24:09 | * | ng01 joined #nim |
17:24:55 | * | ng0 quit (Ping timeout: 244 seconds) |
17:28:16 | FromGitter | <kayabaNerve> What is it printing? |
17:28:21 | FromGitter | <kayabaNerve> What's the data type? |
17:28:23 | FromGitter | <kayabaNerve> @bung87 |
17:28:44 | FromGitter | <bung87> it 's porting from https://github.com/mattilyra/LSH/blob/master/lsh/cMinhash.pyx |
17:29:00 | * | ng01 is now known as ng0 |
17:30:22 | FromGitter | <bung87> the jaccard results in 0..1,all basic type is unsigned int |
17:31:47 | FromGitter | <kayabaNerve> It's probably an overflow issue/string/array |
17:32:07 | FromGitter | <kayabaNerve> You should get a big num lib |
17:32:27 | FromGitter | <kayabaNerve> Or find a way to properly compare the data types |
17:34:28 | FromGitter | <bung87> which parts could cause this issue ? I see the number is limited |
17:37:13 | FromGitter | <kayabaNerve> 1) .1? As in a decimal? Represented as a fraction via an undesigned int? |
17:37:20 | FromGitter | <kayabaNerve> *unsigned |
17:37:25 | FromGitter | <kayabaNerve> Back to what is it printing? |
17:38:52 | FromGitter | <bung87> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8d71ac58a3797aa3f96c4e] |
17:40:37 | * | cspar joined #nim |
17:41:54 | FromGitter | <bung87> ok you're right, it should return float but this another problem |
17:44:00 | FromGitter | <kayabaNerve> Float to int truncates |
17:44:59 | FromGitter | <bung87> still prints `0.0-0.0` |
17:46:10 | FromGitter | <bung87> I may have big mistake , I only have a little experiences in compiled language under framework . |
17:47:05 | FromGitter | <kayabaNerve> I can do more investigating when I'm not on my phone :p sorry for not being helpful so far. |
17:48:04 | FromGitter | <bung87> thanks! you fix a bug . |
17:50:12 | * | SenasOzys quit (Quit: Leaving) |
18:03:59 | * | xet7 joined #nim |
18:13:58 | * | nsf joined #nim |
18:15:43 | * | xet7 quit (Quit: Leaving) |
18:17:56 | * | xet7 joined #nim |
18:58:38 | * | zachcarter quit (Quit: Lost terminal) |
18:58:48 | * | zachcarter joined #nim |
18:59:42 | zachcarter | I have this example from hyperHTML now working w/ my port - https://viperhtml.js.org/hyperhtml/examples/#!fw=React&example=Hello%2C%20world%20%26%20tick |
19:00:42 | FromGitter | <kayabaNerve> @bung87 It seems to be intersection/union. |
19:01:04 | FromGitter | <kayabaNerve> I can't get the code to run due to issues on my machine though |
19:01:06 | FromGitter | <kayabaNerve> Sorry |
19:01:49 | FromGitter | <bung87> how could that be a problem |
19:02:43 | FromGitter | <kayabaNerve> No idea. I just know that those two generate the return value for jaccard so you should check what they're doing |
19:07:02 | zachcarter | so much refactoring / cleaning up to do on this lib now |
19:07:06 | FromGitter | <bung87> I'm not sure the `char_ngram` parts , it may produces in original cMinhash.pyx that I not noticed, or it inside MurmurHash |
19:07:28 | zachcarter | but at least it's working :D tagged template literals are awesome :D - now we have basically two Nim FE web libraries :D |
19:10:27 | * | crem quit (*.net *.split) |
19:10:28 | * | surma quit (*.net *.split) |
19:10:28 | * | r4vi quit (*.net *.split) |
19:10:30 | * | LyndsySimon quit (*.net *.split) |
19:10:31 | * | enigmeta quit (*.net *.split) |
19:10:32 | * | AlexMax quit (*.net *.split) |
19:10:52 | * | AlexMax_ joined #nim |
19:10:55 | * | crem1 joined #nim |
19:10:56 | * | surma_ joined #nim |
19:11:36 | * | r4vi joined #nim |
19:11:41 | * | enigmeta joined #nim |
19:11:45 | * | LyndsySimon joined #nim |
19:13:18 | FromGitter | <xmonader> Hi anyone tried Mdbook with Nim lang? I can't get the highlighting to work :S |
19:14:38 | zachcarter | first time I've heard of mdbook |
19:15:16 | * | Trustable quit (Remote host closed the connection) |
19:16:21 | FromGitter | <bung87> https://github.com/mattilyra/LSH/blob/3db37cf07eefa3276e7409b12e73f30f596236ae/lsh/cMinhash.pyx#L49-L55 the ngram produces here? |
19:18:54 | * | kapil___ joined #nim |
19:19:04 | * | Trustable joined #nim |
19:19:42 | FromGitter | <xmonader> @zacharycarter really? it's the one the rust book build on and multiple other projects |
19:20:04 | FromGitter | <xmonader> I found out the problem, they didn't include `nimrod` support from highlight custom build |
19:22:15 | zachcarter | ah interesting |
19:22:56 | zachcarter | this tagged template lib is only `9.83KB gzipped (38.33KB uncompressed)` |
19:23:01 | zachcarter | after running through google closure compiler |
19:28:19 | FromGitter | <bung87> @kayabaNerve I got an idea , the pyx version function get a char pointer and it produce produce ngrams by move pointer |
19:32:21 | * | cspar quit (Ping timeout: 252 seconds) |
19:32:29 | FromGitter | <xmonader> OK Nimdays migrated to mdbook ⏎ please check https://xmonader.github.io/nimdays ⏎ I think it's beautiful than softcover and Day 12 is out :) on how to encode/decode data in redis protocol too |
19:34:27 | FromGitter | <zetashift> @xmonader on day11 you wrote 'managng' on the first paragraph :D |
19:34:37 | FromGitter | <zetashift> I like nimdays a lot btw ! |
19:35:00 | FromGitter | <xmonader> @zetashift Thanks I'll fix. I'm glad you like it :) |
19:55:53 | * | vivus joined #nim |
19:57:01 | zachcarter | need to figure out how to implement - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Class_expressions - next |
19:57:13 | zachcarter | I'm guessing macros + emit |
20:00:40 | * | AlexMax_ left #nim (#nim) |
20:01:16 | * | AlexMax joined #nim |
20:12:01 | * | Sentreen joined #nim |
20:12:25 | * | skrylar joined #nim |
20:12:59 | * | skrylar quit (Client Quit) |
20:13:08 | * | skrylar joined #nim |
20:26:45 | * | Trustable quit (Remote host closed the connection) |
21:09:20 | vivus | is anybody familiar with yaml? Someone mentioned it to me earlier. Trying to see if I can get the right yaml format |
21:11:17 | zachcarter | vivus: what are you having issues w/ regarding YAML? |
21:13:01 | * | stefanos82 quit (Quit: Quitting for now...) |
21:13:01 | vivus | zacharycarter: can YAML look like this: https://www.zerobin.net/?01c6c89d30b0c52c#61suUZ+NRDIgXWWxog1zqDeiKgUSbKQx2QKnRHMDwvU= ? |
21:13:04 | * | fredrik92 joined #nim |
21:14:23 | * | abm joined #nim |
21:14:59 | zachcarter | vivus: yes you can have lists and associatons in YAML |
21:15:21 | zachcarter | I mean - that's not how you'd write the YAML to represent that - but it is definitely representable in YAML |
21:15:29 | vivus | zacharycarter: the online yaml validators say that my format is incorrect |
21:16:23 | * | couven92 quit (Ping timeout: 244 seconds) |
21:16:41 | zachcarter | well - yes - I don't think you've written your example correctly using yaml |
21:17:05 | zachcarter | vivus: may wnat to check out - https://learn.getgrav.org/advanced/yaml - or another tutorial on YAML |
21:17:09 | zachcarter | to get the basic syntax down |
21:17:46 | vivus | hmmm, im not sure I want to yak-shave this. if it can't match my current format, i may be fighting against it to do so |
21:18:00 | zachcarter | Araq: regarding - https://forum.nim-lang.org/t/3755#23449 - I think there is value to adding ES6 constructs to the JS backend |
21:18:07 | vivus | zacharycarter: can my format be represented in a Nim data structure? |
21:18:24 | zachcarter | vivus: yes - look at the tables module |
21:19:19 | zachcarter | for instance - https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements - relies on ES6 classes - so without ES6 classes, you can't take advantage of custom elements |
21:19:39 | FromGitter | <alehander42> @vivus you can simply have ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8da56b58a3797aa3faa912] |
21:20:54 | vivus | hmmm, I guess that might work too. |
21:21:44 | FromGitter | <alehander42> it depends, here I assume your categorie names are unique |
21:22:45 | vivus | they are. each category is meant as a grouping for similar items. fruit, veg, flowers, trees, etc. |
21:23:02 | FromGitter | <alehander42> if you can have fruit, after that vegetable, after that fruit, then you might need to just have another field category: similar to name: |
21:23:38 | * | nsf quit (Quit: WeeChat 2.2) |
21:23:46 | FromGitter | <alehander42> but if order doesn't matter, yeah, then it should be fine like that ^(a dict/table) |
21:23:57 | vivus | @alehander42 could you save me 2 hours of time and tell me which example on nimyaml is the closest to the desired output, so that I can customize it |
21:24:26 | vivus | (the output you showed) |
21:27:59 | FromGitter | <alehander42> so, you want to generate this from nim data structures? |
21:28:11 | FromGitter | <alehander42> because otherwise this is the input |
21:29:21 | vivus | should I use the "loading objects from yaml" example and work from there? |
21:30:08 | FromGitter | <alehander42> yeah |
21:31:49 | FromGitter | <alehander42> well, overally just remember the basis of yaml syntax: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ and then you just define a type that maps to your yaml structure [https://gitter.im/nim-lang/Nim?at=5b8da845f86b741b0504ee0c] |
21:32:01 | FromGitter | <alehander42> it's similar with json etc |
21:32:22 | seni | what's the status with interfacing with C++? |
21:33:17 | seni | came across this post https://forum.nim-lang.org/t/363 but it's 4 years old |
21:33:51 | zachcarter | seni: yes you can bind / interop w/ C++ and Nim |
21:34:20 | zachcarter | seni: checkout c2nim and Sorry for necroing this thread - but that web components are close to reaching maturity, I think ES6 constructs are going to be crucial to Nim's JS backend moving forward. |
21:34:24 | zachcarter | For instance - https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements - rely on ES6 classes. |
21:34:35 | zachcarter | ugh my bad |
21:34:47 | * | tribly quit (Quit: WeeChat 2.2) |
21:34:49 | zachcarter | had something on my clipoboard that I didn' tthink was there |
21:34:58 | zachcarter | seni: checkout c2nim | https://github.com/genotrance/nimgen |
21:35:05 | * | endragor joined #nim |
21:35:34 | vivus | @alehander42 and how do I get the category name? I am using that example, which seems almost identical to mine, except I also have category names |
21:37:24 | * | tribly joined #nim |
21:37:49 | seni | zachcarter: thanks |
21:37:57 | * | kapil___ quit (Quit: Connection closed for inactivity) |
21:38:04 | zachcarter | seni: np |
21:38:09 | * | Vladar quit (Remote host closed the connection) |
21:39:13 | * | endragor quit (Ping timeout: 245 seconds) |
21:40:38 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8daa5611227d711d0efec5] |
21:41:44 | FromGitter | <alehander42> what is the type of your yaml ? it's a table of string(category name) => seqElement (or what you call them). you just need to pass the type to yaml to parse it |
21:42:03 | FromGitter | <alehander42> after that you can just iterate through the table or `[]` |
21:43:39 | vivus | why does Element, name and color all have * next to them? |
21:43:47 | vivus | name* color* ? |
21:45:26 | zachcarter | that means they're exported |
21:45:45 | vivus | I still dont understand, sorry |
21:47:16 | zachcarter | it's an access modifier - it denotes whether the symbol is visible to other modules that import it |
21:47:27 | zachcarter | it's like public / private / protected in other programming languages like Java or C++ |
21:47:46 | zachcarter | if the symbol isn't exported - it won't be available to other modules that import it |
21:48:08 | vivus | oh so it means its public |
21:48:57 | zachcarter | well Nim doens't have the concept of public or private or protected - it's either exported or its not |
21:49:17 | vivus | but exported means public right? I need a way to remember it |
21:50:33 | FromGitter | <metasyn> @vivus ^ yes, exported == available to other modules ~= "public" |
21:51:24 | zachcarter | vivus: https://narimiran.github.io/nim-basics/ - might be a good guide to go through |
21:51:35 | zachcarter | explains a lot of basics w/ Nim and is really well written |
22:00:01 | * | seni quit (Quit: Leaving) |
22:37:43 | * | xet7 quit (Quit: Leaving) |
22:40:45 | Guest21953 | Hey, a question (probably to dom96 ?), if I stored future in a variable, then... how can I check that it failed (stuff already moved forward). Basically i "spawned" some `while true` loop but now I lost it's status completely |
22:46:18 | * | PrimHelios joined #nim |
22:54:33 | * | captainkraft quit (Ping timeout: 244 seconds) |
23:14:41 | FromGitter | <honewatson> @dom96 does httpbeast support https? |
23:21:34 | zachcarter | Guest21953: https://nim-lang.org/docs/asyncdispatch.html#asynchronous-procedures-handling-exceptions |
23:22:21 | zachcarter | honewatson: I don't see any reason it wouldn't - you could easily try by using devel nimble and https |
23:24:22 | * | pokk11 joined #nim |
23:27:15 | * | pokk11 quit (Remote host closed the connection) |
23:28:29 | zachcarter | honewatson: https://gist.github.com/zacharycarter/92c38941845c05b8b0479a6c4cedc11f |
23:30:09 | zachcarter | whoops |
23:30:12 | zachcarter | forgot the s lol |
23:30:23 | zachcarter | hrm - yeah apparently the request just hangs |
23:31:09 | zachcarter | that's pretty limiting feature... |
23:34:59 | FromGitter | <honewatson> thanks zachcarter |
23:35:14 | FromGitter | <honewatson> you were right about graphql by the way |
23:36:58 | zachcarter | what about it? |
23:37:22 | zachcarter | honewatson: https://gist.github.com/zacharycarter/92c38941845c05b8b0479a6c4cedc11f - updated example using actual https :) |
23:37:26 | FromGitter | <honewatson> it would be good if Nim had a graphql server |
23:37:32 | zachcarter | Ah - yes - it would be :) |
23:38:27 | * | captainkraft joined #nim |
23:38:40 | zachcarter | I imagine it would be alot easier to produce w/ Nim than via Go - Nim's codegen capabilities are much more empowered due to templates | macros |
23:39:32 | zachcarter | honewatson: I got the green light to use Nim at work - so I'm working on the web ecosystem atm - a GraphQL lib is definitely in my sights |
23:39:43 | FromGitter | <honewatson> ok thats cool |
23:39:51 | zachcarter | I just finished the majority of the port of - https://github.com/WebReflection/hyperHTML - over the weekend |
23:40:10 | FromGitter | <honewatson> Let me know when you begin GraphQL |
23:40:11 | zachcarter | which I think is going to be the next hotness to replace React | Vue | Angular, etc... |
23:40:15 | zachcarter | will do |
23:40:18 | FromGitter | <honewatson> I might be able to help |
23:41:03 | zachcarter | that'd be swell! once I get this tagged template literal library cleaned up, published, and documented - I imagine that will be my next endeavour |
23:41:10 | FromGitter | <honewatson> Would like to but young family so always committments |
23:41:45 | FromGitter | <honewatson> ok that is good regarding hyperHtml |
23:41:45 | zachcarter | I can't relate but I can empathize - I have two young nieces and they require all the world's attention whenever they're around :P |
23:41:50 | FromGitter | <honewatson> I wanted this in Nim |
23:42:19 | zachcarter | well - I have this example compiling working now - https://viperhtml.js.org/hyperhtml/examples/#!fw=React&example=Hello%2C%20world%20%26%20tick |
23:42:38 | zachcarter | I have a lot of refactoring to do - I abused the hell out of toJs and to |
23:42:41 | zachcarter | in jsffi |
23:42:51 | zachcarter | but it's working :D and it's doing exactly what hyperHTML does |
23:43:03 | FromGitter | <honewatson> nice work |
23:43:06 | zachcarter | thank you! |
23:44:11 | zachcarter | I'm now working on a macro for ES6 classes for Nim's JS target |
23:44:21 | zachcarter | as they're required for custom elements in the webcomponents spec |
23:45:04 | zachcarter | all this is going towards the next iteration of the Nim playground - which I plan to write using webcomponents / the library I just ported |
23:47:55 | FromGitter | <arnetheduck> anyone else having trouble bootstrapping? ```lib/system.nim(487, 35) Warning: unknown magic 'Exception' might crash the compiler [UnknownMagic] ⏎ lib/system.nim(709, 8) Warning: unknown magic 'NewSeqOfCap' might crash the compiler [UnknownMagic] ⏎ lib/system.nim(1930, 15) Error: invalid pragma: intdefine ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5b8dc82b94f8164c17d8b3f9] |
23:48:38 | zachcarter | arnetheduck: I will give it a shot |
23:49:20 | FromGitter | <arnetheduck> git |
23:51:49 | * | PrimHelios quit (Read error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number) |
23:52:31 | * | PrimHelios joined #nim |
23:52:42 | * | zachcarter quit (Quit: Lost terminal) |
23:52:57 | * | zachcarter joined #nim |
23:53:27 | zachcarter | arnetheduck: `git clone https://github.com/nim-lang/Nim.git nimtest && cd nimtest && sh ./build_all.sh` works fine for me |
23:54:45 | zachcarter | unless that's not what you meant |
23:55:19 | zachcarter | I'm pretty sure build_all.sh boostraps the compiler though |