Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Null pointers are the billion dollar mistake

Name: Anonymous 2017-02-02 10:34

@davetchepak "What can C# do that F# cannot?"
NullReferenceException :-)

Educating the imperative gorillas about sum types:

https://chadaustin.me/2015/07/sum-types/

Name: Anonymous 2017-02-04 1:35

A minor point, perhaps, but Java’s Optional is not free. Due to Java lacking ‘value types’, essentially just stack allocation, you must allocate on the heap to wrap a type in Optional. And, due to that lack of value types, you can not wrap a primitive type in an Optional - so you’re again forced to make use of the heap when it may not be necessary. These are minor annoyances, but coming from lower level languages I definitely find it irksome to be forced to use the heap in places where the stack is obviously acceptable.

Rumor has it that Java will be getting some form of value types. All it took was them being shown up by C++, then C#, then Go, then Swift. Give them another 20 years and it will basically be an enterprise version of Haskell.

Name: Anonymous 2017-02-04 1:38

>>41
Haskell doesn't have value types.
HIBT?

Name: Anonymous 2017-02-04 1:48

>>42
Actually, it only has value types

Name: Anonymous 2017-02-04 1:51

>>43
Thunks aren't value types.

Name: Anonymous 2017-02-04 2:25

>>42
Who said it did?

Name: Anonymous 2017-02-04 2:53

JACKSON 46 GET

Name: Anonymous 2017-02-04 7:07

>>42
GHC has unboxed types, they're marked by #

Name: Anonymous 2017-02-04 7:23

It's a clunky hybrid of static + dynamic typing?

Name: Anonymous 2017-02-04 7:28

function sum_obj(xvalue, xtype){
this.value = xvalue;
this.type = xtype;
return(this);
}

Name: Anonymous 2017-02-04 8:42

>>48
No, dynamic typing is a poor man's sum type.

Name: Anonymous 2017-02-04 8:57

>>50
JavaScript is a poor man's Scheme

Name: Anonymous 2017-02-04 10:14

>>51
Yep.

Name: Anonymous 2017-02-04 11:38

How come modern mathematics is so much like a cult? In universities you're forced to recite the correct incantations, which in most cases are just a layer of bullshit on top of the base ideas, for full credit.

Cult of the infinite set. Very focused on repackaging old ideas in a more abstract and harder to understand way.

Name: Anonymous 2017-02-04 13:32

more like lulpointers amiright

Name: Anonymous 2017-02-04 17:36

>>47
I (>>42) was wrong. Yes, unboxed types in Haskell are value types.

Name: Anonymous 2017-02-04 18:58

>>51
No! Javascript will rule them all! You'll see!

Name: Anonymous 2017-02-04 19:23

>>53
Very focused on repackaging old ideas in a more abstract and harder to understand way.
Modern computer science is very much like that too.

Name: Anonymous 2017-02-04 19:35

>>56
Come back when Javascript can solve the Ackermann function.

Name: Anonymous 2017-02-04 23:33

>>58
Didn't even know what that was, but here it is, I've come back:
https://rosettacode.org/wiki/Ackermann_function#JavaScript

Name: Anonymous 2017-02-05 0:08

>>59
I ran A(5,5) and my browser stopped responding. This function sucks.

Name: Anonymous 2017-02-05 1:32

function ack(m, n) {
return m === 0 ? n + 1 : ack(m - 1, n === 0 ? 1 : ack(m, n - 1));
}

function x(m,n)
if(m!=0){
if(n!=0)
x(m-1, x(m, n-1));
if(n == 0)
x(m-1, 1);
}
if(m==0) return n+1;

>>58
it just needs a memoization routine?

Name: Anonymous 2017-02-05 2:04

x(1,1)
= x(0, x(1, 0))
= x(0, x(0, 1))
= x(0, 2)
= 3

x(2,2)
= x(1, x(2, 1))
x(2, 1)
= x(1, x(2,0))
x(2, 0)
= x(1, 1) = 3
< x(1, 3)
= x(0, x(1, 2))
x(1, 2)
= x(0, x(1,1))
x(1,1) = 3
< x(0, 3)
< x(0, 4)

fractal trace tables lol

Name: Anonymous 2017-02-05 2:08

>>60
Your Javascript engine sucks because it doesn't support TCO or a decently sized stack. The Ackermann function is defined recursively, but it isn't primitive recursive, so you can't easily convert it into an iterative solution.

Name: Anonymous 2017-02-05 7:18

>>63
It probably doesn't support arbitrarily large integers out of the box either

They get a bit silly defining integer addition as recursive, then using a + symbol in their definition
And it doesn't really work for non-integers (there's no smallest positive non-integer)

Name: Anonymous 2017-02-05 13:38

>>64
there's no smallest positive non-integer
Triggered.jpg
(1/10)^n where n is arbitrary large, example of infinitesimal.

Name: Anonymous 2017-02-05 14:45

>>64
Ackermann function is defined on natural numbers, not ``integers''.

Name: Anonymous 2017-02-06 7:16

>>66
set of natural numbers is a a subset of a set of integers

Name: Anonymous 2017-02-06 7:45

>>65
0 <= (1/12)^n <= (1/10)^n

Name: Anonymous 2017-02-06 8:05

Let us define 1/inf for an n+1 bit range variable as = to 1/2^n

1/inf * inf = 1 ?

Name: Anonymous 2017-02-06 12:20

>>67
And the set of natural numbers is also a subset of the set of sedenions, but the Ackermann function is only defined on the natural numbers.

Name: Anonymous 2017-02-06 13:05

natural numbers
noun
noun: natural number; plural noun: natural numbers

the positive integers (whole numbers) 1, 2, 3, etc., and sometimes zero as well.

Name: Anonymous 2017-02-06 19:04

Natural numbers are sexist and homophobic.

Name: Anonymous 2017-02-06 21:42

>>71
ZERO IS NATURAL
When will dictionaries ever learn?

Name: Anonymous 2017-02-07 1:30

>>73
Nothing is zero so how can it be natural.

Name: Anonymous 2017-02-07 1:41

>>74
Plenty of things are zero.

Name: Anonymous 2017-02-07 5:42

>>75
What does zero apples look like?

Name: Anonymous 2017-02-07 6:13

>>76
Look directly in front of you and tell me.

Name: ImperativeGorillaPower 2017-02-07 7:57

>>76
When you eat all the apples, and search for them.

Name: Anonymous 2017-02-07 10:14

>>78
>>77
So, zero is when something doesn't exist. You can't actually show me something in a quantity of zero, so it doesn't really exist.

Name: Anonymous 2017-02-07 10:17


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List