« first day (2873 days earlier)      last day (1960 days later) » 
00:00 - 16:0016:00 - 00:00

12:29 AM
@quartata how does one implement generators? Is it like one giant switch(){} statement with the current position in the function and the callee stores the function's scope?
Also @ASCII-only should generator functions return a Generator/Iterator class?
Don't want to go the Java route and have a Iterable and Interator interfaces/classes since those are euck
 
@Downgoat should return lazy list maybe
 
@ASCII-only lazy list?
 
Yeah
 
elaborate on semantics?
also @ASCII-only for generator function do we want generator func myGenerator or func* myGenerator
 
12:51 AM
Hmmmm
Star only if that's syntax for spread too
 
well spread operator will probably only be for array concat
so not sure if should do ... or *
because ... is inclusive range atm
 
@ASCII-only I am
I've wanted for a while to make a golfing language with readable tokens that compresses
In the first version all tokens will take a multiple of 0.5 bytes, but I hope to eventually move to arithmetic encoding
 
1:15 AM
@lirtosiast mthmtca is a thing though
@lirtosiast arithmetic?
 
@ASCII-only Program is stored as an arbitrary precision real number between 0 and 1; you predict probabilities for each token, assign them to intervals, decode the token, and zoom in on the interval
@ASCII-only ooh I didn't know about that
 
@lirtosiast so... Like Huffman coding
Why choose arithmetic coding though
 
arithmetic coding should be theoretically unbeatable in the long run, out of any coding scheme
anything more advanced than that is a compression scheme
things like Huffman coding only have a chance of winning if your input is very short, because they can optimise the last few bits of the output
 
2:06 AM
@Downgoat What language is this
 
@Quintec VSL
 
2:23 AM
@ais523 ???
 
@ASCII-only Huffman coding is basically arithmetic coding except that every command has to be rounded to a whole number of bits
so arithmetic coding does as well or better
 
Ah, fair enough
 
2:46 AM
@Downgoat you asked me this question before
Apr 25 at 0:10, by Downgoat
@quartata Like I was thinking I could do it with having a state struct and then jumping to correct part of code but I'm not sure if there is better way
 
huh
though how to then generate code for for loop is question :/
and also how to then deal with lambda capture :/
 
click through
since you are already using libc you have ucontext_t
fcontext from boost is optimized for x86 but is much faster
however i also brought up inline generators which is an important point for consideration
and some syntax considerations, since Python and JS both have bad syntax for this
you should think first whether you care about full vs semi coroutines though
additionally as i mentioned you could pick through the C output from the Nim compiler to learn more practically
 
 
2 hours later…
4:31 AM
SO says to use srand(time(0)) instead of rand() is this really a better idea? since iirc time() is accurate to second which means if you call multiple times in same second youd get same random number
 
@Downgoat You call srand once, it sets the seed for future rand calls.
 
@Pavel is that necessary though for non-crypto applications
 
@Downgoat Well otherwise you get the same seed every time, so your random doesn't end up being random: Try it online! (Run it multiple times, notice the number not changing)
 
wait wtf
 
Now with the srand call: Try it online!
 
4:36 AM
issue is if program is called within same second of another instance still get same number :/
 
This isn't an issue for most programs.
Like how often does that happen.
 
forking
 
@Pavel very
@Downgoat you didn't know?
 
@ASCII-only Have you ever written a random-dependent program that can reasonably expect to be called multiple times a second? srand(time(0)) is reasonable for most purposes
 
@Pavel but not all...
And that's the important thing
Time is just not good enough for a mainstream language
 
4:42 AM
@ASCII-only no i thought was something like /dev/random
 
Especially if gettimeofday is in the same header
 
also dont want to stream from there because stupid windows
 
@Downgoat possibly. But yeah it's not cross platform
 
@Downgoat Rand will, by the C specification, give the same values for the same seed.
/dev/random is "real" random generated from hardware entropy
 
@ASCII-only i could try to use gettimeofday but issue is that, that uses long int which I don't accurately know the sizeof for VSL
 
4:43 AM
dont use rand anyways
 
@Pavel that's srand
@quartata pls recommend alternative
 
@Downgoat srand just supplies the seed for rand
And yeah as quartata points out almost all implementations of rand are pretty shite
 
@Downgoat xorshift :P
@Pavel I thought that was urandom? Unless random is same just not cryptographically secure
 
i mean for actual C++ work the new random header is good
 
@ASCII-only urandom and random use the same pool of random data, but random blocks when it runs out and urand starts generating pseudorandom data instead
 
4:45 AM
but youre not linking to that
 
@quartata C++ bindgen to borkable for use in core stl and also yeah dont want to link to that
 
frankly you can make your own thats better than rand()
theres a few choices
 
I think random is already better than rand but IDK how portable it is
 
oh I have a question about RNGs
if we want a really good noncrypto one and are lazy, can we just xor like 3 different RNGs together?
Or does that not improve the quality
 
4:49 AM
Mathematica deadass used to use Rule 30 as a PRNG
 
ISAAC is cryptographically secure: burtleburtle.net/bob/rand/isaacafa.html
@quartata You mean, the cellular automata?
 
Yep
 
Not too surprised tbqh
 
it actually sucks but
 
@quartata O_o does this actually work well
looks suspiciously simple
 
4:51 AM
its one of the stronger non crypto
 
o ok
prob just gonna link to openssl for crypto rand anyways
 
I wonder how fast it is compared to ISAAC
ISAAC gives performance information in CPU cycles and I'm not sure what to do with that information
 
the lowest bit on xoroshiro is biased IIRC
so for coinflips you check the sign instead
 
@quartata Do you have a source on the Rule 30 thing
I want to tell people about it
 
wolfram has a CA fetish
one bit per iteration lol
the other columns are no good
 
4:58 AM
I don't know what CA means and I assume that link would tell me
so I refuse to click that link
it is more fun to guess
 
A cellular automaton (pl. cellular automata, abbrev. CA) is a discrete model studied in computer science, mathematics, physics, complexity science, theoretical biology and microstructure modeling. Cellular automata are also called cellular spaces, tessellation automata, homogeneous structures, cellular structures, tessellation structures, and iterative arrays.A cellular automaton consists of a regular grid of cells, each in one of a finite number of states, such as on and off (in contrast to a coupled map lattice). The grid can be in any finite number of dimensions. For each cell, a set of cells...
oh sorry
 
@quartata what to seed this with tho
 
@quartata I got to meet Conway and Wolfram together once
 
@Pavel what where how
 
4:59 AM
There was a conference
 
I met wolfram once. It was at a hackathon where I programmed a spinning orange
 
It wasn't like 1 on 1 or anything
(1 on 2?)
 
@Pavel ( ͡° ͜ʖ ͡°)
 
@Downgoat docs.microsoft.com/en-us/windows/desktop/api/bcrypt/… for win32, /dev/random everywhere else
or dont care and use time
 
@quartata Why does it take 4 arguments tho
 
5:04 AM
overengineered like everything else in this hell userland
it can run it through a prng too i think
 
o crap xoroshiro128 needs for loop which needs iterators which needs interfaces which i haven't implemented yet oops
while loops exists but yuck
 
wait ???
write it in IR lol, its a hot path
wait why would it need an iterator
 
@quartata foreach, not for
 
@quartata dont want to have C-style for
@quartata I would but can't do inline IR because LLVM doesn't expose any API to parse or directly insert IR
 
then unroll the loop
 
5:08 AM
:|
 
what
 
A for-loop can be rewritten as a recursive function :)
 
frankly im surprised that implementation doesnt
i never assume the compiler will unroll
@feersum ok now this is epic
 
@feersum don't want to create 64 new call frames every time i call random function though llvm will prob unroll
 
@Downgoat it wont, not tail recursive
uhh
I dont think
 
5:10 AM
@quartata why wouldn't it? I am just doing for i = 0; i < 64; i++ as recursive
 
@quartata Do you just unroll all your loops by hand
 
real men unroll their loops by hoof
 
With GCC I've found it will unroll a recursive function 15 times or so
So you might get a recursive function, but only calling itself 4 times
Don't know about clang.
 
@Pavel in low level yeah
ive seen some bad bad compilers
 
@quartata wait crap mean tco it
 
5:13 AM
have you tried not using bad bad compilers
 
though i have a decorator that will force it
 
@Pavel not usually a choice
 
It's already tied to clang.
 
Oh right Visual compiler exists
 
I will be a proud goat tonight if VSL can type deduct (x << k) | (x >> (64 - k)) without crashing
uhh @quartata how do I pass a seed into: vigna.di.unimi.it/xorshift/xoroshiro128plus.c
so I change s0 or s1 or something else?
 
5:18 AM
It's blows my mind that this language is being written in JavaScript
 
@Pavel it is actually pretty fast because JS handles graph data structures pretty well
and also hot spot is really great for things like iterating trees because those get called like a bajillion times
 
Maybe it's fast because all your programs so far are one file with 10 lines?
 
@Downgoat the array s is the state
128-bit hence the name
 
aaaaaaahhhhhhhhh that makes more sense
 
two long longs
 
5:23 AM
can i turbocharge this by using llvm 128bit stuff or would that not work anyway
 
it still needs the low/high separate in next
 
:| apparently JS cannot represent 0xdf900294d8f554a5 which the algorithm uses as it looses precision so now cannot use in VSL :|
2
 
um
uh
@everyone get a load of this guy trying to emit a 64-bit number in javascript
wheeze
 
Is there any German word for the feeling of being entertained by the misfortune of Javascript users
 
good news is wolfram alpha found factorization that is representable in 32 bit
 
Anonymous
5:38 AM
@feersum JSchadenfreude
 
when you multiply them its just going to overflow ??
theyre doubles
you need the exact number, its a bit mask
 
@quartata they are multiply in LLVM
 
uhhhhhhhhh
have you considered
 
What kind of code are you even writing? VSL? LLMV IR textual representation? A library that generates binary IR?
 
  %0 = call i64 @"FSTCUInt64N*AlhsTCUInt64ArhsTCUInt64"(i64 422105777641, i64 38164317)
  store i64 %0, i64* @gNjumpConstantA
@feersum LLVM's C++ API
 
5:40 AM
hes apparently using LLVM bindings which is why he cant just use a string
 
@Downgoat And this involves JS how...?
 
@Downgoat ah cool, i didnt want to use my eyeballs anyways
 
@feersum because JS talks to LLVM C++ api
 
@feersum his compiler is written in JS
so he literally cant emit the number because it gets stored in a double by JS before being truncated to an int
 
How is that even possible? It is an abomination.
 
5:41 AM
still JS compiler code is neater than GCC source code
 
the bindings have to use a uintarray somewhere
canr you pass one
 
so no
@quartata what is the purpose/when do I use the jump() long_jump() functions
 
so the cast is done in C
you realize this language sucks right
 
it says for parallel computation but we'll all be old by the time I implement parallelism in VSL
@quartata uhh so its parsed as a string we parse string -> double in node.js and then we do double -> int32 -> uint64 in c++
 
@quartata When you say "this language" do you mean JS, VSL, C, or all of them?
 
5:47 AM
JS
 
I do but too late to rewrite this in php
 
@Downgoat so as it says its like it skips ahead 2^64 iterations
 
Perl is like the one other language that can't figure out integers either
Even if you use integer you only get 32 bit ints
 
@Pavel Conway and Wolfram both spoke at a math camp when I was young, but not on the same day
 
@quartata but why would i want to do that
 
5:50 AM
Can you like reverse-babel it to a sane language
Is that a thing
 
@Pavel me and @ASCII-only were considering making something like that
but no
technically i could convert to typescript and use an experimental typescript to llvm compiler and then try to use an llvm to c compiler
 
Brilliant
 
a second thread can start from the same seed but jump ahead so they dont run the same sequence
is my guess
 
ok i am just going to not implement that part until i can get 64-bit ints working :P
 
> Node Bindings for LLVM. The API is mostly identical to the one of LLVM (when possible and not to cumbersom)
Guess this one was to cumbersom.
 
5:53 AM
mm cucumbers
 
is there no cross-platform hardware rng
 
you know i love a good cucumber
@Downgoat lol no
 
There's probably a boost thing for it
 
well
technically
random.org
 
what is windows alternative to /dev/urandom then?
 
5:54 AM
i linked it
 
link to your linkn?
oh
@Pavel does this use windows's calls to hardware RNG
 
@Downgoat Yes
 
do not ask me Win32 api questions
 
5:55 AM
But yeah, Win32 is fucking terrifying
 
@Downgoat whatever sources of entropy it has
 
Have you considered linking boost
 
no
 
Has downgoat considered linking boost
 
@Pavel oh god no
who do you think i am
 
5:57 AM
What about declaring random number generation to be the user's responsibliity?
 
@Downgoat Someone who's writing a compiler for a practical language in JavaScript
Two of them
@Downgoat Why don't you write your random in VSL
VSL should probably be able to handle 64-bit integers
I screencapped this convo in another chat and now I'm being assaulted by a JS defender please advise
 
@Pavel tell him as the person who is writing a language in JS that is stance is irrational and that he should learn python
@Pavel I am but still need to figure out how to get seed
and accurate time is hard to get
Can't use gettimeofday as that uses a cstruct
I don't think I can assume sizeof(long) == sizeof(void*) either
 
@Pavel the "everything is a double" is a sore point for some reason
@Downgoat hm?
 
is clock() ^ time() a good enough random seed
wait wtf it can be a float
god what idiot made the c standard
 
Well you still get 32 bits, just in a different order, so whatever :)
 
6:04 AM
C, libc, and the actual standard we have now were made by different people
 
why cant you read from dev random and worry about Win32 when your compiler works
 
Why is boost magically harder to link than any other library
 
you just read 16 bytes with the pointer to s
 
<-- hasn't tried linking anything himself
 
Use a constant seed and tout reproducible executions as a language feature.
 
6:05 AM
reversible computing
 
@quartata compiler work relatively fine except interface but doing things without linking to custom C files is pain
@quartata should I set s[0] and s[1] to same values or should I make them different
after 2038 hopefully I can assume time_t is 64-bit and whatever idiot used a computer with 32-bit time is already crashed anyway
6
 
@Pavel at least both have bigint now
 
@Downgoat brilliant long-term planning strategy "just wait until 2038 and the code will work"
 
:)
 
@Downgoat maybe it'll just loop around. Maybe. So the people that use 32bit go back to 1970
 
6:15 AM
private lazy let randS1: UInt64 = UInt64::clock()
private lazy let randS2: UInt64 = time()
I think this is how random works?
 
@Pavel tbh it might not be finished before 2038
 
oh god LLVM unrolled
 
@ASCII-only no look-ahead or look-behind
 
@Downgoat Why id it private let and not let private
 
@primo O_o
 
6:17 AM
the "magic" bit handles significantly more than 8 cases
 
@Pavel i have not seen any language in which it is let private and not private let
 
private let just sounds weird
 
that is true
I could change it back to var
 
"adjective verb noun" just sounds wrong compared to "verb adjective noun"
 
@primo that's not magic anymore. That's sorcery
 
6:20 AM
O_o seems like LLVM optimizes xor to branching instruction
 
@primo what about $`/$' then
 
does C have any pow() function that takes int instead of floating points
 
@Downgoat no
 
how to do 64-bit pow then
 
the slow way: multiplying and squaring
 
6:34 AM
ew
I don't want to chop 64-bit ints to doubles and don't want to use 80/128-bit floats because then things get weird with data layout :/
 
@ASCII-only $' is utilized, yes
 
7:13 AM
good news: you can now print numbers in vsl bad news: those numbers are in reverse
 
@Downgoat lol
You need to allocate enough space and do double dabble or w/e
@Downgoat you don't have to?
 
@ASCII-only how else to do
@quartata do you know why LLVM icmp ugt still finds 1 << 31 > 0 as false. Shouldn't icmp ugt basically be icmp ne 0
 
7:36 AM
@primo I just found the (Python) solution to phi. Very cool
 
also how tf is 2147483648 converted to an FP 0x41E0000000000000 O_o
 
@H.PWiz it's a common trick in ruby, rarely applicable to python though
 
In ruby, because you can have multiple = in one expression?
 
trailing assignment x=4*y=3 makes it a lot easier to do
 
7:54 AM
Would there be any interest in doing fastest-code challenges with GPUs? I haven't seen any so far, but with the right problem I think it could be interesting. I have at least one idea for a challenge, perhaps related to my avatar.
 
 
2 hours later…
9:43 AM
1
Q: Trifid Cipher (without keyword)

Kevin CruijssenIntroduction: I have loads of different ciphers stored in a document I once compiled as a kid, I picked a few of the ones I thought were best suitable for challenges (not too trivial, and not too hard) and transformed them into challenges. Most of them are still in the sandbox, and I'm not sure ...

 
10:13 AM
0
Q: Regex only base64 decoder

ParadoxisWrite a regular expression substitution string which can base64 decode a string using only a regular expression engine built into the language. Eg: # Example in python import re print(re.sub(..., ..., "SGVsbG8gd29ybGQK")) # "Hello world" # ^^^ ^^^ # These count toward...

 
 
2 hours later…
11:58 AM
@maxb Doesn't seem like it would work well since GPU hardware is too diverse.
 
0
Q: Fill the Bucket

Vedant KandoiYour task is to fill the bucket with numbers upto a given input. Rules Numbers occupy the leftmost position then rightmost, then leftmost and so on. After overflow, the numbers start to gather around the bucket in a similar manner. They occupy position diagonally. The examples should make it ...

 
@feersum Of course I'd provide a test rig similar to every fastest-code challenge. But you're right, it's not as simple as regular programming when it comes to testing on your own before. It could definitely be a problem that not all people have Nvidia with CUDA. Though OpenGL should work for both AMD and Nvidia right?
 
@maxb Can you use OpenGL for general computation somehow? I thought it can only draw graphics.
 
@feersum I haven't used it personally, so I don't know unfortunately, I have only used CUDA. I'm just hoping that it could provide a hardware-independent way of participating in the challenge.
I feel that a CUDA specific challenge could also be interesting, but I'd understand if it's not allowed.
@feersum From some googling, it seems as if the problem I had envisioned has a solution using OpenCL, so judging by that it should be viable to create a challenge
 
12:45 PM
I'll put a post in the sandbox, that way people can leave feedback there before an eventual challenge.
 
 
1 hour later…
1:46 PM
ಠ_ಠ if i hadn't submitted the answer to todays AoC part 1 as x;y instead of x,y i would almost be on the leaderboard
 
Lol
At least you could actually do it
 
APLs is a builtin for "do this for x×y subregions of the input" so that was helpul
 
@feersum doesn't minxomat's turbo.js use WebGL to speed up computation
@feersum not like you normally program for the hardware anyway
@dzaima :|
 
sadly it pads 0s around the input and is slow so didn't manage to do task 2 in the 15 mins i had
 
@Downgoat different
@Downgoat you know clock() is based on time since it started right
So your high is going to be 0
 
3:00 PM
0
A: Sandbox for Proposed Challenges

maxbBuddhabrot (speed edition) Your goal is to generate an image like this one: (Sandbox: this image will be replaced by a valid solution image for the challenge) This is a render of a 2D histogram called Buddhabrot. The algorithm for generating it is very simple. If you have heard of (or writte...

 
3:43 PM
@quartata why would exactly zero clock cycle have elapse since program start
 
Is TIO down?
 
@Downgoat its not in cpu cycles
technically speaking the epoch is undefined, its only supposed to be compared to other clock_ts. but its going to be at about the same time you initialize the RNG since its static so
 
@Oliver working for me
 
Random Announcement: In roughly several months' time, there will be a Microbits in addition to Minibits.
22
 
@Geobits What's a Microbits
And what's a Minibits
 
3:56 PM
Minibits is my son :D
 
Ah
Congrats!
 
@Geobits are they like nesting dolls
so you have the microbits
 
I certainly hope not lol
 
then minibits
then geobits
you just stack them
 
that sounds very disturbing...
 
3:57 PM
its just science
 
I'm gonna pretend Geobits actually named them that because that sounds like something Geobits would do
 
Stackable, yes. Nestable, no.
 
ohh ok so theyre not hollow
all right i get it now
 
Well, I'm not hollow anyway, and I've seen some x-rays of Minibits due to various fractures, so I'm assuming the Micro version will also not be hollow, but with technology these days, who knows?
 
00:00 - 16:0016:00 - 00:00

« first day (2873 days earlier)      last day (1960 days later) »