<< 22-02-2018 >>

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:12PMunchHmm, 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:10Araqrepr() it?
09:11:12PMunchHmm, doesn't that also show the address?
09:11:44Araqsure but isn't it for debugging?
09:12:05PMunchTrue
09:12:23PMunchJust 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:21ZevvHi #Nim. Can I do SSL async http clients in 0.17.2?
10:29:33Zevv18-02-22 11:28:09|err|HTTP error: SSL support is not available. Cannot connect over SSL.
10:30:23Zevvooow wait, I've been asking before reading again
10:33:15Araq-d:ssl
10:33:34Zevvyeah :)
10:33:59Zevvas usual, it's just in the manual
10:40:57Araqthe error message could be improved ;-)
10:41:01Araq@dom96
10:49:37dom96https://github.com/nim-lang/Nim/commit/fb3e460f6d2b1b31b75e8219ff52cacd1a9f5184
10:50:05dom96So I might do a quick Twitch stream today
10:50:44Zevvnimheroes :)
10:53:17Araqdom96: thanks. the next time please remove the copy&paste
10:54:07dom96Sure, 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:43PMunchdom96, what about?
11:03:52*derlafff quit (Remote host closed the connection)
11:04:07*derlafff joined #nim
11:11:52dom96A little command line app for this API https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/
11:20:31PMunchOh cool
11:21:08dom96figured it'd be a good little tutorial
11:22:19PMunchYeah, both a fun result and a nice way to showcase Nim :)
11:22:37PMunchWhat 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:32dom96Plenty of sha1 packages
11:25:47dom96Sadly have to wait until after my lecture :)
11:26:10PMunchYeah I know there are plenty, that's why I was wondering which one you'd use :P
11:26:32dom96That'll be part of the stream :)
11:26:54PMunchHaha, okay. I'll try to tune in when it starts :)
11:27:07dom96great :)
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:08krux02hello people I am today here with irc, because I feel retro :P
12:48:40FromGitter<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:29FromGitter<tim-st> something like `add*T (s: var seq[T], elem: var T)`
12:56:40*LyndsySimon joined #nim
12:59:05FromGitter<tim-st> ok, it seems I can use the type `ref tuple[...]` instead of `tuple[...]`to get it working.
13:00:25krux02tim-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:35FromGitter<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:24FromGitter<krux02> `let ptr2seq = myseq.addr`
13:02:48FromGitter<krux02> proc foobar(arg: seq[T]): T = ... # does not copy the seq it just passet it by reference
13:02:57FromGitter<tim-st> thx, I didnt meant a ptr to seq but to add elem.addr to seq or soemthing
13:04:15FromGitter<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:51FromGitter<krux02> yes tuple types are value types
13:05:22FromGitter<krux02> same as when you have an int and then add the int to the seq
13:05:37FromGitter<tim-st> thanks, that's the thing I forgot that :(
13:06:05FromGitter<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:34FromGitter<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:23FromGitter<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:26FromGitter<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:47FromGitter<krux02> that's fine
13:08:00FromGitter<tim-st> but why not on seq?
13:08:22FromGitter<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:30FromGitter<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:37FromGitter<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:01FromGitter<krux02> Meaning all pointers to the seq members that still exist at this time are invalid.
13:11:16FromGitter<tim-st> I know how that works, the memory doesnt grow in my use case
13:11:53FromGitter<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:54FromGitter<krux02> well I don't know you use case
13:12:13FromGitter<nitely> @tim-st you can use `mitems` and `mpairs` to modify the seq items
13:12:29FromGitter<krux02> I have a habit to not modify my objects anymore after initialization.
13:12:50FromGitter<krux02> it minimizes state changes and that helps a lot to prevent bugs
13:13:00FromGitter<tim-st> @nitely Thanks, I saw that in source code, but it has bad runtime for my use case
13:13:25FromGitter<krux02> to be honest I don't fully understand what you want to do
13:13:27FromGitter<nitely> and using refs is faster?
13:13:46*endragor quit (Ping timeout: 256 seconds)
13:13:55FromGitter<tim-st> didnt try so far, that would break a lot of code or needed changes
13:14:07FromGitter<krux02> well in my opinion refs makes you dependent on the GC and the GC is not for free.
13:14:57FromGitter<nitely> ref items are likely less error prone. But I doubt it's any faster
13:15:06FromGitter<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:38FromGitter<krux02> refs are more memory intensive :P
13:16:43FromGitter<krux02> and pointer indirection causes cache misses, meaning slower code execution
13:19:59Araq_krux02: the C++ solution is not much better. refcounting can lead to destructor cascades and stack overflows
13:21:06Araq_actually both shared_ptr and unique_ptr share these problems
13:21:06FromGitter<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:22FromGitter<nitely> I wonder if there is a way to do that in-place, mmmh...
13:22:20Araq_turns out these "smart" pointers are really not that smart at all
13:22:44Araq_because they can only do some local reasoning
13:23:20krux02well anything that is called `smart` in programming is really not that smart.
13:23:46krux02it's a very confusing term in my opinion, because it also doesn't mention at all what problem it tries to solve.
13:23:50FromGitter<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:55Araqkrux02: the problem is when you have a tree structures or graphs
13:26:23Araqthere are no good ways to model these without some "smart" pointers
13:27:08krux02my graphs are always stored flat, like `var nodes: seq[Node], edges: seq[(a,b: int)]` but I get the point
13:27:54Araqflat is cumbersome to work with but all around the best thing you can do.
13:29:07Araqunfortunately my compiler doesn't use flat data structures
13:29:12krux02and 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:26dom96That sure is a strange fibonacci Nim implementation: https://news.ycombinator.com/item?id=16437177
13:32:23krux02https://gist.github.com/bcebfc3e9443b485e9d24f4f61668416
13:32:48Araqdom96: it's fib in closed form
13:33:16dom96I provided a translation of Go in any case
13:33:55FromGitter<alehander42> @dom96 Ithink that's the math formula
13:34:09Araqhttp://mathworld.wolfram.com/BinetsFibonacciNumberFormula.html
13:34:35dom96Fun
13:34:56Araqwe proved it in university iirc, fun with generating functions or whatever they are called in English
13:35:02FromGitter<alehander42> ironically that's probably the fastest solution of all of them :D
13:35:21FromGitter<krux02> well, not for small numbers.
13:35:21FromGitter<alehander42> yeah, recurrence relations I think
13:35:30FromGitter<krux02> but much faster than the recursive implementation
13:35:31FromGitter<alehander42> yeah, for bigger N ofc
13:35:46Araqalehander42: the iterative integer version is probably fastest
13:36:02Araqit only sums stuff in a loop
13:36:26Araqand sqrt() stuff hides more loops
13:36:37Araqand is prone to rounding problems
13:37:07Araqbut yeah it's weird that this formula full of real numbers always produces natural numbers
13:37:23FromGitter<andreaferretti> the fastest version is probably an array where you store all Fibonacci numbers that fit into an int64
13:37:33FromGitter<andreaferretti> there are not so many of them after all
13:37:46tongirAraq: Hey mate, I read in the c2nim user manual that the C "##" preprocessor can't be translated. Is that still the case?
13:37:48FromGitter<alehander42> well sqrt(5.0) can be potentially executed on compile time
13:38:33tongirWhoops, nevermind. Just stumbled on some forum posts that say it is supported now
13:38:49Araqgood point but the x^n is a loop too
13:39:02Araqtongir: I doubt it works well :-)
13:39:26Araqbut you can sometimes run GCC's preprocessor and then c2nim the result
13:39:50FromGitter<andreaferretti> there was a project to simplify generating stuff with c2nim
13:39:58FromGitter<andreaferretti> a sort of c2nim preprocessor
13:40:11FromGitter<andreaferretti> https://github.com/genotrance/nimgen
13:41:27Araqis it a preprocessor or a postprocessor?
13:42:11tongirAraq: Oh cool, I might give that a whirl. Preprocessor I'm pretty sure
13:42:33tongirandreaferretti: Nice, will check it out, thanks
13:43:25Araqkrux02: can you share these accessor generators?
13:44:11*endragor joined #nim
13:44:12Araqbtw
13:44:15Araq type 'tyObject_HashSet_J1RbOJyRcRl1E5zDK6YKcQ' (aka 'struct
13:44:15Araq tyObject_HashSet_J1RbOJyRcRl1E5zDK6YKcQ')
13:44:42Araqfrom clang is not a really good error message
13:47:02dom96report it :P
13:47:07cremwhy?
13:47:37cremtyObject_HashSet_J1RbOJyRcRl1E5zDK6YKcQ and struct tyObject_HashSet_J1RbOJyRcRl1E5zDK6YKcQ are identifiers from different namespaces.
13:47:46Araqbecause I don't give a fuck about X vs struct X differences.
13:48:11Araqit's just noise
13:48:35*endragor quit (Ping timeout: 255 seconds)
13:49:47FromGitter<krux02> Araq: https://gist.github.com/ead328968f7aa60859864cccd138dca0
13:49:47cremOk, maybe. Is there some small code snippet to reproduce that?
13:51:52Araqcrem: not sure but clang often emits 'aka'
13:53:04cremSo, 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:26cremIf it's typedef struct A {} B; error "type B (aka struct A)" is also noise?
13:54:28Araqmy compiler doesn't produce typedef struct A {} B;
13:55:54cremBut 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:11FromGitter<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:12FromGitter... out that.
13:56:33Araqcrem: yes.
13:57:05FromGitter<krux02> Araq: do you not generate typedefs for structs?
13:57:14cremSo, only A (aka struct A) is wrong, but A (aka B) is actually useful, correct?
13:57:21Araqtypedef struct A A;
13:57:27Araqstruct A { ... };
13:57:32Araqis produced by Nim
13:57:44FromGitter<krux02> ah, ok.
13:57:54FromGitter<krux02> that is semantically the same to me.
13:57:57Araqcrem: I guess.
13:58:31*xkapastel joined #nim
14:00:32Araqkrux02: that is superb
14:00:38Araq connectivity:
14:00:38Araq Publication * .. 1 Publisher
14:00:38Araq Publication * .. * Project
14:00:40Araq Publication * .. 1 Outlet
14:00:54Araqwant to write an article about your graph DSL?
14:01:11*SenasOzys quit (Ping timeout: 276 seconds)
14:02:34dom96ooh, that is really nice
14:02:45dom96There is always room on nim-lang.org for articles
14:02:58dom96That goes for anybody
14:03:26PMunchI'm gonna write something when I'm done with combparser/protobuf
14:03:39PMunchAnd hopefully I'll remember to do the FOSDEM recap tonight :P
14:03:56dom96Shall I remind you? :P
14:04:26PMunchPlease do :)
14:04:33PMunchI'm horrible at remembering stuff
14:04:57FromGitter<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:02PMunchWell, I remember information just fine. But remembering to do stuff I'm horrible at
14:09:37FromGitter<krux02> Araq: if you want to, I just like to make things look nice with macros
14:09:53FromGitter<krux02> I am abusing the parser a bit an that syntax
14:10:20Araqagreed but it's cool anyway
14:11:17*SenasOzys joined #nim
14:12:36FromGitter<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:53ZevvThe nre manual shows this as an example:
14:22:54Zevv "abc".match(re"(\w)").captures[0] == "a"
14:23:03*athenot joined #nim
14:23:08Zevvbut I get
14:23:08Zevv Error: type mismatch: got (Option[nre.RegexMatch])
14:23:18Zevvwhat am I doing wrong?
14:24:28*MJCaley joined #nim
14:24:40dom96try .get().captures[0]
14:25:05dom96Which reminds me
14:25:14dom96Araq: Are we removing nre from stdlib?
14:25:59Zevvwhat will be the obvious replacement for nre then?
14:26:04dom96re
14:26:23Zevvok
14:31:25Araqdom96: yes but in the long run we need to adopt nitely's native Nim regex implementation
14:32:03dom96of course
14:32:07dom96this is all about the API
14:36:11*gokr quit (Ping timeout: 256 seconds)
14:38:05dom96Starting in around 5 minutes. Tea first :) https://www.twitch.tv/d0m96
14:41:15*jackprob joined #nim
14:41:37jackprobdo 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:54jackprobwhich means I have good interoparability with everything that C has good interoparability with?
14:59:54PMunchjackprob, more or less
15:00:50PMunchhttps://gradha.github.io/articles/2015/01/writing-c-libraries-with-nim.html
15:01:07PMunchThat might be a bit dated, from 2015 I think
15:10:55*floppydh quit (Ping timeout: 248 seconds)
15:20:58federico3an updated tutorial would help :)
15:21:07*r3d9u11 quit (Remote host closed the connection)
15:24:01*miran joined #nim
15:25:32jackprobthanks :)
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:22FromGitter<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:36FromGitter<Bennyelg> oh it's pairs
17:55:41FromGitter<Bennyelg> sorry :|
18:12:04dom96Here 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:05mirandom96: post it on reddit (if you didn't already), to get some activity in nim sub....
18:40:26dom96Feel free to post it :)
18:41:01miranwell, you're the author, and you are usually active on reddit ;)
18:41:48dom96The more users post stuff there the better ;)
18:44:04*Quantem_ quit (Ping timeout: 260 seconds)
18:50:00GitDisc<LePrasson> Hi there
18:50:24Araqhi
18:50:44GitDisc<LePrasson> can someone help me? I'm looking for a lib for telnet connections, it exist ?
18:51:56*aphyrnim joined #nim
18:52:16GitDisc<LePrasson> can someone help me? I'm looking for a lib for telnet connections, it exist ?
18:52:40GitDisc<LePrasson> whoops, sorry for double posting
18:53:30PMunchhttps://forum.nim-lang.org/t/841
18:55:15PMunchOr you could try wrapping this: https://github.com/seanmiddleditch/libtelnet
18:56:08PMunchOr port something like this: https://l3net.wordpress.com/2012/12/09/a-simple-telnet-client/
18:56:41GitDisc<LePrasson> thank you!
18:57:05PMunchNo 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:39Araqhuh? net.nim in the stdlib?
19:13:49*Jesin joined #nim
19:19:25PMunchAraq, well yeah. But it doesn't include any Telnet specific stuff
19:19:41Araqwhat would that be?
19:19:50Araqwe have readLine for sockets
19:20:11PMunchhttps://tools.ietf.org/html/rfc854
19:20:20PMunchA high-level wrapper around this stuff
19:20:28PMunchIt's not much, but it is a protocol
19:20:33dom96Araq: Why is there a std/sha1 module?
19:20:46dom96specifically, why is it in a 'std' directory?
19:20:55*douglascorrea joined #nim
19:21:06Araqbecause new stdlib modules all end up 'std'
19:21:28dom96why?
19:21:28PMunchWhy?
19:21:29Araqsha1 is a common name
19:21:57Araqand not everybody follows the import $nimblePkg / sha1 rule
19:23:14dom96sha1 will only conflict with the 'sha1' package: https://github.com/onionhammer/sha1
19:24:01Araqdom96: yuriy reported the conflict for his large code base
19:24:06dom96Putting all new module into 'std' will turn the stdlib into a mess
19:24:09dom96*modules
19:24:34Araqno, import std / [foo, bar, baz] is how it is supposed to work
19:24:40Araqwhat's messy about it?
19:25:07dom96Why do we need a std/sha1 when we have securehash?
19:25:24Araqwe had an RFC
19:25:37dom96Random modules will only be importable via 'import std/'
19:25:42Araqwe needed to rename securehash to sha1 because of consistency
19:26:57Araqrandom.nim caused the same conflicts back then when we introduced it
19:27:11AraqI don't understand your remark.
19:27:27dom96which is why we introduced the optional disambiguation syntax: import std/random
19:27:53dom96The problem was that you couldn't import the 'random' from the stdlib
19:28:08dom96Not the other way around, right?
19:28:42AraqI don't know if nimble packages have priority over stdlib modules or not
19:28:48AraqI think stdlib comes first
19:29:01*r3d9u11 joined #nim
19:29:01Araqso it also was a problem to say "not the stdlib random"
19:31:33dom96So is there now a way to import something explicitly from Nimble?
19:32:52Araqit's
19:32:55*pyrmalthakon joined #nim
19:33:01Araqpackagee / [stuff]
19:33:02Araqvs
19:33:07Araqstd / [stuff]
19:33:36Araqthe old things like strutils continue to work without the std/ so that not every Nim program ever written is broken
19:34:02dom96It's not 'random/random' for the random package
19:34:04dom96it's just 'random'
19:34:06dom96So how can that work?
19:34:15Araqimport std / random
19:34:20dom96no
19:34:24dom96How can I import the Nimble package
19:34:26dom96?
19:34:33*aphyrnim quit (Ping timeout: 264 seconds)
19:34:48dom96How can I tell the compiler to explicitly import the random Nimble package?
19:34:53Araqhmmm
19:35:13dom96If the stdlib comes first then this doesn't solve a thing
19:35:14Araqnever occured to me we have nimble packages without a directory
19:35:27dom96:/
19:36:54Araqshould we introduce import nimble / random ?
19:37:51Araqor maybe we change the order so that nimble packages are preferred, meh
19:38:10Araqimport random was never a good idea to begin with
19:38:39Araqwell I'm open to suggestions
19:38:45dom96The order is codified in my book :)
19:38:57Araqso tell me, what is the order?
19:39:01Araq:-)
19:39:15dom96stdlib then nimble
19:39:23*yglukhov joined #nim
19:39:53Araqas I remember it, ok.
19:40:02Araqyglukhov: we need you. ;-)
19:40:16dom96let me double check my book
19:40:17*Jesin quit (Quit: Leaving)
19:42:05dom96hrm, 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:13dom96but nimble-first order would be weird IMO
19:44:27dom96I thought the idea was always to provide some way to disambiguate between these
19:44:40dom96to tell the compiler "I want you to look for a Nimble package"
19:46:41*poopBotTelefon joined #nim
19:50:45PMunchHmm, 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:53FromGitter<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:53FromGitter... see a way to only temporarily change the Ctrl-C hook?
20:02:34*endragor joined #nim
20:02:42dom96setControlCHook at the end of getPassword maybe?
20:03:48FromGitter<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:31dom96Can't you just call setControlCHook(nil)?
20:05:58*r3d9u11 quit (Remote host closed the connection)
20:06:35dom96hrm, it wants 'not nil'
20:06:42FromGitter<Vindaar> exactly
20:06:55dom96PMunch: Remember to write :)
20:07:15FromGitter<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:33PMunchdom96, I'm trying to right now :)
20:09:46PMunchBut 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:14shodan45_what other language uses "&" for string concat? I know there's one, can't think of it....
20:36:40PMunchAda
20:36:45PMunchAppleScript
20:37:01PMunchCobol
20:37:17PMunchModula-3
20:37:38PMunchTI-89 BASIC :P
20:37:48PMunchVB.NET
20:37:48shodan45_ohh was it basic I was thinking of?
20:37:56PMunchVBA
20:38:19PMunchNot regular basic though
20:38:37PMunchBy the way I'm not crazy, just did a search for & here: https://rosettacode.org/wiki/String_concatenation
20:38:38PMunch:P
20:39:27*Jesin quit (Quit: Leaving)
20:39:27shodan45_....
20:39:31shodan45_PMunch: thanks
20:39:37PMunchNo 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:40AraqI 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:33PMunchAraq, are you fine with me using this photo for my Nim at FOSDEM post: https://uploads.peterme.net/nimstand.png?
21:14:11PMunchIf 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:35miranPMunch: link doesn't work
21:14:44PMunchOh woops
21:14:45Araqok whatever
21:14:59PMunchhttps://uploads.peterme.net/nim_fosdem.txt
21:15:21PMunchMy script apparently didn't understand "up Documents/nim_fosdem.txt" very well :P
21:15:40PMunchAraq, sure? I can make another one if you're not okay with it :)
21:16:08dom96That's a nice photo
21:17:32PMunchHaha, thanks. Feel free to re-use it
21:17:51miranPMunch: i would probably add some commas here and there, but i might be using more commas than normal for english language
21:18:09PMunchIt'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:01PMunchmiran, yeah I actually haven't read through it yet so it might not be the best flow :P
21:19:57dom96I like what you've written. Maybe we should use this as the recap article? :)
21:20:22dom96It's good to add some variety to the authors of our blog posts
21:22:19*yglukhov joined #nim
21:23:52shodan45PMunch: lot's should be lots
21:24:14PMunchGood catch!
21:24:59shodan45PMunch: "seen been"
21:26:10shodan45lol... (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:49PMunchYeah, we realised that at the stand
21:26:54shodan45PMunch: "having being"
21:26:57FromGitter<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:01PMunchPeople 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:24shodan45PMunch: "While Nim is described as a systems and applications language" [add comma?]
21:29:49PMunchThanks, Vindaar
21:30:34PMunchshodan45, hmm, not too sure about that comma..
21:33:23shodan45"Q: Speaking of libraries, does Nim support X?" - I first thought you meant X11 :)
21:33:38PMunchHaha, maybe change it to X or Y?
21:33:50shodan45hm, maybe
21:33:52PMunchOr "library X"
21:36:57shodan45or change X to foo
21:37:55PMunchThat's a nice option
21:38:22FromGitter<data-man> @PMunch: XXX :D
21:39:56PMunchAnd 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:07PMunchOh crap, I forgot to mention the distinct types and stuff
21:43:44dom96oh I guess that's a no
21:43:53dom96no worries
21:44:01PMunchHuh?
21:45:26dom96I was thinking we could post what you've written as the recap article on nim-lang.org
21:45:44PMunchSure :)
21:46:24GitDisc<LePrasson> is there a native function to print ascii value of an integer ?
21:46:37GitDisc<LePrasson> I mean, to print the character
21:46:48dom96I'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:18PMunchLePrasson, 5.char?
21:50:26PMunchWell 5 is a bad example
21:50:28PMunch32.char
21:50:42PMunchThat is the character ' '
21:51:17GitDisc<LePrasson> oh, thanks
21:52:07PMunchWhat it actually does is just cast it to a char and print that
21:54:29PMunchOkay, shimmied in a question on the type stuff now :P
21:59:45PMunchhttps://www.reddit.com/r/programming/comments/7zird1/nim_at_fosdem_frequently_asked_questions/
21:59:58PMunchhttps://www.reddit.com/r/nim/comments/7zim30/nim_at_fosdem_frequently_asked_questons/
22:00:08PMunchIf you want to help with visibility
22:00:14PMunchI'm off to bed now, night!
22:00:23dom96Thanks for writing!
22:00:30PMunchNo problem :)
22:00:36*PMunch quit (Quit: leaving)
22:10:04FromGitter<mratsim> upvoted
22:16:31GitDisc<Lite5h4dow> just wondering if someone could explain how streams work
22:16:44GitDisc<Lite5h4dow> ive been reading the documents but i dont think i understand it
22:17:14GitDisc<Lite5h4dow> specifically the read line function
22:18:31GitDisc<LePrasson> @PMunch I don't find this on documentation
22:19:13GitDisc<LePrasson> I'm trying to do something like "blabla".int, to convert it into ascii values of each letter
22:20:45GitDisc<Lite5h4dow> i think your looking for this @LePrasson https://nim-lang.org/docs/strutils.html
22:21:02GitDisc<Lite5h4dow> unless i missunderstand what yourtrying to do
22:21:43GitDisc<Lite5h4dow> unless i miss understand what your trying to do
22:21:51GitDisc<LePrasson> yes exactly
22:21:53GitDisc<LePrasson> thanks
22:22:02GitDisc<Lite5h4dow> no problem 😄
22:27:44FromGitter<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:11GitDisc<Lite5h4dow> is there anyone willing to tell me how streams work? >.<
22:39:19GitDisc<Lite5h4dow> im super confused
22:39:32dom96what are you confused about? :)
22:41:31*pyrmalthakon quit (Quit: Konversation terminated!)
22:41:45GitDisc<Lite5h4dow> well i dont know what they do xD
22:41:54GitDisc<Lite5h4dow> for starters
22:43:43*natrys quit (Quit: natrys)
22:48:37*douglascorrea joined #nim
22:52:12GitDisc<Lite5h4dow> the documentation just assumes that you know what it does and how to use the procs
22:52:24GitDisc<Lite5h4dow> i just want to read all the lines in a document
22:52:34GitDisc<Lite5h4dow> and then write them back again later
22:52:54*endragor joined #nim
22:54:22GitDisc<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:32dom96Lite5h4dow: You don't even need streams for that.
22:58:38GitDisc<Lite5h4dow> i dont?
22:58:50dom96No, you can just use the readFile and writeFile procedures
22:59:19GitDisc<Lite5h4dow> but i need to read them line by line so i can write it to Nigui's text box
22:59:28dom96I'm pretty sure I've already given you a link to this: https://rosettacode.org/wiki/File_input/output#Nim
22:59:37dom96It shows how to read line by line
22:59:54GitDisc<Lite5h4dow> ah right
23:00:07GitDisc<Lite5h4dow> i could have sworn someone told me to use streams
23:01:23dom96Perhaps
23:01:29dom96You can achieve the same thing using streams
23:01:36dom96but it's slightly more complex
23:02:07GitDisc<Lite5h4dow> oh ok
23:02:13GitDisc<Lite5h4dow> but for future reference
23:02:20GitDisc<Lite5h4dow> what do streams actually do?
23:02:30GitDisc<Lite5h4dow> incase i find a use for them
23:03:14dom96They offer an interface that can be implemented for stream-like functionality
23:03:29GitDisc<Lite5h4dow> o.o
23:03:42dom96Just don't worry about them for now
23:03:48GitDisc<Lite5h4dow> right ok xD
23:03:56GitDisc<Lite5h4dow> ill look into them another time
23:04:06dom96You will only ever need them if another module requires them
23:04:28dom96I never really use them
23:04:39GitDisc<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