What are you working on?
/dpt/ - Daily Programming Thread
first for lucky star
Second for Konata
C++
Sucks
Nothing. I'm staring at my screen, completely out of inspiration at the moment. I need something to work on, anyone here got ideas on what to make?
:- module horribleabuse.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module string, int.
:- func [] = int.
[] = 0.
:- func [T | int] = int.
[X | N] = length(string(X)) + N.
main(!IO) :-
io.print_line([1, 2, 3, 4], !IO),
io.print_line(["hello", "world"], !IO).
which outputs:
$ ./horribleabuse
4
14
this works because list syntax is built into Mercury, but the functions it desugars into are not. They're normally imported with the 'list' module.
Refactoring a large section of my game with equally ugly code
I approve of this thread
Where the fuck is the link to last thread, faggot?
>wrong format
Kill yourself OP
Good job, Anone. You are progressing very nicely with your JavaScript studies.
>no link to previous thread
>no Renge pic
Are you okay OP?
ty senpai
Usually in code that does some processing you get to set a 'verbose' parameter which hides/shows certain text.
Is the common way to implement this by simply prepending each such text with condition checking the boolean verbosity flag?
Write a function for it.
Thanks that's actually a clever idea. Just out of curiosity, is there some naming convention for such function that most programmers follow: vprint, verbosePrint etc?
Usually you just have some logger structure which you call into with a function and an enum saying what log level the message should be displayed at.
asked this in /sec/ as well, anyone have any tips or how to get started unobfuscating javascript, using a tool or otherwise?
I was aware of the logging structure. However the official documentation states that logging should only be used for tracking events. So I decided against it in favor of verbosity flag.
If your language isn't strongly statically typed you should probably get out. Exceptions will be made for Erlangers.
>exceptions
>strongly statically typed
throw
s you out a window*
I wish I was konata bros
Just learning some Direct3D©
>strongly statically typed
That basically rules out any language except Haskell
pajeets out
based
who said you couldn't be?
I'm just starting out learning C as my first language. I feel as if I'm no longer a beginner, but I'm not sure what to do. Are there any projects I can try to build that aren't super complicated for someone who understands the basics of C?
t. mt stupid
t. believes C is strongly typed
>ecosystem so shit that javatuples.org is a thing
t. has no idea how many languages actually exist
t. possibly doesn't actually know the difference between statically typed and strongly typed
>javatuples offers you tuple classes from one to ten elements:
Unit (1 element)
Pair (2 elements)
Triplet (3 elements)
Quartet (4 elements)
Quintet (5 elements)
Sextet (6 elements)
Septet (7 elements)
Octet (8 elements)
Ennead (9 elements)
Decade (10 elements)
sir pls
I wasted too much of my youth and time learning meme stuff and tinkering stuff I liked
Now the time has come to get a job
What are some failproof stuff to learn considering i dont have a degree that will land me respectable job in programming?
Are Go and Rust passing fad and meme?
Do you think web is good? Python perhaps?
>github.com
Sirs, why isn't this on suckless again? They have to do the needful.
c#
t. believes there are any typing systems that can be considered strong compared to Haskell
haskell's type system is absolutely fucking shit
liquid haskell trying to be idris makes me puke.
Also most """"""""""'systems"""""""""""" angs that aren't C shit are strongly typed.
look around for job offers that you like and note the languages they ask for.
Working out the bugs and intricacies of my ex-coworkers and absentees. What else could I do to get the massive jewbuck?
Ada's type system is strong relative to Haskell.
In Ada you'll create numeric types with the exact properties that you want. This is the default, standard, encouraged way to do things. In Haskell your math will be 'dynamically typed'.
It's funny that you have yet to provide a single counterexample and instead just have a melt down. It's almost like you don't know shit.
>system languages
Go's typing is shit
C's typing is shit
Sepples is only slightly better than C, so I guess that makes it puke
Rust's typing is puke
Also, imagine being so rustled you hit your keyboard so hard you miss a bunch of letters.
>when you have sub-90 IQ, are 12 years old and have just listened to a talk by edwin brady
what are your problems with haskell's type system? t. haskell novice
of course i will do that
just wanted to hear some advise from you guys aswell
Implement a CSP solver, there are much complex structure manipulations and I/O operations involved, and you can implement many generators for common problems as a bonus.
Which is also called Dependent typing iirc.
see Agda
Idris
to name a few others. It's mostly functional languages.
don't take him too seriously he's an idiot
languages like agda and idris support dependent types, they're much newer than haskell, and idiots like him think it's the only thing that matters
>Which is also called Dependent typing iirc.
No
Seems interesting. Thanks for the help!
>he thinks lazy evaluation is the same as dynamic typing
It's called type inference, not the same as dynamic typing.
no, nothing to do with dependent typing. The only possible connection there is that Ada will inject runtime checks that could be performed at compile-time with a dependently-typed lang. But that doesn't mean you get Ada's numerics without a lot of work.
>and idiots like him think it's the only thing that matters
Can you really go back to haskell after using idris/agda?
>he read "lazy evaluation" anywhere in that post.
you are retarded.
You have literally no idea what either of those two people are talking about
Absolutely
> dynamic typing.
No one mentioned dynamic typing retard. Stop puffing the crack pipe.
Ada doesn't have type inference thouhg.
Idris is what Haskell should have been.
That's the idea, after all. It'd be embarrassing if it weren't.
got you senpai
template using Unit = std::tuple;
template using Pair = std::tuple;
template using Triplet = std::tuple;
template using Quartet = std::tuple;
template using Quintet = std::tuple;
template using Sextet = std::tuple;
template using Septet = std::tuple;
template using Octet = std::tuple;
template using Ennead = std::tuple;
template using Decade = std::tuple;
>animefags making fun of the SUCKLESS MINIMALISM way of life.
>liquid haskell trying to be idris makes me puke.
It's not you fucking brainlet. The entire point of liquid haskell is that you don't want to write proofs which is why they use refinement types which can be more easily automated.
>languages like agda and idris support dependent types, they're much newer than haskell
Are you talking about Agda and Idris or dependent types? Because Coq is as old as Haskell.
A normal production Idris program is realistically going to look largely just like your average Haskell programm. It's only when you want to formally verify that your program works correctly that dependent types become important, but this isn't something you'd do for your average program.
>when you want to formally verify that your program works correctly that dependent types become important, but this isn't something you'd do for your average program.
You know with how much trash is out there that's full of bugs and broken shit maybe that should be a priority. Just an observation.
I didn't say dependent types didn't exist, but thanks for confirming you can think of literally nothing else
Can we all just admit that Haskell, Idris, Ada, and Agda are all strongly typed contrary to what thinks.
>No one mentioned dynamic typing retard.
>In Haskell your math will be 'dynamically typed'.
Cope posters
is it fair that webdev codemonkeys earn as much as an educated C++ programmer?
where did it go so wrong
Haskell and Idris are
Ada not so much
well you can get more compile-time guarantees out of Ada, Agda, and ATS (the only good dependently-typed language) than you can get out of Haskell.
learn Ada.
and join a nunnery.
>Strongly typed is a concept used to refer to a programming language that enforces strict restrictions on intermixing of values with differing data types. When such restrictions are violated and error (exception) occurs.
Pretty sure Ada adheres to that.
one state having the monopoly on 90% of the tech industry.
the government opening up academia networks to the public
2007
i don't know, there's a few options.
Demand and supply. There is a higher demand for webdevs than sepples programmers. The free market gives a rat's ass about what's fair. Capitalism was a mistake.
Type systems are not totally ordered by strength.
I'm fairly certain we're going to see more system critical elements being formally verified, but in general it's just prohibitively expensive. As long as it's cheaper to rewrite software every few years, nothing is going to change.
what the fuck are you talking about. When did I ever say anything about the existence of dependent types?
He wasn't talking about type inference you stupid retard
C also adheres to that, but only to a certain degree.
blame captcha for being absolute shit and failing at the last second of auto reply, i was going to add prior to idris/agda
c adheres to basically none of that besides basic prim checks.
c also lets you not adhere to 100% of it if you choose.
C does not adhere to that at all. It allows for implicit conversation when it doesn't even make sense.
yeah but why arent at least webdev employers demanding quality in from their monkeys, it would raise quality of programmers and webdev industry would slowly fix itself
how come the quality of software became so low priority or no priority at all
Then I'd tell you reread your sentence, it's ambiguous.
It can be read as either
>languages like agda and idris support dependent types, [agda and idris are] much newer than haskell
or
>languages like agda and idris support dependent types, [dependent types are] much newer than haskell
That's why I was asking which one you were going for.
Please list all dependently-typed programming languages that have been used in production.
ATS
almost.
dep types are just a form of sub typing.
ada has sub typing
ada is as production as it gets.
Capitalism is why you are alive.
According to Wiki these are the languages.
Ada
F*
I don't know the rest of these languages so i can't comment.
>yeah but why arent at least webdev employers demanding quality in from their monkeys
If you are implying that C and C++ programmers inherently have higher quality then you probably haven't been working very long in the industry. I have 8 years experience on my belt, and I've seen some absolute horrific things that made me want to bash their heads in.
Code monkeys are everywhere.
Boomer C monkeys, usually self taught or haven't learned anything new since the 90s, are even worse than hipster javascript code artisans who went to two week bootcamps.
Coq. HOL is better, though, and more widely used. Why go dependent when you can be simple?
obviously agda and idris
No, my mother and father fucking is the reason I'm alive. Capitalism may be the reason why I'm sitting indoors in a comfy chair instead of running around naked in the woods though, I'll give you that.
C++2x will be strongly typed and also feature Dependent types that blow Haskell out of the water.
Adga != Ada
i didnt have any idea that C and co. programmers can be on par with shittiness of webdevs
i always imagined they need to know how computer works and be more educated generally and have higher IQ to handle stuff
They are both listed, Sirs. Ada is used in production and that can't be denied.
C++ is getting rid of void*?
pretty daring.
Trying to make a web scraper bot that downloads porn from pornhub.
At least I've made some progress today.
>my mother and father would exist without capitalism
mises.org
the 2x stands for the year 200000000
Lets be real here, C++ is not C. It doesn't really need void * in the slightest. Classes/OOP entirely replace it in a better way.
much as I despise Haskell, by the time C++ gets those features, Haskell will be the simpler language.