<devyn>
whitequark: alright, how do I run it on stored data?
<whitequark>
unpack it, then
<whitequark>
./readhist.d.byte btce/btc_usd
<whitequark>
need to make it before
<devyn>
right
<whitequark>
or just ocamlbuild -use-ocamlfind ./readhist.d.byte -- btce/btc_usd
<whitequark>
I have alias ob=ocamlbuild -use-ocamlfind
<whitequark>
btw, .d.byte means debug bytecode executable. .byte and .native are non-debug versions
<whitequark>
to get a backtrace, export OCAMLRUNPARAM=b
<whitequark>
(OCaml uses exceptions as a means of control flow *extensively* so it records no backtraces by default. that way, raise is just a jmp)
<devyn>
that doesn't sound good lol
<purr>
lol
<whitequark>
why?
<devyn>
well, state and all, if there is any
<whitequark>
see, it has no return or break or continue statements
<whitequark>
so if you want to use its imperative features
<whitequark>
or just break out of List.iter
<devyn>
mm
<whitequark>
you raise an exception and it's cheap
<devyn>
alright
<devyn>
whitequark: these are 30 second periods, eh?
<whitequark>
devyn: yeah
<whitequark>
i am an impatient tester, adjust it however you need
<devyn>
alright
<whitequark>
readhist.ml is like
<whitequark>
ten lines
<whitequark>
it's fucking beautiful
<devyn>
haha
<devyn>
idk, so far I'm not that impressed with OCaml compared to Haskell beauty-wise
<whitequark>
oh?
<devyn>
seems very noisyt
<devyn>
noisy*
<devyn>
and any sane person writes Haskell with layout, which makes things very clear
<whitequark>
mhm, the syntax has some idiosyncrasies, but you get used to it quickly
<whitequark>
(then I've not seen haskell code written by sane people)
<whitequark>
but
<whitequark>
that was not what I'm referring to
<whitequark>
it's beautiful semantically :p
<devyn>
heh
<devyn>
how does 'lwt … = …' work?
<devyn>
is it a macro?
<whitequark>
yes
<whitequark>
"lwt a = f in x" ≡ "bind f (fun a -> x)"
<devyn>
I figured
<whitequark>
aka "f >>= fun a -> x"
<whitequark>
there's a few more. "a >> b" ≡ "a >>= fun () -> b"
<devyn>
yes I know how monads work
<devyn>
Haskell uses them extensively, unfortunately
<whitequark>
oh ok, I don't, I'm just familiar with lwt :p
<devyn>
:p
<whitequark>
(actually, I do, I just have no idea whether haskell uses same syntax or not)
<whitequark>
btw if you want to see how the code is expanded
<devyn>
yeah, it does; >>= is bind, >> is sequence, return is return
<whitequark>
ocamlbuild -verbose 1, then look at ocamlc invocation, then run it with -verbose too
<whitequark>
there will be a camlp4 invocation, copy it, change -printer 'p' to -printer 'o'
<whitequark>
look at the resulting code
<devyn>
alright how would I go about wrapping one of my indicators into an LWT stream
<whitequark>
look at exchange.ml:39
<whitequark>
the ticker calculator
Sgeo_ is now known as AntiVariousPro
<devyn>
what does the backtick in `Ask and `Bid mean
<whitequark>
polymorphic variants
AntiVariousPro is now known as AntiVariousProte
<whitequark>
basically same as normal variants, except you can specify them as extensible (doesn't matter here) and they're stored differently so you do not need to specify full module path to use them
<whitequark>
(stored as a hash instead of contiguous numeric values)
<whitequark>
writing Exchange.TradeKind.Ask gets old fast
<joelteon>
it's typesafe but it calls error sometimes
<devyn>
it can't parse the string at compile time
<joelteon>
so it's not typesafe
<devyn>
so the type safety is runtime
<whitequark>
so ocaml's printf is better :p
<joelteon>
does ocaml have dependent types
<whitequark>
no
<devyn>
no, it's just a special case :p
<joelteon>
how does it do printf?
<devyn>
special case joelteon
<joelteon>
oh ok
<joelteon>
i wrote th-printf just for this purpose
<devyn>
ew th
<devyn>
whitequark: isn't there some simple way to just make a stream transformer that folds into an output stream and internal state?
<whitequark>
devyn: can you elaborate?
<whitequark>
there's Lwt_stream.map
<devyn>
map isn't quite good enough; I need to fold into my own internal state at the same time - each output value is dependent upon the last output value as well
<whitequark>
fold ?
<whitequark>
:p
<whitequark>
Lwt_stream.fold_s
<whitequark>
or more like, just fold
<devyn>
hmmm, but I also want to produce a stream like map
<devyn>
fold returns an Lwt.t
<devyn>
which is not what I want
<whitequark>
oh
<whitequark>
then there's no such combinator
<whitequark>
write it :p
<devyn>
klfjafjalksjf I'm going to bed lol
<purr>
lol
<devyn>
I started on it and then I guess one of the plugins I installed for Vim likes to crash it
<devyn>
and I deleted the swap file
<devyn>
out of stupidity
<devyn>
so
<devyn>
whatever.
<whitequark>
okay
<whitequark>
(why the fuck editor plugins may crash editor is beyond me)
<whitequark>
devyn: so, continue tomorrow?
Sgeo has joined #elliottcable
AntiVariousProte has quit [Ping timeout: 260 seconds]
Sorella has joined #elliottcable
fwg has joined #elliottcable
gazoombo_ has joined #elliottcable
silentbicycle_ has joined #elliottcable
gazoombo has quit [Ping timeout: 240 seconds]
silentbicycle has quit [Ping timeout: 240 seconds]
fwg has quit [Ping timeout: 240 seconds]
silentbicycle_ is now known as silentbicycle
gazoombo_ is now known as gazoombo
fwg has joined #elliottcable
Sorella has quit [Remote host closed the connection]
alextgordon has joined #elliottcable
Sorella has joined #elliottcable
Sgeo has quit [Read error: Connection reset by peer]
Sorella_ has joined #elliottcable
Sorella has quit [Ping timeout: 260 seconds]
Sorella_ has quit [Client Quit]
Sorella has joined #elliottcable
Sorella has joined #elliottcable
Sorella has quit [Changing host]
fwg has quit [Ping timeout: 252 seconds]
fwg has joined #elliottcable
yorick has joined #elliottcable
yorick has quit [Remote host closed the connection]
sharkbot has quit [Remote host closed the connection]
sharkbot has joined #elliottcable
<whitequark>
wow, there's an almost revolution in ukraine
<whitequark>
200k-1.6m people and an assault attempt at the president's administration
<alextgordon>
break out the poison!
<whitequark>
poison?
<alextgordon>
whitequark: russians love three things: 1) alcohol, 2) bombs, 3) poison
<alextgordon>
though you can argue that 1 and 3 are the same
<whitequark>
no bears? I'm surprised
* alextgordon
calls rule 34 on putin wrestling a bear
<alextgordon>
lol yeah, who wants to live in guildford
<purr>
lol
<alextgordon>
especially in the 70s!
<alextgordon>
though apparently 70s guildford has slutty girls
fwg has quit [Ping timeout: 246 seconds]
<whitequark>
fuck, btc-e no longer accepts bank transfers :/
<alextgordon>
ooh
<alextgordon>
that means the price on btc-e will go up
fwg has joined #elliottcable
<whitequark>
well, it's for RUB transfers
<whitequark>
international wire transfers still accepted, but it's a PITA
<whitequark>
on other hand, I *may* get a better exchange rate with my bank than on btc-e itself
<whitequark>
it's really a horrible situation where you currently need 2-3 intermediaries between your bank account and btc-e and they all charge outrageous amounts
<joelteon>
is there a fixed number of bitcoin?
<whitequark>
yeah, 22m
<joelteon>
is it reasonable to assume we'll find them all
<whitequark>
that's the idea
<joelteon>
ooh
<alextgordon>
joelteon: upper bound of 12m right now though
<alextgordon>
joelteon: also bitcoins aren't "found" they're allowed to be created by the network
<joelteon>
right
<joelteon>
wherever bitcoin come from
<alextgordon>
if someone reprogrammed all the clients to say there could be 40m bitcoins, then there could be 40m bitcoins
<joelteon>
the electronic stork in the sky
<alextgordon>
:D
<alextgordon>
still don't understand how anybody had the genius to create bitcoin
<alextgordon>
it's one of those things where... anybody can understand how it works (with enough grounding in cryptography), but nobody thought of it until recently
<joelteon>
I dunno how it works
<alextgordon>
tbh I find bittorrent to be more difficult
<alextgordon>
all that dht stuff
<joelteon>
yeah bittorrent is crazy
<whitequark>
BA -> Visa -> Qiwi -> BTC-e is 5.525% but more like ~11% if you take USD/RUR exchange rate into account
<whitequark>
holy fuck
<joelteon>
so i kinda get how bitcoin works now
<joelteon>
cursory glance at wikipedia
<whitequark>
BA -> Contact -> OKPAY -> BTC-e is 3.53% but really ~9%
<whitequark>
and requires verification
<whitequark>
and requires me to physically move my arse
<joelteon>
so who's the one who decides what a valid bitcoin is
<whitequark>
network consensus
<whitequark>
a majority system basically
<alextgordon>
joelteon: all the nodes have a copy of the blockchain, it's trivial to check it
fwg has quit [Quit: gone]
<joelteon>
and the blockchain stores every transaction that's ever happened?
<alextgordon>
yep
<joelteon>
cool
<joelteon>
including who spent it, or just where the btc went?
<joelteon>
what happens if you buy something illegal with it
<alextgordon>
joelteon: you get something illegal
<joelteon>
and then there's proof you bought it
<alextgordon>
there's proof someone bought it
<alextgordon>
depends where you got your bitcoins from
<joelteon>
yeah, and the someone is you
<alextgordon>
yeah but the blockchain doesn't say that
<joelteon>
ok
<joelteon>
so the blockchain includes who spent it, but not who spent it
<whitequark>
plus there's money laundering services
<alextgordon>
it says "Address a990d12j09d12j transfered 0.3 BC to address jd092k1092d902"
<whitequark>
aka mixers
<alextgordon>
yeah
<alextgordon>
or you can just convert to litecoin and back again
<alextgordon>
etc
<joelteon>
ok, makes sense
<alextgordon>
so it's semi-anonymous
<whitequark>
pleudonymous
<whitequark>
*pseudo
* alextgordon
likes pleudonymous better
<alextgordon>
it's like encryption... theoretically it's possible to do it correctly, but most people fail
<alextgordon>
it seems the US government is betting on the second right now, but I think they'll be in a rude awakening when people figure out how to anonymize themselves
<whitequark>
nah, they're betting on stupidity
<joelteon>
how can you anonymize yourself if the blockchain records that a transaction was made using your public key to an illegal service
<whitequark>
never underestimate stupidity.
<whitequark>
and laziness!
<alextgordon>
joelteon: it's not your PGP key... it's a one-time key
<joelteon>
oh
<alextgordon>
it only identifies you if you let it
<joelteon>
ok that's different
<whitequark>
plus, you don't need to catch everyone, you only need to catch most of them
<joelteon>
makes more sense
<whitequark>
or not even most
<whitequark>
enough to scare the rest.
<joelteon>
for a second it was sounding like a credit card
<alextgordon>
joelteon: most bitcoin clients will give you different receiving addresses
<alextgordon>
at least electrum does
<alextgordon>
so every time you do a transaction you use a new address
<joelteon>
cool
<alextgordon>
and when you spend bitcoins, there's the concept of "change" where you construct a transaction that has an output to yourself
<whitequark>
hm, so, looks like international wire transfer is the most efficient way for a RU resident to deposit to RU-affiliated exchange
<whitequark>
which is funny
<whitequark>
also, IWT seems to be a horrible pain in the ass
<alextgordon>
...which makes it difficult to tell whether you sent the bigger amount or the smaller amount
<joelteon>
nice, my loan officer used an apostrophe s where only an s was appropriate
<whitequark>
loan officer?
<joelteon>
whatever you call them
<joelteon>
loan agent
<alextgordon>
?
<joelteon>
the person giving me a loan
<alextgordon>
loan shark?
<joelteon>
yeah
<alextgordon>
whitequark can recommend some to you
<whitequark>
lol
<purr>
lol
<joelteon>
that
<joelteon>
sure
<whitequark>
alextgordon: he's not a RU resident
<alextgordon>
I want one of those 10% interest bank accounts though!
<joelteon>
the question is, .ru?
<whitequark>
120%, alextgordon, 120%
<alextgordon>
120%?!
<whitequark>
yearly, yes
<alextgordon>
dayum
<alextgordon>
what about regular banks?
<whitequark>
that's somewhere in range of 7-10%
<whitequark>
where for 10% you need to deposit like
<alextgordon>
wow
<whitequark>
$30k for 3 years
<whitequark>
and you can't take it out early
<whitequark>
not even partially
<whitequark>
the less money, time or more flexibility you want, the less % you will get
<alextgordon>
though that's in rubles, so you're petting the ruble won't devalue by 10%/year for the next 3 years
<alextgordon>
*betting
<whitequark>
it's pretty straightforward if you analyze the patterns, I wish they just put up a nice table :/
* whitequark
spent a good day comparing their offerings
<whitequark>
hm
<whitequark>
current inflation rate is 6.3%
<alextgordon>
yeah but that's in russia only
<whitequark>
since 2010 it was below 10% all the time
<alextgordon>
like if the GBP/RUB changes unfavourably, it could wipe out any interest
<whitequark>
(and in 2010 they had much better loans)
<whitequark>
er
<whitequark>
deposits
<whitequark>
oh actually
<whitequark>
it's not 7-10%
<alextgordon>
I have no idea how much interest I get on my savings
<whitequark>
it's 4.40%-9.50%
<whitequark>
so you barely beat inflation, and unless you have a fuckton of money, you don't
<joelteon>
i didn't realize how terrible simple's interest rate was until recently
<alextgordon>
hm they don't say xD
<alextgordon>
1%
<alextgordon>
not even worth bothering about
<alextgordon>
fixed term is a bit better at 2%
<whitequark>
that's about same you get here for USD
<whitequark>
euro is even less
<alextgordon>
government says inflation is 2.2% so I'll assume it's 3% :P
<whitequark>
lol they can't lie about that
<purr>
lol
<alextgordon>
oh they can, they're very good at it :P
<alextgordon>
inflation is just a calculation of how a standard basket of goods has appreciated in price, and they control the basket of goods
<whitequark>
hmmm
<alextgordon>
obviously inflation is different for every person
<alextgordon>
if you buy lots of rice, and the price of rice goes up then your personal inflation goes up
<alextgordon>
I think I'm pretty atypical though
<alextgordon>
I buy more computer equipment, less trips to magaluf
<whitequark>
Cashiers, bookkeepers, and bankers were reportedly the most prone to this affliction.[2] Besides a compulsion to write endless strings of zeros, individuals that suffered from this condition would reportedly become confused when referring to numbers and would state that they were ten billion years old or had forty trillion children.
<alextgordon>
hahaha
<alextgordon>
new favourite wikipedia article
* whitequark
is reading up on 1879 english contract law case