News for hackers. Stuff that matters.
Re:Show HN: Python library for functional programming by catnaroek on Friday December 15, 2017 @04:26PM (#15935305)
> It would be desirable for our programs to always have meanings that aligned with their behaviour, but we shouldn't turn a blind eye to the fact that many programs don't.

The meaning of a program is its behavior, period. If reality doesn't agree with your views, it's your fault, not reality's.

> Any practical programming language will give you some way to find the memory address of a particular value, so values that we usually consider as semantically identical are not actually indistinguishable in practice.

Standard ML doesn't give you any way to get the memory address of a particular value, so values that are semantically identical are actually indistinguishable in practice.

> We deal with this by only assigning semantics to a subset of the language that excludes those operations.

That doesn't make sense. Semantics is a property of the real programming language you are using, not the fictitious one you wish you were using.

Re:Show HN: Python library for functional programming by lmm on Friday December 15, 2017 @06:58PM (#15936365)
> The meaning of a program is its behavior, period. If reality doesn't agree with your views, it's your fault, not reality's.

That's not the usual meaning of, well, meaning.

> Standard ML doesn't give you any way to get the memory address of a particular value, so values that are semantically identical are actually indistinguishable in practice.

Just tried it to be sure:

    fun address i = Unsafe.cast(ref i) : Int32.int ;;
    val a = 4 :: nil ;;
    val b = 4 :: nil ;;
    address (a) ;;
    address (b) ;;
    address (a) ;;
And yep, a and b are semantically identical values but distinguishable in practice:

    val address = fn : 'a -> Int32.int
    val a = [4] : int list
    val b = [4] : int list
    val it = ~175003712 : Int32.int
    val it = ~174998232 : Int32.int
    val it = ~175003712 : Int32.int
Re:Show HN: Python library for functional programming by catnaroek on Saturday December 16, 2017 @04:39AM (#15938698)
SML/NJ is not an implementation of Standard ML. It's known to be non-conformant in several ways: http://mlton.org/SMLNJDeviations
Re:Show HN: Python library for functional programming by lmm on Monday December 18, 2017 @05:36AM (#15950723)
If SML/NJ doesn't count as Standard ML then I'd say Standard ML doesn't count as a practical programming language.
Re:Show HN: Python library for functional programming by catnaroek on Wednesday December 20, 2017 @11:12AM (#15970810)
I use MLton and Poly/ML on a daily basis. No problems with them at all.