<< 08-01-2018 >>

00:00:09AraqI'm patient, no worries
00:00:37Araqmisbehaviour: it produces "variable not initialized" even though it is
00:00:50Araqfor some program of minor complexity
00:01:01FromGitter<ervinbosenbacher> :D
00:01:04FromGitter<ervinbosenbacher> ok
00:01:20Araqit's not critical at all, I wondered if you had experience with these algorithms
00:01:42FromGitter<ervinbosenbacher> i was looking into them sometime ago yes
00:02:17FromGitter<ervinbosenbacher> i will look into it
00:02:45FromGitter<ervinbosenbacher> building nim for jetson should be ok
00:02:47Araqand be gentle, it's my first DFA :P
00:03:21Araqonly did control flow agnostic analyses before ;-)
00:03:38FromGitter<ervinbosenbacher> funny
00:03:55FromGitter<ervinbosenbacher> I was planning to build a FSM next week in Nim
00:04:00FromGitter<ervinbosenbacher> as a first exercise
00:04:19FromGitter<ervinbosenbacher> Then I will look into your DFA implementation
00:05:24Araqactually that's not true, but my other control flow dependent analysis are more adhoc
00:05:50*ehmry quit (Read error: Connection reset by peer)
00:05:51*unclechu quit (Read error: Connection reset by peer)
00:05:52*macsek1911[m] quit (Read error: Connection reset by peer)
00:05:53*Jipok[m] quit (Read error: Connection reset by peer)
00:05:54*dyce[m] quit (Remote host closed the connection)
00:05:55*hohlerde quit (Read error: Connection reset by peer)
00:05:56*byteflame quit (Remote host closed the connection)
00:05:56*hiway quit (Remote host closed the connection)
00:05:56*notdekka[m] quit (Remote host closed the connection)
00:05:58*TheManiac quit (Remote host closed the connection)
00:05:58*shashlick quit (Remote host closed the connection)
00:05:58*Demos[m] quit (Read error: Connection reset by peer)
00:05:59*Miguelngel[m] quit (Read error: Connection reset by peer)
00:05:59*planetis[m] quit (Read error: Connection reset by peer)
00:06:20Araqsince Nim doesn't have 'goto' things are usally easy enough. this time I tried to follow the literature more closely though.
00:07:00FromGitter<ervinbosenbacher> ok
00:07:00*shashlick joined #nim
00:07:01shashlickhttps://github.com/genotrance/ff
00:07:02shashlicknew CLI tool for Windows built using Nim, feedback appreciated!
00:09:20*kunev quit (Ping timeout: 260 seconds)
00:10:19*dandevelo joined #nim
00:11:06*kunev joined #nim
00:14:05*hiway joined #nim
00:14:59*dandevelo quit (Ping timeout: 255 seconds)
00:15:57*user0 quit (Quit: user0)
00:16:15*user0 joined #nim
00:17:14Araqshashlick: nice, did you use the improvements we merged into terminal.nim?
00:18:11FromGitter<tim-st> @Araq pls add an "add" proc to set/table
00:18:21FromGitter<tim-st> additionally to incl
00:19:36FromGitter<ervinbosenbacher> okay i successfully built nim on my ARM based ubuntu :)
00:20:00FromGitter<ervinbosenbacher> its a good start
00:20:31*user0 quit (Client Quit)
00:20:46*user0 joined #nim
00:21:01*user0 quit (Client Quit)
00:21:50FromGitter<tim-st> I remember I got sort working but now I cannot for seq[string] :(
00:22:06FromGitter<tim-st> in python the default call is easier
00:23:18FromGitter<tim-st> oh, it was in algorithm modul, now it works
00:24:06*byteflame joined #nim
00:24:06*dyce[m] joined #nim
00:24:07*Miguelngel[m] joined #nim
00:24:07*Demos[m] joined #nim
00:24:07*ehmry joined #nim
00:24:07*unclechu joined #nim
00:24:09*sz0 quit (Quit: Connection closed for inactivity)
00:24:13*TheManiac joined #nim
00:24:13*Jipok[m] joined #nim
00:24:13*macsek1911[m] joined #nim
00:24:14*hohlerde joined #nim
00:24:14*notdekka[m] joined #nim
00:24:15*planetis[m] joined #nim
00:27:45FromGitter<data-man> @shashlick: For Windows I recommend to use Everything http://www.voidtools.com ⏎ Very fast. There is SDK http://www.voidtools.com/support/everything/sdk/
00:30:27*dandevelo joined #nim
00:30:59FromGitter<data-man> @tim-st: Your keys is strings?
00:31:42FromGitter<tim-st> yes, I got it working. I didnt remember that I needed to import algorithm for using sort
00:32:06FromGitter<tim-st> thought it was in system, but only cmp was there
00:33:38FromGitter<data-man> Try critbits
00:34:11FromGitter<tim-st> can it be constant?
00:36:04FromGitter<tim-st> I need to retrieve a sequence of sorted keys, for example everything between "ab"..."abe"
00:36:14FromGitter<tim-st> or an iterator
00:37:26FromGitter<data-man> CritBitTree support search with prefix
00:38:33FromGitter<tim-st> hm, looks very interesting indeed, thanks for letting me know!
00:38:49FromGitter<tim-st> not sure if its constant though
00:38:57FromGitter<tim-st> *can be
00:40:22FromGitter<data-man> What do you mean "constant"?
00:41:28FromGitter<tim-st> can I make `const cb = CritBitTree()`?
00:42:01FromGitter<tim-st> or `const cb = procThatReturnsSuchTree`
00:43:36FromGitter<data-man> For that? How many keys you need to store?
00:44:18FromGitter<tim-st> wikipedia index
00:44:33FromGitter<tim-st> and wiktionary
00:45:41FromGitter<tim-st> less than 4.5 million
00:46:30FromGitter<data-man> Oh! Then you better to use a key-value DBs or SQLite
00:46:48FromGitter<tim-st> why? it's read only
00:47:38FromGitter<tim-st> I'm pretty sure nims datastructures are much better for this by far
00:51:27*yglukhov quit (Remote host closed the connection)
00:52:37FromGitter<ervinbosenbacher> hey @Tim what are you building out of interest
00:54:19*endragor joined #nim
00:55:05FromGitter<tim-st> a system for natural processing, but with the aim to interpret very good or even correct, and after this I use it as a base for solving many interesting problems :)
00:55:14FromGitter<tim-st> *natural language
00:55:30FromGitter<ervinbosenbacher> yeah we are working on similar things
00:55:38FromGitter<ervinbosenbacher> :) go figure
00:57:04FromGitter<ervinbosenbacher> i am wokring on an finite state machine for fuzzy search.
00:58:42*endragor quit (Ping timeout: 246 seconds)
00:58:46FromGitter<tim-st> interesting^^, I want to support this too and also other very interesting things regarding linguistics
01:08:40*marenz__ quit (Ping timeout: 265 seconds)
01:19:35*Demos[m] quit (Ping timeout: 276 seconds)
01:22:00*yglukhov joined #nim
01:26:44*yglukhov quit (Ping timeout: 276 seconds)
01:27:38*Demos[m] joined #nim
01:53:31*xet7 quit (Quit: Leaving)
01:57:56*dandevelo quit (Ping timeout: 276 seconds)
02:08:37*S1t1Schu joined #nim
02:12:28*S1tiSchu quit (Ping timeout: 265 seconds)
02:25:24*yglukhov joined #nim
02:29:42*yglukhov quit (Ping timeout: 246 seconds)
02:33:39FromGitter<RedBeard0531> Tim, a critbit tree of that size will be pretty slow. Maybe try porting or wrapping a btree or qp tree impl
02:50:36*S1t1Schu quit (Remote host closed the connection)
02:50:49shashlickcan someone close this issue? https://github.com/nim-lang/Nim/issues/1976
02:57:36*yglukhov joined #nim
02:58:27*vlad1777d quit (Ping timeout: 240 seconds)
02:59:51*chemist69 quit (Ping timeout: 240 seconds)
03:01:56*yglukhov quit (Ping timeout: 255 seconds)
03:02:41*hosearch joined #nim
03:02:43*hosearch quit (Remote host closed the connection)
03:14:00*chemist69 joined #nim
03:16:09*arnetheduck joined #nim
03:24:15*dandevelo joined #nim
03:29:48*dandevelo quit (Ping timeout: 265 seconds)
03:31:20*MJCaley quit (Quit: MJCaley)
04:01:08*yglukhov joined #nim
04:05:21*yglukhov quit (Ping timeout: 248 seconds)
04:21:48*arnetheduck_ joined #nim
05:12:56*yglukhov joined #nim
05:17:28*yglukhov quit (Ping timeout: 268 seconds)
05:26:44*dandevelo joined #nim
05:32:05*dandevelo quit (Ping timeout: 265 seconds)
06:13:28*devdri joined #nim
06:33:54*nsf joined #nim
06:38:55*devdri quit ()
07:07:17*yglukhov joined #nim
07:11:40*yglukhov quit (Ping timeout: 260 seconds)
07:13:16*TheManiac quit (*.net *.split)
07:13:16*Jipok[m] quit (*.net *.split)
07:13:16*Syneh_ quit (*.net *.split)
07:13:16*enigmeta quit (*.net *.split)
07:13:17*EastByte quit (*.net *.split)
07:13:21*Syneh__ joined #nim
07:13:49*Jipok[m] joined #nim
07:13:49*TheManiac joined #nim
07:13:50*EastByte joined #nim
07:13:52*enigmeta joined #nim
07:16:20*heinrich5991 quit (Ping timeout: 260 seconds)
07:21:39*wurui joined #nim
07:26:07*heinrich5991 joined #nim
07:29:11*dandevelo joined #nim
07:47:45*dandevelo quit (Ping timeout: 264 seconds)
08:02:37*wurui_ joined #nim
08:03:37*wurui_ quit (Max SendQ exceeded)
08:03:51*wurui quit (Ping timeout: 240 seconds)
08:04:07*wurui_ joined #nim
08:05:15*wurui_ quit (Remote host closed the connection)
08:05:52*wurui_ joined #nim
08:06:45*wurui_ quit (Remote host closed the connection)
08:12:39*floppydh joined #nim
08:17:04*dddddd joined #nim
08:30:07*PMunch joined #nim
08:34:53FromGitter<ervinbosenbacher> can we use pointers in Nim aka ptr?
08:35:01*claudiuinberlin joined #nim
08:42:42*sendell joined #nim
08:43:37*wurui joined #nim
08:47:33PMunchervinbosenbacher, yes?
08:48:04FromGitter<ervinbosenbacher> trying to interface withsome level c libs and very new to nim
08:48:12PMunchAh right
08:48:22PMunchYeah you're able to create a ptr type
08:48:25FromGitter<ervinbosenbacher> some very low level
08:48:44FromGitter<ervinbosenbacher> simd intrinsics
08:48:47PMunchHave you checked that it hasn't been wrapped already by the way?
08:49:17FromGitter<ervinbosenbacher> :)
08:49:20FromGitter<ervinbosenbacher> good point
08:49:56livcdi remember something about simd intrisincs being mentioned on forums / reddit
08:49:58PMunchThis is a pretty interesting project for SIMD: https://github.com/jackmott/nim_simd
08:50:31FromGitter<ervinbosenbacher> yes, found it, that saves me some time, working on a bitpacking / compression lib
08:50:41FromGitter<ervinbosenbacher> and helps to learn the language
08:50:55FromGitter<ervinbosenbacher> OpenMP
08:51:12FromGitter<ervinbosenbacher> mentioned here
08:51:13FromGitter<ervinbosenbacher> https://forum.nim-lang.org/t/212
08:52:05FromGitter<ervinbosenbacher> thx for the help that heps to start to do what I do
08:53:04PMunchHappy to help, hope you find Nim to your liking :)
08:53:11FromGitter<ervinbosenbacher> @PMunch thank you
08:53:19FromGitter<ervinbosenbacher> yes I am in love
08:53:21FromGitter<ervinbosenbacher> :D
08:53:38FromGitter<ervinbosenbacher> I will help with the compiler and tools once I know better
08:58:48*tajmone joined #nim
08:59:12*tajmone quit (Client Quit)
08:59:45*yglukhov joined #nim
09:00:08*xet7 joined #nim
09:00:26FromGitter<ervinbosenbacher> previously I was working with D and rust
09:01:18PMunchAnd how do you feel Nim compares?
09:01:36FromGitter<ervinbosenbacher> Freedom
09:01:54FromGitter<ervinbosenbacher> well defined small language
09:02:19FromGitter<ervinbosenbacher> but what is critical in my case is that I can target various languages
09:02:40PMunchMhm, that is pretty neat
09:03:08FromGitter<ervinbosenbacher> we have spent gazillion time to make sure that libs works across frameworks languages that we bridge things here and there
09:03:48FromGitter<ervinbosenbacher> some of the stuff implemented in rust to be able to close to metal some in c++11/14/17 some in D to interface easily with C++ some in JS for the front and so on
09:04:03FromGitter<ervinbosenbacher> With nim well 1 language
09:04:16*yglukhov quit (Ping timeout: 265 seconds)
09:04:16FromGitter<ervinbosenbacher> so I am busy porting our core libs to Nim right now
09:04:24*gmpreussner quit (Ping timeout: 268 seconds)
09:04:43*gmpreussner joined #nim
09:05:30PMunchOh nice! Big project?
09:05:39FromGitter<ervinbosenbacher> Nim is pure awesomeness especially that I am into macros, templates metaprogramming
09:06:07PMunchYeah, the metaprogramming stuff is great. So many cool projects that wouldn't be possible without it
09:06:15FromGitter<ervinbosenbacher> quite big, working on a search engine that you can deploy anywhere aka embedded devices
09:06:36FromGitter<ervinbosenbacher> I will add stuff to here as open source
09:06:54FromGitter<ervinbosenbacher> working on an DSL for queries
09:07:06FromGitter<ervinbosenbacher> imagine elasticsearch and lucene in Nim
09:07:41FromGitter<ervinbosenbacher> i added our startup to the list of companies
09:07:43PMunchOoooh, very interesting
09:07:45FromGitter<ervinbosenbacher> finddit.com
09:08:20FromGitter<ervinbosenbacher> Nim is just perfect for our use case
09:08:34PMunchYeah I'd imagine
09:08:41FromGitter<ervinbosenbacher> before I created a metaprogramming lib in c++14/17
09:09:20FromGitter<ervinbosenbacher> trageting C with Pythonish syntax. almost allof our AI research is in pythob
09:09:21*yglukhov joined #nim
09:09:30FromGitter<ervinbosenbacher> so perfect
09:11:01FromGitter<ervinbosenbacher> anyway I will contribute as much as I can but its been only 3 days so patience :D
09:11:08*yglukhov quit (Read error: Connection reset by peer)
09:11:41*yglukhov joined #nim
09:11:55FromGitter<ervinbosenbacher> my interest is that Nim becomes powerful, its already is, by using Nim we are savin a lot of time as I had a similar project in my mind.
09:12:01FromGitter<ervinbosenbacher> so we just continue with Nim
09:12:37PMunchThat's great to hear, looking forward to seeing you use Nim in the future :)
09:13:10FromGitter<ervinbosenbacher> I have extensive compiler experience so I will help with Nim v2
09:13:33FromGitter<ervinbosenbacher> last nighti already packed up Nim on an ARM device
09:13:50FromGitter<ervinbosenbacher> compiled without effort
09:13:57FromGitter<ervinbosenbacher> high quality stuff
09:14:52PMunchI have yet to try it on ARM or even Arduinos, but it's something I've been meaning to do for the longest time..
09:15:48FromGitter<ervinbosenbacher> We are targeting jetson tx2 with cuda, after checkng out the code on it took a few minutes to build it
09:15:58FromGitter<ervinbosenbacher> flawless
09:16:24FromGitter<ervinbosenbacher> (its also faster than rust with a smaller footprint for some reason)
09:16:36FromGitter<ervinbosenbacher> (in my case)
09:20:00*Vladar joined #nim
09:23:05*xet7 quit (Ping timeout: 240 seconds)
09:35:57*xet7 joined #nim
09:44:32*dandevelo joined #nim
09:45:33*yglukhov quit (Read error: Connection reset by peer)
09:45:34*wurui left #nim (#nim)
09:46:09*yglukhov joined #nim
09:47:08*yglukhov quit (Remote host closed the connection)
09:49:10*dandevelo quit (Ping timeout: 260 seconds)
09:59:24*yglukhov joined #nim
10:00:32FromGitter<ervinbosenbacher> what is the ! operator do? its been depreated it seems
10:00:40*yglukhov quit (Read error: Connection reset by peer)
10:01:12*yglukhov joined #nim
10:04:48FromGitter<alehander42> @ervinbosenbacher I am using karax in a middle-sized electron app, it works fine for me
10:05:00FromGitter<ervinbosenbacher> perfect
10:05:21FromGitter<alehander42> @araq is there a way to getCurrentDir() at compile time ?
10:05:21FromGitter<ervinbosenbacher> Is it open source can you share? Its ok if not
10:05:26FromGitter<alehander42> no, sorry
10:05:37FromGitter<ervinbosenbacher> its ok I was just wondering
10:05:39FromGitter<alehander42> but if you have any questions, feel free to ask
10:05:44FromGitter<ervinbosenbacher> thx
10:06:03FromGitter<ervinbosenbacher> ill try to figure it out
10:06:27FromGitter<ervinbosenbacher> can you see preformance improvement?
10:06:36FromGitter<ervinbosenbacher> are you more productive?
10:06:46FromGitter<ervinbosenbacher> What about the size of the running app?
10:07:04FromGitter<alehander42> well, we use Nim for the electron app since we created it, so I can't really compare haha
10:08:27AraqI am more productive with karax than I was with vue.js but
10:08:34Araqa) I loathe vue.js
10:08:40Araqb) I wrote Karax.
10:08:47Araqso I am as biased as possible.
10:08:55FromGitter<ervinbosenbacher> i know that I am just wndering about the process
10:09:17FromGitter<ervinbosenbacher> it would be nice to have at least a boilerplate to see how that works
10:09:44FromGitter<ervinbosenbacher> or avoid reinventing the wheel
10:09:46Araqhttps://nim-lang.org/araq/karax.html ?
10:10:02FromGitter<ervinbosenbacher> i mean integration with electron
10:10:19FromGitter<ervinbosenbacher> @araq i have a quikc question
10:10:27Araqoh ok, I don't use electron. shoot.
10:10:28FromGitter<alehander42> @Araq is staticRead of another nim binary that echo-es getCurrentDir the only way to get it at compile time :?
10:10:56FromGitter<ervinbosenbacher> is the ! operator used for negating things?
10:10:58FromGitter<ervinbosenbacher> if node.ident == !"simd":
10:10:59Araqalehander42: I don't know, getConfigDir works at compile-time and it did bite us
10:11:17Araqervinbosenbacher, nah it's just identifier construction
10:11:25FromGitter<ervinbosenbacher> this line is deprecated in nim_simd I am wondering why
10:11:38Araqread it as if node.ident == "simd"
10:11:53FromGitter<ervinbosenbacher> ah
10:12:23FromGitter<ervinbosenbacher> so if node.ident == !"simd”: is the same as if node.ident == "simd”:?
10:13:56Araqwell no, it's the same as if node.ident == ident"simd" but the 2nd ident only exists to make the type checker happy
10:15:27FromGitter<ervinbosenbacher> thx
10:15:42FromGitter<ervinbosenbacher> how about thsi one
10:15:43FromGitter<ervinbosenbacher> in countup(0,<a.len,simd.width div 4):
10:15:48*vlad1777d joined #nim
10:15:50FromGitter<ervinbosenbacher> The < is deprecated
10:16:07FromGitter<ervinbosenbacher> what would be the current equivalent
10:16:27FromGitter<ervinbosenbacher> I am guessing until ?
10:16:54FromGitter<alehander42> how did getConfigDir bite u
10:19:38Araqa.len-1
10:19:52FromGitter<ervinbosenbacher> yes i already did it :)
10:20:16Araqalehander42: use it at compile-time, it resolves to /home/alehander42/.config, tada
10:20:23Araqa program that only works on your machine
10:22:16FromGitter<alehander42> aha, well I want to use it for a test macro (it reads filenames of examples on compile time), as usually I build it as a part of the test
10:22:20FromGitter<alehander42> but I can see your point
10:23:38*chemist69 quit (Ping timeout: 276 seconds)
10:25:38*xet7 quit (Ping timeout: 255 seconds)
10:28:40FromGitter<ervinbosenbacher> this is what worked
10:28:42FromGitter<ervinbosenbacher> if node.ident == toNimIdent("simd"):
10:29:52Araqthat's the long version, yes.
10:30:14FromGitter<ervinbosenbacher> teh short version is ident”simd”?
10:30:18Araqbut my version should also work
10:30:28Araqyes.
10:31:12FromGitter<ervinbosenbacher> whats the correct syntax?
10:31:16FromGitter<ervinbosenbacher> ``` node.ident = ident simdType``````
10:31:58FromGitter<ervinbosenbacher> any shorter version?
10:33:44FromGitter<ervinbosenbacher> I am using 0.17.3
10:35:21*xet7 joined #nim
10:36:33*xet7 quit (Remote host closed the connection)
10:36:50*xet7 joined #nim
10:37:02*chemist69 joined #nim
10:42:32Araqwhat are you trying to do? assignment or comparison?
10:43:10FromGitter<ervinbosenbacher> well thsi works ``` if node.ident == toNimIdent("simd"): ⏎ ⏎ ``` node.ident = toNimIdent(simdType)`````` [https://gitter.im/nim-lang/Nim?at=5a534b3e19147ac3231b536f]
10:43:24FromGitter<ervinbosenbacher> how does the short version looks like?
10:49:05Araqnode = newIdentNode simdType iirc
10:53:39*floppydh quit (Quit: WeeChat 2.0.1)
10:55:47*floppydh joined #nim
10:56:50FromGitter<ervinbosenbacher> @Araq would this be correct code? If I want to introduce a new type
10:56:55FromGitter<ervinbosenbacher> ``````
10:57:15*xet7 quit (Ping timeout: 268 seconds)
10:57:34FromGitter<ervinbosenbacher> the original ```typedef float __m128 *attribute*((__vector_size__(16)));```
10:57:55FromGitter<Araq> yeah, looks good
10:58:11FromGitter<ervinbosenbacher> thx
11:07:23Araqbah now I am curious. **why** is fmt causing a conflict? what's the error message?
11:08:35*yglukhov quit (Remote host closed the connection)
11:09:30FromGitter<tim-st> How do I call a proc that takes varargs[(string, string)] -> strutils.multiReplace ?
11:10:11*xet7 joined #nim
11:11:23FromGitter<tim-st> I dont understand it when reading: https://nim-lang.org/docs/tut1.html#advanced-types-varargs
11:12:40PMunchtim-st, what is your problem?
11:13:29PMunchmultiReplace takes a string and then any number of tuples of two strings
11:13:32FromGitter<tim-st> how do I call the multiReplace proc? "hello".multireplace(("e", "x"), "h", "J") ?
11:13:41FromGitter<alehander42> does nim have some slice syntax similar to python's :: ?
11:14:12Araqthere is no step parameter, alehander42
11:14:21PMunchSo you can call it like "hello".multireplace(("e", "x"), ("h","J")) and it should give you "Jxllo"
11:14:35FromGitter<tim-st> this dont work: `return w.multiReplace(("ä":"a"), ("ö":"o"))`
11:14:40*vlad1777d quit (Ping timeout: 248 seconds)
11:14:47PMunchNot :
11:14:48PMunch,
11:14:56FromGitter<tim-st> ah, sry my mistake
11:15:26Araqw.multiReplace({"ä": "a", "ö": "o"}) is also possible, I think
11:16:18FromGitter<tim-st> it works good, my problem was again that I didnt import it because I manually imported from strutils and forget this...
11:16:50*yglukhov joined #nim
11:17:32livcdcan I use nim on Solaris/sparc or this is not advised ?
11:17:51FromGitter<alehander42> should we add some kind of `step` iterator to sequtils?
11:18:15*dandevelo joined #nim
11:18:17*wurui joined #nim
11:18:19FromGitter<ervinbosenbacher> @alehander42 Maybe you could try? I think it would be nice!
11:21:14FromGitter<ervinbosenbacher> is there a serialization framework in Nim?
11:21:51*wurui quit (Remote host closed the connection)
11:23:16Araqlivcd: should work on Solaris
11:24:44Araqervinbosenbacher: there is marshal.nim
11:32:58FromGitter<ervinbosenbacher> thx @Araq
11:33:50FromGitter<tim-st> It would be really nice if two runes() iterators could run parallel using zip() it would end when the shorter ends and if one could find out which iterator was the one that ended. That could improve my performance very much
11:37:16*MJCaley joined #nim
11:39:55Araqyeah well, write a zip that knows about runes, not ideal but also not much work
11:40:08FromGitter<ervinbosenbacher> especially if they could run on different threads
11:40:45*wurui joined #nim
11:41:14FromGitter<ervinbosenbacher> i have a similar problem the indexer is indexing different parts of the same docuemnt or different documents at the same time then I have to merge the results in a table
11:41:20FromGitter<alehander42> why is `()` deprecated
11:41:51Araqalehander42: Unknown interactions with the rest of the language
11:42:52Araqunclear benefits, you can overload `{}` instead.
11:43:12FromGitter<alehander42> ok, so when will it be removed completely ?
11:43:56Araqwhen we know.
11:44:24PMunchervinbosenbacher, I also wrote this: https://github.com/PMunch/binaryparse
11:44:30PMunchTo read and write binary formats
11:44:35Araqit's only deprecated to force an .experimental pragma
11:44:46FromGitter<ervinbosenbacher> ah thank you
11:46:22FromGitter<ervinbosenbacher> this is 2 years old https://github.com/dfdeshom/nimlz4 Can i pick this up and update it?
11:47:01PMunchDon't see why not :)
11:47:18FromGitter<ervinbosenbacher> ok I will continue to maintain it.
11:49:28FromGitter<ervinbosenbacher> @Tim I will experiment with multiple strems of compression using lz4, say you want to use multiple iterators in parallel through channels
11:49:54FromGitter<ervinbosenbacher> so will compress/decompress multiple streams at the same time
11:51:55FromGitter<tim-st> For compression it's good to use them, for me the reason was primarily to compare two string rune by rune and return as early as possible instead of operating two times on both complete string and than iterate over them
11:52:15*MJCaley quit (Quit: MJCaley)
11:52:46FromGitter<ervinbosenbacher> yes I get it
11:55:10Araqoh it's one of those days ... why does nimble dir use a dot? do not hide source code...
11:55:51FromGitter<tim-st> @Araq can I load data from filestream and make the returned result const?
11:56:21FromGitter<tim-st> I get error undeclared identifier
11:57:21AraqI forgot to tell you. embedding full wikipedia into your executable is not a good idea.
11:57:34FromGitter<tim-st> its only 45mb
11:57:43FromGitter<tim-st> or less
11:58:36Araqstill meh, use getAppDir() / "resource.xml", your compiletimes will thank you
11:59:06Araqand to answer your question: I don't think you can.
11:59:16FromGitter<tim-st> ok, thanks
12:03:26*Snircle joined #nim
12:03:43FromGitter<ervinbosenbacher> that or a key value store
12:03:47FromGitter<ervinbosenbacher> or json
12:04:22FromGitter<tim-st> does a key value store communicate via tcp?
12:04:35FromGitter<tim-st> *every
12:05:13FromGitter<ervinbosenbacher> What is your preferece @tim-st
12:05:16*wurui_ joined #nim
12:06:03FromGitter<tim-st> I would a communication via ram not tcp
12:06:09FromGitter<tim-st> *prefer
12:06:28FromGitter<ervinbosenbacher> yeah I am not ready but eventually rocksdb will happen
12:06:45*wurui quit (Remote host closed the connection)
12:06:55FromGitter<ervinbosenbacher> onmy todo list which is embedded and very powerful and key value docuemnt store
12:07:32FromGitter<ervinbosenbacher> https://github.com/zielmicha/leveldb.nim
12:07:35FromGitter<ervinbosenbacher> try this
12:07:41FromGitter<ervinbosenbacher> rocksdb is based on leveldb
12:08:15FromGitter<ervinbosenbacher> someone had the same idea :D https://github.com/nimscale/rocksdb
12:08:31FromGitter<tim-st> Thanks, I will read into this database
12:09:51FromGitter<ervinbosenbacher> well here we go https://github.com/nim-lang/needed-libraries/issues/75
12:10:22*wurui_ quit (Remote host closed the connection)
12:10:33FromGitter<ervinbosenbacher> I will work on this definitely as I am dare need as well and I have been toying with this for more than a year I have a POC in python was plannning to develop it in rust
12:10:38FromGitter<ervinbosenbacher> it will be nim
12:13:07*wurui joined #nim
12:14:57*zahary joined #nim
12:23:03*wurui quit (Remote host closed the connection)
12:23:38FromGitter<ervinbosenbacher> ill write a wrapper first and will try to figure how to make it idiomatic with Nim
12:23:55FromGitter<ervinbosenbacher> ro integrate it with the Nim orm lib
12:25:06Araqwhat is the Nim orm lib?
12:25:22enthus1astervinbosenbacher the last time i used lz4 module it leaked memory (so say a comment in old code)
12:25:22FromGitter<ervinbosenbacher> Whats the name you wrote it :D
12:25:45FromGitter<ervinbosenbacher> thx for the info
12:27:21enthus1astormin
12:27:35FromGitter<ervinbosenbacher> Thats the one thx :D
12:28:07enthus1astDoes ormin has a network api? Looks like it
12:28:29FromGitter<ervinbosenbacher> dont know, right now I have information overload
12:28:39*dandevelo quit (Ping timeout: 256 seconds)
12:28:49FromGitter<ervinbosenbacher> :D new language and trying to find my way through a bunch of stuff
12:29:19enthus1astormin + karax could be a nimmish "meteor"
12:29:33FromGitter<ervinbosenbacher> yes
12:29:54FromGitter<ervinbosenbacher> i have been nimbed
12:30:10FromGitter<ervinbosenbacher> my brain is nimb
12:30:14FromGitter<ervinbosenbacher> ok enuff
12:32:18Araqormin is SQL only and hardly works with today's compiler :-)
12:33:13FromGitter<ervinbosenbacher> ok we will have something for key value stuff
12:33:37FromGitter<ervinbosenbacher> one of my core components is built around compression key value stores and encryption
12:34:03FromGitter<ervinbosenbacher> I need those in and possibly I will start with compression and key value store
12:34:26FromGitter<ervinbosenbacher> make them open source libs for the benfit of everyone
12:34:55enthus1astervinbosenbacher tried considering redis?
12:35:13FromGitter<ervinbosenbacher> yes but there are issues with redis
12:36:02FromGitter<ervinbosenbacher> One of them it is not really free when you want to embed it and that it occupies huge memory space
12:36:54FromGitter<ervinbosenbacher> this is what I have been using https://github.com/yinqiwen/ardb
12:37:16livcdAraq: thanks
12:37:31dom96Redis isn't really free? how so?
12:40:11FromGitter<ervinbosenbacher> Well we have run into issues I dont know. But for our purpose MongoDB is better suited
12:40:20FromGitter<ervinbosenbacher> Sorry mixed up with mongo
12:41:07FromGitter<ervinbosenbacher> anyway mongodb woud be better for a search engine. Also redis is a huge memory footprint and rocksdb doesnt
12:42:01FromGitter<ervinbosenbacher> This was a long debate. Redis could be a could choice.
12:42:08FromGitter<ervinbosenbacher> It dpeends on the scenario
12:42:41enthus1astIdk, but for a search engine i would look for these big table like dbs
12:42:49FromGitter<ervinbosenbacher> @Tim there is a wrapper Redis
12:43:30FromGitter<ervinbosenbacher> https://github.com/nim-lang/redis
12:45:07FromGitter<ervinbosenbacher> yes scylladb
12:45:27FromGitter<ervinbosenbacher> thats in c++ so we could have a Nim wrapper
12:48:52enthus1astAraq do you know meteor js? Because ormin+karax could potentially be a nimish meteor. (withouth the annoying parts)
12:49:00*Yardanico joined #nim
12:49:11Araqnever heard of it
12:49:29FromGitter<ervinbosenbacher> https://www.meteor.com/
12:50:29enthus1astmeteor = write server/client js code side by side, client can register a view on an imaginary db table, client gets autoupdated, client has a simple `mongodb` like in the browser
12:50:35Araqoh wow, this needs some exposure, https://forum.nim-lang.org/t/3459
12:51:04FromGitter<ervinbosenbacher> you mean like a universal app?
12:51:43enthus1astdatabase in the browser gets updated via websocket when data in the database change
12:52:07Araqwow I tried to build such a thing once and failed :-)
12:52:58Araqmeteor seems the right idea for the wrong language
12:53:17enthus1astthe only thing that seems missing (karax+ormin) is a way to update the clients
12:53:34Araqno, that is covered
12:53:47FromGitter<ervinbosenbacher> then its done
12:53:54Araqthe only thing is that that freaking websockets module doesn't work for me
12:53:55FromGitter<ervinbosenbacher> we just need that 2nd blog :)
12:54:13Araqthat 2nd blog is done since forever
12:54:15livcdI want to run c2nim on some code pieces from reactos. Do I just the .h and .c files for those ?
12:54:27FromGitter<ervinbosenbacher> :)
12:54:27Araqlivcd: https://forum.nim-lang.org/t/3459
12:54:41livcdah
12:55:59FromGitter<Yardanico> livcd: wow, reactos? :)
12:56:10FromGitter<ervinbosenbacher> you mean how karax + ormin works ?
12:56:24Yardanicolivcd, I have some connects with guys from reactos :D
12:56:28Yardanico*connections
12:56:33FromGitter<ervinbosenbacher> @araq you said its not ready yet.
12:56:49livcdYardanico: well reactos already has those wrappers defined so I hope i can use them
12:57:19Araqervinbosenbacher: no I said, it hardly works with today's compiler.
12:57:37Araqit does work and will work better with a couple of compiler fixes.
12:57:38FromGitter<ervinbosenbacher> ok ok
12:57:46Yardanicolivcd, I mean there's telegram groups (russian is the biggest one) and IRC channel #reactos #reactos-dev #reactos-testers
12:59:25livcdYardanico: well i am only interested in simple stuff :D
12:59:45livcdlike enumerating services,manipulating services etc
13:00:26Yardanicolivcd, reactos should be generally compatible with winapi
13:01:17YardanicoReactOS currently targets NT5.2
13:01:17livcdso eg. I want to take this out and try nimgen/c2nim on it https://doxygen.reactos.org/d2/d57/cmdStart_8c_source.html
13:01:47Yardanicowell it would be not that easy because winapi is always a lot of macros :)
13:01:52Yardanicobut IDK about nimgen
13:03:50livcduhm bummer i cant install nimgen
13:04:12FromGitter<ervinbosenbacher> @Araq https://nim-lang.org/araq/karax.html is there a follow up this post?
13:04:30FromGitter<ervinbosenbacher> i know it doesnt work with the current compiler
13:06:04Yardanicofirst part does AFAIK
13:06:29FromGitter<ervinbosenbacher> yes that i know, i have tested it
13:09:37FromGitter<ervinbosenbacher> I am after Ormin or whatever way I connect to any database backend
13:15:49dom96you might prefer the db_* modules in the stdlib
13:18:03Yardanicobut they don't have actual ORM :)
13:20:02livcdah this wont do. I really need nimgen i guess but i cant install it
13:21:30*dandevelo joined #nim
13:24:10dom96livcd: We need more info to help you
13:25:58enthus1astlivcd: such as the error message you get :)
13:26:30livcdsure but i think this is on whoever created nimgen. https://ghostbin.com/paste/9u7hc
13:27:25dom96nope
13:27:30dom96this is c2nim failing to build
13:27:47dom96which sucks
13:28:18livcdaahh
13:28:22dom96try `nimble install compiler@#devel` (make sure your shell doesn't comment that out, but you're on Windows so it shouldn't)
13:28:32livcdyeah ok
13:37:55livcdsame error
13:39:30*Zevv joined #nim
13:40:00ZevvHi #nim; is there some documentation available explaining how buffering is done in the net module, and especially, how to disable this?
13:40:07FromGitter<ervinbosenbacher> hey you need head of nim and compiler
13:40:09FromGitter<ervinbosenbacher> remove ~/.nimble
13:40:34FromGitter<ervinbosenbacher> i have spent a bit of time to getit right myself as well
13:41:29Zevvor should I switch to rawsockets instead?
13:41:59Araqwhy disable the buffering?
13:42:01*martinium_laptop joined #nim
13:44:07ZevvI want to receive UDP packets as they come
13:44:32Zevvvariable size
13:47:15enthus1astare you not receiving the whole packet with UDP?
13:48:10ZevvThey are buffered until buffersize is reached
13:48:22Zevvthus, I loos packet boundaries and get unwanted latency
13:49:57Araquse "nativesockets" for UDP
13:50:01livcdervin: i tried that. Still the same error i pasted earlier
13:50:30ZevvAraq: ok, thanks
13:50:58FromGitter<ervinbosenbacher> @lbvcd 1 sec
13:51:39FromGitter<ervinbosenbacher> can you repaste the error please
13:51:45Yardanicoguys, wow
13:51:46Yardanicohttps://github.com/metacraft-labs/py2nim
13:54:02FromGitter<ervinbosenbacher> thats very cool
13:55:31PMunchWow, that is pretty cool
13:56:31Yardanicoit's developed by alehander42 and zah at the same time, so I think it will be great :)
13:57:43YardanicoTime to update my PoC https://github.com/Yardanico/nimpylib to add link to this py2nim :)
13:57:47livcdervin:https://ghostbin.com/paste/bks4a
13:59:16Araqervin, data-man, https://github.com/nim-lang/Nim/issues/7041
13:59:29FromGitter<ervinbosenbacher> testing py2nim
13:59:43Yardanicoit's in very early state as stated in the readme
13:59:45FromGitter<ervinbosenbacher> thx @Araq
13:59:53*Serenitor joined #nim
13:59:55FromGitter<ervinbosenbacher> still I want to try it
14:00:02FromGitter<ervinbosenbacher> eventually contribute
14:00:31Yardanicohttps://github.com/Yardanico/nimpylib/commit/77f8086d737ffe0618064ff508ccc8fe2e9d9c00 :)
14:00:48FromGitter<ervinbosenbacher> well ```python3 python-deduckt/deduckt/main.py example/fib.py ⏎ ⏎ Traceback (most recent call last) ⏎ py2nim.nim(64) py2nim ⏎ py2nim.nim(60) translate ... [https://gitter.im/nim-lang/Nim?at=5a53799097cedeb0482db7c3]
14:01:15FromGitter<ervinbosenbacher> using python 3.6
14:04:06FromGitter<ervinbosenbacher> https://github.com/metacraft-labs/py2nim/issues/1
14:04:31Yardanicoervin: are you sure you did it right?
14:04:39Yardanicoreadme says you should use './py2nim example/fib.py'
14:04:48FromGitter<ervinbosenbacher> yes
14:05:01FromGitter<ervinbosenbacher> ./py2nim example/fib.py
14:05:26FromGitter<ervinbosenbacher> 1 sec
14:06:10FromGitter<ervinbosenbacher> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a537ad151915d962afdbefe]
14:07:03dom96Zevv: Araq: Don't use nativesockets if you can help it. Just disable buffering, newSocket(buffered=false)
14:07:12Araqok
14:09:18*martinium_laptop quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:11:40*dandevelo quit (Ping timeout: 260 seconds)
14:14:48Zevvdom96: I tried that, but that didn't seem to work
14:14:50Zevvlet me check
14:14:58FromGitter<ervinbosenbacher> @libvcd I had the same problem. ⏎ ⏎ ```rm -rf ~/.nimble ⏎ nimble install compiler@#head ⏎ nimble install c2nim@#head``` [https://gitter.im/nim-lang/Nim?at=5a537ce281cd9a5d7ea27181]
14:15:08FromGitter<ervinbosenbacher> @libvcd https://github.com/nim-lang/c2nim/issues/115
14:15:14FromGitter<ervinbosenbacher> Please do that
14:16:28dom96Zevv: That's odd, might be a bug
14:18:16FromGitter<tim-st> When I have `let s = returnsSomeSeq()` and I want to pass `s` by reference to a proc how should I write it?
14:18:33FromGitter<tim-st> s is of seq[string]
14:19:26FromGitter<tim-st> I tried `ref` and `var` nothing really works
14:21:39FromGitter<tim-st> `return word.exists(source=var s, ignoreCase=ignoreCase)` was my guess
14:22:00Yardanicoyour proc should accept var seq[string] probably
14:22:09Yardanicobut you need to use "var s = returnsSomeSeq()"
14:23:00PMunchWhy isn't there a reverse of this: https://github.com/nim-lang/Nim/blob/master/lib/pure/xmltree.nim#L199
14:23:40FromGitter<tim-st> @Yardanico thanks, and can I use let for this? I only want to read from the var
14:23:52YardanicoI don't think so, but I might be wrong
14:23:59FromGitter<tim-st> thanks
14:24:42YardanicoPMunch, lol, there are 2 other places in nim stdlib where a proc like this is used
14:24:48Yardanico(copy-pasted) :P
14:25:01Yardanicoah, sorry, 4 other places
14:27:51PMunchReally?
14:28:01PMunchAnd there is no place that does the opposite conversion?
14:28:22enthus1ast^ this, and we also need a mime.nim because parsing mime is done in smtp; http and what not else
14:28:29YardanicoPMunch, I didn't find any in nim repo
14:30:21YardanicoPMunch, duplicates are in cgi, compiler/ccgutils, unittest, xmldom, docutils,
14:31:20Yardanicowell they're a bit different
14:40:53YardanicoSo as I understand it seems like with the new runtime Nim will be moving towards making C++ the default compilation target?
14:41:21*zahary quit (Quit: Leaving.)
14:42:10Araqlikely, yes.
14:45:30FromGitter<RedBeard0531> I was reading setLengthStr and I can't tell if this is a bug or intentional. It is passing the requested size to resizeStr in the argument for how much to *grow* the string: https://github.com/nim-lang/Nim/blob/316c693b9127ecc764e3fe26528b255b08afa239/lib/system/sysstr.nim#L231 https://github.com/nim-lang/Nim/blob/316c693b9127ecc764e3fe26528b255b08afa239/lib/system/sysstr.nim#L204
14:46:16FromGitter<RedBeard0531> This is certainly weird, but similar enough to doubling growth that I thought it *could* be by design
14:49:10FromGitter<RedBeard0531> I was thinking setLen would be easier to use setLen if it treated nil input the same as "" and left the string with the desired size, which is why I was looking in the first place.
14:52:12FromGitter<RedBeard0531> C++ as default CG is great news. It seems to have much lower cost exception handling (in the happy path case) than sjlj-based exception handling.
14:53:23Yardanicoyeah, that's the reason
14:53:35Yardanicobecause newruntime will use a lot more `try` blocks
14:53:48Yardanico(that's one of the main reasons)
14:55:03FromGitter<RedBeard0531> I've noticed a tendency of core code to use try/finally rather than defer blocks, even when defer blocks would have felt more natural to me at least. Is there a reason for that, or just different people's styles?
14:56:17FromGitter<RedBeard0531> ex: https://github.com/nim-lang/Nim/blob/devel/lib/pure/collections/sharedtables.nim#L66-L75
14:57:02livcdervin: maybe i am doing something wrong
14:57:05livcdlet me try that
14:57:12euantor`defer` converts to `try/finally` if I remember correctly, so there's no actual difference between the two except from readability
14:57:30Araq'defer' came later and I don't like it
14:57:39euantorI find `try/finally` easier to reason about, especially if there are several lines - you can clearly see when a resource is released that way
14:57:50Araqtry finally is easier to follow IMO
14:58:27livcdwell i also do not like defer: when it gets converted to try/finally
14:58:31euantorSame way as C#'s `using (IDisposable) {}` becomes `IDisposable.create() try { } finally { IDisposable.Dispose() }`
14:58:55livcdsucks to have to keep in mind what it is and how it works :D
14:58:55euantorThough with `using()` you get the easy to follow benefit due to a clear end of scope
14:59:22*Yardanico[Phone] quit (Quit: Quit)
14:59:47FromGitter<RedBeard0531> I guess I like to see the release next to the acquire so I can stop worrying about how/whether it gets released. Also, it avoids an unnecessary layer of indentation. But I'm coming from a C++ RAII mindset, so that could be coloring how I read code.
15:01:31livcdhmm i did exactly that and it is still broken. I'll try to update nim then
15:01:34FromGitter<RedBeard0531> @Araq, any thoughts on the setStrLength possible bug I mentioned earlier?
15:04:25Araqseems like an old bug that got never caught because it only allocates too much?
15:06:49FromGitter<RedBeard0531> ok, I'll PR when I get some time. Just wanted to make sure my understanding of the code was correct.
15:08:55*zahary joined #nim
15:10:15FromGitter<alehander42> @ervinbosenbacher about py2nim: actually you have to pass the full path to the file currently, that should be fixed soon ⏎ overally, it's still in an early stage indeed, but these days we might upload some more complete example translating a lib/project
15:10:51Araqalehander42: why not base it on PyPy?
15:13:01FromGitter<alehander42> why base it on PyPy?
15:13:15*skelett joined #nim
15:13:54Araqdunno, it can deduce some type information at runtime too
15:14:26Araqwell I have no clue how python-deduckt works
15:16:25FromGitter<ervinbosenbacher> @alehander42 ok it worked!
15:17:19FromGitter<ervinbosenbacher> @alehander42 how do i get the output?
15:18:00FromGitter<ervinbosenbacher> ok got it
15:18:08Araqthis is too clever for me
15:18:39Araqno idea how you can make Python output type information with this little amount of Python code and no core interpreter fixes
15:21:17*endragor joined #nim
15:25:27*endragor quit (Ping timeout: 240 seconds)
15:26:49FromGitter<ervinbosenbacher> @alehander42 python-deduckt.json
15:27:06FromGitter<ervinbosenbacher> how is it gets generated? its been cashed afer I compiled sum
15:27:14FromGitter<ervinbosenbacher> then I have deleted it
15:28:55FromGitter<alehander42> @Araq well Python has trace hooks, so you can execute a function on each call/line/return etc. We collect info on each call/return, then process it a bit and serialize it (we also merge some of it with the serialized python ast)
15:29:18FromGitter<alehander42> there are several other tools generating mypy definitions with a similar approach: pyannotate and monkeytype
15:29:50FromGitter<alehander42> of course, you can probably do even more powerful stuff with a patched vm, but it would be harder to install/maintain
15:30:26*Yardanico quit (Remote host closed the connection)
15:30:40FromGitter<RedBeard0531> Do you ignore inputs that result in TypeError?
15:30:53FromGitter<ervinbosenbacher> apart from the examples i wasnt able to transpile anythng else
15:31:16FromGitter<ervinbosenbacher> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a538ec319147ac3231b5639]
15:31:23*Yardanico joined #nim
15:31:59FromGitter<ervinbosenbacher> i took a random python file of mine with full path
15:32:04FromGitter<ervinbosenbacher> and got this
15:32:31FromGitter<RedBeard0531> I'm always afraid of using tests as feedstock for anything that analyzes runtime behavior (such as PGO) because by their nature, many tests are testing edge cases like invalid inputs.
15:33:08FromGitter<ervinbosenbacher> i go back to my hand based transpilation of our python code to nim
15:33:50FromGitter<ervinbosenbacher> python-deduckt.json didnt get generated
15:33:56FromGitter<alehander42> @ervinbosenbacher the intended usage is to pass a file in the context of a package that results in good "function" coverage: usually a test file.
15:34:12*endragor joined #nim
15:34:27FromGitter<alehander42> anyway, it's probably too early to apply it to random real world folders
15:34:34FromGitter<alehander42> as I already said
15:34:36FromGitter<ervinbosenbacher> ok I wait
15:34:44FromGitter<ervinbosenbacher> just got excied
15:34:58FromGitter<ervinbosenbacher> as I am starting to do this by hand
15:36:54FromGitter<ervinbosenbacher> i have been working on python 3.6 to c++14 transpiler maybe I just will use that generate hooks using nim
15:37:27FromGitter<alehander42> @RedBeard0531 that's a valid concern, other possible problem with unit tests can be mocks etc
15:38:40FromGitter<alehander42> running it with integration tests might produce more reliable results sometimes
15:39:03*endragor quit (Ping timeout: 256 seconds)
15:40:49FromGitter<dom96> @alehander42 looks like an awesome tool :)
15:42:32FromGitter<ervinbosenbacher> yes it is, @alehander42 can I help instead of me trying to convert over 100k python code? :D
15:45:22*craigger quit (Quit: bye)
15:45:33*craigger joined #nim
15:48:17*Yardanico quit (Ping timeout: 248 seconds)
15:50:24*Yardanico joined #nim
15:50:46*craigger quit (Quit: bye)
15:50:54*craigger joined #nim
15:59:11Araqalehander42: one guiding principle could be "no matter what, we'll manage to output Nim syntax"
15:59:25*xet7 quit (Ping timeout: 268 seconds)
15:59:35Araqand then the more your runtime profile uncovers, the better Nim code is produced
15:59:54*floppydh quit (Quit: WeeChat 2.0.1)
16:00:04Araqso that people are not left with "ok, the tool crashes, back to hand translation"
16:00:11Araq:-)
16:01:54Araqbut hey, you can also use the py2nim translator I wrote as a forum post (nah, just kidding)
16:05:17*gangstacat quit (Quit: Ĝis!)
16:07:53FromGitter<ervinbosenbacher> :D @Araq I was kidding not giving up
16:08:32FromGitter<ervinbosenbacher> Currently what I do is that using Cython I convert python code to C and then build a nim file y hand to call those functions
16:08:38FromGitter<ervinbosenbacher> without kidding
16:09:15FromGitter<ervinbosenbacher> downside is the huge C code and that I have to link with python lib
16:09:54FromGitter<ervinbosenbacher> the reason for my gazillion questions how do I interface with C
16:10:19AraqI wasn't kidding though.
16:10:31FromGitter<ervinbosenbacher> i know
16:10:54FromGitter<data-man> @Araq: What else should I do for my truecolored PR?
16:11:08*kivyion joined #nim
16:11:10FromGitter<ervinbosenbacher> I understand that there is a lot of work i am here to help, my main focus is on the compiler, destructor etc and python tooling
16:13:45*gangstacat joined #nim
16:14:45*xet7 joined #nim
16:15:54Araqdata-man: your cache is still wrong.
16:16:05Araqfortunately it's also not required
16:16:33Araqif you want to avoid the string concats, use an array[size, char]
16:16:44Araqand pass that instead to the write
16:17:03FromGitter<alehander42> @dom96 thanks. (you should tag @zah too :D )
16:17:32Araqyou misunderstand my "This version works for a disabled taint mode too." remark, but it's not important, I can clean up your PR before merging it
16:17:51*dandevelo joined #nim
16:18:00FromGitter<alehander42> @Araq absolutely, the tool should be fault tolerant and it shouldn't crash in principle
16:18:43Araqalehander42: glad you agree. :-)
16:18:46FromGitter<alehander42> in the worst case it should produce warn messages and commented out original code/suggestions (still not the case, but that's the design goal)
16:19:15FromGitter<data-man> @Araq: Why not required? Cache significantly speeds up the output.
16:19:38Araq"Maybe to add (enable|disable|isSupported)TrueColor procs?" yes.
16:19:48FromGitter<data-man> Ok
16:20:00FromGitter<data-man> Thanks!
16:20:10FromGitter<alehander42> @ervinbosenbacher ofc, contributions would be great
16:21:03*Jesin quit (Quit: Leaving)
16:22:17Araqdata-man: "\x1b[38;2;" & $rgb.r & ";" & $rgb.g & ";" & $rgb.b & 'm' can be written in a way that is faster than hashing it and looking it up
16:22:34*nsf quit (Quit: WeeChat 2.0.1)
16:23:02Araqand it will make the code shorter too
16:23:02FromGitter<ervinbosenbacher> yes I will
16:23:11FromGitter<ervinbosenbacher> currently trying to figure that one out
16:23:25FromGitter<ervinbosenbacher> Ihave no desire to rewrite our entre python codebase by hand
16:23:39FromGitter<ervinbosenbacher> would be silly, better to help you
16:23:57Araqervinbosenbacher: the approach I used for Nim was a bit different than py2nim's approach though
16:24:14FromGitter<data-man> @Araq: strformat? :-)
16:25:04AraqI had a tool pas2nim that could translate Pascal to Nim. I introduced custom annotations for the Pascal code to help the pas2nim tool
16:25:37Araqand for a long time I kept working on the Pascal version until bootstrapping worked reliably with the translated compiler.
16:25:50FromGitter<ervinbosenbacher> yes @Araq just explained I am using cpython to compile python to C then by hand the nim interface
16:26:08Araqyeah but that might not your best option
16:26:17FromGitter<ervinbosenbacher> i know
16:26:25FromGitter<ervinbosenbacher> what would be the best option?
16:26:35Araqif py2nim allows for custom annotations in the Python code you can try what I did
16:26:52FromGitter<ervinbosenbacher> yes just whati was thinking
16:27:16Araqthe trick is to not edit the translated code too quickly
16:27:21FromGitter<ervinbosenbacher> aka nuitka
16:27:44Yardanicowell nuitka basically translated python code into python C API calls
16:27:52Yardanicoand optimizes some constructs
16:27:56Yardanico*translates
16:28:28FromGitter<ervinbosenbacher> yes I was refering to annotations. but then you have to pile thrugh tons of code and add annotations.
16:28:52FromGitter<ervinbosenbacher> Cython does the same thing you still have to link to python
16:29:13Araqyes, it also depends on your goals.
16:29:21*Trustable joined #nim
16:29:32FromGitter<ervinbosenbacher> right quick and dirty solution until the tool is not ready
16:29:41FromGitter<ervinbosenbacher> iteration 1 if you will
16:30:00FromGitter<ervinbosenbacher> python to c (somehow) call it from Nim
16:30:03Araqwith my approach I never had a wasteland of code I couldn't run.
16:30:43FromGitter<ervinbosenbacher> so what did you do again? You were talking about pascal
16:31:13Araqyeah ofc the problem was easier since I only used the subset of Pascal I know would translate easily
16:32:14Araqand I had this lovely {@ignore} pascal code; {@emit Nim version} construct
16:32:34*Jesin joined #nim
16:32:38AraqI think c2nim now has something similar.
16:34:58Araqmy point is "quick and dirty solutions" are good if you don't end up in a messy situation like "Python version too slow and hasn't kept up with the recent features, Nim version has more features but crashes" :-)
16:35:57*dandevelo quit (Remote host closed the connection)
16:36:22FromGitter<alehander42> something like magic comment directives for py2nim might be useful indeed
16:36:31*dandevelo joined #nim
16:36:57FromGitter<ervinbosenbacher> what I do in detail is that I convert the python code to cpython code, basically. And adding annotations to the python code.
16:37:15Araqthat can never hurt :-)
16:38:07FromGitter<alehander42> some other hooks should be also eventually possible: mapping some specific for your project dynamic components to handwritten nim stuff (eg decorators to provided by the user macros), providing our idioms dsl for the user etc
16:38:45*PMunch quit (Quit: Leaving)
16:38:54Araqalehander42: you also often need abstraction breaking transformations
16:39:03Yardanicoervin: don't confuse cpython with cython :)
16:39:16FromGitter<alehander42> loading info from mypy annotations is also possibly useful, the reason it didn't have much priority is that mypy definitions still don't seem to be popular enough (it's not like definitely-typed and ts)
16:39:59Araqlike regex based rewrite rules that are specific to the project and don't generalize well
16:40:01FromGitter<alehander42> @Araq that's true, as a whole often you need architectural changes etc which just can't be expressed with a general translation engine
16:40:14dom96alehander42: already told him, we've got a Slack channel (possibly should open that to everyone)
16:40:28Araqdom96: don't you dare.
16:40:33dom96another suggestion I made: type hints in Python could help
16:40:55dom96Araq: You can still have a private channel for your secret zahary/Araq discussions :P
16:40:55FromGitter<alehander42> yeah, two messages up I gave my view on that
16:41:15Araqdom96: they are not private, you should read them :P
16:41:26dom96fine, me/you and zahary then :P
16:41:33FromGitter<alehander42> but if somebody wants to contribute, mypy support might be a very cool start
16:42:48Araqalehander42: better would be something like Nim's using statement. tell the tool externally how to infer the type based on the parameter name
16:43:31FromGitter<ervinbosenbacher> Then I will use cython for now, second step I will try to help with py2nim
16:43:31Araqhow many def signatures are there to annotate? many thousands. how many different parameter names are used? much fewer, I bet.
16:43:51dom96btw, important-ish announcement. I've decided to change the way Nimble works: if `bin` is specified, Nimble will no longer install .nim files, only compile the binary and install it (this is a more common case so it makes sense by default IMO).
16:44:01FromGitter<ervinbosenbacher> dont know I need to get this done now, we will work on improvements later
16:44:44FromGitter<ervinbosenbacher> if I export functins from cython I can have a quick nim interface job done
16:44:58FromGitter<ervinbosenbacher> its not as glamorous and easy as the tool but better
16:45:08FromGitter<ervinbosenbacher> than rewriting the while thing
16:46:27FromGitter<alehander42> yes, for a big project as yours, probably some process well tweaked for it might be best (at least on the current stage of py2nim)
16:47:09FromGitter<ervinbosenbacher> yes I also get my hand dirty with Nim and get insights how to link the stuff together then I can help with the tool
16:47:44Araqyou can build your Nim code as a DLL and call it from Python.
16:49:00FromGitter<ervinbosenbacher> yes but the main point is not to have python right now.
16:49:11*skelett quit (Ping timeout: 240 seconds)
16:50:06FromGitter<ervinbosenbacher> that is a good option too tw
16:50:08FromGitter<ervinbosenbacher> tw
16:50:12FromGitter<ervinbosenbacher> testedt yesterday
16:50:31FromGitter<ervinbosenbacher> sorry for the typos, on the phone
16:51:11FromGitter<RedBeard0531> @dom96 will nimble still support hybrid lib/bin packages?
16:51:56dom96RedBeard0531: yep, but you will need to explicitly tell Nimble that you want the .nim files installed for that
16:54:33*chemist69 quit (Ping timeout: 265 seconds)
16:54:42*skelett joined #nim
17:03:06FromGitter<ervinbosenbacher> i still think Nim is the best thing currently we just need to figure out how to make it even more awesome and these are just teething issues that we are going to fix
17:05:06*azur_kind joined #nim
17:07:59*chemist69 joined #nim
17:08:28*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
17:13:25*darithorn joined #nim
17:15:41skelettHello, I'm trying to implement an application which should listen on SIGUSR1 for toggeling an inplace configuration reload. In C, only certain operations/functions are safe to be called inside a signal handler. Does anybody know whether the nim compiler pays attention so that signal handlers are always safe or is this up to me (as in C)? Currently I'm using the `onSignal` template from the `posix` module.
17:17:39dom96Unfortunately Nim doesn't do any checking for this AFAIK
17:17:57dom96But I think Nim's effect system would be perfect for this, somebody just has to define what is allowed
17:22:07skelettdom96: Ok thank you. Indeed that could solve the problem in the future. Afaik `man 7 signal-safety` should give an overview over all allowed functions.
17:22:32dom96skelett: feel free to create an issue for this :)
17:28:23Araqskelett, dom96 .gcsafe is a good first approximation of what is valid in a signal handler, I think
17:29:45*miran joined #nim
17:30:07dom96Here are the relevant man pages: http://man7.org/linux/man-pages/man7/signal-safety.7.html
17:31:31dom96huh, this implies that printf uses a global buffer, am I misreading? I find that surprising.
17:32:28*yglukhov quit (Remote host closed the connection)
17:33:01FromGitter<RedBeard0531> I think all of the FILE* functions in c use locking and locking inside a signal hander is a big no-no (possibly unless it is reentrent)
17:33:19skelettdom96: printf is not a safe function
17:33:22dom96ahh
17:34:48skelettBut the low level write function should be IIRC
17:34:49FromGitter<RedBeard0531> write() is safe because it is unbuffered and non-locking (at least in user-space)
17:36:42FromGitter<RedBeard0531> IIRC snprintf is banned because some implementations malloc internally which is another no-no
17:36:55dom96Fun :)
17:37:53*sendell quit (Remote host closed the connection)
17:41:19*claudiuinberlin joined #nim
17:42:29dom96oh, just realised: https://developers.google.com/open-source/gsoc/timeline
17:43:20dom96If we want to apply we've got until January 23rd
17:44:53dom96Last time we made an attempt was 2016 it seems: https://github.com/nim-lang/Nim/wiki/GSoC-2016-Ideas
17:46:52*sz0 joined #nim
18:01:08*yglukhov joined #nim
18:03:09*themagician joined #nim
18:04:37shashlickaraq: from earlier, no I didn't have to use terminal, fzf does most of that
18:05:19*yglukhov quit (Ping timeout: 248 seconds)
18:07:13mirandom96: we want to apply, right? :)
18:07:37dom96we do, but I need people who are willing to mentor/write up tasks for this
18:15:02miranwhat of those 2016 tasks has been completed and what is still open?
18:17:04dom96I think most of them are no longer applicable
18:17:55dom96One task I can think of after looking at this is a webassembly target for Nim
18:19:33miranand is there a roadmap with some clear goals for nim in next year of two?
18:20:38dom96sort of, me and Araq have been meaning to make it public for a while now.
18:21:15Yardanicoit's private? :)
18:21:17miranplease do it :)
18:22:29miranone thing at top of my mind when it comes to nim improvements is nim's vscode plugin
18:22:53miranas this is something that most of us use every day
18:23:00dom96That's true
18:23:11dom96I would like to see a language server implementation
18:23:17dom96That builds on top of nimsuggest
18:23:35dom96and does its own parsing for faster responses in some cases
18:23:42FromGitter<data-man> https://gist.github.com/data-man/62b186bfd39694cfbc9976321f11359b ⏎ ⏎ |benchGetColor.nim | relative | time/iter | iters/s ⏎ --- | ---| --- | --- ⏎ getColorSimpleConcat | | 80.15ms | 12.48 ... [https://gitter.im/nim-lang/Nim?at=5a53b72e0505ad8b45cce4cf]
18:28:54Araqstill not as optimized as I imagine :P
18:30:53FromGitter<data-man> You can always improve after merging :-D
18:31:06FromGitter<Araq> I can't merge, it's not correct
18:31:38FromGitter<Araq> you cannot use SharedTable with string keys unless you protect() the string
18:31:58FromGitter<Araq> it's really messy
18:34:24FromGitter<data-man> Then I will remove caching for threads mode. ⏎ It's ok?
18:34:26*nsf joined #nim
18:34:56*azur_kind quit (Remote host closed the connection)
18:35:36*endragor joined #nim
18:36:14*endragor_ joined #nim
18:36:48Araqyes!
18:37:04Araqoh, I misread, oh well
18:40:05*endragor quit (Ping timeout: 240 seconds)
18:40:18FromGitter<data-man> fmt is thread safe? :-)
18:40:28*endragor_ quit (Remote host closed the connection)
18:41:00*endragor joined #nim
18:42:15*endragor quit (Remote host closed the connection)
18:42:49*endragor joined #nim
18:44:06*endragor quit (Remote host closed the connection)
18:45:06*Trustable quit (Remote host closed the connection)
18:45:09FromGitter<xmonader> Hi
18:45:32FromGitter<xmonader> I see https://github.com/nim-lang/Nim/issues/6778 all of the methods to be deprecated are already done hmm
18:50:43Araqdata-man: it is.
18:59:40FromGitter<RedBeard0531> Why deprecate repr? In languages without it (basically everything but python and nim) I end up missing it.
19:00:30*zahary quit (Quit: Leaving.)
19:05:58*yglukhov joined #nim
19:06:38Araqmacros.repr is not system.repr
19:06:48Araqand it should have been macros.$
19:06:53*Ven`` joined #nim
19:07:19Araqbut I don't want to do this anymore either, pointless renamings everywhere when we've much better things to do
19:07:39FromGitter<RedBeard0531> ahh, got scared for a second :)
19:10:25*yglukhov quit (Ping timeout: 248 seconds)
19:15:40*miran quit (Quit: Konversation terminated!)
19:17:48FromGitter<RedBeard0531> Even if the renames aren't a good use of time, extending nimsuggest (or building a similar tool) to support renames like this seems pretty valuable. I know I use that functionality in rtags in our c++ codebase fairly frequently. It is great being able to hit a few keys and have all usages rewritten.
19:17:48*Ven`` quit (Read error: Connection reset by peer)
19:18:05*Ven`` joined #nim
19:22:35*zahary joined #nim
19:32:12AraqI can do that with nimgrep, more or less.
19:32:38Araqthe problem is I don't have "all usages", I have plenty of Nim projects on multiple different machines
19:33:09Araqand "project X now only works with the latest Nim" is not much of a feature for everybody else
19:33:21*Serenitor quit (Ping timeout: 248 seconds)
19:38:09*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:59:38FromGitter<ervinbosenbacher> we should keep the stuff simple and consistent without renaming things which can break things. Imho once the language is finalized its should be kept that way. Countless languages fall in the same trap.
19:59:53FromGitter<ervinbosenbacher> just my cents out of the blue.
20:00:04*mckendricks joined #nim
20:00:12FromGitter<RedBeard0531> I think macros.repr highlights the limitations of using nimgrep for this, but I get your larger point. Breaking stuff without good reasons sucks for everyone. I've gotten too used to working on a unified codebase where I can change everything that doesn't change rpc inputs and outputs in a single commit.
20:03:02*rauss quit (Quit: WeeChat 2.0.1)
20:04:08*rauss joined #nim
20:06:18*martinium joined #nim
20:11:02*Vladar quit (Quit: Leaving)
20:12:43YardanicoI'm currently trying to run py2nim on a ~1k loc project :)
20:13:12FromGitter<ervinbosenbacher> Ok let me know how you getting on
20:15:38Yardanicowow, python-deduckt.json is 123mb :)
20:16:08FromGitter<ervinbosenbacher> how big is the result ?
20:17:22FromGitter<ervinbosenbacher> i mean the nim file(s)
20:19:48YardanicoWell I'm redoing it (I merged tests and project file into one file)
20:20:03FromGitter<ervinbosenbacher> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a53d27351915d962afdc472]
20:20:22FromGitter<ervinbosenbacher> i cant submdule init due to permissions
20:21:10Yardanicoyeah I fixed that
20:21:26*yglukhov joined #nim
20:21:31FromGitter<ervinbosenbacher> thats 2 minutes ago
20:21:32Yardanicochange file .git/config
20:21:38FromGitter<ervinbosenbacher> ok
20:21:44Yardanicochange url in submodule to https://github.com/metacraft-labs/python-deduckt
20:21:46Yardanicoit will work
20:22:07FromGitter<ervinbosenbacher> thx
20:25:37*yglukhov quit (Ping timeout: 248 seconds)
20:28:52Yardanicowell py2nim sigsegvs :)
20:29:10FromGitter<martinium> Happy New Year guys!
20:29:26Yardanicoyou're a bit late :P
20:30:33FromGitter<martinium> yeah :)
20:30:43*zahary quit (Quit: Leaving.)
20:30:57FromGitter<martinium> haven’t been in here in a bit so wanted to say hi and catch up
20:31:05*jjido joined #nim
20:31:14dom96alehander42: why not use nimble instead of submodules?
20:31:49Yardanicobecause his submodule is in python ? :)
20:32:01Yardanicoit's a python project for tracing python types at runtime
20:32:14Yardanico(this is possible with some magic)
20:33:41*jjido quit (Read error: Connection reset by peer)
20:33:53Yardanicogrumpy works the same way btw
20:35:09Yardanicohttps://github.com/google/grumpy/tree/master/compiler
20:35:32Yardanicobut it seems it uses static analysis
20:38:15FromGitter<ervinbosenbacher> right now I will use nim modules from python following the advice
20:38:35*SitiSchu joined #nim
20:38:50FromGitter<ervinbosenbacher> mnaged to comile python for for our embdded platform so we go with that and gradually I will add new stuff using nim
20:39:47*SitiSchu quit (Client Quit)
20:40:08*SitiSchu joined #nim
20:42:12*jjido joined #nim
20:43:51*Yardanico quit (Remote host closed the connection)
20:45:14*jjido quit (Read error: No route to host)
20:49:22darithornhow do I use macros.quote if I want to change the op parameter?
20:50:17*jjido joined #nim
20:50:46Araqhttps://github.com/nim-lang/Nim/issues/6989 now somebody figures out the reason please
20:50:50Araqsee you later
21:00:30dom96Yardanico: oh lol, my bad.
21:02:30jjidoWhat does ^rot do?
21:07:20FromGitter<zetashift> ^rot = rot.len
21:07:49FromGitter<zetashift> I think actually: https://nim-lang.org/docs/tut1.html#advanced-types-subranges under 'Slices'
21:17:20*jjido quit (Read error: Connection reset by peer)
21:20:23*jjido joined #nim
21:25:05*yglukhov joined #nim
21:29:23*yglukhov quit (Ping timeout: 255 seconds)
21:35:10*miran joined #nim
21:36:04miranAraq: i just seen your comment about strange behaviour in 0.17.3
21:36:23miranit seems like ^ is the cause?
21:37:03*jjido quit (Read error: No route to host)
21:37:38miranjjido: ^x is like -x in python, indexing from the right
21:45:04*jjido joined #nim
21:51:47*martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:51:59*deech joined #nim
21:53:08*miran quit (Quit: Konversation terminated!)
21:54:07*martinium joined #nim
22:27:17*nsf quit (Quit: WeeChat 2.0.1)
22:38:50*dddddd quit (Remote host closed the connection)
22:47:08FromGitter<data-man> https://github.com/data-man/SciTENim ⏎ Just for fun :)
22:56:38*Serenitor joined #nim
22:57:28*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
23:06:28*vlad1777d joined #nim
23:08:00*Yardanico[Phone] joined #nim
23:25:52*jjido quit (Read error: Connection reset by peer)
23:33:26*mckendricks quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:52:23*marenz__ joined #nim