00:01:45 | nekits | A little late but thank you Vindaar! |
00:05:57 | * | gokr quit (Ping timeout: 240 seconds) |
00:14:51 | FromGitter | <Vindaar> No worries, glad I could help! |
00:44:38 | FromGitter | <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:57 | psj | i'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:02 | FromGitter | <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:42 | radagast_04 | Hi, How can I pass a comparison operator into a function? for example, fn(3, 12, >)? |
04:19:50 | radagast_04 | https://play.nim-lang.org/?gist=c6152867fbfc79aa57fa83d7309d96a4 |
04:31:22 | radagast_04 | looks like > is a template |
04:31:26 | radagast_04 | sish |
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:20 | FromGitter | <nitely> @psj this works: https://play.nim-lang.org/?gist=caafc2b222d10bec34cc2d5b8f6ba3bd |
06:44:33 | FromGitter | <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:47 | FromGitter | <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:07 | FromGitter | <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:35 | Araq | .intdefine and .strdefine |
08:21:58 | * | HoloIRCUser quit (Ping timeout: 252 seconds) |
08:22:29 | FromGitter | <bung87> the default value can be a variable? the example from document is constant |
08:23:46 | Araq | can only be a constant |
08:23:52 | Araq | you can do |
08:23:55 | Araq | const X = ... |
08:23:59 | Araq | var v = X |
08:24:06 | Araq | and then use 'v' |
08:26:44 | FromGitter | <bung87> the compile args says could be -d:aaa=111 then why canot be variable? |
08:29:04 | Araq | because. now use my workaround. |
08:30:13 | FromGitter | <bung87> but the value is actually from a cfg file which generate by a python program |
08:30:45 | Araq | first of all, replace that Python program by a Nim program. :P |
08:31:02 | Araq | secondly, why does that matter? |
08:31:16 | Araq | either 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:24 | FromGitter | <bung87> so the --define just a boolean flag? |
08:33:08 | Araq | --define works as documented. your cfg file generated from Python has nothing to do with --define |
08:34:22 | Araq | to read a config file, use the parsecfg module |
08:34:45 | FromGitter | <bung87> it generate nim.cfg contains "define:"PY_MOD_NAME=genesis_api"" |
08:34:57 | FromGitter | <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:24 | FromGitter | <bung87> when defined(PY_MOD_NAME): is true but I dont know how to get the value of PY_MOD_NAME |
08:36:27 | Araq | so? 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:39 | FromGitter | <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:01 | Araq | oh it's you again |
10:14:19 | Araq | will I ever get that email you promised me months ago? ;-) |
10:15:40 | * | rinzai joined #nim |
10:17:45 | Araq | welcome back, girvo |
10:19:27 | girvo | You 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:03 | girvo | But 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:25 | PMunch | Wow, that's really cool |
10:20:29 | Araq | I'm sure these words mean something. |
10:20:43 | girvo | Hehe :) You'd easily be able to tackle it Araq |
10:20:55 | girvo | https://en.wikipedia.org/wiki/Paillier_cryptosystem |
10:21:18 | PMunch | Homomorphic cryptography is really interesting |
10:21:47 | girvo | Encrypt 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:24 | girvo | But yes: it's in production! Being used for real trustless tasks between the 4 largest insurance agencies in the Southern Hemisphere :) |
10:22:58 | PMunch | Oh wow, that's possibly even cooler! :P |
10:23:28 | Araq | girvo: do you keep up with Nim devel? Any code breakages we should be concerned about? |
10:23:43 | girvo | According to IBM who were sort of our partners, it's one of the first commercial usages of homomorphic encryption ever |
10:24:15 | girvo | Araq: 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:29 | girvo | And some of my weird algorithmic data types now compile, which makes me very happy |
10:25:27 | Araq | :D |
10:26:34 | girvo | I've been doing some really weird stuff with flow.org recently |
10:27:03 | * | dddddd quit (Remote host closed the connection) |
10:27:22 | girvo | Ignore the file-type, it's Javascript with Flow type hints: https://hastebin.com/xeliqihona.ts |
10:28:05 | FromGitter | <mratsim> why mix Flow and typescript? |
10:28:06 | girvo | It 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:32 | girvo | mratsim: I didn't! The .ts extension was just to get highlighting on Hastebin |
10:29:18 | girvo | What 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:53 | Araq | oh didn't realize you have a fork of Nim, nice |
10:31:30 | * | girvo quit (Remote host closed the connection) |
10:32:57 | FromGitter | <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:05 | girvo | woops I crashed my IRC client |
10:47:42 | * | rinzai joined #nim |
10:52:00 | girvo | mratsim: 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:02 | girvo | Araq: 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:05 | FromGitter | <mratsim> I see |
10:53:11 | def- | 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:12 | girvo | I'd like to do that more often, actually |
10:53:34 | girvo | def- yeah if you're after _actual_ just uint256 then its not hard at all |
10:54:16 | girvo | But for Pailier and most of the other homomorphic cryptosystems, you're dealing uint4096's heh |
10:54:39 | def- | boost has some generalized stuff for uintXXX, alternatively at some point just use gmp |
10:55:23 | def- | but then you have indirection of course |
10:55:37 | FromGitter | <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:38 | girvo | I 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:53 | FromGitter | <mratsim> can’t use GMP, it’s GPL :P |
10:56:13 | girvo | So 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:15 | def- | mratsim: so you need to compile with c++? |
10:56:16 | girvo | Ah damn! |
10:56:25 | FromGitter | <mratsim> Yes must use Cpp :/ |
10:56:45 | girvo | Hey, nah, it's LGPL! |
10:57:01 | girvo | I had a heart attack for a second. My lawyer would've murdered me, and they did due dilligence on it |
10:57:15 | def- | the cpp backend had a few more bugs than c, personally I'd stay with c |
10:57:22 | FromGitter | <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:25 | girvo | Yeah I've had horrendous fun trying to bind C++. It doesn't even have a stable ABI for crying out loud 😭 |
10:58:57 | girvo | Neat work mratsim |
10:59:37 | Araq | def-: it got much better though. |
10:59:43 | girvo | I'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:12 | girvo | Which I entirely plan on doing in Nim, given the choice, so hopefully I can contribute :) |
11:00:49 | Araq | probably still doesn't work for 'koch boot' but in my v2 plans embracing the C++ target I got some flashback |
11:02:16 | FromGitter | <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:24 | girvo | Eh, we'd need to get rid of the Ethereum VM first. It's horrid |
11:10:57 | def- | girvo: they're doing that, rewriting it in Nim |
11:11:05 | girvo | And 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:16 | girvo | def-: For real? Do you know which team? |
11:11:27 | def- | girvo: Yeah, Nim team at Status.im |
11:11:42 | def- | https://github.com/status-im/nimbus |
11:11:58 | FromGitter | <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:36 | FromGitter | <alehander42> (the vm is not perfect at all, but I think solidity is the way bigger problem) |
11:12:46 | girvo | Agreed on Solidity being the bigger issue, for sure |
11:13:00 | girvo | And definitely! Hold on, let me find something really neat for you |
11:13:20 | FromGitter | <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:38 | girvo | https://github.com/dhall-lang/dhall-lang |
11:14:08 | girvo | The 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:28 | Araq | non-turing-complete solutions either grow until they are TC or get replaced by a TC solution |
11:14:43 | Araq | regexes, SQL and HTML come to mind |
11:14:51 | dom96 | I 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:04 | Araq | HTML is replaced/enhanced with JS |
11:15:15 | girvo | Araq: 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:11 | PMunch | Is HTML+CSS Turing complete? |
11:16:14 | girvo | Yeah |
11:16:25 | girvo | It can run various automatons which are turing complete lol |
11:16:29 | girvo | But 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:32 | Araq | girvo: JS is used everywhere, raw HTML not so much |
11:17:33 | FromGitter | <alehander42> generally languages do converge to TC indeed, in this case one has to just forbid it :D |
11:18:32 | Araq | alehander42: Why though? it doesn't make things harder to analyse if you don't specify first what it means to "analyse" |
11:18:36 | girvo | For 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:04 | FromGitter | <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:18 | Araq | plenty of properties are orthogonal to turing completeness. |
11:19:33 | Araq | I can have a TC language without IO. |
11:19:37 | FromGitter | <alehander42> well, for once, knowing for sure upper bounds on gas usage etc would be cool |
11:20:24 | FromGitter | <alehander42> I guess e.g. total functions would be a good fit |
11:20:42 | girvo | What 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:53 | Araq | Error: interpretation takes too many steps. |
11:22:00 | * | SenasOzys joined #nim |
11:22:12 | Araq | take that, comp-sci! |
11:22:13 | girvo | Yeah. Put a simple cost function |
11:22:23 | girvo | It's genuinely feasible heh |
11:22:29 | girvo | But the Brisbane consensys team are building yet another ethereum desktop client :/ |
11:22:37 | Araq | Nim's VM solved this problem. |
11:22:43 | Araq | :P |
11:23:06 | Araq | I didn't have to butcher the language with total functions for that feature |
11:23:43 | girvo | You say butchery, I say elegance... ;) |
11:24:57 | Araq | ackerman function is total in N iirc |
11:25:19 | * | rinzai quit (Ping timeout: 248 seconds) |
11:25:25 | Araq | and yet it can make your precious VM run forever |
11:25:56 | Araq | see? your solutions don't work. ;-) |
11:26:09 | girvo | hahaha ;) |
11:26:35 | girvo | For 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:37 | FromGitter | <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:37 | Araq | yeah you don't but what's the gain in totality? |
11:30:34 | * | rinzai joined #nim |
11:30:51 | Araq | I 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:18 | FromGitter | <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:28 | FromGitter | <alehander42> what's the gain in type systems, it's similar |
11:31:54 | Araq | alright fair enough, the upper bounds are usually horrible though :P |
11:32:32 | FromGitter | <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:44 | FromGitter | <alehander42> but still they look promising *for some niches* |
11:33:19 | girvo | I'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:57 | girvo | alehander42: Yeah, like writing configuration! :) https://github.com/dhall-lang/dhall-lang |
11:34:11 | FromGitter | <alehander42> yeah, starred it, will look at it when i have some time :D |
11:34:35 | Araq | ackermann 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:45 | Araq | what do you do with it? |
11:35:31 | Araq | and 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:51 | FromGitter | <alehander42> that's the point: you prove stuff is total *and* you also test your stuff, again, you can do both |
11:36:09 | girvo | If 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:12 | Araq | but it's meaninglessly "total" :-) |
11:36:13 | FromGitter | <alehander42> it's like saying, why would you want memory guarantees from your compiler if you have valgrind |
11:36:24 | girvo | Though you still have to _implement_ it correctly once you proved it haha |
11:37:27 | Araq | it'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:13 | Araq | and if you say "I've proven it to not blow up" then that's a proof that does not rely on totality. |
11:38:34 | Araq | because totality does no such thing, see Ackermann. |
11:39:06 | Araq | you need a more restrictive version of totality and turn it into a type system. |
11:39:16 | girvo | (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:24 | girvo | Yeah exactlu |
11:39:27 | girvo | Yeah exactly* |
11:39:27 | * | vlad1777d joined #nim |
11:40:14 | * | rinzai joined #nim |
11:43:20 | FromGitter | <alehander42> do you have a link for the goroutine one ? |
11:43:34 | girvo | I'll see if I can find it, two seconds |
11:44:04 | girvo | http://mrg.doc.ic.ac.uk/publications/a-static-verification-framework-for-message-passing-in-go-using-behavioural-types/draft.pdf |
11:44:14 | girvo | A Static Verification Framework for Message Passing in Go using Behavioural Types (J. Lange, N. Ng, B. Toninho, N. Yoshida) |
11:44:20 | girvo | It's exactly what we are talking about ;) |
11:44:33 | * | rinzai quit (Ping timeout: 248 seconds) |
11:45:16 | girvo | Also worth reading through more of the papers here: https://github.com/golang/go/wiki/ResearchPapers |
11:48:27 | FromGitter | <alehander42> awesome, thanks! |
11:49:08 | girvo | My god I love these paper titles: https://github.com/gasche/icfp2017-papers |
11:49:59 | girvo | > How to Prove Your Calculus is Decidable: Practical Applications of Second-order Algebraic Theories and Computation |
11:51:24 | FromGitter | <alehander42> i am gonna name my child after them |
11:53:44 | * | rinzai joined #nim |
11:56:27 | girvo | My 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:03 | dom96 | bleh, strformat.fmt should really be the "default" not ``&`` |
12:10:55 | * | yglukhov quit (Ping timeout: 260 seconds) |
12:11:41 | FromGitter | <andreaferretti> @girvo nice stuff - do you have anything open sourced? |
12:12:04 | * | rinzai joined #nim |
12:12:32 | FromGitter | <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:43 | FromGitter | <andreaferretti> in fact, I wanted to do something like this in Nim https://pdfs.semanticscholar.org/cbf3/42b31d7b7c027549c3f946c34d04769f1b63.pdf |
12:14:13 | FromGitter | <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:45 | FromGitter | <andreaferretti> I just realized there is not an issue to track my problem, going to open it |
12:21:33 | FromGitter | <andreaferretti> here https://github.com/nim-lang/Nim/issues/7209 |
12:22:33 | FromGitter | <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:53 | FromGitter | <mratsim> Ah! Yeah the modularRing would be awesome |
12:25:38 | FromGitter | <andreaferretti> the issue I ran into |
12:25:56 | FromGitter | <andreaferretti> which is the reason I stopped working on Emmy |
12:26:29 | FromGitter | <andreaferretti> is that when you do a lot of modular arithmetic, you want the modulo to be a static[T] parameter |
12:26:40 | FromGitter | <andreaferretti> to avoid storing everything redundantly |
12:27:03 | FromGitter | <andreaferretti> now, for static[int] things work ok (it used to crash, but now it is fixed) |
12:27:21 | FromGitter | <andreaferretti> it is still not working generically, though - see the above bug |
12:27:29 | FromGitter | <andreaferretti> I just opened |
12:27:57 | FromGitter | <andreaferretti> I thought I already had one issue opened on this, but it turns out I didn't |
12:28:37 | FromGitter | <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:12 | FromGitter | <andreaferretti> I wanted to be able to do linear algebra over finite fields |
12:29:27 | FromGitter | <andreaferretti> which in turn are prime fields modulo some polynomial |
12:29:45 | FromGitter | <andreaferretti> this requires being able to to handle modular operations generically |
12:30:27 | FromGitter | <andreaferretti> I have the linear algebra parts, polynomials and modular stuff basically working |
12:30:39 | FromGitter | <andreaferretti> but I cannot put everything together due to the above |
12:30:52 | FromGitter | <mratsim> I see |
12:37:21 | * | TakeYourFreedom quit (Ping timeout: 248 seconds) |
12:38:42 | FromGitter | <andreaferretti> @girvo if you have anything you can share about your use case, I would be interested to know |
12:38:51 | FromGitter | <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:45 | girvo | Send me an email! josh (at) jgirvin (dot) com |
13:04:49 | FromGitter | <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:05 | FromGitter | <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:05 | FromGitter | ... the same name. Why does this occur, and is it intended? |
14:05:41 | FromGitter | <mratsim> I think it’s a gotcha. Some languages have Higher Order Functions, Nim also has Higher Order Modules :P |
14:06:51 | FromGitter | <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:21 | FromGitter | <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:36 | FromGitter | <nepeckman> Haha sorry, didn't realize! I guess my question is why the same ambiguity doesn't apply to function calls? |
14:12:33 | Araq | because the ambiguity is resolved with overloading resolution |
14:12:44 | FromGitter | <mratsim> I think it used to clash but we had a random module with random procs |
14:13:07 | Araq | variables have no OR and hence can't have the module's name. |
14:13:47 | FromGitter | <nepeckman> Oh gotcha, that makes sense |
14:14:35 | FromGitter | <nepeckman> Thanks for the explanation! |
14:16:23 | FromGitter | <qqtop> @mratsim binomialCoeff (4,2) == 4 at combinatorics.nim :) the assert actually fails |
14:16:45 | FromGitter | <mratsim> uh? lol :P |
14:21:50 | FromGitter | <mratsim> oh I know why `result *= (n-i) div (i + 1)` should be `result = result * (n-i) div (i + 1)` :/ thanks @qqtop |
14:29:18 | Araq | oh no, we have to deprecate *= now. |
14:31:27 | * | SenasOzys quit (Ping timeout: 240 seconds) |
14:32:02 | Araq | :-) |
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:53 | FromGitter | <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:19 | FromGitter | <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:01 | FromGitter | <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:35 | FromGitter | <mratsim> nice |
16:47:48 | FromGitter | <mratsim> I guess for arbitrary precision int nim will be covered then |
16:50:26 | FromGitter | <mratsim> it’s probably better if I split in specialized libraries (modular arithmetic, combinatorics, uint256, …) |
16:51:34 | * | d10n-work joined #nim |
16:51:47 | FromGitter | <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:13 | FromGitter | <andreaferretti> hopefully emmy will allow to have modular arithmetic on any euclidean ring :-) |
17:16:20 | FromGitter | <andreaferretti> (which is in fact a concept) |
17:18:01 | FromGitter | <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:24 | FromGitter | <Quelklef> Is there any way to guarantee that stdout isn't polluted? |
17:20:28 | FromGitter | <Quelklef> I keep getting `CC: ... ` |
17:26:43 | FromGitter | <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:26 | FromGitter | <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:47 | Araq | mratsim: your macro produced let|var x.field = ... |
18:20:28 | FromGitter | <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:52 | girvo | Ugh 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:01 | FromGitter | <nitely> @girvo what? push it |
19:39:11 | FromGitter | <nitely> and mean the deadline not your mental health XD |
19:42:35 | girvo | We 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:23 | FromGitter | <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:29 | girvo | Up 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:47 | dom96 | girvo: Take care of yourself, there are more important things than money :) |
20:42:05 | * | darithorn quit (Remote host closed the connection) |
20:45:28 | shodan45 | so vs code is more or less the editor of choice for nim these days? not aporia? |
20:46:12 | nekits | It's what I use. |
20:46:20 | nekits | But I'm only one person. |
20:47:11 | nekits | I have friends that use intelliJ, some use vim or micro. |
20:47:23 | shodan45 | I'm used to jetbrains' IDEs (intellij, pycharm, etc.), and never used any VS |
20:47:58 | nekits | you could easily stick with that then. are you looking to switch or just curious? |
20:48:17 | * | endragor joined #nim |
20:48:20 | shodan45 | just curious |
20:48:43 | shodan45 | I didn't know that intellij had a nim plugin |
20:48:57 | nekits | It should. |
20:50:14 | shodan45 | I primarily use phpstorm, tho... it makes dealing with the horrors of PHP less brain-damaging |
20:50:37 | nekits | less is the key word there |
20:50:52 | shodan45 | nekits: you don't need to convince me |
20:59:58 | * | yglukhov joined #nim |
21:00:48 | shodan45 | hrm... I see 2 nim plugins in intellij. https://github.com/jhspetersson/idea-nim is ~2.5 years old |
21:01:20 | shodan45 | the other one doesn't have a URL and is only 5.3kb |
21:01:37 | shodan45 | ah, screw it, I'll just use a dumb editor |
21:01:45 | shodan45 | for now |
21:04:26 | nekits | what os do you use? |
21:04:46 | shodan45 | linux |
21:05:00 | nekits | which distro? |
21:06:15 | shodan45 | opensuse |
21:06:17 | shodan45 | 42.3 |
21:07:27 | nekits | ever try micro? |
21:07:40 | nekits | https://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:03 | dom96 | When a library you want to use calls `exit()` on error... *sigh* |
22:27:06 | shodan45 | I'm slightly unsure of how variant types work in nim... is a "case" under "object" a compile-time conditional? |
22:27:44 | shodan45 | dom96: oh hello, I'm reading your book right this very second ;) |
22:29:09 | shodan45 | hm, no, it can't be compile-time.... because doing invalid stuff throws an exception, not a compile error |
22:29:18 | shodan45 | (right?) |
22:30:11 | dom96 | yep |
22:30:24 | dom96 | object variants are runtime constructs |
22:31:31 | shodan45 | the syntax is a little confusing, IMHO |
22:31:44 | * | endragor joined #nim |
22:32:16 | shodan45 | heh, I wish I could link to what I'm talking about, but this is in ch. 3 |
22:34:04 | shodan45 | "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:16 | shodan45 | I'm sure I'll get used to it |
22:34:33 | shodan45 | pay no attention to the noob in IRC ;) |
22:34:49 | FromGitter | <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:01 | FromGitter | <Quelklef> sorry, variant type* |
22:36:26 | shodan45 | hm, can you "vary" based on multiple fields? |
22:36:55 | shodan45 | or is that like multiple inheritance - yeah, but "please don't do that"? :) |
22:37:12 | FromGitter | <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:41 | FromGitter | <Quelklef> never needed it though so I've never tried |
22:39:39 | shodan45 | Quelklef: I meant inside of an "of" branch |
22:40:02 | shodan45 | can't think of the right word for that suddenly |
22:40:56 | shodan45 | multi-level? compound? |
22:41:30 | subsetpark | shodan45: sort of |
22:41:36 | FromGitter | <Quelklef> nested |
22:41:52 | shodan45 | yes, nested. thank you. |
22:41:57 | shodan45 | stupid brain. |
22:42:02 | FromGitter | <Quelklef> : ) |
22:42:15 | subsetpark | https://play.nim-lang.org?gist=7e3b66afe43817ee5008c14a36954f43 |
22:43:05 | FromGitter | <Quelklef> Working on my local machine too (was making a different example) |
22:43:22 | subsetpark | You 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:57 | FromGitter | <Quelklef> Couldn't you just make 'em the same names |
22:44:03 | subsetpark | Nope. |
22:44:44 | FromGitter | <Quelklef> Damn these Nim devs and their comprehensive code |
22:44:51 | subsetpark | Every field name can only appear once |
22:45:02 | subsetpark | (otherwise the compiler couldn't statically tell what branch you're in) |
22:45:17 | shodan45 | interesting |
22:45:28 | subsetpark | of course - you could easily have a single field that's a tuple |
22:45:55 | shodan45 | subsetpark: I see what you mean |
22:46:24 | subsetpark | oh actually i think i'm lying |
22:47:13 | subsetpark | yeah, 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:33 | FromGitter | <Quelklef> I mean conceptually it could work |
22:55:46 | FromGitter | <Quelklef> as long as the contained types are "caseable" |
22:55:59 | FromGitter | <Quelklef> enumerable |
23:08:33 | * | yglukhov quit (Remote host closed the connection) |
23:13:26 | subsetpark | yes... 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:05 | FromGitter | <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:59 | FromGitter | <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 |