« first day (1861 days earlier)      last day (3313 days later) » 

18:00
but I guess that unshared single-process memory provides stronger guarantees than regular I/O
@orlp Well, not in the way that is exposed from the OS. No other process can touch it.
user1804599
Luckily, you don't deal with RAM directly in Haskell. You deal with values. That those values are stored in RAM in some way, and that they are GC'd, is an implementation detail.
@JohanLarsson a tree of hashes
@JohanLarsson magic
user1804599
18:01
@JohanLarsson The file is hashed. The hash is used as the filename.
@milleniumbug The only true variant thereof
user1804599
That way, the same file is always stored only once.
but if there are changes the entire file is stored for each change?
user1804599
I think Git does optimisations by storing deltas when the repository reaches a certain size, but I am not sure.
IIRC the data storage for git is separate from it's commit tracking
the commit tracking is a hash tree
user1804599
18:03
@orlp It's all a matter of "who can touch what data?" If only one person P can ever change some data X, then it is safe for P to assume X hasn't changed if P hasn't changed X.
the data storage is a delta from an arbitrary commit to another
Check .git/objects
@JohanLarsson you can ask git to try and compress your repo more aggressively
I'm using git for a settings repo
18:06
git gc –aggressive
Have one that changes frequently and it is probably a poor fit then
basically it will search for commit pairs that have smaller deltas
user1804599
Does anyone ever use the GitHub "Pulse" feature?
@Elyse never used it
had to google to see what it is
I recall seeing the button, but never clicking it
@Elyse hrm, it offers a maximum timeframe of 3 months
user1804599
No idea what it is.
18:08
it seems a quick summary of the liveliness of a github project
how many authors, commits, issues, etc were made in the last X time units
sadly it only offers a maximum timeframe of 3 months while I'd argue that for some open source projects any action within at least the last year still indicate life
user1804599
cool
user1804599
I wonder what the oldest actively-maintained software project is.
@JohanLarsson Why? Is space at a premium? Use compression.
18:11
there are some cobol artefacts around
user1804599
Maybe some NASA Fortran stuff. :P
@R.MartinhoFernandes just feels wrong, I'll add a daily commit scheme or something for it
@JohanLarsson is it just a backup system?
yeah
nice to see diffs of what has changed and when
xml and json files
how frequent changes, of what size, distributed to what parties?
18:14
~every second, it is running statistics for a machine
commits don't need to be frequent
¨would just be noise
I meant a change as in a change for the backup system
how often the actual data changes is irrelevant
user1804599
Combine ¨ and ~ for a nice smiley.
[¨~¨]
user1804599
@JohanLarsson I had a Danish Coke can today and I could read everything it said AFAIK.
@JohanLarsson "If you want to turn your data into big data, encode it as XML." -some dude on twitter (prob jeff atwood)
18:15
:)
obligatory fuck xml
@JohanLarsson have you checked out github.com/bup/bup
nope thanksfor the link
I've never personally used it
but it looked cool
I used libgit2sharp
user1804599
I don't know how to implement let polymorphism.
18:19
let the polymorphism hit the floor
@orlp here is the lib.
@Elyse what does it entail in laymans terms
I know what polymorphism is in the C++ context
user1804599
@orlp variables defined in let-bindings can have more than one type.
@Elyse is your let mutable and can it be reassigned with different values later?
user1804599
No, of course not.
18:20
or is it just a type check such that "the RHS must be one of these?"
or is it something else?
user1804599
let id = \x -> x
 in (id 1, id "A") # works, because id has type "forall a. a -> a"

(\id -> (id 1, id "A")) (\x -> x) # type error, because lambda arguments cannot be polymorphic
user1804599
Where \x -> y is the analog of C++ [] (auto x) { return y; }.
what is y?
something
user1804599
A made-up variable for the purposes of analog display.
I'm sorry, the syntax is too foreign to me
user1804599
Then I can't explain it.
what is \?
user1804599
The symbol which introduces a lambda.
\x -> x in python would be lambda x: x?
user1804599
18:24
Yes.
so let id = \x -> x makes the identity lambda function and gives it the name id
user1804599
Yes.
I don't know what the in does though
user1804599
@orlp Like the semicolon ending a variable declaration in C++.
user1804599
It's English: let "id" be "\x -> x" in "some code"
18:26
@TonyTheLion Amusing how the name is played for a joke when the entire article is about people taking the piss out of him for his name.
oh
your let is associated with a scope
then you create a tuple with (id(1), id("A")) and discard the tuple
then what comes after is a separate expression?
user1804599
@orlp No, the tuple is the result of the let expression.
you mean that id is now (1, "A")?
user1804599
let id = \x -> x in (id 1, id "A") is behaviorally equivalent to (\id -> (id 1, id "A")) (\x -> x).
user1804599
You can always translate let x = y in z to (\x -> z) y (immediately-applied lambda), for any x, y and z.
18:29
yes, but you're not using the result of let id = \x -> x in (id 1, id "A"), right?
it gets discarded
user1804599
If that's your whole program, then it is indeed discarded.
(or I guess printed on a REPL)
ah ok
@Puppy Its a bit sad he ended up with a name like that
user1804599
But you could e.g. pass it to a function: f (let id = \x -> x in (id 1, id "A")).
well
when I look at this line
user1804599
18:30
The distinction between let x = y in z and (\x -> z) y is in the types.
(\id -> (id 1, id "A")) (\x -> x) # type error, because lambda arguments cannot be polymorphic
user1804599
In let id = \x -> x in ..., id is generic; it accepts an argument of any type. However, in (\id -> ...) (\x -> x), id is not generic; it accepts an argument of only one specific type.
I don't know what the type of id is supposed to be
it's never declared
user1804599
@orlp A function that accepts an integer or a string and returns that integer or string.
user1804599
That's the minimal type you need to make this work.
18:32
ah I see
it's inferred from the body that those types are required for id
user1804599
Yes.
but \x -> x can't infer anything from the body
so it should be Any
user1804599
@orlp generics
or well, some parameter T
user1804599
@orlp Yes, type parameter.
user1804599
18:33
However, in the type system in question (Hindley Milner), it is not allowed for lambdas to take functions that have type parameters. Hence let is needed.
user1804599
Because that would make type inference impossible.
\T -> T should fit \int -> int
@TonyTheLion I think it's a bit sad people can't handle names from other cultures
@Elyse personally I don't like inferred function argument types
user1804599
@orlp I'll make an example in C++.
18:34
@Puppy well yea there's that too
@Elyse Why does the anonymity of the function make any difference?
@Elyse you're trying to cast template<class T> T f(T); to int f(int) or char* f(char*)
or well, cast
reduce, infer
not sure what the appropriate word for the action is
user1804599
The second example is not allowed in Hindley-Milner, because the function passed to (\id -> (id 1, id "A")) is polymorphic (generic).
@Elyse if you named it a generic I'd understand it from the start (apart from some syntax)
haven't seen those referred to as polymorphic functions
but then again, I don't dabble too much in FP
@Elyse what part of HM breaks if you allow generic functions as function arguments?
user1804599
18:39
Type inference.
user1804599
I don't know why, though.
does it break or are there then syntactically legal constructs for which the types simple are not defined well?
user1804599
Never looked into why.
because if it's the first you're fucked
but if it's the latter you could simply make those a semantical error
I guess if you have to consider recursion things might get nasty
user1804599
@orlp You can do some heuristics (Haskell language extensions do this, as does PureScript), but there's no way to make it work in all cases without sometimes requiring the programmer to write down type signatures explicitly.
18:41
@Elyse I personally believe that Concepts is the way to go for function signatures
user1804599
I don't like templates.
why?
user1804599
I don't want two-phase lookup.
what are the two phases?
user1804599
I want the second phase of two-phase lookup to be gone. It's too late IMO.
user1804599
18:42
The entire body of a generic function should be checked once its defined. Not half of it when it's defined and the other half again and again for each instantiation.
@Elyse if you restrict a function body to only those operations allowed by the concept shouldn't that be a non-issue?
user1804599
@orlp Indeed, and that's what Haskell (concepts ~ type classes) and Rust (concepts ~ traits) do.
@Elyse I was referring to the rust system, mentally
not the C++ implementation
user1804599
Ok. :)
18:44
I personally believe that is the sanest way to handle things
user1804599
Instantiation-time body type checking suffers from the same problems as dynamic typing, except that it's at compile-time.
although your language must have damn good composition and boilerplate-free ways to define 'em
@Elyse isn't that unnecessary with proper traits though?
user1804599
class Eq a where
    (==) :: a -> a -> Bool
    (/=) :: a -> a -> Bool
user1804599
Like that? :D
For example
calling == on a parameter that isn't Eq (or some other trait that provides it) is a syntax error
user1804599
18:46
brb; gonna play videogames
not at instantiation time
but at function define time
user1804599
@orlp type error, not syntax error
right
furthermore, once you implement it this way
'generic instantiation' becomes a codegen only thing that's irrelevant to your language
user1804599
f :: a -> a -> Bool
f x y = x == y -- type error

f :: Eq a => a -> a -> Bool
f x y = x == y -- OK
yes, for example
from what I've seen that approach has very little problems and solves a ton
now if you want to get really fancy
your standard library should have a lot of predefined traits
and your compiler can infer traits from the function body
user1804599
18:47
@orlp Yes, allows funky things like this: en.wikipedia.org/wiki/Polymorphic_recursion
e.g. using == will automatically add the Eq trait
OMG BEST NEWS EVER
MY FLIGHT IS AT 7PM not 7AM
dances and opens a bottle of WCIPA
also I've been thinking
@BartekBanachewicz :O
@orlp I get that you have a particular idea of how the world works and some experience in programming. I get that your imagined ways of mapping real world problems to computer solutions involves thinking about the world as a mutable state you can directly represent with memory transistors. That being said, functional programming it's not only about "I'm going to write those functions in a pure way so I can test them easily but then call them in some imperative sequence anyway".
It can express things that are completely unheard of in the regular programming world. Yes, that introduces a whol
I mean you don't have to excuse me being rude but hopefully that provides some context on why do I find this kind of thinking annoying.
I believe that FP definitely has some very interesting and powerful ideas and concepts
but to my knowledge these don't necessitate unconditional immutability in the universe (where universe = programming language)
18:57
FP also has some areas where it fails spectacularly
@orlp in practice, this makes things easier, not harder, imho
I strongly recommend you try writing a program in that fashion even not necessarily in Haskell, but in your language of choice
Sure, Haskell is heavily biased towards that and makes it more natural, but the benefits are universal.
and if you'd rather see a concrete example, I recommend this read
also, uh, I guess I'm sorry for being so aggressive

« first day (1861 days earlier)      last day (3313 days later) »