<< 06-07-2018 >>

00:02:11dom96Check the index for "object variant"
00:08:52nasusirodom96: inside the book you mean?
00:09:50dom96hrm, seems it's not in the index
00:09:52dom96Page 74
00:11:43nasusirobloody hell, how come I did not absorb the "empty: bool" part in the first place? O.o
00:11:57nasusiroI guess it's not doing any good to study until morning hours on a daily basis
00:17:34nasusirothank you dom96, now I refreshed my memory and understood it better, let alone correctly this time.
00:30:43CodeVanceconstructors should use curlybraces instead of round braces
00:30:45CodeVanceIMO
00:34:11FromGitter<kayabaNerve> CodeVance: Fight me.
00:34:34FromGitter<kayabaNerve> Constructors are generally functions. () symbolize a function.
00:35:03CodeVanceIts not really a funtion though
00:35:45CodeVanceand there's no way to overload them
00:40:03FromGitter<kayabaNerve> I would like to be able to overload newType to Type()
00:40:36FromGitter<kayabaNerve> I just think Type{} looks weird.
00:40:42CodeVanceyes
01:09:21FromGitter<Varriount> @kayabaNerve What do you mean?
01:09:37FromGitter<Varriount> You can already do `Type(member: value ...)`
01:22:02FromGitter<kayabaNerve> @Varriount I mean set my own function for Type()
01:22:23FromGitter<kayabaNerve> So instead of doing Type(member: value), Type(arg) calls newType(args)
01:22:26FromGitter<kayabaNerve> Overload
01:23:44CodeVanceI guess you can overload new
01:23:51CodeVanceType.new(asdasd)
01:24:36CodeVancebut you'd just be saving a few keypresses
01:34:55*nasusiro quit (Quit: Quitting for now...)
01:39:22FromGitter<kayabaNerve> That's losing one...
01:39:26FromGitter<kayabaNerve> newType ⏎ Type.new
01:43:53*find0x90 joined #nim
01:49:21CodeVanceya XD
01:49:51CodeVanceproc newFoo():Foo vs new(_:type Foo):Foo meh :\
01:57:53*leorize joined #nim
02:16:30*yglukhov[i] joined #nim
02:19:00*leorize quit (Ping timeout: 245 seconds)
02:21:21*yglukhov[i] quit (Ping timeout: 264 seconds)
02:26:19*leorize joined #nim
02:28:29*ashleyk__ joined #nim
02:29:55*ashleyk_ quit (Ping timeout: 250 seconds)
02:48:53*leorize quit (Ping timeout: 255 seconds)
02:55:50*leorize joined #nim
02:56:37*leorize quit (Client Quit)
02:58:54TangerHey folks! If I'm looking to raise an error when the user enters an invalid value for an argument, what kind of error should I be using?
02:59:31TangerI was raising an OSError, but it doesn't make sense because the OS hasn't technically errored yet
02:59:50*endragor joined #nim
03:04:05*endragor quit (Ping timeout: 240 seconds)
03:06:35FromGitter<Varriount> Tanger: ValueError
03:10:15TangerThanks Varriount
03:28:27*leorize joined #nim
03:29:02*endragor joined #nim
03:37:35*lompik joined #nim
03:55:30*find0x90 quit (Quit: find0x90)
03:55:36*fjvallarino quit (Remote host closed the connection)
03:56:03*fjvallarino joined #nim
04:00:57*fjvallarino quit (Ping timeout: 265 seconds)
04:55:09*dorelix quit (Quit: Leaving)
05:07:09*fjvallarino joined #nim
05:29:04*Vladar joined #nim
05:42:22*leorize quit (Quit: WeeChat 2.1)
06:06:27*erratic quit (Ping timeout: 240 seconds)
06:19:20*yglukhov[i] joined #nim
06:24:09*yglukhov[i] quit (Ping timeout: 256 seconds)
06:33:06*Trustable joined #nim
06:45:51*NamPNQ joined #nim
06:52:54FromGitter<retsyo> a newbie seek for help to make https://github.com/Tormund/winim ( which is forked from https://github.com/khchen/winim) run COM example under current nim. Sorry I can only read what the error is but don't know how to fix
07:04:16FromGitter<mratsim> @codevance @kayabaNerve you can put your thoughts on new here: https://github.com/nim-lang/Nim/issues/7519
07:05:48FromGitter<mratsim> and this one too: https://github.com/nim-lang/Nim/issues/7832
07:06:36*yglukhov[i] joined #nim
07:12:02*yglukhov[i] quit (Read error: Connection reset by peer)
07:12:34*yglukhov[i] joined #nim
07:14:37FromGitter<Varriount> @mratsim I'm not a huge fan of requiring braces everywhere (a requirement for that kind of generic usage).
07:15:55FromGitter<Varriount> I do like the init idea though.
07:17:28FromGitter<mratsim> I don’t sway one way or the other regarding braces, but I find the newTable, newSeq, initTable a bit clunky.
07:18:31FromGitter<mratsim> regarding typedesc vs generics, unless there is a single type argument (constructor), I prefer Generics because when reading I see instantly what is type related from what is an argument
07:19:09FromGitter<mratsim> I’m fine with conversion proc taking a data and a typedesc argument too
07:31:20*PMunch joined #nim
07:42:17yglukhovretsyo: comment out all the `variantConverter` and use `fromVariant` directly.
07:47:12*BitPuffin joined #nim
07:54:36*leorize joined #nim
08:02:36Araqthe problem with 'init' is that it takes a 'var T' where it should take an 'out T' (which Nim doesn't have)
08:03:32Araqit's a tough problem with no obvious solution
08:04:27FromGitter<admin0day> hi guys,what is the difference influence between the "ref object" and the "object"?
08:06:00yglukhov[i]admin0day: https://forum.nim-lang.org/t/3869#24100
08:06:37FromGitter<admin0day> nice job,thx
08:08:58*floppydh joined #nim
08:24:36*Hotkeys joined #nim
08:26:04FromGitter<mratsim> > Size of the objects (and whether it fits on stack) almost never has to be considered in reality. ⏎ ⏎ My 8GB tensors beg to differ ;)
08:27:10Araqthinking about it more, this is just bad. var x: T; init(x) is not the same as var x: T = init()
08:27:55*dddddd joined #nim
08:27:56Araqin other words, we have an 'out' parameter and it's called the "return value"
08:28:14Araqwe need to make use of it.
08:28:50FromGitter<mratsim> `proc init(T: typedesc[non ref]): T` ?
08:29:14Araqyeah.
08:33:12AraqMyObject(field: init(type(MyObject.field)))
08:34:47FromGitter<admin0day> how to achieve the "#define" which is the text's replacement function of the C by using the Nim?
08:35:08def-templates
08:36:06FromGitter<admin0day> thx , i will try it
08:36:17def-well, in some situations in C you have to use #define, but in Nim generic inline procs would be fine, so it depends
08:40:24FromGitter<admin0day> u means inline will be ok too? @FromIRC
08:41:36PMunchadmin0day, FromIRC is not a user, it's just a bridge between Gitter and IRC
08:41:45PMunchI think you wanted to highlight def-
08:42:37PMunchAnd to answer you question, it depends on what you want to achieve. The problems that are solved by #define have different solutions in Nim
08:43:09FromGitter<admin0day> i just trying to achieve a simple line which is referred in another place,is seem just a simple text's replacement function.
08:43:14PMunchYou will be able to solve all of them with a template, but depending on what you want to do it might not be the best way
08:44:07PMunchAh, yeah then a template might be right for you. But keep in mind that Nims templates are hygienic unless you specify the {.dirty.} pragma
08:47:10FromGitter<admin0day> hhhh,in fact,i just dislike my code so much cause i am the new fish in programming,i think i will signout {.dirty} without any doubt
08:49:12FromGitter<admin0day> ok i found the simple way to use template
08:49:20FromGitter<admin0day> thx
09:02:30*rosshadden quit (Read error: Connection reset by peer)
09:03:37*rosshadden joined #nim
09:35:29*NamPNQ quit (Ping timeout: 256 seconds)
09:46:59*ng0 joined #nim
09:51:15*ng0 quit (Client Quit)
10:06:15FromGitter<retsyo> @yglukhov, thanks. but so bad, the fresh built github's source gives nim 0.18.1, which now said a new error: type 'ptr void' is not allowed
10:06:54yglukhovretsyo: that one just replace with `pointer`
10:09:55FromGitter<retsyo> I think it could be better if someone can keep an up-to-date winim
10:27:46yglukhovretsyo: currenlty tormund seems too lazy to overtake it. so you've got a chance to be the one ;)
10:29:12*noonien joined #nim
10:46:17*msmorgan quit ()
10:46:29*mgdelacroix quit ()
10:46:34*msmorgan joined #nim
10:46:46*mgdelacroix joined #nim
10:51:13FromGitter<retsyo> I wish I could but I know little about nim.
11:03:57FromGitter<retsyo> since I have finished my application with python+win32com, there is only a little motive( i.e. I just want to release the app easily for different Windows version) for me to rewrite the app in a new language. Further more, if I use nim, I have to fix the bugs in nim's library which decrease my motive again.
11:06:48FromGitter<retsyo> this maybe the situation for nim to attract non-hardcore-programmer like me who purpose to find a langauge with many libs to handle problems quickly
11:06:49FromGitter<retsyo> this maybe the situation for nim to attract non-hardcore-programmer like me who purpose to find a langauge with many libs to handle problems quickly
11:15:31Araqwhich bugs do you mean?
11:15:48Araqbugs are always being worked on, you don't have to fix them all on your own.
11:17:05FromGitter<retsyo> I mean bugs/errors in winim
11:37:57Araquse winlean instead? :P
11:38:21Araqthe last time I looked at winim it chose to emulate Basic.
11:38:30Araqthat's not what I want from a wrapper.
11:40:14dom96retsyo: What does your application do?
11:45:46FromGitter<retsyo> it reads from DOC and DOCX files which are supplied by others. So I have to rely on COM objects heavily since even for Python there is no package can read all infos from both DOC and DOCX
11:47:13FromGitter<retsyo> I have checked winlean just now. But it seems that it has nothing to do with COM.
11:47:17FromGitter<retsyo> I have checked winlean just now. But it seems that it has nothing to do with COM.
11:48:34dom96Are there any C libraries out there for reading doc/docx?
11:48:51Araqhardly, COM is a pita
11:49:05Araqand winim isn't bad at it
11:49:13Araqbut needs a serious cleanup session.
11:49:13PMunchWell docx is just a zip file with xml in it
11:49:26*xet7 joined #nim
11:49:40FromGitter<retsyo> no, no. there is also DOC files too in my situation
11:49:58PMunchFound this dom96 https://stackoverflow.com/questions/301132/microsoft-word-text-parser-in-c
11:52:09dom96meh, looks like these libraries are all outdated
11:52:21PMunchWell, doc is a pretty dated format
11:52:23*freevryheid joined #nim
11:52:30*freevryheid is now known as fvs
11:53:51Araqwell need a good, reasonably complete win API package under nim-lang
11:54:24AraqNim's rather good Windows support gives us a little strategic advantage
11:54:36Araqand so we need to put more effort into it.
11:55:08Araqand by 'we' I mean 'Araq' as everybody else doesn't use fucking Windows anymore :P
11:59:21FromGitter<retsyo> the real story is: I am a teacher. I hate to check the format in student's paper which is a tedious work. So I finished an app (in Python, sorry), which can check/semi-check: 1. whether the numbering of heading/figure/table/equation is continuous; 2. whether the number of references is enough, whether all references are cited; 3. page/font/paragraph size; 4. and more
12:01:19FromGitter<retsyo> it is a sad story because we can't control all these kind of format by just telling students to obey basic rules.
12:01:43dom96You could take marks off your students for not saving in .docx :)
12:01:52dom96Is this high school?
12:04:52AraqFailure: reExitcodesDiffer
12:04:52AraqExpected:
12:04:52Araqexitcode: 0
12:04:52AraqGotten:
12:04:52Araqexitcode: 1
12:04:54AraqOutput:
12:04:57AraqFull read size: 20
12:04:59Araqtmemfiles2.nim(22) tmemfiles2
12:05:01Araqmemfiles.nim(64) mapMem
12:05:03Araqoserr.nim(66) raiseOSError
12:05:05AraqError: unhandled exception: Access is denied.
12:05:06FromGitter<Vindaar> @retsyo in that case, can't you just use e.g. pandoc, convert it to Org, Markdown etc. (any ASCII format basically) and just parse that much easier?
12:05:07Araq [OSError]
12:07:59dom96Araq: Abide by the channel paste rules or you'll be banned :P
12:08:39Araqdom96, we'll see about that.
12:08:48Araqnow help me please. why is this test failing?
12:09:18Araqnew branch "consistent modules"? where does that come from?
12:09:20dom96No idea. Admin rights required?
12:09:50Araqbut it's a regression
12:10:09AraqI changed how the "to cstring" conversions are implemented
12:10:39dom96there is bound to be plenty of that going on in this test
12:10:57FromGitter<retsyo> maybe pandoc is a workaround @Vindaar.
12:10:57*nasusiro joined #nim
12:11:09Araqit's the only test that fails, https://ci.appveyor.com/project/Araq/nim/build/4949/tests
12:13:36FromGitter<retsyo> Windows is ugly, but ms word is nice. I did not find other word processing software can replace msword ( if we ignore Latex), no matter libreoffice/WPS/or something else
12:13:37FromGitter<retsyo> Windows is ugly, but ms word is nice. I did not find other word processing software can replace msword ( if we ignore Latex), no matter libreoffice/WPS/or something else
12:13:37FromGitter<retsyo> Windows is ugly, but ms word is nice. I did not find other word processing software can replace msword ( if we ignore Latex), no matter libreoffice/WPS/or something else
12:13:50dom96oprypin: is that a bug? ^
12:13:59dom96pandoc sounds like a good idea btw
12:14:01dom96bbl
12:14:37FromGitter<Vindaar> @dom96 the message also appeared several times on Gitter for me
12:15:09FromGitter<Vindaar> I've had that happen to me when I use gitter with sketchy internet. sometimes messages disappear and then suddenly show up twice and so on
12:18:08AraqLatex!!! the best tool ever. only losers spend time on formulars, scientific work or proofs when you can instead try to make a blind, dump tool from the 60ies format your results in a way that doesn't run over the margins
12:19:03ehmrydom96: about this nimble cross-compiling, I want to compile for a platform that is not-self hosting, but I want to use nimble's depenency management, why not support this in nimble?
12:21:25FromGitter<mratsim> New paper on memory model / intermediate representation optimization for C, C++ and Rust from LLVM researchers: http://sf.snu.ac.kr/publications/llvmtwin.pdf
12:21:39AraqI honestly want to know how much scientific progress is held back by Latex. Or how many results are buggy just because people produced typos with its dynamite syntax.
12:22:51*endragor quit (Remote host closed the connection)
12:22:53FromGitter<mratsim> section 4.8 mentions “memory block lifetimes"
12:23:17ehmrydom96: otherwise I would clone to a local directory an call nimble build with a custom nim.cfg
12:23:17FromGitter<Vindaar> @Araq honestly I'm not against using a different tool than Latex, but I've yet to find a tool as convenient to write theses / papers. Once you start adding tons of equations, plots and tables things are horrible in the alternatives I'm aware of
12:23:20*endragor joined #nim
12:23:56FromGitter<mratsim> Start in MultiMarkDown, finish in latex
12:25:11Araqnever ever use Latex.
12:25:22Araqfor anything.
12:25:24FromGitter<Vindaar> Well, smaller things I write in Org mode and export to Latex. But for something larger / more important than some documentation I wouldn't dare
12:25:49Araqnim's rst2pdf uses latex as the interim step
12:26:06Araqand even for that it's terrible.
12:26:25*FromGitter * narimiran writes in LaTeX as we speak
12:26:39FromGitter<Vindaar> hehe
12:26:59FromGitter<alehander42> it's weird, i 've always read latex produces beautiful results
12:27:33FromGitter<Vindaar> and IMO it does (if you consider a *few* things anyways)
12:27:38FromGitter<mratsim> you need to optimize your typefaces for that, it’s super time consuming
12:27:42*endragor quit (Ping timeout: 245 seconds)
12:27:46Araqand the very idea of putting stuff beyond the margin means the authors haven't understood its problem domain.
12:28:06Araqhint: paper is finite in size.
12:29:47Araqbeautiful results my ass, it cannot even word wrap stuff decently.
12:30:33FromGitter<alehander42> haha, well, they dreamed of A2 papers
12:30:42FromGitter<retsyo> it looks we can chat free topic here. I post one of my question I have not find solution for my app. But to be frankly , I think it is impossible by computer. https://stackoverflow.com/questions/51093751/ai-deep-learning-approach-to-judge-reference-in-paper
12:32:33*krux02 joined #nim
12:33:12krux02hey people, I have good news. Debugging Nim and inspecing the variables is finally possible.
12:33:34krux02just look at this screenshot: https://snag.gy/KHa6mr.jpg
12:33:54PMunchalehander42, don't listen to him. Latex is beautiful :)
12:34:02krux02bad news. The only gdb frontend that I got to work was eclipse :/
12:34:20FromGitter<mratsim> Ugh, eclipse ...
12:34:25FromGitter<retsyo> good news. but eclipse is too heavy
12:34:33PMunchOooh interesting krux02
12:34:57krux02types aren't printed correctly, but I think people can live with that
12:35:18PMunchWhat do you mean printed correctly?
12:35:21krux02so instead of "system.string" it is "NimStringDesc *"
12:35:23FromGitter<ChristianWitts> aaww, not even gdbgui for browser based ? :(
12:35:27PMunchAh right
12:35:37krux02I tested gdbgui
12:35:47krux02but gdbgui is too buggy
12:35:50*endragor joined #nim
12:35:52FromGitter<mratsim> @restsyo, it’s not impossible, it’s pretty well structured and you can train a DL model on it, but for the parsing part a Nim macro is probably enough
12:35:57FromGitter<mratsim> @retsyo*
12:36:16krux02or better said they don't use the api correctly and then you can't see the children of containers
12:36:28FromGitter<mratsim> Here are some example of Deep learning usage for sentence parsing: https://github.com/status-im/datasets/blob/master/201805_EIP0_shared_values/eip0_shared_values_wordcloud_topic_modelling.ipynb
12:36:38krux02I reported that bug thogh. So it is up to gdbgui to fix that
12:36:39FromGitter<ChristianWitts> ah damn. I’ve not had issues with it, but it worked fine for Rust for me :/
12:36:45FromGitter<ChristianWitts> Cool
12:37:28FromGitter<mratsim> @retsyo, and another example of a trickier sentence to parse: https://github.com/explosion/spaCy/blob/master/examples/information_extraction/entity_relations.py 'Net income was $9.4 million compared to the prior year of $2.7 million. Revenue exceeded twelve billion dollars, with a loss of $1b.'
12:37:35FromGitter<mratsim> #Expected output: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3f628f3c5abf52b6411b0d]
12:37:47FromGitter<retsyo> @mratsim thanks, I try to learn your example
12:38:31krux02I am also a bit confused the HashSet[string] lists the characters of the strings it contains as individual letters and the elements as different C-array types to characters
12:38:43FromGitter<mratsim> and since bibliography has a very codified syntax, you can just write a lexer/parser for it, and reject when bibliography is not properly formatted
12:39:22FromGitter<mratsim> note that if you want to deal with unicode it becomes much harder.
12:39:29krux02ChristianWitts: since you have experience with Rust and Nim. Which one is better :P
12:39:49Araqbut before answering
12:39:52FromGitter<retsyo> the syntax of bibliography is actually tooo complex
12:39:55Araqremember this is #nim :P
12:39:58FromGitter<ChristianWitts> They both have their use cases :)
12:40:04Araqheresy!
12:40:05*endragor quit (Ping timeout: 240 seconds)
12:40:13FromGitter<mratsim> blasphemy!
12:40:16Araqthere can be only one language.
12:40:21*Amun_Ra quit (Quit: Gdyby mi się chciało tak jak mi się nie chce...)
12:40:28FromGitter<mratsim> *summon pitchfork
12:40:35FromGitter<ChristianWitts> Personally, I prefer nim, but Rust sometimes has a package already built for what I want :D
12:40:41*Amun_Ra joined #nim
12:40:56FromGitter<mratsim> Ah, it’s just laziness, well that’s understandable ;)
12:41:28FromGitter<ChristianWitts> I spend most of my time these writing YAML for various *-as-code tools, so it’s whatever gets it done faster if I’m writing an application
12:41:33FromGitter<retsyo> this is the reason why python is more popular
12:41:38krux02I still have humble plans in my head to write a macro that can autogenerate Nim wrappers for Rust packages.
12:41:47FromGitter<ChristianWitts> So, Python, Go, Nim, Rust, Bash scripts. Whatever works
12:41:56FromGitter<ChristianWitts> oooo, that would be fantastic
12:42:10krux02but I don't know how well that works out.
12:42:12FromGitter<mratsim> @krux02 we could use that in production at Status.
12:42:55krux02I mean for stand alone rust libraries that could work out pretty well. but for some deeper layed dependency networks of rust packages, I don't know how practicable it will be.
12:43:46Araqmratsim: that paper pretty much implies wasm is misdesigned.
12:44:02FromGitter<mratsim> surprise? :P
12:44:04Araqas it doesn't distinguish between integers and pointers iirc
12:44:10krux02mratsim: I am sure a lot of people could use that in production. For c++ it would even have much more value because there are more c++ packages. but I think for c++ an automatic solution is not feasible.
12:44:11FromGitter<ChristianWitts> I had a random thought the other night about trying to get Seastar working in Nim. Then I had more wine and promptly forgot about it :D
12:44:32Araqkrux02, c2nim can parse C++
12:44:42Araqand was used for large wrappers of C++.
12:44:53Araqbut ofc it can never be automated completely.
12:44:59krux02araq: yea but c2nim is semiautomatic
12:45:04krux02yes
12:45:27krux02I don't need to tell you the problems with the c macros.
12:48:20krux02C++ is supposed to get modules as well. Maybe there is a bright future that allows to auto-wrap at least the c++-module libraries.
12:48:22*SenasOzys joined #nim
12:48:52krux02But I wouldn't hope too much. Every time someone proposes something that could actually solve problems in c+ there will always be someone who well be agains it.
12:49:14*SenasOzys quit (Remote host closed the connection)
12:49:43*SenasOzys joined #nim
12:49:45krux02(that is not strictly tied to c++, but I think it is because these people are those who have heavy investments to work around those problems and when that problem would go away they would loose their market advantage).
12:50:25krux02that is just theory.
12:51:43dom96ehmry: I'm not too sure what Nimble needs for cross-compilation, but I'm very reluctant when it comes to adding features to Nimble
12:52:16dom96Araq: I wrote my dissertation in LaTeX*.
12:52:18dom96* I used pandoc ;)
12:52:58ehmrydom96: I should try to write a script to do this then first
12:53:11Araqsame here, why do you think I hate it so much?
12:53:17dom96ehmry: Yes. Don't jump to "nimble needs to do this" immediately :)
12:53:35krux02well I dislike latex a lot. The same I dislike c++.
12:53:52dom96I don't disagree that it sucks, but there isn't really an alternative.
12:54:18krux02plain Tex
12:54:50krux02the same that there are people disagreeing with c++ and program in c, there are people disagreeing with latex who use tex
12:55:01FromGitter<narimiran> @dom96 there's no need to (directly) use LaTeX if you have just several equations here-and-there, but when you deal with lots of equations, the other solutions start to lose their advantages
12:55:27AraqHTML to "print view" works better.
12:55:40Araqwell that's my hypothesis for now :P
12:55:51FromGitter<narimiran> and for "regular writing", markdown/rst/asciidoc will do the trick just fine
12:56:16krux02and org mode :P
12:56:28Araqall you need to have is a good PDF library and then you can write your own tool...
12:56:51Araqand it will suck really badly, but still make you more productive than Latex
12:57:03FromGitter<narimiran> @krux02 re: org mode: ...the same that there are people disagreeing with emacs and use vim :D :D
12:57:24krux02I disagree with emacs and still use it.
12:57:24FromGitter<retsyo> it is said that knitr+r is suitable for paper with calculations and plots
12:57:38krux02Because I think it is like Latex there is no real alternative.
12:58:05Araqhand writing + a scanner -- superior to any other tool. ;-)
12:58:26PMunchdom96, I wrote my masters thesis in Latex :)
12:58:27krux02Araq: but be warned xerox scanners might change your numbers
12:58:29FromGitter<ChristianWitts> you could use SVGs for your equations, and do your text in whatever floats your boat
12:58:40*leorize quit (Ping timeout: 256 seconds)
12:58:45FromGitter<narimiran> in the end - whatever tool you choose to use - don't forget to first bikeshed for quite a lot of time while you're trying to find the perfect tool!!
12:58:59PMunchAraq, it's been so long since I've written anything for hand I think it would cramp up and fall off if I were to try and write something that long by hand :P
12:59:15PMunchAnd I'm pretty sure I'm actually faster at typing at a computer than I am writing by hand
12:59:19Araqhand writing also lets you introduce new math symbols and embed secret messages
12:59:44dom96Sure, I can use AsciiDoc or markdown but I won't get such a high quality PDF out of them
12:59:53PMunchHaha, that's fair. Hand writing is more versatile
12:59:58Araqnot too mention the famous "I found a proof but it doesn't fit this margin"
13:00:21*leorize joined #nim
13:00:24Araqmythical predictions that never come true ... hand writing ftw.
13:00:51dom96hand writing hurts my hand :P
13:01:21krux02I like the hand writing trick where the font gets smaller at the end of the line to still fit that last characers in without starting a new line
13:01:32FromGitter<retsyo> what about plot when you do use handwriting?
13:01:38Araqyeah but let's face it.
13:01:46Araqthis hand writing trick was inspired by Latex.
13:02:26FromGitter<mratsim> still better than the way Word handles “justification"
13:02:30Araqbut it improved upon Latex. because it never exceeds the physical paper size.
13:02:44PMunchkrux02, maybe that would be a solution to the 80 characters per line thing. Just make the font smaller and smaller so it never passes the 80 character per line margin :P
13:03:46Araqretsyo: you use a ruler?
13:03:54Araqand plot stuff.
13:04:56Araqor you print it out and write around the plots
13:05:51krux02Araq: most important you actually know where your plot will be on the page
13:06:34krux02Latex has quite a lalent at locating graphcs on the wrong page
13:06:51*leorize quit (Quit: WeeChat 2.1)
13:06:52Araq"that's just an implementation detail the writer should not be bothered with"
13:07:09Araq<-- CS thinking produces terrible tooling.
13:07:19FromGitter<retsyo> you must be kidding, Araq. I don't think I can draw this by hand https://matplotlib.org/gallery/pyplots/whats_new_99_mplot3d.html#sphx-glr-gallery-pyplots-whats-new-99-mplot3d-py
13:08:33Araqattach a sombrero to your paper
13:10:46*Hotkeys quit (Quit: Connection closed for inactivity)
13:12:56*fjvallarino quit (Remote host closed the connection)
13:13:02*fjvallarino joined #nim
13:13:12FromGitter<mratsim> This guys gets it, no transpiler: https://akr.am/languages/ (HN https://news.ycombinator.com/item?id=17470161)
13:14:27Yardanicohttps://akr.am/languages/?source=Nim&target=Python lol
13:15:30FromGitter<mratsim> the graph should only have Nim—>JS —> Python here :?
13:15:41FromGitter<mratsim> ah no, you can go through LLVM
13:18:14FromGitter<survivorm> The question is how effective would be this code
13:19:32Araqjust accept the word "transpiler" already.
13:19:45Araqcan't fight it, it's everywhere.
13:20:18FromGitter<alehander42> ah, if py2nim was more mature, we could have made a circle
13:24:19FromGitter<survivorm> Aha, cause the back way is void
13:24:22FromGitter<survivorm> https://akr.am/languages/?source=Python&target=Nim
13:24:45FromGitter<mratsim> @Araq, “just accept bad untested code, you can’t fight it, it’s everywhere"
13:25:13Araqmratsim: well spoken language is not code.
13:25:50FromGitter<mratsim> I never heard “transpiler” being spoken to be honest ;)
13:26:37FromGitter<survivorm> By the way? how hard would be to create c2nim not wrapper, but compiler?
13:27:15FromGitter<mratsim> c2nim can transform c code, it does not just wrap headers
13:27:53FromGitter<survivorm> Is it? Looks like i was wrong in my observation on it
13:28:08FromGitter<mratsim> Give it a c expression or type definition it will create a proper Nim file from it
13:28:08FromGitter<survivorm> or is it a recent addition?
13:28:21dom96I've created a wrapper for libclang and was thinking about creating (lib)clang2nim
13:28:28dom96But it would be a lot of work
13:29:05FromGitter<survivorm> But it would actually lessen a pain of migrating almost from any language to Nim
13:29:15FromGitter<mratsim> @surviworm, iirc that was c2nim generated: https://github.com/status-im/nim-evmc/blob/master/src/evmc.nim#L454
13:30:14FromGitter<mratsim> from that: https://github.com/status-im/nim-evmc/blob/master/headers/evmc.h#L305
13:30:44dom96That site definitely should add `c2nim` as an arrow from C to Nim though, maybe?
13:31:35Yardanicoc2nim is not fully automatic
13:32:56FromGitter<survivorm> cause almost all languages somehow compile to c
13:33:30FromGitter<survivorm> so adding automatic c -> nim compiler we add a route to migrate almost any code
13:33:46FromGitter<mratsim> JS —> Nim ;)
13:34:51dom96survivorm: that wouldn't be practical at all though
13:35:07dom96The resulting Nim code would be horrible
13:35:18FromGitter<survivorm> And yes, i know it sould be carefully treated with rasp :D
13:35:26dom96You may as well just include the C code itself in your program
13:35:26FromGitter<mratsim> The JS code generated by Nim is horrible as well ;)
13:35:30dom96And Nim makes that possible
13:35:54FromGitter<survivorm> That's limiting maintainability
13:36:09FromGitter<survivorm> and affects for the mess in the code
13:36:46FromGitter<alehander42> @mratsim the resulting js code almost has sourcemaps now
13:36:51dom96You wouldn't want to maintain code that has been translated from C
13:37:02dom96Especially if the C code was generated by another compiler...
13:37:17FromGitter<alehander42> (it has, but they're not merged,as they might still have some issues and I am not sure if i want to refactor jsgen )
13:40:50FromGitter<survivorm> @dom96 You wouldn't want, yes. But it's possible. And it's possible to clean it up, as the time passes. And it would be working, from the first day, hopefully
13:40:57*pwntus quit (Ping timeout: 265 seconds)
13:41:14*pwntus joined #nim
13:41:32FromGitter<survivorm> It's like living with the ton of legacy - noone likes it, but sometimes it's the only option...
13:50:10FromGitter<bevo009> Hi guys, another noob question :) ...what's the most efficient method for inserting multiple elements to the start of a sequence? I'm down to these 2 so far out of a few I've figured out, but maybe you have a better way ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b3f7392a99e1e52b71b9a03]
13:54:37FromGitter<mratsim> insert
13:54:57FromGitter<mratsim> with @\[\] you get extra heap allocation
13:55:58FromGitter<bevo009> ahh cool
13:56:15FromGitter<bevo009> Is there a reason strutils.insert isn't included with .add in module system ?
13:57:20FromGitter<bevo009> I thought importing a module might add some overhead
13:57:56FromGitter<mratsim> there is no overhead, unused code is not compiled in
14:01:23FromGitter<bevo009> well that's good to know, I'll just import strformat and sequtils every time then
14:01:46FromGitter<bevo009> thanks for that mratsim!
14:03:58FromGitter<bevo009> back to the game...
14:05:24FromGitter<Quelklef> @bevo009 "Ill just import strformat and sequtils every time then" Don't do this; having unused imports is bad documentation
14:06:16*yglukhov[i] quit (Read error: Connection reset by peer)
14:06:47FromGitter<bevo009> Easy enough to take out if i don't use them, but i use strformat a lot
14:06:50*yglukhov[i] joined #nim
14:07:04FromGitter<Quelklef> yeah
14:07:26FromGitter<Quelklef> by the way @ anyone is there a tool that lists unused imports or clears them out for me
14:07:52FromGitter<kaushalmodi> @retsyo Don't worry. There are many LaTeX fans out there. I'm one.
14:09:39FromGitter<narimiran> @Quelklef IMO, the nim vscode plugin should warn about unused imports (but currently it doesn't)
14:10:29FromGitter<Quelklef> darn :(
14:10:50FromGitter<Quelklef> i dont use vscode anyway tho
14:10:58*nsf joined #nim
14:12:45FromGitter<bevo009> I seem to remember the go plugin managing imports automatically
14:13:18FromGitter<Quelklef> hmmmm what would a nim minify be called?
14:13:23FromGitter<Quelklef> nimify? nimminify?
14:13:27FromGitter<Quelklef> niminify?
14:14:19FromGitter<Quelklef> apparently "Go won't let you import unused packages"
14:14:37FromGitter<bevo009> yeah
14:14:58FromGitter<bevo009> but IIRC it could import what you forgot
14:15:30FromGitter<Quelklef> wym
14:15:34FromGitter<Quelklef> like infer an import??
14:15:40nasusiroyou are referring at vim-go I presume
14:15:54FromGitter<bevo009> sublime
14:16:48nasusiroI'm quite pleased with vim-go and I wish we had something similar for Nim as well
14:17:03FromGitter<bevo009> back before vs code was around, so my recollection could be wrong
14:19:48Araqhttps://herbsutter.com/2018/07/02/trip-report-summer-iso-c-standards-meeting-rapperswil/ can we still stop C++20 ?
14:20:13Araqsounds to have terrible stuff in it... ("just terminate on OOM")
14:22:19nasusiroAraq: if they continue like this, C++ standard manual will consist of 10K pages
14:23:58Araqseriously, they say their stdlib can become noexcept when you terminate on OOM, but since that behaviour can be changed at runtime into throwing an exception, how can you make it 'noexcept' at all?
14:24:29Araqstuff like that is told you by the Nim compiler and its effect system...
14:25:13Araqbut even ignoring Nim, this is pretty obvious.
14:25:50Araqyes, there is a performance advantage of 'quit' over 'raise'. but you can only leverage it when you have an OS underneath.
14:26:10Araqand C++ does not assume an OS underneath.
14:26:32Araqhigh time I blog about error handling to make everybody see the light...
14:27:33nasusiroI think they have created an unnecessary mess with C++
14:27:43*PMunch quit (Quit: Leaving)
14:27:55nasusiroit's still one of my favorite programming languages, but if they continue with this pace, I will stop using it as a whole
14:29:35nasusiroright now Nim is very high in my "masterpiece languages" and the only thing that "bugs" me just a bit is that it emits C or C++ code. It would have been more than awesome if it could just compile to machine code without depending on glibc or whatsoever
14:29:48nasusirobut I'm allowed to dream, am I not?
14:30:00FromDiscord<k0pernicus> Maybe for Nim 10.0 ?
14:30:05FromDiscord<k0pernicus> 😉
14:30:46Amun_Rause musl-gcc if you don't want glibc dependency
14:31:33Araqnasusiro: NLVM exists
14:31:42nasusirowhat's that Araq?
14:31:44Araqthat's nim's frontend with an LLVM backend
14:32:00nasusirowhy I hate LLVM so much? -_-
14:32:17AraqI dunno but you're pretty alone with this hate.
14:32:28Araqbetter hate Latex instead, it deserved it.
14:33:10nasusiroAraq: I actually adore LaTeX
14:33:31Amun_Rasame here
14:33:31Araqyou have to loathe your margins then.
14:33:49nasusiromy margins obey me to anything I say
14:34:06AraqI still want my hours back.
14:34:14Araqread two books about it.
14:34:22Araqit never cared about my margins.
14:34:32Araqnor about my math layout.
14:34:44Araqor the positioning of my plots.
14:34:54Araqor about my spelling mistakes.
14:35:02Araqor about Unicode.
14:35:19FromDiscord<k0pernicus> LLVM is pretty cool, really
14:35:19FromDiscord<k0pernicus> And used almost in all new programming languages (Rust, Julia, Crystal, ...)
14:35:27nasusiroAraq: I read more than 4 LaTeX books and I feel just fine. I guess you are some form of PTSD with it for some reason
14:36:08Araqwhen I found RST I never looked back.
14:36:35nasusiroI'm not good with memorizing acronyms; what's RST?
14:36:48Araqthat thing that lost against markdown
14:37:43FromDiscord<k0pernicus> @nasusiro Check for `reStructuredText`
14:38:02nasusiroyeah, I wasn't sure whether Araq was referring at reStructuredText
14:38:07nasusiroI used it with Nikola
14:38:31dom96Nikola?
14:38:33nasusiroyep
14:38:48nasusirohttps://getnikola.com/
14:39:21dom96Ahh
14:41:56*cryptocat1094 joined #nim
14:42:26*fjvallarino quit (Remote host closed the connection)
14:42:28Araqgah, Nim's test suite is so terrible. it keeps finding my mistakes
14:43:03*fjvallarino joined #nim
14:43:16nasusiroAraq: was that sarcastic or ironic? lol
14:43:52dom96Nimble is failing with `Users/dom/projects/nim/lib/system.nim(3991, 8) Error: \n not allowed in character literal.` :(
14:45:36dom96Araq: can I s/\n/\x0A?
14:45:54Araqhuh? \n is allowed now
14:45:58Araqin character literals.
14:46:11AraqI guess you use an older Nim for bootstrapping?
14:46:31dom96I have an older Nimble
14:46:47dom96It's better to use \x0A for better backwards compatibility
14:46:53Araqyou can \L instead then
14:47:18FromGitter<Quelklef> Wait, how is `'\n'` now allowed? Isn't newline sometimes CRLF which is 2 characters?
14:47:27Araqnot anymore
14:47:27*fjvallarino quit (Ping timeout: 240 seconds)
14:47:31nasusiroAraq, question: is there a reason why we have this line hardcoded? https://github.com/nim-lang/Nim/blob/devel/ci/nsis_build.bat#L34
14:47:35FromGitter<Quelklef> huh
14:47:40Araqto get the "platform specific" newline, use \p
14:47:49dom96okay, will do
14:47:52FromGitter<Quelklef> Ah, what's \n now
14:48:00Araqjust LF, everywhere.
14:48:20FromGitter<Quelklef> that feels a little weird but i trust you more than i trust me lol
14:49:17nasusiroQuelklef: I quess it's related to this Microsoft's change https://blogs.msdn.microsoft.com/commandline/2018/05/08/extended-eol-in-notepad/
14:49:18Araqnasusiro: I don't think that file is used anymore
14:49:24nasusiroAraq: cool
14:49:53FromGitter<Quelklef> oh my god they finally did it
14:50:05nasusirobetter late than never LOL!
14:50:14FromGitter<Quelklef> i guess, hahaha
14:50:21FromGitter<Quelklef> i had given up hope of notepad ever being useful
14:50:56dom96Really wish jester.io was free :/
14:51:26Araqeverybody uses notepad++ anyway
14:52:07FromGitter<Quelklef> i still dont have it installed on my desktop :o
14:52:18FromGitter<Quelklef> i just use wordpad to edit any config files...
14:52:24*sotrhravendroid joined #nim
14:52:46FromGitter<mratsim> So C++ changed their “span” to “range”? or did I miss something. Coroutines, yeah!
14:53:18FromGitter<mratsim> concepts and contracts, seems OK as well though I’m curious about their concept approach
14:53:53Araqcontracts ... they need to be based on external tools. that's what Nim will do fwiw
14:54:27Araqthe state of the art in proof engines is constantly changing, can't make that part of the language spec. ymmv
14:54:35sotrhravendroidI get an error when I try to readFile("people.txt.")
14:54:47Yardanicosotrhravendroid, what error?
14:54:57sotrhravendroidminus that last period
14:55:27sotrhravendroidLord for
14:55:39dom96grrr /Users/dom/projects/nim/lib/pure/math.nim(294, 19) Error: list of key:value pairs expected.
14:55:51sotrhravendroidio error
14:56:34FromDiscord<k0pernicus> dom96 Think you have an error... 🤡
14:56:44FromDiscord<k0pernicus> dom96 I think you have an error... 🤡
14:56:59dom96If I'm running into this then everyone else will
14:57:02Yardanico@k0pernicus btw, your edits will be sent as separate messages because IRC doesn' support message editing :)
14:58:27Araqdom96: what are you doing?
14:58:31yglukhov[i]Araq: btw, it would be cool to not depend depend on libc in os:standalone mode, if at all. namely memcpy, memset, memcmp. can we consider that?
14:58:40dom96Araq: Just trying to use Nimble
14:58:54dom96And I happen to have an older version so it just fails on the new stdlib
14:59:01Araqyglukhov[i]: these are not libc, these need to be compiler builtins
14:59:15Araqintrinsics.
14:59:24dom96Another reason to start using Nim externally in Nimble instead of using the Nim compiler source code directly :(
14:59:38Araqit's stupid to have them in libc
14:59:56Araqdom96: 'koch nimble' gives you a fresh one, nimble does not have build itself
15:00:02Araqonly the compiler has that problem.
15:00:09yglukhov[i]Araq: they are in libc though :). sometimes compiler can optimize them away, but sometimes it can't.
15:00:29Araqwell we have bitops using intrisics
15:00:39dom96yeah, I know, I solved it
15:00:39Araqmemcpy needs to do the same.
15:00:41dom96still a pain though
15:00:47dom96Also, no idea why it imports math
15:01:05Araqeverything imports everything else :-(
15:01:33Araqprobably tables need nextPowerOfTwo that is in math
15:01:38Araqand everything imports tables
15:01:48dom96oooh, I just benchmarked the forum and got 1400 req/s. That's not bad.
15:01:56Araqlol what
15:02:24Araqyglukhov[i]: so yeah, I agree completely.
15:02:29dom96Single threaded too. Because I'm not brave enough to run the forum in parallel.
15:02:47Araqmemcpy etc should not be imported from libc
15:03:11sotrhravendroidlet contents = readFile("people.txt")
15:03:38sotrhravendroidI get an io error
15:04:00Araqso give it a real path
15:04:39yglukhov[i]Araq: i'm not sure if you can tell the C compiler to never import memcpy from libc. can we produce a pure nim memcpy et al? which will be as efficient as cc intrinsic?
15:05:17Araqyeah, but maybe it's a bit messy.
15:05:39sotrhravendroidOk it is in the same dir. I will give it a try.
15:05:39Araqiirc clang optimizes the memcopy loops to 'memcpy'
15:06:25Araqyou can try a simple .compilerProc for these and see what clang produces for it
15:07:29yglukhov[i]ok
15:16:04*xet7 quit (Quit: Leaving)
15:18:56*fjvallarino joined #nim
15:36:46*sotrhravendroid quit (Quit: -a- IRC for Android 2.1.40)
15:52:41*fjvallarino quit (Remote host closed the connection)
15:52:47*fjvallarino joined #nim
16:04:53*xet7 joined #nim
16:32:08*krux02 quit (Remote host closed the connection)
16:32:39*miran joined #nim
16:35:56*floppydh quit (Quit: WeeChat 2.1)
16:46:35*CcxWrk joined #nim
16:59:19*SenasOzys quit (Remote host closed the connection)
17:06:31*cryptocat1094 quit (Ping timeout: 268 seconds)
17:11:06*Trustable quit (Remote host closed the connection)
17:12:36*cryptocat1094 joined #nim
17:18:44*thomasross quit (Remote host closed the connection)
17:19:19*thomasross joined #nim
17:28:07*yglukhov[i] quit (Remote host closed the connection)
17:32:49*elrood joined #nim
17:48:11dom96https://news.ycombinator.com/item?id=17473139
17:48:15*ng0 joined #nim
17:50:39shashlickhttps://forum.nim-lang.org/t/3922#24440
17:51:45*Perkol joined #nim
17:52:49PerkolI remember there was function for matching file extensions in the standart library somewhere
17:55:25shashlicksplitFile()
18:00:41*krux02 joined #nim
18:03:15dom96shashlick: Thanks!
18:22:13FromGitter<kayabaNerve> Araq: About that new thing. While overloading does allow `var a: Type = new()` via overloading, which isn't explicit and I wouldn't support adding it to the language... culture, we (in chat) were referring to overriding Type() which is still explicit. The first GitHub issue is utilizing a return type overload, and the second overloads the first argument (Type.new()).
18:22:45FromGitter<tim-st> cant the following be improved quite easily?
18:22:48FromGitter<tim-st> const x = (10u8, 10u16, 10u8) ⏎ const y = (10u8, 10u8, 10u16) ⏎ echo x.sizeof #6 ⏎ echo y.sizeof #4 [https://gitter.im/nim-lang/Nim?at=5b3fb37860c387078363d10b]
18:25:16FromGitter<kayabaNerve> !eval const x = (10u8, 10u16, 10u8); const y = (10u8, 10u8, 10u16); echo sizeof(x); echo sizeof(y)
18:25:19NimBot6↵4
18:26:28FromGitter<kayabaNerve> That's why you said # 6 and # 4. lol. I was confused since it should be the same and Gitter formats as pull requests.
18:27:17FromGitter<tim-st> yes, I think tuples order can be changed without generating problems
18:27:41FromGitter<tim-st> especially useful for big data described as tuples
18:28:41FromGitter<kayabaNerve> No idea why that is...
18:30:10FromGitter<tim-st> hm, it seems that is not a nim bug, but a gcc bug or missing improvement, I should start contributing to gcc^^
18:31:01*smt quit (Read error: Connection reset by peer)
18:32:38FromGitter<tim-st> seems known: https://stackoverflow.com/questions/119123/why-isnt-sizeof-for-a-struct-equal-to-the-sum-of-sizeof-of-each-member
18:32:44FromGitter<kayabaNerve> Thing is, when GCC has a bug of this sort, it's because Nim generated code caused it. Just like when my code caused a bug with the standard GC, but not markandsweep, technically it was the GC, but it was my code effectively. ⏎ ⏎ I'm not trying to say its definitely Nim. Just likely,
18:33:29FromGitter<kayabaNerve> So does it have different behavior on clang and do tuples becomes struct?
18:33:51FromGitter<tim-st> I'd like to test the equivalent c code, but have no idea how to write :(
18:33:54FromGitter<kayabaNerve> If no and then yes, than GCC
18:33:57FromGitter<kayabaNerve> Check the nimcache
18:34:10FromGitter<tim-st> nimcache has too much nim to be sure
18:34:24FromGitter<kayabaNerve> Nimcache is literally the generated C code and object files
18:34:55FromGitter<kayabaNerve> It's pretty decent
18:35:03FromGitter<tim-st> yes, but it is possible to build an equivalent 3 lines c code to the three lines nim code. the nimcache c code generates 109 lines
18:35:15FromGitter<tim-st> so i cannot find out definete
18:38:12*smt joined #nim
18:39:18FromGitter<tim-st> well your second answer is yes, they are struct
18:39:28FromGitter<tim-st> *answer to your second question
18:40:06FromGitter<tim-st> ok, but they use nims type NU8, NU16 maybe this is a nim problem then
18:44:43FromGitter<tim-st> ok, I understand this is maybe wanted by gcc: https://stackoverflow.com/questions/3318410/pragma-pack-effect
18:45:21*crem quit (Ping timeout: 248 seconds)
18:47:10*crem joined #nim
18:47:35FromGitter<tim-st> hm, no doesnt make sense... because my example code has same size with different order, an other person has to find out :\
18:54:18*Perkol quit (Quit: Leaving)
18:57:00FromGitter<tim-st> it's a gcc problem: https://gist.github.com/tim-st/9d3855c91f24e2f346feab5bbee6ac90
18:59:05FromGitter<kayabaNerve> Good to know. Thanks @tim-st
19:00:00FromGitter<tim-st> no problem ;)
19:00:11FromGitter<tim-st> sorting them seems to always solve it
19:00:37*natrys joined #nim
19:19:14*miran_ joined #nim
19:19:33*miran quit (Ping timeout: 264 seconds)
19:24:08*endragor joined #nim
19:26:02*cryptocat1094 quit (Ping timeout: 245 seconds)
19:28:57*endragor quit (Ping timeout: 265 seconds)
19:41:28*libracious left #nim ("The Lounge - https://thelounge.github.io")
19:44:05*lompik quit (Ping timeout: 256 seconds)
19:48:45*miran_ is now known as miran
20:10:50*nsf quit (Quit: WeeChat 2.1)
20:11:53*skrylar joined #nim
20:23:08*fvs left #nim ("ERC (IRC client for Emacs 25.3.1)")
20:26:20*yglukhov[i] joined #nim
20:38:09Araqhttps://queue.acm.org/detail.cfm?id=3212479
20:38:15*miran quit (Quit: Konversation terminated!)
20:48:43*skyfex joined #nim
20:58:57*noonien quit (Quit: Connection closed for inactivity)
21:03:25FromGitter<Quelklef> Cool article
21:03:43FromGitter<Quelklef> Besides, like, straight assembly, what *do* you write in to be low-level?
21:05:25Araqbtw destructors landed in devel without the --newruntime switch
21:05:39Araqand destructors now imply finalizers
21:05:55Araqbut it needs more testing, of course :-)
21:12:00*fjvallarino quit (Remote host closed the connection)
21:12:27*fjvallarino joined #nim
21:12:44dom96https://github.com/dom96/jester/blob/master/changelog.markdown#030---06072018 🚀🚀🚀 🃏🃏🃏
21:13:54*Vladar quit (Quit: Leaving)
21:16:03Araqdom96, please add a note that your 'extend' feature requires Nim devel
21:16:19Araqwell jester in general now required devel afaik
21:16:40dom96yeah, true
21:16:54*fjvallarino quit (Ping timeout: 256 seconds)
21:24:26*fjvallarino joined #nim
21:25:20dom96The bigger the tweet, the better, right? https://twitter.com/d0m96/status/1015345911164219393 :D
21:31:07*yglukhov[i] quit (Remote host closed the connection)
21:37:25FromDiscord<exelotl> looking forward to trying out jester
21:38:34nasusiroAraq: that was an outstanding article you shared. Thank you very much!
21:39:17AraqI don't really agree with it, but it makes some valid points
21:41:37Araqespecially the point about holes in the memory due to alignment
21:42:04AraqC is only simple if you don't know it well.
21:43:31nasusiroAraq: yes, that was what I was personally thinking, about alignment and such
21:46:15nasusiroAraq: unfortunately, many companies care more about profitability than qualitative code.
21:53:21AraqI don't think it's about companies. C is simply not a very good design and it won over its better competitors because of Unix/cheaper
21:55:29nasusiroand we got stuck with it :/
21:55:41nasusironot that I have a problem with it, but it could have been better
21:56:19Araqit could also have been much worse.
21:56:50Araqhowever, when you write a newer standard for such an important fossil, ffs try to improve its design.
21:57:21Araqfor example, add builtins for integer arithmetic that tells you if you had an overflow...
21:57:27Araqhow hard can it be?
21:58:46Araqor make setjmp not require 'volatile' locals as 'volatile' already means something else
21:58:49nasusirothe irony is that the standard is often way behind compilers such as GCC that indeed add such kind of changes in their own compiler and satisfy both users and security as a whole
21:59:12Araqand specify what exactly 'volatile' means.
21:59:26Araqor remove it again and add volatileRead()/Write() ops
21:59:46*yglukhov[i] joined #nim
21:59:52Araqwhich would have been the better design as it doesn't encode an implement accident in the type system...
22:00:00Araq*implementation accident
22:00:21nasusiroI remember reading an article by Linus a couple of days ago that diss the shit out of the committee for not designing important parts of the language *as part of the standard* and they (the Linux core team) are lucky they use GCC which adds such important mechanisms in the form of extensions
22:01:58nasusiroin other words GCC, and I assume other compilers as well, are fixing the most important stuff that the committee should have done so decades ago
22:02:36nasusirobut without being conspiracy theorist here or weirdo, it gives me the impression they are doing so on purpose; there's no other logical explanation.
22:04:08Araqnot adding checked arithmetic ops is criminal.
22:04:15nasusiroLinus' father said in a European Union meeting that was broadcast live on TV that NSA approached his son to add a backdoor to Linux
22:04:32Araqand they should have put into jail for that.
22:04:33*yglukhov[i] quit (Ping timeout: 264 seconds)
22:04:47nasusirohe didn't
22:04:57nasusirothey told them to fuck off as usual lol
22:05:14Araqsounds like a myth to me
22:05:30Araqbut it's the NSA, so maybe it's true
22:05:34*Araq shrugs
22:06:14nasusirohttps://en.wikipedia.org/wiki/Nils_Torvalds#Linux_kernel_statement
22:06:25*dorelix joined #nim
22:07:35Araqyeah, right... that reads like some religious story
22:08:56Araqis his father even alive.
22:09:47nasusiroit seems so
22:15:50nasusirowhat matters right now, at least for me, is to master C language so I can push its limits whenever I need to
22:16:09Araqwhy? use Nim instead.
22:16:19nasusiroI'm using it already lol
22:16:38*geocar joined #nim
22:17:28nasusiroI want to push C's limits for future participation in Nim's development. I want to know C's dark corners so Nim can become faster and faster.
22:18:45FromGitter<kayabaNerve> What if Nim compiled to binary?
22:18:53FromGitter<kayabaNerve> Does the LLVM version do that?
22:19:24Araqof course it does do that.
22:19:27FromGitter<kayabaNerve> Wait. Isn't LLVM its own language in itself?
22:19:32FromGitter<kayabaNerve> Compiled direclty.
22:19:39FromGitter<kayabaNerve> *not language but intermediary
22:19:52Araqyes. so?
22:20:01Araqit can produce native binaries.
22:20:06FromGitter<kayabaNerve> Not my point.
22:20:53Araqwhat is your point?
22:21:38FromGitter<kayabaNerve> My point was what if there was a way to directly generate binary instead of C? Would that be more efficient if done properly? Do GCC have clang just have so many microoptimizations it could never compare?
22:22:32Araqyeah.
22:22:55Araqpretty much this. can't beat the thousands of manhours they put into their optimizers
22:22:55FromGitter<kayabaNerve> ... to which one.
22:22:59FromGitter<kayabaNerve> Got it.
22:24:37Araqyou can beat them if you have some domain specific language and can make use of this fact in your optimization pipeline
22:25:09Araqbut I've never seen that happen.
22:25:23FromGitter<kayabaNerve> What if Nim is the DSL? :some-thinking-emoji-Gitter-still-doesnt-have-freaking-trash-gitter:
22:25:47AraqNim is a general purpose language, too broad
22:25:57FromGitter<kayabaNerve> https://discordemoji.com/assets/emoji/HyperThink.png
22:26:14FromGitter<kayabaNerve> Yeah. I know. It was a joke. Where's Hyperthink when you need it...
22:26:48elroodkayabaNerve, you know clang is based on llvm, right? and nim's reference implementation right now wastes time on generating c, which then has to be lexed and parsed redundantly by a c compiler again
22:27:28elroodof course it would be more efficient to generate binaries directly. but on the other hand, nim is already quite fast and more flexible the way it is
22:27:34nasusiroI wish I had 1/ millionth of Fabrice Bellard's ingenuity -_-
22:28:08Araqelrood, fair but what is often overlooked. this split makes it easy to run the backend/C compiler on multiple cores
22:28:32elroodfair point. still cycles wasted tho
22:28:41Araqand when you use LLVM as a library you wouldn't get this behaviour as easily.
22:33:49nasusiroif tcc had all gcc's optimizations...man, that would have been a dream coming true to me!
22:34:13Araqlol then it would be as slow as gcc
22:37:06nasusiroyou mean is the optimizations that make it so slow?
22:37:23elroodwhat else could it be, what do you think?
22:37:49nasusirohmm...can I take the help from the audience?
22:37:56Araqyes and also, gcc really is not slow on a half modern CPU.
22:38:52nasusironow I got a bit disappointed lol
22:39:04nasusiroI thought tcc was something...magical!
22:39:25Araqwell ok, I have 4 cores a 4.4GHz... what do I know about GCC's speed
22:39:41Araqnasusiro, tcc isn't but luaJIT really is :-)
22:40:15nasusirothat's another story. Mike Pall is a machine from Terminator and I firmly believe it!
22:45:28*natrys quit (Quit: natrys)
22:48:11FromGitter<kayabaNerve> elrood: Yes. I know Clang is LLVM based. I'm talking about executable efficiency, not compiler efficiency.
22:51:41Demos[m]do yall nimrods have thoughts on crystal. I've been using ruby quite a bit and I'm pretty impressed with their tooling :D
22:54:52AraqDemos[m], traitor! :-)
22:55:10Demos[m]hehe
22:55:34Demos[m]competition is good Araq
22:55:52elroodcrystal still lacks proper windows and parallelism support, afair. so, nice and interesting language, something to keep an eye on, but not there yet
22:56:16Araqreally? what if the competition pushes me out of business? :P
22:56:37elroodyou feel pushed? work harder ;P
22:56:46Demos[m]*cracks whip*
22:57:36Araqno. that's exactly what we shouldn't do. :P
22:57:45Araqwe should work *smarter*
22:58:31FromGitter<Varriount> ^
23:00:15FromGitter<Varriount> I'd rather have, for example, standard library modules which are well designed, rather than modules which offer 30 different procedures for something.
23:01:23nasusiroAraq: if people promote Py2nim to Pythonistas that need performance improvement, then Nim will live for many decades :D
23:02:17elroodif it only was as easy as that
23:03:22nasusiroelrood: nothing is easy, but then again nothing is difficult.
23:03:42Araqtargetting Python devs is hard, these guys are always so happy with their language :P
23:04:24Araqso we're after the C++ programmers now, they always seek new challenges
23:04:37*Araq is not entirely serious.
23:05:58nasusirowhat I like about Nim is the way it keeps things simple, at least from an aesthetic point of view. Now...how it does its magics behind the scenes goes beyond my comprehension (at least for now)
23:06:44Demos[m]heck I cam to nim for "C but with modules and a sane function pointer syntax"
23:07:01Demos[m]and tooling
23:07:09Demos[m]like nim's tooling is actually already better than C++
23:07:28nasusiroAraq: about going after C++ programmers. Well, if compilation speed gets reduced to the lowest time possible, then I'm sure they will come running in Nim!
23:07:36Demos[m]which is really pathetic (for c++) considering c++ is like 25 years old
23:07:51nasusiroDemos[m]: you have no idea about C++, do you?
23:07:59Demos[m]huh?
23:08:04Demos[m]I know c++ pretty well
23:08:04nasusiroit was first released in 1979 and it was called C with classes
23:08:09nasusiroI'm sure you do
23:09:44Demos[m]I don't know how old c++ is off the top of my head
23:10:01elroodso tooling means something completely different than multiple mature development environments, debuggers, profilers, compilers etc. these days? nim's tooling is superiour? really? i'm confused..
23:10:31Araqelrood, you are living in the past. "tooling" now means "a formating tool"
23:10:45elroodmy mistake, sorry
23:10:54Araqlol
23:11:34Demos[m]so like the ability to ask questions like "what are some completions here" or "where is this defined", c++ has tools for this, but very few of them actually work
23:11:45Araqand we now have 'nimpretty' but bloody #nim refuses to take over its development
23:12:36FromDiscord<treeform> I came to nim looking for faster python with types. Languages I looked into before were pyrex/cython and boo.
23:13:30FromDiscord<treeform> Araq, are you done with nimpretty, what are your next steps?
23:15:27nasusirotreeform: Cython is not bad, but it's an extensions language for existing Python code, which does its job just fine, but adds an extra layer of unnecessary complexity on top of other problems a developer already have.
23:16:47Araqtreeform: I'm following the v1 plan rather closely. and nimpretty is not part of it
23:17:24Araqsometimes I do other things as well, but when I do, it's done in my spare time ;-)
23:17:55FromGitter<rayman22201> Random possibly weird question... Could I use the compiler (specifically the lexer/parser) itself as a library? ⏎ I have a random (probably bad) idea: I would like to use Nim to create a DSL that outputs bash files. ⏎ I don't want to write a lexer or parser. the Nim parser is already really good. ⏎ I don't want to write a back-end for Nim because Nim is general purpose and that make no sense... ⏎ I would
23:17:55FromGitter... ideally use Nim's excellent macro facility to just rewrite the AST nodes into equivalent Bash constructs, or yell at you if you try to use some unsupported thing like threads. ... [https://gitter.im/nim-lang/Nim?at=5b3ff8a389db5e701ca85d84]
23:18:04FromGitter<rayman22201> sorry for the novel of a post
23:18:08nasusiroAraq: if you ever write a book about language or compiler design, I want it on my shelf please lol!
23:19:03Araqrayman22201: that got easier as the compiler as an API is finally free of ugly the global variables
23:19:31Araqand your idea is not crazy, I had the same idea too.
23:19:33Demos[m]you can indeed use it as a library. There's little documentation for this use case
23:19:39Demos[m]the compiler is even in nimble!
23:20:08FromGitter<rayman22201> Or you and I have similar kinds of crazy @Araq :-P
23:20:16Araqhttps://github.com/nim-lang/Nim/tree/devel/tests/compilerapi Demos[m]
23:20:48Araqdocs are still sparse, but the example is now part of the test suite
23:21:02Demos[m]ah!
23:21:04Demos[m]fun
23:21:16FromGitter<rayman22201> awesome!!! <3
23:21:25Demos[m]I've been meaning to write a library that generates gobject-introspection GIR files from nim code
23:22:34FromGitter<rayman22201> lol @Demos[m] put Vala out of business :-D
23:22:57FromGitter<rayman22201> get the Elementary OS people to use Nim instead. I like this idea
23:23:45AraqI want NimOS. if you like to invent a new OS, contact me please
23:23:55AraqI can tell you what to try out.
23:23:59Araqand what to avoid.
23:24:21dom96First thing: SQLite DB as filesystem? :P
23:24:39Araqnah.
23:25:42elrooddoes this compilerapi library thingy support incremental parsing? if not, can we generously wipe it aside as unusable? ;P
23:26:01Sargundom96: Wasn't that WINFS?
23:26:18Araqdepends on what you mean by that, elrood. Nim's secret REPL uses it for that
23:26:57elroodoh, interesting. care to share a bit of your secrets?
23:27:16FromGitter<rayman22201> I'm actually really on board with that. I think RedoxOS was really good for the Rust ecosystem, and I think something similar would be good for Nim as well
23:27:48Demos[m]I'm way more interested in integrating nim with desktop envs
23:28:06Demos[m]nim version of clutter / processing
23:28:13Demos[m]stuff like that
23:28:47Araqwell there is little to say about it, the parser takes a stream and you can tell it to parse a single statement and then continue later with the next statement
23:29:03Demos[m]using nim to write bindable gobject libraries
23:29:14dom96I actually know the guy that works on https://solus-project.com/
23:29:18Araqit's incremental on the statement level, you cannot pass it a single token
23:29:23dom96Well "know" :)
23:29:39Araqbut that's good enough for the REPL.
23:29:40dom96Haven't spoken to him in years, but I'm still disappointed he's using Vala and not Nim
23:30:29Demos[m]nim's bindings to gtk aren't quite prod ready
23:30:54elroodfair enough. didn't know there was a repl for nim, seems to be a well-kept secret, or i'm just oblivious
23:31:06Demos[m]in particular to unseat vala you need great support for callback registration and composite widget templates
23:31:06dom96No? I've built Aporia using them
23:31:08FromGitter<rayman22201> @dom96 you should call your friend and yell at him immediately :-P
23:31:14Demos[m]elrood: it's literally a secret
23:31:17Demos[m]the command is "nim secret"
23:31:33dom96In any case, it's trivial to bind GTK
23:31:34Demos[m]dom96: I meant gtk3 / gobj-introspection
23:31:37Demos[m]that C bindings are fine
23:32:03dom96Composite widget templates, hrm.
23:32:07dom96Not familiar with them :)
23:32:10elroodfascinating. thanks
23:32:13dom96But callback registration was trivial
23:32:48Demos[m]so in vala you can annotate methods with [callback] and members with like [child] and it can automatically pull bits of your class out of a gtkbuilder xml file
23:33:01Araqelrood, but please don't report bugs for it. we know it's so bad that it must be kept a secret
23:33:15Demos[m]so it will automatically call gtk_widget_class_bind_template_child and gtk_widget_class_bind_template_child
23:33:45dom96All this is just a macro away, but yeah I get that it's work
23:33:52dom96It's a pity nobody decided to do it
23:34:12dom96Creating a completely separate language just for the gobject ecosystem is a bit odd
23:34:32Araqhuh? we have a GTK3 wrapper that somebody put a ton of effort into
23:34:39Demos[m]well having a ABI that is just gobject makes sense
23:34:46Demos[m]gintro
23:34:46Demos[m]yeah
23:35:14Demos[m]I know, it needs a little love, haven't had the time myself yet
23:35:37Araqbut GTK itself is pretty much in a state of despair, no?
23:35:46Demos[m]huh?
23:35:49Demos[m]not really
23:36:07Araqthey lost a couple of project to Qt the last time I followed it
23:36:12Araq*projects
23:36:25Demos[m]yeah, but a bunch of projects are coming back
23:36:38Demos[m]and they have been switching to meson (from autotools) and trying to get things working smooth on windows
23:36:48Demos[m]which addresses the big complaints about it
23:37:13dom96What about macOS? :P
23:37:27dom96I've given up on them after dealing with GTK on macOS
23:37:31Demos[m]it works fine on macOS
23:37:47Demos[m]it's going to look identical on all the platforms
23:37:53Demos[m]which people may not like on OSX
23:38:00elroodfor any arbitrary definition of fine
23:38:05dom96yeah, that's not "works fine" in my book :)
23:38:22dom96I've spent literal weeks compiling GTK on macOS
23:38:30dom96and then it ended up failing for some people anyway
23:38:32Demos[m]I mean trying to have "native" widgets is a bad idea
23:38:45Demos[m]worked on my machine :D
23:39:00Demos[m]again, meson is helping with this stuff a whole lot
23:39:04nasusirooff-topic: interesting thing you did there elrood with the italic "fine". how did you do that? lol I'm using hexchat and rendered it beautifully
23:39:29Demos[m]I'm using fractal (matrix) and it worked not at all
23:39:47dom96I'm using XChat Azure and it didn't render either, weird.
23:40:00dom96bold
23:40:11nasusiroI see a bold statement
23:40:32dom96It's mIRC Format
23:40:37nasusirodom96: maybe it's time to migrate to hexchat yourself? lol
23:40:41dom96HexChat should have an option to add it somewhere
23:40:47Demos[m]I see a regular statement
23:40:48elroodctrl-i for me, also on hexchat. begone, philistines, works for me™ :P
23:40:51Demos[m]*test*
23:41:11dom96nasusiro: Maybe. Last time I checked it was very Windows focused
23:41:19dom96But that was 3+ years ago
23:41:33nasusirodom96: as you can see, I'm talking to you from a Debian testing 64-bit machine and works just fine
23:42:00AraqDemos[m], well GTK lost against Qt and Qt lost against the browser ;-)
23:42:03dom96If you were talking to me from a Mac then I might try it
23:42:23Araqand the browser lost against iOS
23:43:08Araqwhich lost against Android. Yay, Java based UIs, here we come.
23:44:30elroodso.. when are you going to port the backend to output java..?
23:44:47nasusirowhy not COBOL elrood?
23:45:28Araqnah, instead better wasm support is coming
23:45:35Araqwasm is the future of the UI.
23:46:04Araqstill lacks the DOM integration, but that's just a minor implementation detail. you can already compute prime numbers with wasm
23:46:26elrooddoes cobol drive android, nasusiro? where did that come from now?
23:47:02nasusiroelrood: you surely don't appreciate a good sense of sarcastic geeky humor
23:47:38nasusiroJava is considered the COBOL of 21st century by many programmers
23:49:23FromGitter<honewatson> Any benchmarks for jester with httpbeast @dom96
23:51:45FromGitter<rayman22201> ohhh, yay, The Systems Programming article guy responded! https://medium.com/@sargun/i-saw-your-response-on-the-nim-forums-and-realize-i-missed-the-comment-e4b28d7c7593
23:52:48elrood← almost entirely composed of sarcasm and cynism, nasusiro. it just doesn't always translate through these internet wires
23:54:05nasusiroelrood: accept my sincere apologies my fellow nerd. The next time we may meet in real life, I will buy you a Guinness for truce!
23:56:54elroodno worries, mate, no offense taken, and nothing to apologize for. likewise
23:59:22nasusiroby the way, any Austrians here?
23:59:39nasusirowhat the hell is going on with that psychopath who want people to work for 12 hours per day?