/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Previous Thread:

Other urls found in this thread:

github.com/cs01/gdbgui
chemie.fu-berlin.de/chemnet/use/info/libc/libc_19.html
theoutline.com/post/1166/programmers-are-confessing-their-coding-sins-to-protest-a-broken-job-interview-process
ocaml.org/learn/companies.html
twitter.com/SFWRedditVideos

"I'm not a fan of religiously taking some idea to the extreme, and I try to be pragmatic in my design choices (but not *too* pragmatic, see the start of this sentence :-). I value readability and usefulness for real code. There are some places where map() and filter() make sense, and for other places Python has list comprehensions. I ended up hating reduce() because it was almost exclusively used (a) to implement sum(), or (b) to write unreadable code. So we added builtin sum() at the same time we demoted reduce() from a builtin to something in functools (which is a dumping ground for stuff I don't really care about :-).

If I think of functional programming, I mostly think of languages that have incredibly powerful compilers, like Haskell. For such a compiler, the functional paradigm is useful because it opens up a vast array of possible transformations, including parallelization. But Python's compiler has no idea what your code means, and that's useful too. So, mostly I don't think it makes much sense to try to add "functional" primitives to Python, because the reason those primitives work well in functional languages don't apply to Python, and they make the code pretty unreadable for people who aren't used to functional languages (which means most programmers).

I also don't think that the current crop of functional languages is ready for mainstream. Admittedly I don't know much about the field besides Haskell, but any language *less* popular than Haskell surely has very little practical value, and I haven't heard of functional languages *more* popular than Haskell. As for Haskell, I think it's a great proving ground for all sorts of ideas about compiler technology, but I think its "purity" will always remain in the way of adoption. Having to come to grips with Monads just isn't worth it for most people." -Guido van Rossum

An app that automatically converts between reddit and Sup Forums spacing to hide your actual nature

Any language with ⊥ as an inhabitant of every type is worthless.

If Guido hates it, it's probably good

Python is shit, so much is his creator.
Got it.

I'm pretty sure it's against the law to show your political opinion trough the dpt op image you faggot.

It always amuses me when Haskell fags think they will get dependent types as an extension or something, or even better, when they think they already have them.

Meanwhile you can implement CoC in about an hour and you have a more rich type system than Haskell.

Must suck to hate every programming language

what political opinion?

t. haskleler

the correct term is Haskellite

>Meanwhile you can implement CoC in about an hour
In what language?

Haskellyte*

I'm sorry for assuming your demonym

github.com/cs01/gdbgui
> A modern, browser-based frontend to gdb
>modern
Why do people think that being browser-based is somehow modern?
The only thing I can parse from that it's additional bloat over gdb with no added advantages.

Anything functional. Bit longer if not.

They can have their dependent types if they get rid of type inference, which will never happen.

replace D lang logo with Rust logo and that pic will be accurate.

>Why do people think that being browser-based is somehow modern?
They don't think that, but they're desperately trying to make others think it, because there's a whole bunch of people who can't program in anything other than JS who want to be relevant. Once WebAssembly takes off there'll be a lot of webdevs without jobs.

There are already plenty of extensions that are undecidable with full type inference, that's not the problem.

But Rust is younger AND more popular than D

>Dfag delusion

D stands for Dead

Rust is a meme language that only few SJW hipsters use. D is alive and well.

Also there is a very powerful fragment of type inference that is completely compatible with dependent types. First, there's bidirectional type checking, where certain terms' types are inferred and others checked (and all inferable terms may be checked). On top of that you have decidable classes of unification like higher-order pattern unification to mop up a lot of remaining cases.

rust is meme
D can't choose if it wants to have gc or no
nim is buggy shit
Chapel is the future

D is a pointless language at this point, it showed promise back when its only competition was 90s C++, but these days it fails to offer compelling advantages over even modern Java and C#, let alone functional languages, while having a GC means it simply can't compete against Rust.

...

>rust is meme
Not an argument.

How would I type this in python?

(a=b=c) and a = A or a = B

>Not an argument.
Not an argument.

Oh don't worry, eventually D will shed its GC, you just need to wait, honest. Sure they haven't done it despite having had over 15 years to do so, but trust me! One day it will be done! In the meantime you should begin using it despite it being worthless

if ((a == b and a == c and b == c) and a == A) or a == B

Is Python's equality transitive?

Thanks sir.

All the languages are kind of nice but only chapel introduces easier parallel constructs. It's kind of c++ done right with go's promise of easier concurrency except you replace concurrency with parallelism.

>'==' for equality
>'and' and 'or' for conjunction and disjunction, not '&&' and '||'
What the fuck is with these people? Why have symbols for some operators but words for others?

if a == b == c and a == A or a == B

Because equality != identity

a is b != a == b

It is by design.
It produces more readable code.

I disagree vehemently.

This poster is correct.

Ignore my post, user above is correct.

What language lets me to place comma as a decimal point?

So? Just use triple equals for identity, like other languages.

I'd still much rather use it over either C# or Java.
Who cares

The solution is not to use commas as decimal points.

>equality != identity

Should add some characters so you can go though r9k mode

Its an absolutely minor point of syntax, a personal preference by the creator that does not matter. Stop complaining.

On the point of readability, I too disagree, also I think that claiming that syntax like this makes python easier to learn is also very incorrect

Fine, you go suck a bunch of D, just don't try to get us to do it too by lying about its utility.

Decades of semantic bugs disagree with you.

We must stamp out this sort of idiocy wherever it occurs before it takes root, no matter how minor it appears.

It's used just as much if not more than Rust

I know C++'s isn't

Oh Guido!
>For such a compiler, the functional paradigm is useful because it opens up a vast array of possible transformations, including parallelization.
Yes.. you're getting there... keep going.....
>But Python's compiler has no idea what your code means
Yess... you're getting a grip now... follow dat train of thought Guide..
>and that's useful too
wot

Disingenuous. That's nothing to do with its merits compared to Rust, and everything to do with it being more than a decade older than Rust.

*language, singular

Also equality vs identity is a useful point. Two lists/strings may easily contain the same elements without being the same object referentially, and this becomes important when you factor in mutability.
Some not so bad ways of handling this:
Scheme: eq? compares reference, equal? compares data
Haskell: == must be defined on a data type for comparison to be possible. For some objects equality shouldn't even be possible (e.g. functions). Referential equality is meaningless in a purely functional language.

>For some objects equality shouldn't even be possible (e.g. functions)

>Meanwhile you can implement CoC in about an hour
Best first determine if You Need The Coc

>For some objects equality shouldn't even be possible (e.g. functions)
Complete rubbish. Look at how Lisp does it. Code is just data.

I only say that because everyone's posting about how dead it is
If we want to talk about merits, D has a very clean syntax, great metaprogramming. The standard library is also fantastic.

What's CoC anyway? In case one wanted to write babby's first, um, y'know

But this solution doesn't answers the question

I wonder if it's possible to become useful programmer if you start learning at 29?

Note that i have just enough knowledge to create webscraper program that finds used cars on a site and displays the results in gui. But most of those things were reverse-engineered, i don't really know any of it

Ever heard of turing completeness?

>great metaprogramming
It's literally just string manipulation.

Calculus of constructions.

>syntax
>metaprogramming
Scheme is better.

Once WebAssembly reaches feature parity with JS (strings, dom, objects all without handing custom FFI/export objects from module to module) ... not seeing that in the next ~5 years, given how slow-paced browser devs are these days

Completely irrelevant.

Lisp doesn't compare functions by comparing the s-expressions, that's idiotic.
Also, I can't think of a single situation where I would need to non-referentially compare two functions without invoking them

>It's literally just string manipulation.
We're not talking about C
>this somehow means D's is bad

Dependent types. Though, aside from definitional equality, function equality isn't mechanically checked, it must be proven using function extensionality.

Lisp has many equality functions. =, EQ, EQL, EQUAL, EQUALP, etc.

In C you can set locale.
see chemie.fu-berlin.de/chemnet/use/info/libc/libc_19.html

Yes, dependent types, which requires making your language non turing complete. The reason non-referential function equality is meaningless is because of turing completeness.

Fug. I meant something like

float array[] = {3,4,5,6,7};

int array[] = { 3;4;5;6;7 }.

>requires making your language non turing complete.
See Idris.

>Yes, dependent types, which requires making your language non turing complete.
Nope!

>The reason non-referential function equality is meaningless is because of turing completeness.
Just because you can't compare absolutely every function doesn't mean you can't compare the 99% of functions that do terminate or are infinitely productive.

Yes and? Are you just spouting random langauges and paradigms to try to undermine my point?

It's necessary to change syntax to use commas.

>claim
>counter example
>Yes and? Are you just spouting random langauges and paradigms to try to undermine my point?

So function equality is restricted to provably total functions.
And languages like haskell allow every function to be nontotal, therefore its reasonable not to implement equality over functions

Great, now how do you handle multiple assignments/updates in for-loops? You can't use semicolons because they have a special meaning already.

Using commas as decimal points fucks up the whole language. Don't do it. Use the English convention.

>he uses semicolons as terminators

>So function equality is restricted to provably total functions.
Which, in practice, is nearly every function you will ever write and almost certainly every function you will even need to compare in the first place.

>And languages like haskell allow every function to be nontotal, therefore its reasonable not to implement equality over functions
Haskell is garbage.

Learn OCaml. Semicolon delimits array elements, and can be used as an operator to chain multiple statements.

Yes? And?

I don't care about OCaml, it's not a useful language.

trips confirm

dirty impure ocaml disgusting

>Great, now how do you handle multiple assignments/updates in for-loops

We use for-loops with float values now?
Also, we can use dots if we did itwith the semicolon in the first example.

theoutline.com/post/1166/programmers-are-confessing-their-coding-sins-to-protest-a-broken-job-interview-process

I genuinely think most programmers are retarded, and not in the LOL XD way.

>Learn OCaml.
Why would I be learning a literal piece of trash?

Whatever your opinion, its still obviously possible to let ; delimit expressions in an array.
Also, C (without GNU extensions) doesnt let you nest statements in an expression position like an array element, therefore the use of semicolon wouldn't clash and it'd be easy for the parser to still allow both uses

According to?

>They also discriminate against people who are already underrepresented
The unqualified category seems well enough represented to me.

Except for ocaml.org/learn/companies.html
(Not an Ocaml user myself)
Although many of those don't seem to be all that "useful" themselves. But this is a side-effect of any somewhat-affluent economy

>some reddit link
>LOL XD
Back to your subreddit

Did you even read my fucking post?

you have to go back.