/dpt/ - Daily Programming Thread

Turing complete type systems are a scam edition.

What are you working on, Sup Forums?
Old thread:

Other urls found in this thread:

github.com/kostya/benchmarks/blob/master/json/json-hs/src/Main.hs
github.com/kostya/benchmarks/blob/master/json/test.cr
open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf
github.com/GaloisInc?utf8=✓&q=&type=source&language=haskell
stackoverflow.com/questions/2284875/why-is-haskell-used-so-little-in-the-industry
web.archive.org/web/20120311135851/http://stackoverflow.com/questions/2284875/why-is-haskell-used-so-little-in-the-industry
grinninglizard.com/tinyxml2/
twitter.com/SFWRedditImages

>Turing complete type systems are a scam
Correct, they should be expressive but ultimately Turing incomplete. Turing completeness goes hand in hand with inconsistency.

>Haskell
github.com/kostya/benchmarks/blob/master/json/json-hs/src/Main.hs
>Crystal
github.com/kostya/benchmarks/blob/master/json/test.cr

Why would anyone recommend someone Haskell?

What type systems do you consider expressive but are turing incomplete?

#include


int main()
{
SDL_SpinLock l;
SDL_AtomicLock(&l);
printf("text\n");
SDL_AtomicUnlock(&l);
return 0;
}

Why doesn't this program end?
The spinlocks work fine if I have threads, it makes no sense that it's blocking with single threaded program.

>SDL_AtomicLock
The state of C documentation.

'l' is uninitialised.

>they should be expressive
Literally for what purpose? I want my programming language to be expressive, not the type checker. It should be designed to get out of my way and let me code, not create extra work for me.

l is not properly initialized. it can have any value when SDL_AtomicLock looks at it, so SDL_AtomicLock probably ends up believing it's locked.

Try l = 0

Hired lisp programmer here.

Teach me your ways.

What do you think about C vs C++?

Is it worth it to put a bunch of SJW shit in my cover letter when applying to programming jobs? I have some vision loss and I'm debating whether or not it's worth it to include
>I am excited to be given the opportunity to work at a company that welcomes people of all abilities

Good or bad idea?

Do a lot of lisping on the side and do not apply for every job you like regardless of the requirements.

>do apply
fug

Any dependent type system.

Why do you think expressivity = verbosity? Also the whole point of a type system is to "get in the way" and prevent you from writing incorrect code.

__FILE__ and __LINE__

//chatlib.us Room Crash By BrU
while(true){window.open('BrU Hax U!!');}

Why do you think verbosity == mental overhead? You're still making extra work for yourself by donning your hyperpolyisomorphicnonlinearmetatypes chastity belt.

C++ is garbage and basically all the good stuff is in C.

This.

Pretty much this.

/biz/ is in full meltdown Bitcoin goes from $19k in late December crashing now at $10k and still headed downward...

how much did you short?

Both have their uses. When you don't want to implement a hash table for 100th time you use C++. But sometimes you DO want to implement it yourself.

An expressive type system has no mental overhead because the things you would have to keep in your head with a shitty type system can just be parts of types. In fact you could probably consider it negative mental overhead.

I guess it's mental overhead if you're not used to thinking while programming but you should be doing that anyway.

is there an SDL_SpinLock_init function?

t. simple minded person

Both should be forgotten.

c++ is the greatest language of all time

But that's wrong because an "expressive type system" explicitly implies that you have to express types in the first place. Types should never leave the compiler whenever possible.

Tell me more about how type autism has made you more productive. :^)

Serves them right.

>But that's wrong because an "expressive type system" explicitly implies that you have to express types in the first place.
Well, yes, you have to be capable of expressing your thoughts in the first place, but again, not a problem if you're not a brainlet.

So if taking things out of the compiler and managing it ourselves is a feature and not a bug, then why don't we all just write assembly? You're not a brainlet, are you?

How on earth did you conclude that assembly is anything like a dependent type system?

Should I try compiling a list of broken C++ features?

Do it, fgt.

Types ought to internal to the language, and not exposed to the programmer as the represent unnecessary overhead. But if you want to code in a turing tarpit then that's your perogative.

Just don't use them.

Oh, they've already done it for you.
open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf

>not looking into the library's source code yourself

are you even trying to program user

kek

>Types ought to internal to the language, and not exposed to the programmer
Which necessarily limits the power of the type system because the logic must be decidable, and it defeats the purpose of types as specification and documentation in addition to verification.

>unnecessary overhead
Explain this.

All the complexity of Haskell and Kotlin combined with the expressiveness of C. Delightful.

Haskell is only useful to throw incompetent programmers under the bus. If you can't write a haskell program, even a imperative one, just go to testing or q&a.

>expressiveness
Explain.

It can be implied in the structure of the language itself. See the pic in the OP's post.

>>unnecessary overhead
>Explain this.
You have literally created an entirely new class of problems that you didn't need to worry about before. How is this not obvious to you? The problems that overbuilt type systems solve were trivial in the first place, and yet the amount of additional effort they require is enormous.

what's your ideal of a language then mate

Haskell is so good that you don't even need to use it write programs. You can just talk about how good it is all day long.

>amount of additional effort they require is enormous.
YYou're just not used to it yet. Give it some time.

>It can be implied in the structure of the language itself.
Right now you are arguing against fundamental limitations of computation.

>You have literally created an entirely new class of problems that you didn't need to worry about before.
Wrong, you have to worry about them before but, unlike with types, you're given no assistance. You have to use dynamic checks and reasoning in your head or on paper.

People are gonna defend left.

>you're just holding it wrong
No, it's bad language design. Overbuilt type systems are a regression in programming languages.

I'm kinda depressed about programming /dpt/, every good idea I have is already covered by a well-known algorithm/patent/etc.
It's like everything was already invented already.

This is how brainwashed you are. Read about Julia fgt

Only time will tell. If it's shit, few people are gonna use them.

your age, name of your programming language, and proficiency in high school algebra?

my first girlfriend's name was Julia and I don't want anything to do with it whatsoever

So far that's been the case, considering no real software has been written in haskell

23, asm, C, python, Julia, MS in applied math

>considering no real software has been written in haskell
You got me beat there.

There are open source companies building software with haskell, eg:
github.com/GaloisInc?utf8=✓&q=&type=source&language=haskell
So, hows that not real?

22, c & scheme, ms in mathematics

>So, hows that not real?
Maybe it's behind mirrors or something?

>expressive types create new problems
>i-it's not a problem if you sweep it under the rug or sacrifice performance so that it will simply crash the program instead of causing a security breach

53, C, hi schol

>Python
>Julia
>applied math
Found the data """scientist""".

>asm
>C
And autist to boot.

>that time haskellfags got so buttblasted that stackoverflow had to delete the question altogether
stackoverflow.com/questions/2284875/why-is-haskell-used-so-little-in-the-industry

>53 years old
>still can't find a C job

>C+ asm = autism

What an AUTISTIC deduction

I'll give you the benefit of the doubt. You're a data """scientist""" that writes programs for embedded devices used in field/lab work.

I research self-stabilising plasma geometries. What do you do?

You're not even replying to me now.

at least post an archive faggot.

web.archive.org/web/20120311135851/http://stackoverflow.com/questions/2284875/why-is-haskell-used-so-little-in-the-industry

Haskell community is a bohemian club

why the homophobia?

What the fuck, why was that deleted?

I'm a type evangelist.

I'm a developer advocate.

is this a new meme

Because mathematics had a lot thing call homo, homo means equal in Greek, people start to say homophobic was some math theory

So somebody that doesn't write actual code. That's about what I expected.

stackoverflow's mods have gone off the deep end in the past few years. They have created such autistically strict rules that the only things you can post are essentially questions on how to do your homework or how to unfuck your pajeet code.

Writing code (working on a language) is part of that.

Considering that the 8th edition is from 2016 and K&R is from ~1989, the book that you're given might go over the capabilities of the newer standards.
That said, I've only read K&R and not the book in question.

stack overflow mods are Haskell evangelists.

>People are gonna defend left.
If you can't understand why the Haskell version is better, then kill yourself.

C hasn't really changed all that much in the past 30 years though. It's not like C++.

What is a good and simple xml library for C/C++?

I liked using ezxml but I was wondering if there was something newer. I looked at expat and libxml2; expat I could get compiling and running but I couldn't get libxml2 because of iconv. I don't really care for expat, however.

>why the Haskell version is better
Please explain why the Haskell version is better.

Not him, but safety

grinninglizard.com/tinyxml2/

why do you feel the need to change? what's ezxml lack?

>safety

how so?

Oh boy, *another* programming language. Have you ever considered solving actual problems? This is the problem with haskellfags. They've lost sight of why programming languages exist for the languages themselves.

...

I believe the necessity to use two languages to write formally verified software is a problem.

type String = [Char]

Haskellfags are caught in their own delusional alternate reality.

I don't know why you think I am a Haskellfag. Haskell does not have a good type system.