<< 12-02-2018 >>

00:01:45nekitsA little late but thank you Vindaar!
00:05:57*gokr quit (Ping timeout: 240 seconds)
00:14:51FromGitter<Vindaar> No worries, glad I could help!
00:44:38FromGitter<Quelklef> Honewatson, what do you mean by runtime DSLs? But you might want to look into templates and macros
01:24:27*rinzai joined #nim
01:28:57*rinzai quit (Ping timeout: 256 seconds)
01:33:44*dddddd quit (Remote host closed the connection)
01:42:13*tiorock joined #nim
01:42:13*tiorock quit (Changing host)
01:42:13*tiorock joined #nim
01:42:13*rockcavera is now known as Guest95026
01:42:13*tiorock is now known as rockcavera
01:45:27*Guest95026 quit (Ping timeout: 260 seconds)
01:46:38*rinzai joined #nim
02:07:42*psj joined #nim
02:08:22*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:11:57psji've having problems getting procs, (closure) iterators to work. should i expect this to compile? (fails on both 0.17.2 and git head 0.17.3): http://dpaste.com/2H3N3SG
02:17:02FromGitter<nepeckman> So question: it seems like its possible to export a function with the same name as the module that contains it, but not a variable with the same name as its module. Is this intended behavior?
02:27:12*vlad1777d quit (Ping timeout: 256 seconds)
02:37:24*chemist69 quit (Ping timeout: 256 seconds)
02:51:22*chemist69 joined #nim
03:14:14*TakeYourFreedom quit (Ping timeout: 256 seconds)
03:32:56*psj quit (Ping timeout: 256 seconds)
03:36:04*endragor joined #nim
03:42:40*arthurz joined #nim
04:18:56*radagast_04 joined #nim
04:19:42radagast_04Hi, How can I pass a comparison operator into a function? for example, fn(3, 12, >)?
04:19:50radagast_04https://play.nim-lang.org/?gist=c6152867fbfc79aa57fa83d7309d96a4
04:31:22radagast_04looks like > is a template
04:31:26radagast_04sish
04:40:19*yglukhov joined #nim
04:44:50*yglukhov quit (Ping timeout: 255 seconds)
05:41:41*rinzai quit (Ping timeout: 268 seconds)
05:51:29*endragor quit (Remote host closed the connection)
05:52:02*darithorn quit (Remote host closed the connection)
06:07:34*rinzai joined #nim
06:11:57*rinzai quit (Ping timeout: 240 seconds)
06:15:58*rinzai joined #nim
06:20:10*rinzai quit (Ping timeout: 240 seconds)
06:23:59*nsf joined #nim
06:30:59*endragor joined #nim
06:44:20FromGitter<nitely> @psj this works: https://play.nim-lang.org/?gist=caafc2b222d10bec34cc2d5b8f6ba3bd
06:44:33FromGitter<nitely> also, check the manual, there are some examples in there
06:46:12*rinzai joined #nim
06:50:50*rinzai quit (Ping timeout: 255 seconds)
06:55:17*solitudesf joined #nim
07:07:47FromGitter<nitely> @radagast_04 there is `system.cmp[int]` https://nim-lang.org/docs/system.html#cmp,T,T
07:11:07*arthur joined #nim
07:11:31*arthur is now known as Guest33859
07:14:44*arthurz quit (Ping timeout: 276 seconds)
07:22:36*rinzai joined #nim
07:25:36*SenasOzys joined #nim
07:26:58*rinzai quit (Ping timeout: 252 seconds)
07:45:38*madmalik joined #nim
07:50:37*yglukhov joined #nim
07:56:21*rinzai joined #nim
08:02:07FromGitter<bung87> how to get defined value during compile time
08:05:22*rinzai quit (Ping timeout: 256 seconds)
08:06:27*yglukhov quit (Remote host closed the connection)
08:09:26*chemist69 quit (Ping timeout: 276 seconds)
08:11:02*HoloIRCUser joined #nim
08:15:27*HoloIRCUser quit (Ping timeout: 248 seconds)
08:17:39*HoloIRCUser joined #nim
08:17:52*miran joined #nim
08:21:35Araq.intdefine and .strdefine
08:21:58*HoloIRCUser quit (Ping timeout: 252 seconds)
08:22:29FromGitter<bung87> the default value can be a variable? the example from document is constant
08:23:46Araqcan only be a constant
08:23:52Araqyou can do
08:23:55Araqconst X = ...
08:23:59Araqvar v = X
08:24:06Araqand then use 'v'
08:26:44FromGitter<bung87> the compile args says could be -d:aaa=111 then why canot be variable?
08:29:04Araqbecause. now use my workaround.
08:30:13FromGitter<bung87> but the value is actually from a cfg file which generate by a python program
08:30:45Araqfirst of all, replace that Python program by a Nim program. :P
08:31:02Araqsecondly, why does that matter?
08:31:16Araqeither you use --define on the command line or you don't.
08:31:31*yglukhov joined #nim
08:31:35*rinzai joined #nim
08:32:24FromGitter<bung87> so the --define just a boolean flag?
08:33:08Araq--define works as documented. your cfg file generated from Python has nothing to do with --define
08:34:22Araqto read a config file, use the parsecfg module
08:34:45FromGitter<bung87> it generate nim.cfg contains "define:"PY_MOD_NAME=genesis_api""
08:34:57FromGitter<bung87> which read by nim compiler
08:35:02*yglukhov quit (Read error: Connection reset by peer)
08:35:35*chemist69 joined #nim
08:35:38*yglukhov joined #nim
08:36:24FromGitter<bung87> when defined(PY_MOD_NAME): is true but I dont know how to get the value of PY_MOD_NAME
08:36:27Araqso? const PY_MOD_NAME {.strdefine.} = ""; var myvar = PY_MOD_NAME
08:36:38*rinzai quit (Ping timeout: 276 seconds)
08:39:16*floppydh joined #nim
08:47:39FromGitter<bung87> ok I'll try this ,thanks ! now I 'm getting another problem
08:58:24*BitPuffin joined #nim
09:04:28*rinzai joined #nim
09:05:20*Yardanico_ joined #nim
09:06:10*SenasOzys quit (Ping timeout: 240 seconds)
09:08:59*rinzai quit (Ping timeout: 255 seconds)
09:11:40*ofelas quit (Ping timeout: 240 seconds)
09:15:00*SenasOzys joined #nim
09:18:57*kunev_ quit (Ping timeout: 248 seconds)
09:20:56*kunev joined #nim
09:25:52*HoloIRCUser joined #nim
09:28:43*PMunch joined #nim
09:30:49*Vladar joined #nim
09:35:05*HoloIRCUser quit (Ping timeout: 240 seconds)
09:36:36*Yardanico_ quit (Read error: Connection reset by peer)
09:37:34*rinzai joined #nim
09:41:51*rinzai quit (Ping timeout: 248 seconds)
09:45:14*HoloIRCUser joined #nim
09:51:53*HoloIRCUser quit (Ping timeout: 255 seconds)
09:52:34*ofelas joined #nim
09:53:42*dddddd joined #nim
10:04:29*girvo joined #nim
10:04:37*girvo quit (Client Quit)
10:08:12*arnetheduck joined #nim
10:08:52*girvo joined #nim
10:11:32*gokr joined #nim
10:13:51*girvo waves
10:14:01Araqoh it's you again
10:14:19Araqwill I ever get that email you promised me months ago? ;-)
10:15:40*rinzai joined #nim
10:17:45Araqwelcome back, girvo
10:19:27girvoYou know its funny you say that: I've actually been working on Hindley–Milner and want to combine it with Nim's SCGI/FastCGI support to build the weirdest "PHP-esque" system you've ever seen ;)
10:20:03girvoBut alas, work has been far too mental. Though, the fastest implementation in the world for the Paillier homomorphic encryption algorithm is now written in Nim, just by the way!
10:20:04*rinzai quit (Ping timeout: 260 seconds)
10:20:25PMunchWow, that's really cool
10:20:29AraqI'm sure these words mean something.
10:20:43girvoHehe :) You'd easily be able to tackle it Araq
10:20:55girvohttps://en.wikipedia.org/wiki/Paillier_cryptosystem
10:21:18PMunchHomomorphic cryptography is really interesting
10:21:47girvoEncrypt two numbers, then add the _encryped_ numbers together, getting an encrypted result. Its basically black magic (and falls out of some cute category theory, depending on what algorithm you're doing)
10:22:24girvoBut yes: it's in production! Being used for real trustless tasks between the 4 largest insurance agencies in the Southern Hemisphere :)
10:22:58PMunchOh wow, that's possibly even cooler! :P
10:23:28Araqgirvo: do you keep up with Nim devel? Any code breakages we should be concerned about?
10:23:43girvoAccording to IBM who were sort of our partners, it's one of the first commercial usages of homomorphic encryption ever
10:24:15girvoAraq: I do, yeah I run `devel` -- to be honest, over the last 12 months I've found it more and more stable rather than breaking, so well done there!
10:24:29girvoAnd some of my weird algorithmic data types now compile, which makes me very happy
10:25:27Araq:D
10:26:34girvoI've been doing some really weird stuff with flow.org recently
10:27:03*dddddd quit (Remote host closed the connection)
10:27:22girvoIgnore the file-type, it's Javascript with Flow type hints: https://hastebin.com/xeliqihona.ts
10:28:05FromGitter<mratsim> why mix Flow and typescript?
10:28:06girvoIt uses the generics to pass literals into the class when it's instantiated, locking the type down. So `ourAction.type` can only _ever_ be "Hello"
10:28:32girvomratsim: I didn't! The .ts extension was just to get highlighting on Hastebin
10:29:18girvoWhat I have been playing with on my fork of Nim is outputting advanced Flow type definitions, and perhaps even consuming them back _into_ Nim as well... one can dream
10:30:53Araqoh didn't realize you have a fork of Nim, nice
10:31:30*girvo quit (Remote host closed the connection)
10:32:57FromGitter<mratsim> Btw girvo, since you’re using Nim for crypto, do you have an uint256 library you recommend?
10:45:32*Arrrr joined #nim
10:45:32*Arrrr quit (Changing host)
10:45:32*Arrrr joined #nim
10:46:25*girvo joined #nim
10:47:05girvowoops I crashed my IRC client
10:47:42*rinzai joined #nim
10:52:00girvomratsim: I unfortunately rolled my own on top of the GNU MPC library, and leveraged libsodium for the elliptic curve and other asymmetric algos. Being able to turn off Nim's GC and manage stuff is super important for cache safety (*cough meltdown cough*)
10:52:10*rinzai quit (Ping timeout: 240 seconds)
10:53:02girvoAraq: Yeah I've had a fork for various weird experiments for a while. And every so often its nice to come help clean up some of the pull-requests that are just waiting for some housekeeping
10:53:05FromGitter<mratsim> I see
10:53:11def-mratsim: fixed size should be not too hard to implement, something like https://github.com/calccrypto/uint256_t/blob/master/uint256_t.cpp
10:53:12girvoI'd like to do that more often, actually
10:53:34girvodef- yeah if you're after _actual_ just uint256 then its not hard at all
10:54:16girvoBut for Pailier and most of the other homomorphic cryptosystems, you're dealing uint4096's heh
10:54:39def-boost has some generalized stuff for uintXXX, alternatively at some point just use gmp
10:55:23def-but then you have indirection of course
10:55:37FromGitter<mratsim> @def- Yeah I will implement it. For now we’re using this which works with any multiple of word size: https://github.com/status-im/nim-ttmath
10:55:38girvoI found using Gnu GMP coupled with http://fedeomoto.github.io/bignum/ reasonably nice, as the actual type itself is basically just a wrapper around the real GMP pointer
10:55:53FromGitter<mratsim> can’t use GMP, it’s GPL :P
10:56:13girvoSo it's really easy to just `num[]` deref it to hand on to the other functions that haven't been bound to nim nicely yet
10:56:15def-mratsim: so you need to compile with c++?
10:56:16girvoAh damn!
10:56:25FromGitter<mratsim> Yes must use Cpp :/
10:56:45girvoHey, nah, it's LGPL!
10:57:01girvoI had a heart attack for a second. My lawyer would've murdered me, and they did due dilligence on it
10:57:15def-the cpp backend had a few more bugs than c, personally I'd stay with c
10:57:22FromGitter<mratsim> I’m actually planning to port most of the integer/primes/modular arithmetic code I used for project Euler in a proper package: https://github.com/numforge/number-theory
10:58:25girvoYeah I've had horrendous fun trying to bind C++. It doesn't even have a stable ABI for crying out loud 😭
10:58:57girvoNeat work mratsim
10:59:37Araqdef-: it got much better though.
10:59:43girvoI'm about to join Consensys, and they're basically planning on paying me to do R&D into proper trustless cryptography on top of the blockchain work they do with Ethereum
11:00:08*j_rod_s_ joined #nim
11:00:12girvoWhich I entirely plan on doing in Nim, given the choice, so hopefully I can contribute :)
11:00:49Araqprobably still doesn't work for 'koch boot' but in my v2 plans embracing the C++ target I got some flashback
11:02:16FromGitter<mratsim> So will Nim become somehow the Ethereum language :P
11:03:57*j_rod_s quit (Ping timeout: 240 seconds)
11:03:57*j_rod_s_ is now known as j_rod_s
11:08:59*zahary_ quit ()
11:09:11*zahary_ joined #nim
11:10:24girvoEh, we'd need to get rid of the Ethereum VM first. It's horrid
11:10:57def-girvo: they're doing that, rewriting it in Nim
11:11:05girvoAnd I'm not convinced a turing complete language is a good idea for a cryptocurrency contract, personally. I'd rather an ML-derived language with some constraints on it, to allow one to prove things about their programming
11:11:16girvodef-: For real? Do you know which team?
11:11:27def-girvo: Yeah, Nim team at Status.im
11:11:42def-https://github.com/status-im/nimbus
11:11:58FromGitter<alehander42> a language can be not turing complete and still be compiled to the same vm
11:12:33*SenasOzys quit (Ping timeout: 248 seconds)
11:12:36FromGitter<alehander42> (the vm is not perfect at all, but I think solidity is the way bigger problem)
11:12:46girvoAgreed on Solidity being the bigger issue, for sure
11:13:00girvoAnd definitely! Hold on, let me find something really neat for you
11:13:20FromGitter<alehander42> still, there are a number of different languages in development targetting evm , most noticeably viper (which afaik is not turing complete indeed)
11:13:38girvohttps://github.com/dhall-lang/dhall-lang
11:14:08girvoThe EVM technically is, but relies on it's gas and other mechanisms to work around it; so it's not *too* bad. Solidity can go die tho
11:14:28Araqnon-turing-complete solutions either grow until they are TC or get replaced by a TC solution
11:14:43Araqregexes, SQL and HTML come to mind
11:14:51dom96I wonder if it would make more sense to just use an existing well-known language to target the EVM instead of creating a new language that will have surprising gotchas all over.
11:15:01*yglukhov quit (Remote host closed the connection)
11:15:04AraqHTML is replaced/enhanced with JS
11:15:15girvoAraq: You're not wrong. There are counter-examples, mind you; HTML itself isn't turing complete without CSS and it's crazy selectors
11:15:42*yglukhov joined #nim
11:16:11PMunchIs HTML+CSS Turing complete?
11:16:14girvoYeah
11:16:25girvoIt can run various automatons which are turing complete lol
11:16:29girvoBut it requires you to click ;)
11:17:13*j_rod_s_ joined #nim
11:17:26*yglukhov quit (Read error: Connection reset by peer)
11:17:32Araqgirvo: JS is used everywhere, raw HTML not so much
11:17:33FromGitter<alehander42> generally languages do converge to TC indeed, in this case one has to just forbid it :D
11:18:32Araqalehander42: Why though? it doesn't make things harder to analyse if you don't specify first what it means to "analyse"
11:18:36girvoFor sure Araq :) Though with the crazy <include> and shadow DOM stuff HTML is trying to add, they're trying to ruin its beauty as well lol
11:19:00*j_rod_s quit (Ping timeout: 260 seconds)
11:19:00*j_rod_s_ is now known as j_rod_s
11:19:04FromGitter<alehander42> @dom96 there is work on supporting subset of wasm for contracts, which would in theory make easier for more languages to be supported
11:19:18Araqplenty of properties are orthogonal to turing completeness.
11:19:33AraqI can have a TC language without IO.
11:19:37FromGitter<alehander42> well, for once, knowing for sure upper bounds on gas usage etc would be cool
11:20:24FromGitter<alehander42> I guess e.g. total functions would be a good fit
11:20:42girvoWhat I plan on working on is exactly that alehander: total functional programming so we can get good estimates (modulo the halting problem) on costs
11:21:07*rinzai joined #nim
11:21:53AraqError: interpretation takes too many steps.
11:22:00*SenasOzys joined #nim
11:22:12Araqtake that, comp-sci!
11:22:13girvoYeah. Put a simple cost function
11:22:23girvoIt's genuinely feasible heh
11:22:29girvoBut the Brisbane consensys team are building yet another ethereum desktop client :/
11:22:37AraqNim's VM solved this problem.
11:22:43Araq:P
11:23:06AraqI didn't have to butcher the language with total functions for that feature
11:23:43girvoYou say butchery, I say elegance... ;)
11:24:57Araqackerman function is total in N iirc
11:25:19*rinzai quit (Ping timeout: 248 seconds)
11:25:25Araqand yet it can make your precious VM run forever
11:25:56Araqsee? your solutions don't work. ;-)
11:26:09girvohahaha ;)
11:26:35girvoFor real though, go have a play with Dhall sometime. It's so... weird, but in a lovely way
11:26:44*Arrrr1 joined #nim
11:26:44*Arrrr quit (Disconnected by services)
11:27:09*Arrrr1 quit (Client Quit)
11:27:18*yglukhov joined #nim
11:28:37FromGitter<alehander42> well, the evm already has this gas thing, so realistically programs wouldn't run forever there too :D but still you can combine those two approaches, no need to settle only for one (runtime limit vs totallity)
11:28:57*gokr quit (Ping timeout: 240 seconds)
11:29:37Araqyeah you don't but what's the gain in totality?
11:30:34*rinzai joined #nim
11:30:51AraqI don't see any. memory models seem more interesting, can this value alias that other thing over there, is it mutable or not. totality is only control flow, data flow is more interesting. but whatever, I don't really know what I'm talking about.
11:31:18FromGitter<alehander42> well, the gain is that you can *prove* upper bounds for each case, otherwise it's possible that you don't run into a long loop etc while testing
11:31:28FromGitter<alehander42> what's the gain in type systems, it's similar
11:31:54Araqalright fair enough, the upper bounds are usually horrible though :P
11:32:32FromGitter<alehander42> I agree that data flow is equally interesting, and I admit I am not sure how practical total functional languages would be for that purpose, I'll have to play with one :D
11:32:44FromGitter<alehander42> but still they look promising *for some niches*
11:33:19girvoI'd definitely rather see data-flow analysis. I'm in love with Leslie Lamport's TLA+ at the moment, and have used it extensively for my previous project. Literally saved me from race conditions, deadlocks and more.
11:33:57girvoalehander42: Yeah, like writing configuration! :) https://github.com/dhall-lang/dhall-lang
11:34:11FromGitter<alehander42> yeah, starred it, will look at it when i have some time :D
11:34:35Araqackermann function is total with an upper bound that can't be described by the usual math operators
11:34:35*rinzai quit (Ping timeout: 240 seconds)
11:34:45Araqwhat do you do with it?
11:35:31Araqand ackermann is not the worst either, I think there is proof you can construct ever more evil functions that grow faster than the one before
11:35:51FromGitter<alehander42> that's the point: you prove stuff is total *and* you also test your stuff, again, you can do both
11:36:09girvoIf anyone wants to take a serious look at data-flow analysis in networked systems, I can't recommend TLA+ enough: https://lamport.azurewebsites.net/tla/toolbox.html
11:36:12Araqbut it's meaninglessly "total" :-)
11:36:13FromGitter<alehander42> it's like saying, why would you want memory guarantees from your compiler if you have valgrind
11:36:24girvoThough you still have to _implement_ it correctly once you proved it haha
11:37:27Araqit's not clear what it buys you, it's like saying "ok, in practice I've proven it to work and in theory I've proven it to blow up, even though it's total"
11:38:13Araqand if you say "I've proven it to not blow up" then that's a proof that does not rely on totality.
11:38:34Araqbecause totality does no such thing, see Ackermann.
11:39:06Araqyou need a more restrictive version of totality and turn it into a type system.
11:39:16girvo(Totality isn't enough, which is why most research goes into total functional languages as the base, but then building up more interesting proof systems from that. Theres a great one where they did network analysis of Go `goroutines` using a total language and proved there were race conditions that the compiler wouldn't catch)
11:39:24girvoYeah exactlu
11:39:27girvoYeah exactly*
11:39:27*vlad1777d joined #nim
11:40:14*rinzai joined #nim
11:43:20FromGitter<alehander42> do you have a link for the goroutine one ?
11:43:34girvoI'll see if I can find it, two seconds
11:44:04girvohttp://mrg.doc.ic.ac.uk/publications/a-static-verification-framework-for-message-passing-in-go-using-behavioural-types/draft.pdf
11:44:14girvoA Static Verification Framework for Message Passing in Go using Behavioural Types (J. Lange, N. Ng, B. Toninho, N. Yoshida)
11:44:20girvoIt's exactly what we are talking about ;)
11:44:33*rinzai quit (Ping timeout: 248 seconds)
11:45:16girvoAlso worth reading through more of the papers here: https://github.com/golang/go/wiki/ResearchPapers
11:48:27FromGitter<alehander42> awesome, thanks!
11:49:08girvoMy god I love these paper titles: https://github.com/gasche/icfp2017-papers
11:49:59girvo> How to Prove Your Calculus is Decidable: Practical Applications of Second-order Algebraic Theories and Computation
11:51:24FromGitter<alehander42> i am gonna name my child after them
11:53:44*rinzai joined #nim
11:56:27girvoMy girlfriend is.... decidedly non technical. She finds what I get excited about ridiculous... but then she watches every episode of the Kardashians...
11:58:47*rinzai quit (Ping timeout: 276 seconds)
12:04:50*xet7 quit (Quit: Leaving)
12:10:03dom96bleh, strformat.fmt should really be the "default" not ``&``
12:10:55*yglukhov quit (Ping timeout: 260 seconds)
12:11:41FromGitter<andreaferretti> @girvo nice stuff - do you have anything open sourced?
12:12:04*rinzai joined #nim
12:12:32FromGitter<andreaferretti> I used to dabble with fully homomorphic encryption implementations, but nothing clean enough to publish as a library
12:13:27*yglukhov joined #nim
12:13:43FromGitter<andreaferretti> in fact, I wanted to do something like this in Nim https://pdfs.semanticscholar.org/cbf3/42b31d7b7c027549c3f946c34d04769f1b63.pdf
12:14:13FromGitter<andreaferretti> but static[T] does not work well enough yet
12:17:14*HoloIRCUser1 joined #nim
12:17:28*HoloIRCUser1 is now known as TakeYourFreedom
12:19:45FromGitter<andreaferretti> I just realized there is not an issue to track my problem, going to open it
12:21:33FromGitter<andreaferretti> here https://github.com/nim-lang/Nim/issues/7209
12:22:33FromGitter<andreaferretti> @mratsim if you plan to do something number theoretic, it would be nice if you made it generic enough to integrate with Emmy https://github.com/unicredit/emmy
12:24:53FromGitter<mratsim> Ah! Yeah the modularRing would be awesome
12:25:38FromGitter<andreaferretti> the issue I ran into
12:25:56FromGitter<andreaferretti> which is the reason I stopped working on Emmy
12:26:29FromGitter<andreaferretti> is that when you do a lot of modular arithmetic, you want the modulo to be a static[T] parameter
12:26:40FromGitter<andreaferretti> to avoid storing everything redundantly
12:27:03FromGitter<andreaferretti> now, for static[int] things work ok (it used to crash, but now it is fixed)
12:27:21FromGitter<andreaferretti> it is still not working generically, though - see the above bug
12:27:29FromGitter<andreaferretti> I just opened
12:27:57FromGitter<andreaferretti> I thought I already had one issue opened on this, but it turns out I didn't
12:28:37FromGitter<mratsim> in my case I think providing a macro block like this: ⏎ ⏎ ```modular(16): ⏎ let k = 10 + 15 ⏎ let l = 3 ** 40 ⏎ let j = 3 * 4 + 10``` ⏎ ⏎ That rewrites every proc to its modular version would be enough [https://gitter.im/nim-lang/Nim?at=5a81887597cedeb0482f2021]
12:29:12FromGitter<andreaferretti> I wanted to be able to do linear algebra over finite fields
12:29:27FromGitter<andreaferretti> which in turn are prime fields modulo some polynomial
12:29:45FromGitter<andreaferretti> this requires being able to to handle modular operations generically
12:30:27FromGitter<andreaferretti> I have the linear algebra parts, polynomials and modular stuff basically working
12:30:39FromGitter<andreaferretti> but I cannot put everything together due to the above
12:30:52FromGitter<mratsim> I see
12:37:21*TakeYourFreedom quit (Ping timeout: 248 seconds)
12:38:42FromGitter<andreaferretti> @girvo if you have anything you can share about your use case, I would be interested to know
12:38:51FromGitter<andreaferretti> feel free to write me privately
12:39:29*vlad1777d quit (Ping timeout: 260 seconds)
12:49:32*HoloIRCUser2 joined #nim
12:51:20*Snircle joined #nim
12:55:10*floppydh quit (Quit: WeeChat 2.0.1)
12:55:26*floppydh joined #nim
13:01:45girvoSend me an email! josh (at) jgirvin (dot) com
13:04:49FromGitter<andreaferretti> thanks, I will!
13:05:53*xet7 joined #nim
13:12:00*HoloIRCUser2 quit (Ping timeout: 248 seconds)
13:14:06*Vladar quit (Quit: Leaving)
13:20:39*TakeYourFreedom joined #nim
13:22:30*psj joined #nim
13:23:39*psj quit (Client Quit)
13:30:56*rokups joined #nim
13:41:07*TakeYourFreedom quit (Remote host closed the connection)
13:41:19*TakeYourFreedom joined #nim
13:42:18*yglukhov quit (Remote host closed the connection)
13:55:41*yglukhov joined #nim
14:02:05FromGitter<nepeckman> Asked this question yesterday (think it was a bad time), but I'm really curious: it seems like its possible to export a function with the same name as the module that contains it, but not a variable with the same name as its module. When I try to import a module that exports a variable of the same name, the compiler claims the variable is void. I don't have the same issue if the module instead exports a function of
14:02:05FromGitter... the same name. Why does this occur, and is it intended?
14:05:41FromGitter<mratsim> I think it’s a gotcha. Some languages have Higher Order Functions, Nim also has Higher Order Modules :P
14:06:51FromGitter<nepeckman> Wow I hadn't heard about that! So Modules can return other Modules?
14:06:52*radagast_04 quit (Ping timeout: 260 seconds)
14:08:21FromGitter<mratsim> actually it was more of a joke, but I also got bitten with “ambiguous call” when my variables had the same name as a module, meaning we can call modules ;)
14:10:36FromGitter<nepeckman> Haha sorry, didn't realize! I guess my question is why the same ambiguity doesn't apply to function calls?
14:12:33Araqbecause the ambiguity is resolved with overloading resolution
14:12:44FromGitter<mratsim> I think it used to clash but we had a random module with random procs
14:13:07Araqvariables have no OR and hence can't have the module's name.
14:13:47FromGitter<nepeckman> Oh gotcha, that makes sense
14:14:35FromGitter<nepeckman> Thanks for the explanation!
14:16:23FromGitter<qqtop> @mratsim binomialCoeff (4,2) == 4 at combinatorics.nim :) the assert actually fails
14:16:45FromGitter<mratsim> uh? lol :P
14:21:50FromGitter<mratsim> oh I know why `result *= (n-i) div (i + 1)` should be `result = result * (n-i) div (i + 1)` :/ thanks @qqtop
14:29:18Araqoh no, we have to deprecate *= now.
14:31:27*SenasOzys quit (Ping timeout: 240 seconds)
14:32:02Araq:-)
14:32:43*endragor quit (Remote host closed the connection)
14:33:21*endragor joined #nim
14:35:59*gokr joined #nim
14:52:22*TakeYourFreedom quit (Remote host closed the connection)
15:11:35*Guest33859 quit (Quit: Leaving)
15:14:19*dddddd joined #nim
15:14:55*SenasOzys joined #nim
15:21:12*TakeYourFreedom joined #nim
15:21:25*endragor quit (Remote host closed the connection)
15:36:44*PMunch quit (Quit: Leaving)
15:46:53FromGitter<Quelklef> Anyone know if semver considers "auxiliary feature additions" like syntax highlighting for ST3 to require a minor version increment? Or is patch enough
15:47:19FromGitter<Quelklef> Since it's not really a part of the public API but it *is* relevant to the project.
15:50:13*endragor joined #nim
15:57:01FromGitter<data-man> @mratsim : From my bookmarks :) ⏎ Yet another Nim decimal library https://github.com/Sud0nim/Decimal (WIP)
16:09:02*j_rod_s quit (Read error: Connection reset by peer)
16:09:17*j_rod_s joined #nim
16:16:46*Trustable joined #nim
16:21:11*natrys joined #nim
16:26:17*floppydh quit (Quit: WeeChat 2.0.1)
16:27:54*yglukhov quit (Remote host closed the connection)
16:45:28*Vladar joined #nim
16:47:35FromGitter<mratsim> nice
16:47:48FromGitter<mratsim> I guess for arbitrary precision int nim will be covered then
16:50:26FromGitter<mratsim> it’s probably better if I split in specialized libraries (modular arithmetic, combinatorics, uint256, …)
16:51:34*d10n-work joined #nim
16:51:47FromGitter<mratsim> If “SomeInteger” were a concept that would be easier, This way I could have modular arithmetic on uint256 ;)
16:58:05*gokr quit (Ping timeout: 240 seconds)
16:58:22*yglukhov joined #nim
17:03:02*yglukhov quit (Ping timeout: 260 seconds)
17:16:13FromGitter<andreaferretti> hopefully emmy will allow to have modular arithmetic on any euclidean ring :-)
17:16:20FromGitter<andreaferretti> (which is in fact a concept)
17:18:01FromGitter<data-man> For D, I used this module https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.d (Provide a 2^N-bit integer type) ⏎ I think that Nim port will be more elegant. :)
17:20:24FromGitter<Quelklef> Is there any way to guarantee that stdout isn't polluted?
17:20:28FromGitter<Quelklef> I keep getting `CC: ... `
17:26:43FromGitter<Quelklef> nvm, I'll not use pipes
17:27:50*darithorn joined #nim
17:42:22*rinzai quit (Ping timeout: 256 seconds)
17:42:59*rinzai joined #nim
17:43:23*endragor quit (Remote host closed the connection)
17:47:30*rinzai quit (Ping timeout: 260 seconds)
17:47:50*Jesin joined #nim
17:48:31*SenasOzys quit (Read error: Connection reset by peer)
17:48:50*SenasOzys joined #nim
17:49:32*SenasOzys quit (Remote host closed the connection)
17:49:55*SenasOzys joined #nim
17:54:28*rinzai joined #nim
18:01:30*ipjk joined #nim
18:05:08*ipjk quit (Client Quit)
18:06:07*yglukhov joined #nim
18:11:14*yglukhov quit (Ping timeout: 276 seconds)
18:13:26FromGitter<mratsim> What triggers this `Error: implicit object field construction requires a .partial object, but got Foo`?
18:13:48*Take_Your_Freedo joined #nim
18:14:37*gokr joined #nim
18:14:57*TakeYourFreedom quit (Ping timeout: 240 seconds)
18:18:47Araqmratsim: your macro produced let|var x.field = ...
18:20:28FromGitter<mratsim> ah I was shadowing result like so: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a81daec51915d962aff2f91]
18:22:01*Take_Your_Freedo quit (Quit: Leaving)
18:22:09*Take_Your_Freedo joined #nim
18:30:30*Jesin quit (Quit: Leaving)
18:47:12*TakeYourFreedom joined #nim
18:47:55*endragor joined #nim
18:48:25*Take_Your_Freedo quit (Read error: Connection reset by peer)
19:04:52girvoUgh I've been up for two nights straight now trying to meet a bullshit deadline. Kill me
19:15:41*yglukhov joined #nim
19:17:39*Sargun quit (Changing host)
19:17:39*Sargun joined #nim
19:20:01*yglukhov quit (Ping timeout: 248 seconds)
19:26:01*Trustable quit (Remote host closed the connection)
19:39:01FromGitter<nitely> @girvo what? push it
19:39:11FromGitter<nitely> and mean the deadline not your mental health XD
19:42:35girvoWe can't, unfortunately. $20mil riding on it. But it's all good,gonna take 6 weeks off after this
19:43:38*endragor quit (Ping timeout: 255 seconds)
19:52:23FromGitter<nitely> but can you even be productive without sleep?
19:52:29*rockcavera quit (Remote host closed the connection)
19:53:05*chemist69 quit (Ping timeout: 255 seconds)
19:53:29girvoUp until about literally right now, yeah; but I can only do it about once a year :/
19:57:24*chemist69 joined #nim
20:11:08*subsetpark quit (Remote host closed the connection)
20:19:26*BitPuffin quit (Remote host closed the connection)
20:21:33*yglukhov joined #nim
20:25:56*yglukhov quit (Ping timeout: 255 seconds)
20:35:13*rinzai quit (Ping timeout: 248 seconds)
20:35:47dom96girvo: Take care of yourself, there are more important things than money :)
20:42:05*darithorn quit (Remote host closed the connection)
20:45:28shodan45so vs code is more or less the editor of choice for nim these days? not aporia?
20:46:12nekitsIt's what I use.
20:46:20nekitsBut I'm only one person.
20:47:11nekitsI have friends that use intelliJ, some use vim or micro.
20:47:23shodan45I'm used to jetbrains' IDEs (intellij, pycharm, etc.), and never used any VS
20:47:58nekitsyou could easily stick with that then. are you looking to switch or just curious?
20:48:17*endragor joined #nim
20:48:20shodan45just curious
20:48:43shodan45I didn't know that intellij had a nim plugin
20:48:57nekitsIt should.
20:50:14shodan45I primarily use phpstorm, tho... it makes dealing with the horrors of PHP less brain-damaging
20:50:37nekitsless is the key word there
20:50:52shodan45nekits: you don't need to convince me
20:59:58*yglukhov joined #nim
21:00:48shodan45hrm... I see 2 nim plugins in intellij. https://github.com/jhspetersson/idea-nim is ~2.5 years old
21:01:20shodan45the other one doesn't have a URL and is only 5.3kb
21:01:37shodan45ah, screw it, I'll just use a dumb editor
21:01:45shodan45for now
21:04:26nekitswhat os do you use?
21:04:46shodan45linux
21:05:00nekitswhich distro?
21:06:15shodan45opensuse
21:06:17shodan4542.3
21:07:27nekitsever try micro?
21:07:40nekitshttps://github.com/zyedidia/micro
21:07:54*natrys quit (Quit: natrys)
21:08:15*rokups quit (Quit: Connection closed for inactivity)
21:13:29*nekits quit (Remote host closed the connection)
21:15:22*nsf quit (Quit: WeeChat 2.0.1)
21:17:03*subsetpark joined #nim
21:19:10*rinzai joined #nim
21:22:21*vegax87 quit (Changing host)
21:22:21*vegax87 joined #nim
21:22:21*vegax87 quit (Changing host)
21:22:21*vegax87 joined #nim
21:23:09*yglukhov quit (Remote host closed the connection)
21:23:50*rinzai quit (Ping timeout: 265 seconds)
21:24:30*endragor quit (Ping timeout: 256 seconds)
21:24:55*TakeYourFreedom quit (Remote host closed the connection)
21:28:55*ieatnerds joined #nim
21:31:04*rinzai joined #nim
21:34:24*yglukhov joined #nim
21:39:02*Sargun quit (Read error: Connection reset by peer)
21:39:42*Sargun joined #nim
21:39:42*Sargun quit (Changing host)
21:39:43*Sargun joined #nim
21:45:05*madmalik quit (Quit: Connection closed for inactivity)
21:52:02*vivus joined #nim
21:53:14*xet7 quit (Ping timeout: 255 seconds)
22:07:59*xet7 joined #nim
22:21:03dom96When a library you want to use calls `exit()` on error... *sigh*
22:27:06shodan45I'm slightly unsure of how variant types work in nim... is a "case" under "object" a compile-time conditional?
22:27:44shodan45dom96: oh hello, I'm reading your book right this very second ;)
22:29:09shodan45hm, no, it can't be compile-time.... because doing invalid stuff throws an exception, not a compile error
22:29:18shodan45(right?)
22:30:11dom96yep
22:30:24dom96object variants are runtime constructs
22:31:31shodan45the syntax is a little confusing, IMHO
22:31:44*endragor joined #nim
22:32:16shodan45heh, I wish I could link to what I'm talking about, but this is in ch. 3
22:34:04shodan45"case empty: bool" is what looks odd to me... I'd prefer it if it the field definition & case were on 2 separate lines
22:34:16shodan45I'm sure I'll get used to it
22:34:33shodan45pay no attention to the noob in IRC ;)
22:34:49FromGitter<Quelklef> yeah it was weird at first for me too but it makes it so that you can tell it's an ADT at a glance
22:35:01FromGitter<Quelklef> sorry, variant type*
22:36:26shodan45hm, can you "vary" based on multiple fields?
22:36:55shodan45or is that like multiple inheritance - yeah, but "please don't do that"? :)
22:37:12FromGitter<Quelklef> Probably, like ⏎ ⏎ ```type A = object ⏎ case field1: bool ⏎ of true: ⏎ fieldx: x ⏎ of false:``` [https://gitter.im/nim-lang/Nim?at=5a82171818f388e62695dac1]
22:37:41FromGitter<Quelklef> never needed it though so I've never tried
22:39:39shodan45Quelklef: I meant inside of an "of" branch
22:40:02shodan45can't think of the right word for that suddenly
22:40:56shodan45multi-level? compound?
22:41:30subsetparkshodan45: sort of
22:41:36FromGitter<Quelklef> nested
22:41:52shodan45yes, nested. thank you.
22:41:57shodan45stupid brain.
22:42:02FromGitter<Quelklef> : )
22:42:15subsetparkhttps://play.nim-lang.org?gist=7e3b66afe43817ee5008c14a36954f43
22:43:05FromGitter<Quelklef> Working on my local machine too (was making a different example)
22:43:22subsetparkYou can have multi-level conditionals, but you can't vary based on multiple fields in the sense of creating a boolean matrix; in the example, the y discriminator is only legal in the x = true branch. So you can't have a value for (x: false, y: false)
22:43:57FromGitter<Quelklef> Couldn't you just make 'em the same names
22:44:03subsetparkNope.
22:44:44FromGitter<Quelklef> Damn these Nim devs and their comprehensive code
22:44:51subsetparkEvery field name can only appear once
22:45:02subsetpark(otherwise the compiler couldn't statically tell what branch you're in)
22:45:17shodan45interesting
22:45:28subsetparkof course - you could easily have a single field that's a tuple
22:45:55shodan45subsetpark: I see what you mean
22:46:24subsetparkoh actually i think i'm lying
22:47:13subsetparkyeah, that's nonsense. you can't have a case statement over a tuple.
22:47:49*Vladar quit (Quit: Leaving)
22:53:09*vlad1777d joined #nim
22:55:33FromGitter<Quelklef> I mean conceptually it could work
22:55:46FromGitter<Quelklef> as long as the contained types are "caseable"
22:55:59FromGitter<Quelklef> enumerable
23:08:33*yglukhov quit (Remote host closed the connection)
23:13:26subsetparkyes... I suspect you'll get more mileage out of using an enum and having a separate case statement to go from the enum to the composite
23:20:40*SenasOzys quit (Ping timeout: 240 seconds)
23:24:09*yglukhov joined #nim
23:27:10*arecaceae quit (Remote host closed the connection)
23:27:33*arecaceae joined #nim
23:28:33*yglukhov quit (Ping timeout: 248 seconds)
23:29:11*solitudesf quit (Ping timeout: 276 seconds)
23:30:09*endragor quit (Ping timeout: 248 seconds)
23:31:05FromGitter<honewatson> @ shodan45 I primarily use JetBrains IDEs but for Nim you are better off using VsCode. I was going to write a completion engine for YouCompleteMe when I get time to improve nvim-nim
23:35:59FromGitter<honewatson> @Quelklef I wanted to create static binary command line tool which can read a simple DSL and do stuff so macros and templates are out.
23:37:04*Sembei joined #nim