00:00:17 | * | MJCaley joined #nim |
00:27:30 | * | MJCaley quit (Quit: MJCaley) |
00:28:42 | * | MJCaley joined #nim |
00:58:29 | * | gokr quit (Ping timeout: 256 seconds) |
01:16:32 | * | MJCaley quit (Quit: MJCaley) |
01:19:28 | * | tefter joined #nim |
01:26:26 | * | MJCaley joined #nim |
01:36:18 | * | sz0 joined #nim |
01:42:57 | * | arecacea1 quit (Remote host closed the connection) |
01:43:19 | * | arecacea1 joined #nim |
02:21:02 | * | hogeland quit (Ping timeout: 276 seconds) |
02:21:10 | * | hogeland joined #nim |
02:25:38 | * | instrud quit (Ping timeout: 256 seconds) |
02:51:26 | * | chemist69 quit (Ping timeout: 255 seconds) |
02:53:50 | * | endragor joined #nim |
02:55:09 | * | SenasOzys quit (Ping timeout: 260 seconds) |
03:05:11 | * | chemist69 joined #nim |
03:29:04 | * | MJCaley quit (Quit: MJCaley) |
03:32:03 | * | vlad1777d quit (Ping timeout: 256 seconds) |
03:37:52 | * | sz0 quit (Quit: Connection closed for inactivity) |
04:02:22 | * | kunev joined #nim |
04:04:31 | * | Quantem quit (Quit: Going offline, see ya! (www.adiirc.com)) |
04:12:09 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:42:09 | * | Quantem joined #nim |
04:57:50 | * | hps_ joined #nim |
05:03:20 | * | hps_ quit (Ping timeout: 260 seconds) |
05:46:32 | * | athenot quit (Ping timeout: 260 seconds) |
05:47:59 | * | athenot joined #nim |
05:51:27 | * | athenot_ joined #nim |
05:51:52 | * | athenot quit (Read error: Connection reset by peer) |
06:06:31 | * | nsf joined #nim |
06:17:01 | * | gokr joined #nim |
06:43:57 | * | dddddd quit (Remote host closed the connection) |
07:23:04 | * | xkapastel quit (Quit: Connection closed for inactivity) |
07:27:51 | * | miran_ joined #nim |
07:31:55 | * | j_rod_s quit (Read error: Connection reset by peer) |
07:32:41 | * | hogeland quit (Ping timeout: 255 seconds) |
07:34:09 | * | j_rod_s joined #nim |
07:39:58 | * | hogeland joined #nim |
07:42:22 | * | PMunch joined #nim |
07:44:59 | * | rokups joined #nim |
08:04:33 | * | vlad1777d joined #nim |
08:06:37 | * | athenot_ quit (Read error: Connection reset by peer) |
08:07:14 | * | athenot joined #nim |
08:08:47 | * | Quantem quit (Quit: Connection closed for inactivity) |
08:08:49 | * | ak102 quit (Disconnected by services) |
08:08:58 | * | ak102 joined #nim |
08:08:58 | * | ak102 quit (Changing host) |
08:08:58 | * | ak102 joined #nim |
08:14:57 | * | chemist69 quit (Quit: WeeChat 2.0) |
08:20:12 | PMunch | Hmm, I want to echo out a set, but if the set contains whitespace then it breaks the line. Is there a way to show escape characters instead? |
08:42:16 | * | Arrrr joined #nim |
09:03:56 | * | yglukhov joined #nim |
09:10:10 | Araq | repr() it? |
09:11:12 | PMunch | Hmm, doesn't that also show the address? |
09:11:44 | Araq | sure but isn't it for debugging? |
09:12:05 | PMunch | True |
09:12:23 | PMunch | Just did repr and it didn't show the address, so I guess I'm good :) |
09:12:28 | * | Yardanico_ joined #nim |
09:21:53 | * | Yardanico_ quit (Remote host closed the connection) |
09:22:20 | * | Yardanico_ joined #nim |
09:33:08 | * | Yardanico_ quit (Read error: Connection reset by peer) |
09:48:48 | * | SenasOzys joined #nim |
09:50:02 | * | floppydh joined #nim |
09:51:00 | * | yglukhov quit (Remote host closed the connection) |
10:13:08 | * | r3d9u11 joined #nim |
10:14:41 | * | Vladar joined #nim |
10:29:03 | * | Zevv joined #nim |
10:29:21 | Zevv | Hi #Nim. Can I do SSL async http clients in 0.17.2? |
10:29:33 | Zevv | 18-02-22 11:28:09|err|HTTP error: SSL support is not available. Cannot connect over SSL. |
10:30:23 | Zevv | ooow wait, I've been asking before reading again |
10:33:15 | Araq | -d:ssl |
10:33:34 | Zevv | yeah :) |
10:33:59 | Zevv | as usual, it's just in the manual |
10:40:57 | Araq | the error message could be improved ;-) |
10:41:01 | Araq | @dom96 |
10:49:37 | dom96 | https://github.com/nim-lang/Nim/commit/fb3e460f6d2b1b31b75e8219ff52cacd1a9f5184 |
10:50:05 | dom96 | So I might do a quick Twitch stream today |
10:50:44 | Zevv | nimheroes :) |
10:53:17 | Araq | dom96: thanks. the next time please remove the copy&paste |
10:54:07 | dom96 | Sure, I did it quickly on GitHub.com |
10:57:38 | * | Senketsu_ joined #nim |
10:58:14 | * | pwntus_ joined #nim |
10:58:17 | * | jxy_ joined #nim |
10:58:28 | * | mrshu1 joined #nim |
10:58:36 | * | heinrich5991_ joined #nim |
10:59:12 | * | Senketsu quit (Ping timeout: 264 seconds) |
10:59:12 | * | heinrich5991 quit (Ping timeout: 264 seconds) |
10:59:12 | * | Vladar quit (Ping timeout: 264 seconds) |
10:59:12 | * | jxy quit (Ping timeout: 264 seconds) |
10:59:12 | * | mrshu quit (Ping timeout: 264 seconds) |
10:59:12 | * | pwntus quit (Ping timeout: 264 seconds) |
10:59:12 | * | shodan45 quit (Ping timeout: 264 seconds) |
11:00:38 | * | heinrich5991_ is now known as heinrich5991 |
11:01:40 | * | shodan45 joined #nim |
11:01:43 | PMunch | dom96, what about? |
11:03:52 | * | derlafff quit (Remote host closed the connection) |
11:04:07 | * | derlafff joined #nim |
11:11:52 | dom96 | A little command line app for this API https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/ |
11:20:31 | PMunch | Oh cool |
11:21:08 | dom96 | figured it'd be a good little tutorial |
11:22:19 | PMunch | Yeah, both a fun result and a nice way to showcase Nim :) |
11:22:37 | PMunch | What are you going to use for the SHA-1 hashing? |
11:23:16 | * | shodan45_ joined #nim |
11:24:09 | * | shodan45 quit (Ping timeout: 264 seconds) |
11:25:32 | dom96 | Plenty of sha1 packages |
11:25:47 | dom96 | Sadly have to wait until after my lecture :) |
11:26:10 | PMunch | Yeah I know there are plenty, that's why I was wondering which one you'd use :P |
11:26:32 | dom96 | That'll be part of the stream :) |
11:26:54 | PMunch | Haha, okay. I'll try to tune in when it starts :) |
11:27:07 | dom96 | great :) |
11:27:57 | * | yglukhov joined #nim |
11:31:22 | * | Araq_ joined #nim |
11:32:41 | * | Faster-Fanboi_ joined #nim |
11:32:48 | * | SenasOzys quit (Ping timeout: 240 seconds) |
11:34:26 | * | avsej quit (Ping timeout: 264 seconds) |
11:34:27 | * | Araq quit (Ping timeout: 264 seconds) |
11:34:27 | * | Faster-Fanboi quit (Ping timeout: 264 seconds) |
11:35:35 | * | avsej joined #nim |
11:35:35 | * | avsej quit (Changing host) |
11:35:35 | * | avsej joined #nim |
11:39:27 | * | vlad1777d quit (Ping timeout: 240 seconds) |
11:52:44 | * | Quantem joined #nim |
12:02:58 | * | Snircle joined #nim |
12:12:13 | * | SenasOzys joined #nim |
12:24:53 | * | Vladar joined #nim |
12:34:18 | * | krux02 joined #nim |
12:37:08 | krux02 | hello people I am today here with irc, because I feel retro :P |
12:48:40 | FromGitter | <tim-st> Is there an easy way to add a pointer to a `seq` instead of the deep copy? (That was actually the solution to the bug for my question yesterday) |
12:50:50 | * | LyndsySimon quit (Ping timeout: 255 seconds) |
12:53:29 | FromGitter | <tim-st> something like `add*T (s: var seq[T], elem: var T)` |
12:56:40 | * | LyndsySimon joined #nim |
12:59:05 | FromGitter | <tim-st> ok, it seems I can use the type `ref tuple[...]` instead of `tuple[...]`to get it working. |
13:00:25 | krux02 | tim-st: when you pass a value type as an argument. It is normally not copied. |
13:00:39 | * | Arrrr quit (Quit: Leaving.) |
13:01:12 | * | endragor quit (Remote host closed the connection) |
13:01:35 | FromGitter | <krux02> @tim-st: ref types are always allocated at the GC heap, and in my opinion you really need them very rarely (I never used any ref type) |
13:01:40 | * | endragor joined #nim |
13:02:24 | FromGitter | <krux02> `let ptr2seq = myseq.addr` |
13:02:48 | FromGitter | <krux02> proc foobar(arg: seq[T]): T = ... # does not copy the seq it just passet it by reference |
13:02:57 | FromGitter | <tim-st> thx, I didnt meant a ptr to seq but to add elem.addr to seq or soemthing |
13:04:15 | FromGitter | <tim-st> Atm when I do `mySeq.add(myTupleType)` and than do changes on `myTupleType`than this changes are not made in the seq |
13:04:51 | FromGitter | <krux02> yes tuple types are value types |
13:05:22 | FromGitter | <krux02> same as when you have an int and then add the int to the seq |
13:05:37 | FromGitter | <tim-st> thanks, that's the thing I forgot that :( |
13:06:05 | FromGitter | <tim-st> I will rewrite the code a bit to add to seq at the end than; thanks for your help |
13:06:07 | * | endragor quit (Ping timeout: 248 seconds) |
13:06:34 | FromGitter | <krux02> well, I always think about, who owns the tuple. The owner gets the value type and the non-owner get's a reference (I don't mean `ref` here) |
13:07:23 | FromGitter | <krux02> a reference can be a pointer, or an seq index. Don't store pointer to seq members, because the pointer get invalidadet when you append to the seq. |
13:07:26 | FromGitter | <tim-st> hm, but when I rethink about it, I always passed it as `var MyTupleType` to proc and I could do changes on it |
13:07:47 | FromGitter | <krux02> that's fine |
13:08:00 | FromGitter | <tim-st> but why not on seq? |
13:08:22 | FromGitter | <krux02> even if you pass it as `MyTupleType` to a proc, it is passed internally equally with a pointer for performance reasons |
13:09:26 | * | endragor joined #nim |
13:09:30 | FromGitter | <krux02> var mySeq = @[123] ⏎ let intptr = mySeq[0].addr ⏎ mySeq.add(456) ⏎ echo intptr[] # <- segfault [https://gitter.im/nim-lang/Nim?at=5a8ec10ae4ff28713ab0af24] |
13:10:37 | FromGitter | <krux02> the memory is allocated sequentially. as soon as the internal memory needs to grow, the entire memory is reallocated and all members are copied to the new memory location. |
13:11:01 | FromGitter | <krux02> Meaning all pointers to the seq members that still exist at this time are invalid. |
13:11:16 | FromGitter | <tim-st> I know how that works, the memory doesnt grow in my use case |
13:11:53 | FromGitter | <tim-st> I will just pass the tuple after the last change to the seq, that's a bit more difficult but I dont see an other way |
13:11:54 | FromGitter | <krux02> well I don't know you use case |
13:12:13 | FromGitter | <nitely> @tim-st you can use `mitems` and `mpairs` to modify the seq items |
13:12:29 | FromGitter | <krux02> I have a habit to not modify my objects anymore after initialization. |
13:12:50 | FromGitter | <krux02> it minimizes state changes and that helps a lot to prevent bugs |
13:13:00 | FromGitter | <tim-st> @nitely Thanks, I saw that in source code, but it has bad runtime for my use case |
13:13:25 | FromGitter | <krux02> to be honest I don't fully understand what you want to do |
13:13:27 | FromGitter | <nitely> and using refs is faster? |
13:13:46 | * | endragor quit (Ping timeout: 256 seconds) |
13:13:55 | FromGitter | <tim-st> didnt try so far, that would break a lot of code or needed changes |
13:14:07 | FromGitter | <krux02> well in my opinion refs makes you dependent on the GC and the GC is not for free. |
13:14:57 | FromGitter | <nitely> ref items are likely less error prone. But I doubt it's any faster |
13:15:06 | FromGitter | <krux02> not that it really matters at the moment because the GC is there if you want or not (seq and strings already require it) |
13:15:38 | FromGitter | <krux02> refs are more memory intensive :P |
13:16:43 | FromGitter | <krux02> and pointer indirection causes cache misses, meaning slower code execution |
13:19:59 | Araq_ | krux02: the C++ solution is not much better. refcounting can lead to destructor cascades and stack overflows |
13:21:06 | Araq_ | actually both shared_ptr and unique_ptr share these problems |
13:21:06 | FromGitter | <nitely> @tim-st to modify a single item you can create a proc that takes a `var myTuple` and pass it like `mySeq[i]` |
13:21:22 | FromGitter | <nitely> I wonder if there is a way to do that in-place, mmmh... |
13:22:20 | Araq_ | turns out these "smart" pointers are really not that smart at all |
13:22:44 | Araq_ | because they can only do some local reasoning |
13:23:20 | krux02 | well anything that is called `smart` in programming is really not that smart. |
13:23:46 | krux02 | it's a very confusing term in my opinion, because it also doesn't mention at all what problem it tries to solve. |
13:23:50 | FromGitter | <nitely> @tim-st well there is `mySeq[i].field1 = x`, `mySeq[i].field2 = y`, etc |
13:24:10 | * | tongir joined #nim |
13:24:27 | * | Araq_ is now known as Araq |
13:24:55 | Araq | krux02: the problem is when you have a tree structures or graphs |
13:26:23 | Araq | there are no good ways to model these without some "smart" pointers |
13:27:08 | krux02 | my graphs are always stored flat, like `var nodes: seq[Node], edges: seq[(a,b: int)]` but I get the point |
13:27:54 | Araq | flat is cumbersome to work with but all around the best thing you can do. |
13:29:07 | Araq | unfortunately my compiler doesn't use flat data structures |
13:29:12 | krux02 | and I have a macro to generate all the navagation procs for that specific graph types so that it is not cumbersome to work with :D |
13:31:26 | dom96 | That sure is a strange fibonacci Nim implementation: https://news.ycombinator.com/item?id=16437177 |
13:32:23 | krux02 | https://gist.github.com/bcebfc3e9443b485e9d24f4f61668416 |
13:32:48 | Araq | dom96: it's fib in closed form |
13:33:16 | dom96 | I provided a translation of Go in any case |
13:33:55 | FromGitter | <alehander42> @dom96 Ithink that's the math formula |
13:34:09 | Araq | http://mathworld.wolfram.com/BinetsFibonacciNumberFormula.html |
13:34:35 | dom96 | Fun |
13:34:56 | Araq | we proved it in university iirc, fun with generating functions or whatever they are called in English |
13:35:02 | FromGitter | <alehander42> ironically that's probably the fastest solution of all of them :D |
13:35:21 | FromGitter | <krux02> well, not for small numbers. |
13:35:21 | FromGitter | <alehander42> yeah, recurrence relations I think |
13:35:30 | FromGitter | <krux02> but much faster than the recursive implementation |
13:35:31 | FromGitter | <alehander42> yeah, for bigger N ofc |
13:35:46 | Araq | alehander42: the iterative integer version is probably fastest |
13:36:02 | Araq | it only sums stuff in a loop |
13:36:26 | Araq | and sqrt() stuff hides more loops |
13:36:37 | Araq | and is prone to rounding problems |
13:37:07 | Araq | but yeah it's weird that this formula full of real numbers always produces natural numbers |
13:37:23 | FromGitter | <andreaferretti> the fastest version is probably an array where you store all Fibonacci numbers that fit into an int64 |
13:37:33 | FromGitter | <andreaferretti> there are not so many of them after all |
13:37:46 | tongir | Araq: Hey mate, I read in the c2nim user manual that the C "##" preprocessor can't be translated. Is that still the case? |
13:37:48 | FromGitter | <alehander42> well sqrt(5.0) can be potentially executed on compile time |
13:38:33 | tongir | Whoops, nevermind. Just stumbled on some forum posts that say it is supported now |
13:38:49 | Araq | good point but the x^n is a loop too |
13:39:02 | Araq | tongir: I doubt it works well :-) |
13:39:26 | Araq | but you can sometimes run GCC's preprocessor and then c2nim the result |
13:39:50 | FromGitter | <andreaferretti> there was a project to simplify generating stuff with c2nim |
13:39:58 | FromGitter | <andreaferretti> a sort of c2nim preprocessor |
13:40:11 | FromGitter | <andreaferretti> https://github.com/genotrance/nimgen |
13:41:27 | Araq | is it a preprocessor or a postprocessor? |
13:42:11 | tongir | Araq: Oh cool, I might give that a whirl. Preprocessor I'm pretty sure |
13:42:33 | tongir | andreaferretti: Nice, will check it out, thanks |
13:43:25 | Araq | krux02: can you share these accessor generators? |
13:44:11 | * | endragor joined #nim |
13:44:12 | Araq | btw |
13:44:15 | Araq | type 'tyObject_HashSet_J1RbOJyRcRl1E5zDK6YKcQ' (aka 'struct |
13:44:15 | Araq | tyObject_HashSet_J1RbOJyRcRl1E5zDK6YKcQ') |
13:44:42 | Araq | from clang is not a really good error message |
13:47:02 | dom96 | report it :P |
13:47:07 | crem | why? |
13:47:37 | crem | tyObject_HashSet_J1RbOJyRcRl1E5zDK6YKcQ and struct tyObject_HashSet_J1RbOJyRcRl1E5zDK6YKcQ are identifiers from different namespaces. |
13:47:46 | Araq | because I don't give a fuck about X vs struct X differences. |
13:48:11 | Araq | it's just noise |
13:48:35 | * | endragor quit (Ping timeout: 255 seconds) |
13:49:47 | FromGitter | <krux02> Araq: https://gist.github.com/ead328968f7aa60859864cccd138dca0 |
13:49:47 | crem | Ok, maybe. Is there some small code snippet to reproduce that? |
13:51:52 | Araq | crem: not sure but clang often emits 'aka' |
13:53:04 | crem | So, do you think it's useless only when stuct and non-struct have the same name, or even when they are different? |
13:53:05 | * | Cthalupa- quit (Ping timeout: 255 seconds) |
13:53:26 | crem | If it's typedef struct A {} B; error "type B (aka struct A)" is also noise? |
13:54:28 | Araq | my compiler doesn't produce typedef struct A {} B; |
13:55:54 | crem | But it produces typedef struct A {} A; ? I want to understand what exactly is wrong with clang, in your opinion. |
13:55:59 | * | Cthalupa joined #nim |
13:56:11 | FromGitter | <krux02> crem: It's a pattern in C. In C when you want to use the struct type A you actually have to use `struct A` that's annoying and therefore everybody just typedefs `A` as `struct A`. but typedefs can have valuable information when it is not clear what they mean. But in my opinion the language doesn't distinct between `A` and `struct A` anymore, so I think it's ok to just relove to the and of the typedef chan and just print |
13:56:12 | FromGitter | ... out that. |
13:56:33 | Araq | crem: yes. |
13:57:05 | FromGitter | <krux02> Araq: do you not generate typedefs for structs? |
13:57:14 | crem | So, only A (aka struct A) is wrong, but A (aka B) is actually useful, correct? |
13:57:21 | Araq | typedef struct A A; |
13:57:27 | Araq | struct A { ... }; |
13:57:32 | Araq | is produced by Nim |
13:57:44 | FromGitter | <krux02> ah, ok. |
13:57:54 | FromGitter | <krux02> that is semantically the same to me. |
13:57:57 | Araq | crem: I guess. |
13:58:31 | * | xkapastel joined #nim |
14:00:32 | Araq | krux02: that is superb |
14:00:38 | Araq | connectivity: |
14:00:38 | Araq | Publication * .. 1 Publisher |
14:00:38 | Araq | Publication * .. * Project |
14:00:40 | Araq | Publication * .. 1 Outlet |
14:00:54 | Araq | want to write an article about your graph DSL? |
14:01:11 | * | SenasOzys quit (Ping timeout: 276 seconds) |
14:02:34 | dom96 | ooh, that is really nice |
14:02:45 | dom96 | There is always room on nim-lang.org for articles |
14:02:58 | dom96 | That goes for anybody |
14:03:26 | PMunch | I'm gonna write something when I'm done with combparser/protobuf |
14:03:39 | PMunch | And hopefully I'll remember to do the FOSDEM recap tonight :P |
14:03:56 | dom96 | Shall I remind you? :P |
14:04:26 | PMunch | Please do :) |
14:04:33 | PMunch | I'm horrible at remembering stuff |
14:04:57 | FromGitter | <alehander42> I wanted to write an article comparing Nim with typescript *after* I finish a new version of dts2nim and collect some translated definitions, but I think it's more suitable for a personal blog :D (comparing directly with another lang) |
14:05:02 | PMunch | Well, I remember information just fine. But remembering to do stuff I'm horrible at |
14:09:37 | FromGitter | <krux02> Araq: if you want to, I just like to make things look nice with macros |
14:09:53 | FromGitter | <krux02> I am abusing the parser a bit an that syntax |
14:10:20 | Araq | agreed but it's cool anyway |
14:11:17 | * | SenasOzys joined #nim |
14:12:36 | FromGitter | <krux02> when I made that syntax I never thougt that the parser would accept it, but the parser does parse it and it is an a usable format. |
14:21:33 | * | NimBot joined #nim |
14:22:32 | * | athenot quit (Remote host closed the connection) |
14:22:53 | Zevv | The nre manual shows this as an example: |
14:22:54 | Zevv | "abc".match(re"(\w)").captures[0] == "a" |
14:23:03 | * | athenot joined #nim |
14:23:08 | Zevv | but I get |
14:23:08 | Zevv | Error: type mismatch: got (Option[nre.RegexMatch]) |
14:23:18 | Zevv | what am I doing wrong? |
14:24:28 | * | MJCaley joined #nim |
14:24:40 | dom96 | try .get().captures[0] |
14:25:05 | dom96 | Which reminds me |
14:25:14 | dom96 | Araq: Are we removing nre from stdlib? |
14:25:59 | Zevv | what will be the obvious replacement for nre then? |
14:26:04 | dom96 | re |
14:26:23 | Zevv | ok |
14:31:25 | Araq | dom96: yes but in the long run we need to adopt nitely's native Nim regex implementation |
14:32:03 | dom96 | of course |
14:32:07 | dom96 | this is all about the API |
14:36:11 | * | gokr quit (Ping timeout: 256 seconds) |
14:38:05 | dom96 | Starting in around 5 minutes. Tea first :) https://www.twitch.tv/d0m96 |
14:41:15 | * | jackprob joined #nim |
14:41:37 | jackprob | do I understand it right, that I can write my code in nim, compile it to C and then also use it as C library? |
14:41:54 | jackprob | which means I have good interoparability with everything that C has good interoparability with? |
14:59:54 | PMunch | jackprob, more or less |
15:00:50 | PMunch | https://gradha.github.io/articles/2015/01/writing-c-libraries-with-nim.html |
15:01:07 | PMunch | That might be a bit dated, from 2015 I think |
15:10:55 | * | floppydh quit (Ping timeout: 248 seconds) |
15:20:58 | federico3 | an updated tutorial would help :) |
15:21:07 | * | r3d9u11 quit (Remote host closed the connection) |
15:24:01 | * | miran joined #nim |
15:25:32 | jackprob | thanks :) |
15:31:52 | * | gokr joined #nim |
15:34:00 | * | floppydh joined #nim |
15:37:03 | * | MJCaley quit (Quit: MJCaley) |
15:50:40 | * | arecacea1 quit (Remote host closed the connection) |
15:50:45 | * | dddddd joined #nim |
15:50:59 | * | arecacea1 joined #nim |
16:00:01 | * | gokr quit (Ping timeout: 248 seconds) |
16:01:03 | * | tongir quit (Ping timeout: 248 seconds) |
16:09:34 | * | Zevv left #nim ("Thanks again") |
16:09:57 | * | MJCaley joined #nim |
16:16:27 | * | floppydh quit (Quit: WeeChat 2.0.1) |
16:22:02 | * | PMunch quit (Quit: Leaving) |
16:25:06 | * | r3d9u11 joined #nim |
16:25:26 | * | natrys joined #nim |
16:49:52 | * | yglukhov quit (Remote host closed the connection) |
16:55:05 | * | MJCaley quit (Quit: MJCaley) |
16:56:13 | * | MJCaley joined #nim |
16:58:07 | * | Trustable joined #nim |
17:20:23 | * | yglukhov joined #nim |
17:24:57 | * | yglukhov quit (Ping timeout: 264 seconds) |
17:32:32 | * | SenasOzys quit (Ping timeout: 255 seconds) |
17:37:33 | * | douglascorrea joined #nim |
17:42:48 | * | SenasOzys joined #nim |
17:43:33 | * | r3d9u11 quit (Ping timeout: 264 seconds) |
17:46:44 | * | krux02 quit (Remote host closed the connection) |
17:50:22 | FromGitter | <Bennyelg> Iterate over Table[string, string] ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a8f02de35dd17022ede0614] |
17:50:35 | * | Quantem_ joined #nim |
17:52:58 | * | MJCaley quit (Quit: MJCaley) |
17:55:36 | FromGitter | <Bennyelg> oh it's pairs |
17:55:41 | FromGitter | <Bennyelg> sorry :| |
18:12:04 | dom96 | Here is the livestream: https://www.youtube.com/watch?v=Di2O_lIPxb4 :) |
18:15:37 | * | PMunch joined #nim |
18:24:14 | * | douglascorrea quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:30:56 | * | yglukhov joined #nim |
18:35:11 | * | yglukhov quit (Ping timeout: 248 seconds) |
18:40:05 | miran | dom96: post it on reddit (if you didn't already), to get some activity in nim sub.... |
18:40:26 | dom96 | Feel free to post it :) |
18:41:01 | miran | well, you're the author, and you are usually active on reddit ;) |
18:41:48 | dom96 | The more users post stuff there the better ;) |
18:44:04 | * | Quantem_ quit (Ping timeout: 260 seconds) |
18:50:00 | GitDisc | <LePrasson> Hi there |
18:50:24 | Araq | hi |
18:50:44 | GitDisc | <LePrasson> can someone help me? I'm looking for a lib for telnet connections, it exist ? |
18:51:56 | * | aphyrnim joined #nim |
18:52:16 | GitDisc | <LePrasson> can someone help me? I'm looking for a lib for telnet connections, it exist ? |
18:52:40 | GitDisc | <LePrasson> whoops, sorry for double posting |
18:53:30 | PMunch | https://forum.nim-lang.org/t/841 |
18:55:15 | PMunch | Or you could try wrapping this: https://github.com/seanmiddleditch/libtelnet |
18:56:08 | PMunch | Or port something like this: https://l3net.wordpress.com/2012/12/09/a-simple-telnet-client/ |
18:56:41 | GitDisc | <LePrasson> thank you! |
18:57:05 | PMunch | No problem, unfortunately not a Nim solution. But hopefully it will help you on your way :) |
19:03:18 | * | athenot quit (Remote host closed the connection) |
19:03:48 | * | athenot joined #nim |
19:10:39 | Araq | huh? net.nim in the stdlib? |
19:13:49 | * | Jesin joined #nim |
19:19:25 | PMunch | Araq, well yeah. But it doesn't include any Telnet specific stuff |
19:19:41 | Araq | what would that be? |
19:19:50 | Araq | we have readLine for sockets |
19:20:11 | PMunch | https://tools.ietf.org/html/rfc854 |
19:20:20 | PMunch | A high-level wrapper around this stuff |
19:20:28 | PMunch | It's not much, but it is a protocol |
19:20:33 | dom96 | Araq: Why is there a std/sha1 module? |
19:20:46 | dom96 | specifically, why is it in a 'std' directory? |
19:20:55 | * | douglascorrea joined #nim |
19:21:06 | Araq | because new stdlib modules all end up 'std' |
19:21:28 | dom96 | why? |
19:21:28 | PMunch | Why? |
19:21:29 | Araq | sha1 is a common name |
19:21:57 | Araq | and not everybody follows the import $nimblePkg / sha1 rule |
19:23:14 | dom96 | sha1 will only conflict with the 'sha1' package: https://github.com/onionhammer/sha1 |
19:24:01 | Araq | dom96: yuriy reported the conflict for his large code base |
19:24:06 | dom96 | Putting all new module into 'std' will turn the stdlib into a mess |
19:24:09 | dom96 | *modules |
19:24:34 | Araq | no, import std / [foo, bar, baz] is how it is supposed to work |
19:24:40 | Araq | what's messy about it? |
19:25:07 | dom96 | Why do we need a std/sha1 when we have securehash? |
19:25:24 | Araq | we had an RFC |
19:25:37 | dom96 | Random modules will only be importable via 'import std/' |
19:25:42 | Araq | we needed to rename securehash to sha1 because of consistency |
19:26:57 | Araq | random.nim caused the same conflicts back then when we introduced it |
19:27:11 | Araq | I don't understand your remark. |
19:27:27 | dom96 | which is why we introduced the optional disambiguation syntax: import std/random |
19:27:53 | dom96 | The problem was that you couldn't import the 'random' from the stdlib |
19:28:08 | dom96 | Not the other way around, right? |
19:28:42 | Araq | I don't know if nimble packages have priority over stdlib modules or not |
19:28:48 | Araq | I think stdlib comes first |
19:29:01 | * | r3d9u11 joined #nim |
19:29:01 | Araq | so it also was a problem to say "not the stdlib random" |
19:31:33 | dom96 | So is there now a way to import something explicitly from Nimble? |
19:32:52 | Araq | it's |
19:32:55 | * | pyrmalthakon joined #nim |
19:33:01 | Araq | packagee / [stuff] |
19:33:02 | Araq | vs |
19:33:07 | Araq | std / [stuff] |
19:33:36 | Araq | the old things like strutils continue to work without the std/ so that not every Nim program ever written is broken |
19:34:02 | dom96 | It's not 'random/random' for the random package |
19:34:04 | dom96 | it's just 'random' |
19:34:06 | dom96 | So how can that work? |
19:34:15 | Araq | import std / random |
19:34:20 | dom96 | no |
19:34:24 | dom96 | How can I import the Nimble package |
19:34:26 | dom96 | ? |
19:34:33 | * | aphyrnim quit (Ping timeout: 264 seconds) |
19:34:48 | dom96 | How can I tell the compiler to explicitly import the random Nimble package? |
19:34:53 | Araq | hmmm |
19:35:13 | dom96 | If the stdlib comes first then this doesn't solve a thing |
19:35:14 | Araq | never occured to me we have nimble packages without a directory |
19:35:27 | dom96 | :/ |
19:36:54 | Araq | should we introduce import nimble / random ? |
19:37:51 | Araq | or maybe we change the order so that nimble packages are preferred, meh |
19:38:10 | Araq | import random was never a good idea to begin with |
19:38:39 | Araq | well I'm open to suggestions |
19:38:45 | dom96 | The order is codified in my book :) |
19:38:57 | Araq | so tell me, what is the order? |
19:39:01 | Araq | :-) |
19:39:15 | dom96 | stdlib then nimble |
19:39:23 | * | yglukhov joined #nim |
19:39:53 | Araq | as I remember it, ok. |
19:40:02 | Araq | yglukhov: we need you. ;-) |
19:40:16 | dom96 | let me double check my book |
19:40:17 | * | Jesin quit (Quit: Leaving) |
19:42:05 | dom96 | hrm, actually my book doesn't explicitly show the order |
19:43:40 | * | Jesin joined #nim |
19:44:01 | * | yglukhov quit (Ping timeout: 248 seconds) |
19:44:13 | dom96 | but nimble-first order would be weird IMO |
19:44:27 | dom96 | I thought the idea was always to provide some way to disambiguate between these |
19:44:40 | dom96 | to tell the compiler "I want you to look for a Nimble package" |
19:46:41 | * | poopBotTelefon joined #nim |
19:50:45 | PMunch | Hmm, I've completely forgotten most of the questions I wanted to go through for my post :( |
19:54:51 | * | r3d9u11 quit (Remote host closed the connection) |
19:58:44 | * | r3d9u11 joined #nim |
20:01:53 | FromGitter | <Vindaar> Hm, I tried to implement the getPassword() proc without using getch(). Instead using readLine and changing the style of the terminal. In principle it works fine, but dealing with SIGINT is problematic. Either one is left with an invisible stack trace of SIGINT and (even worse) the password written in plain text (just invisible). Or I use setControlCHook, which seems to enable the hook globally in the program. I don't |
20:01:53 | FromGitter | ... see a way to only temporarily change the Ctrl-C hook? |
20:02:34 | * | endragor joined #nim |
20:02:42 | dom96 | setControlCHook at the end of getPassword maybe? |
20:03:48 | FromGitter | <Vindaar> I need to call setControlCHook before calling readLine. Otherwise it has no effect. But once called, I can't turn it off again |
20:05:31 | dom96 | Can't you just call setControlCHook(nil)? |
20:05:58 | * | r3d9u11 quit (Remote host closed the connection) |
20:06:35 | dom96 | hrm, it wants 'not nil' |
20:06:42 | FromGitter | <Vindaar> exactly |
20:06:55 | dom96 | PMunch: Remember to write :) |
20:07:15 | FromGitter | <Vindaar> This is what it looks like atm: https://gist.github.com/Vindaar/f5cb17a6c47f6d4cdf3a4995ce2bf3ae |
20:07:33 | * | endragor quit (Ping timeout: 264 seconds) |
20:08:08 | * | TK__ joined #nim |
20:09:26 | * | Quantem left #nim (#nim) |
20:09:33 | PMunch | dom96, I'm trying to right now :) |
20:09:46 | PMunch | But I kinda forgot a lot of the stuff I was going to write about :( |
20:10:54 | * | TK__ quit (Client Quit) |
20:15:19 | * | jackprob quit (Remote host closed the connection) |
20:15:31 | * | jackprob joined #nim |
20:31:26 | * | Vladar quit (Quit: Leaving) |
20:33:57 | * | sz0 joined #nim |
20:36:14 | shodan45_ | what other language uses "&" for string concat? I know there's one, can't think of it.... |
20:36:40 | PMunch | Ada |
20:36:45 | PMunch | AppleScript |
20:37:01 | PMunch | Cobol |
20:37:17 | PMunch | Modula-3 |
20:37:38 | PMunch | TI-89 BASIC :P |
20:37:48 | PMunch | VB.NET |
20:37:48 | shodan45_ | ohh was it basic I was thinking of? |
20:37:56 | PMunch | VBA |
20:38:19 | PMunch | Not regular basic though |
20:38:37 | PMunch | By the way I'm not crazy, just did a search for & here: https://rosettacode.org/wiki/String_concatenation |
20:38:38 | PMunch | :P |
20:39:27 | * | Jesin quit (Quit: Leaving) |
20:39:27 | shodan45_ | .... |
20:39:31 | shodan45_ | PMunch: thanks |
20:39:37 | PMunch | No problem :P |
20:42:40 | * | yglukhov joined #nim |
20:42:58 | * | Jesin joined #nim |
20:47:05 | * | yglukhov quit (Ping timeout: 240 seconds) |
20:48:17 | * | athenot quit (Ping timeout: 255 seconds) |
20:48:57 | * | athenot joined #nim |
21:00:35 | * | shodan45_ quit (Remote host closed the connection) |
21:01:05 | * | shodan45 joined #nim |
21:05:17 | * | douglascorrea quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:10:40 | Araq | I took it from Modula 3 |
21:11:16 | * | athenot quit (Read error: Connection reset by peer) |
21:12:41 | * | athenot joined #nim |
21:13:06 | * | rokups quit (Quit: Connection closed for inactivity) |
21:13:33 | PMunch | Araq, are you fine with me using this photo for my Nim at FOSDEM post: https://uploads.peterme.net/nimstand.png? |
21:14:11 | PMunch | If anyone wants to proof-read or give me input by the way my draft can be found here: https://uploads.peterme.net/Documents/nim_fosdem.txt |
21:14:35 | miran | PMunch: link doesn't work |
21:14:44 | PMunch | Oh woops |
21:14:45 | Araq | ok whatever |
21:14:59 | PMunch | https://uploads.peterme.net/nim_fosdem.txt |
21:15:21 | PMunch | My script apparently didn't understand "up Documents/nim_fosdem.txt" very well :P |
21:15:40 | PMunch | Araq, sure? I can make another one if you're not okay with it :) |
21:16:08 | dom96 | That's a nice photo |
21:17:32 | PMunch | Haha, thanks. Feel free to re-use it |
21:17:51 | miran | PMunch: i would probably add some commas here and there, but i might be using more commas than normal for english language |
21:18:09 | PMunch | It's the one photo I took on the left (where everyone shuffled out of frame :P) and the right I think is one you posted on Telegram |
21:19:01 | PMunch | miran, yeah I actually haven't read through it yet so it might not be the best flow :P |
21:19:57 | dom96 | I like what you've written. Maybe we should use this as the recap article? :) |
21:20:22 | dom96 | It's good to add some variety to the authors of our blog posts |
21:22:19 | * | yglukhov joined #nim |
21:23:52 | shodan45 | PMunch: lot's should be lots |
21:24:14 | PMunch | Good catch! |
21:24:59 | shodan45 | PMunch: "seen been" |
21:26:10 | shodan45 | lol... (note to ourselves: include something on the stand saying "programming language") |
21:26:34 | * | miran quit (Quit: Konversation terminated!) |
21:26:44 | * | yglukhov quit (Ping timeout: 252 seconds) |
21:26:49 | PMunch | Yeah, we realised that at the stand |
21:26:54 | shodan45 | PMunch: "having being" |
21:26:57 | FromGitter | <Vindaar> PMunch: "Running Nim on such ⏎ microcontrollers actually have some further benefits" ⏎ ⏎ 1) in the previous sentence you write micro-controllers ⏎ 2) have -> has [https://gitter.im/nim-lang/Nim?at=5a8f35a16fba1a703a8abc79] |
21:27:01 | PMunch | People looked very confused and came up asking that question |
21:27:18 | * | athenot_ joined #nim |
21:27:35 | * | athenot quit (Ping timeout: 255 seconds) |
21:28:24 | shodan45 | PMunch: "While Nim is described as a systems and applications language" [add comma?] |
21:29:49 | PMunch | Thanks, Vindaar |
21:30:34 | PMunch | shodan45, hmm, not too sure about that comma.. |
21:33:23 | shodan45 | "Q: Speaking of libraries, does Nim support X?" - I first thought you meant X11 :) |
21:33:38 | PMunch | Haha, maybe change it to X or Y? |
21:33:50 | shodan45 | hm, maybe |
21:33:52 | PMunch | Or "library X" |
21:36:57 | shodan45 | or change X to foo |
21:37:55 | PMunch | That's a nice option |
21:38:22 | FromGitter | <data-man> @PMunch: XXX :D |
21:39:56 | PMunch | And we're live: https://peterme.net/nim-at-fosdem-frequently-asked-questions.html |
21:41:17 | * | nsf quit (Quit: WeeChat 2.0.1) |
21:42:07 | PMunch | Oh crap, I forgot to mention the distinct types and stuff |
21:43:44 | dom96 | oh I guess that's a no |
21:43:53 | dom96 | no worries |
21:44:01 | PMunch | Huh? |
21:45:26 | dom96 | I was thinking we could post what you've written as the recap article on nim-lang.org |
21:45:44 | PMunch | Sure :) |
21:46:24 | GitDisc | <LePrasson> is there a native function to print ascii value of an integer ? |
21:46:37 | GitDisc | <LePrasson> I mean, to print the character |
21:46:48 | dom96 | I'm happy to write a bit and just link to your article, might be a good way forward now since you've published it on your blog already :) |
21:47:26 | * | athenot joined #nim |
21:47:52 | * | athenot_ quit (Ping timeout: 260 seconds) |
21:48:12 | * | Trustable quit (Remote host closed the connection) |
21:50:18 | PMunch | LePrasson, 5.char? |
21:50:26 | PMunch | Well 5 is a bad example |
21:50:28 | PMunch | 32.char |
21:50:42 | PMunch | That is the character ' ' |
21:51:17 | GitDisc | <LePrasson> oh, thanks |
21:52:07 | PMunch | What it actually does is just cast it to a char and print that |
21:54:29 | PMunch | Okay, shimmied in a question on the type stuff now :P |
21:59:45 | PMunch | https://www.reddit.com/r/programming/comments/7zird1/nim_at_fosdem_frequently_asked_questions/ |
21:59:58 | PMunch | https://www.reddit.com/r/nim/comments/7zim30/nim_at_fosdem_frequently_asked_questons/ |
22:00:08 | PMunch | If you want to help with visibility |
22:00:14 | PMunch | I'm off to bed now, night! |
22:00:23 | dom96 | Thanks for writing! |
22:00:30 | PMunch | No problem :) |
22:00:36 | * | PMunch quit (Quit: leaving) |
22:10:04 | FromGitter | <mratsim> upvoted |
22:16:31 | GitDisc | <Lite5h4dow> just wondering if someone could explain how streams work |
22:16:44 | GitDisc | <Lite5h4dow> ive been reading the documents but i dont think i understand it |
22:17:14 | GitDisc | <Lite5h4dow> specifically the read line function |
22:18:31 | GitDisc | <LePrasson> @PMunch I don't find this on documentation |
22:19:13 | GitDisc | <LePrasson> I'm trying to do something like "blabla".int, to convert it into ascii values of each letter |
22:20:45 | GitDisc | <Lite5h4dow> i think your looking for this @LePrasson https://nim-lang.org/docs/strutils.html |
22:21:02 | GitDisc | <Lite5h4dow> unless i missunderstand what yourtrying to do |
22:21:43 | GitDisc | <Lite5h4dow> unless i miss understand what your trying to do |
22:21:51 | GitDisc | <LePrasson> yes exactly |
22:21:53 | GitDisc | <LePrasson> thanks |
22:22:02 | GitDisc | <Lite5h4dow> no problem 😄 |
22:27:44 | FromGitter | <Vindaar> If you simply want a seq[int] of your string, where int is the ascii code as decimal -> ⏎ `` ⏎ let m = "blabla" ⏎ var ascii: seq[int] = @[] ⏎ for c in m: ... [https://gitter.im/nim-lang/Nim?at=5a8f43e0888332ee3abcc5b0] |
22:37:06 | * | sz0 quit (Quit: Connection closed for inactivity) |
22:38:31 | * | MJCaley joined #nim |
22:39:11 | GitDisc | <Lite5h4dow> is there anyone willing to tell me how streams work? >.< |
22:39:19 | GitDisc | <Lite5h4dow> im super confused |
22:39:32 | dom96 | what are you confused about? :) |
22:41:31 | * | pyrmalthakon quit (Quit: Konversation terminated!) |
22:41:45 | GitDisc | <Lite5h4dow> well i dont know what they do xD |
22:41:54 | GitDisc | <Lite5h4dow> for starters |
22:43:43 | * | natrys quit (Quit: natrys) |
22:48:37 | * | douglascorrea joined #nim |
22:52:12 | GitDisc | <Lite5h4dow> the documentation just assumes that you know what it does and how to use the procs |
22:52:24 | GitDisc | <Lite5h4dow> i just want to read all the lines in a document |
22:52:34 | GitDisc | <Lite5h4dow> and then write them back again later |
22:52:54 | * | endragor joined #nim |
22:54:22 | GitDisc | <Lite5h4dow> but since i dont know what streams actually do i dont understand how to use them |
22:57:21 | * | endragor quit (Ping timeout: 264 seconds) |
22:58:32 | dom96 | Lite5h4dow: You don't even need streams for that. |
22:58:38 | GitDisc | <Lite5h4dow> i dont? |
22:58:50 | dom96 | No, you can just use the readFile and writeFile procedures |
22:59:19 | GitDisc | <Lite5h4dow> but i need to read them line by line so i can write it to Nigui's text box |
22:59:28 | dom96 | I'm pretty sure I've already given you a link to this: https://rosettacode.org/wiki/File_input/output#Nim |
22:59:37 | dom96 | It shows how to read line by line |
22:59:54 | GitDisc | <Lite5h4dow> ah right |
23:00:07 | GitDisc | <Lite5h4dow> i could have sworn someone told me to use streams |
23:01:23 | dom96 | Perhaps |
23:01:29 | dom96 | You can achieve the same thing using streams |
23:01:36 | dom96 | but it's slightly more complex |
23:02:07 | GitDisc | <Lite5h4dow> oh ok |
23:02:13 | GitDisc | <Lite5h4dow> but for future reference |
23:02:20 | GitDisc | <Lite5h4dow> what do streams actually do? |
23:02:30 | GitDisc | <Lite5h4dow> incase i find a use for them |
23:03:14 | dom96 | They offer an interface that can be implemented for stream-like functionality |
23:03:29 | GitDisc | <Lite5h4dow> o.o |
23:03:42 | dom96 | Just don't worry about them for now |
23:03:48 | GitDisc | <Lite5h4dow> right ok xD |
23:03:56 | GitDisc | <Lite5h4dow> ill look into them another time |
23:04:06 | dom96 | You will only ever need them if another module requires them |
23:04:28 | dom96 | I never really use them |
23:04:39 | GitDisc | <Lite5h4dow> like nimYAML? |
23:08:38 | * | gangstacat quit (Quit: Ĝis!) |
23:19:03 | * | gangstacat joined #nim |
23:27:49 | * | jackprob quit (Remote host closed the connection) |
23:28:01 | * | jackprob joined #nim |
23:42:57 | * | jackprob quit (Ping timeout: 248 seconds) |
23:48:26 | * | douglascorrea quit (Read error: Connection reset by peer) |
23:59:14 | * | vlad1777d joined #nim |