/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

wiki.haskell.org/GHC.Generics#Complete_working_example
restaurantjobs.mcdonalds.com/
twitter.com/SFWRedditGifs

Is rust worth learning?

>inb4 GHC Generic is metaprogramming

No

i have an interest in lisp programming how useful it is in modern time.

perhaps

All of the trivial features that aren't in Lisp are metaprogramming, user

Waiting for any muh-type-system poster to provide a working implementation for this:
(Preferably in a muh-type-system language that anyone has ever heard of, but that's not a strict requirement.)

Rust itself, not necessarily. Substructural type discipline and liveness? Very much worth knowing.

yes

Your impatience suggests that you are not open to learning and instead just want to shitpost about how great Lisp is. That all said, I will when I get to my PC.

>you are not open to learning
But that's not true at all. If anyone posts a working example using type system magic instead of metaprogramming or classic reflection, I will definitely be interested to learn how that works.

wiki.haskell.org/GHC.Generics#Complete_working_example

Was that so hard? I'm not that guy you're baiting by the way.

That's not an implementation of what I asked for. Why are you so reluctant to do it if it's so easy in Haskell?

Then be patient.

depend on your gender pronouns

>Then be patient.
I wasn't setting a time limit, user. Just checking if anyone else is willing to give it a honest shot in the meanwhile.

I got a website hosted by OVH. For some reason one day some part of it went down due to the database with this error :

>Error: Unable to connect to MySQL. Debugging errno: 1203 Debugging error: User already has more than 'max_user_connections' active connections

Ofc I reviewed the source code and all connections are closed once the queries are made.
Problem is that I can't access it via the phpmyadmin interface neither so can't see what are those active connexions.

It's a small website for an association so there isn't much traffic (~80 per day) and active connections are supposed to be closed after a few minutes of inactivity anyway (or maybe ovh default config are retarded?). It's been a day like this and it's a little bit annoying

Any idea where it can come from ?

he/him/his (female)

Do it, fgt

Nobody with any experience with non-trivial static type systems will bother because there is a very high probability that you would move the goalposts if a working solution were posted.

I'm the user who offered to write up a solution with dependent types. It's not even difficult (I'm talking like a couple dozen lines), I just don't want to write code with my phone keyboard and this shitty app.

Then I hope the other user is genuine.

Some dynamic language fans remind me a little of some creationists, in both their zealotry and their intellectual dishonesty.

>dynamic language fans
These exist?

It surprised me too at first.

How are huge voxel datasets usually stored? Is it just a sparse structure or do they use some kind of virtual memory system like megatextures?

Just use Lego

Lisplets plague /dpt/ although only Racket-kun really posts anything.

chunks (3d array) in a tree structure

Lisp is a special case I think.

A generous helping of both for very large sets.

>there is a very high probability that you would move the goalposts if a working solution were posted
I won't; but even if I do, I'll just look like an idiot, and any honest onlooker unfamiliar with the power of "non-trivial static type systems" will have a non-meme incentive to give them a serious consideration. Just to be clear (and this is not a new requirement): a solution that amounts to emulating runtime reflection doesn't cut it.

Even so, there is still the "but (my limited conception of) a static language (that is no more powerful than Java) can't do this!!!" screeching.

Not really.
>oh look i can write a basic interpreter / parser in x amount of lines
>but that's about the only special niche my language can do

Come to think of it, virtual memory is already a sparse data structure, so there you go.

Lisp is also useful for keeping away people who only know Python/Ruby/JS.

But you could do extreme programming. In fact, I had a college buddy I did pair programming with. We took a compiler writing class together and studied all that fancy stuff from the dragon book. Then of course the professor announced we would be implementing our own language, called PL/0. After thinking about it a while, we announced that we were going to do our project in BASIC. The professor looked at us like we were insane. Nobody else in the class was using BASIC. And you know what? Nobody else in the class finished their compiler either. We not only finished but added I/O extensions, and called it PL 0.5. That's rapid prototyping.

Hello, /dpt/
I want to get back to programming. What language should I use? I've heard that common lisp is powerful language. What about the new meme languages like rust and go?

I lurk on dpt because to pretend I'm learning while browsing Sup Forums instead of actually reading a book,practicing.

Go is shit. Learn rust

You can do extreme programming with static languages too.

what the hell is extreme programming anyway

>all that butthurt
How come only one user is willing (supposedly, sometime in the future) to give my simple exercise a shot? You don't seem very eager to illustrate the incredible merits of your favorite type system. I guess you're too busy shitposting?

>it's another Lisp autist only proposes the one thing Lisp is half-decent for
zzzzzzzzzzzzzzz

>a solution that amounts to emulating runtime reflection
What are your criteria for this? While I'm not confident that Idris (for example) will monomorphize types depending on compile time constants and thus remove any sort of RTTI, it is not an inherent limitation. It could be done in anything with dependent types. Actually, it doesn't even need them. You could do it in Haskell with heterogeneous lists and spreading a single function definition across a few instances.

extreme

the best functional programming language is...

maybe noone cares about your daily autistic ramblings

agda, desu.

>the one thing Lisp is half-decent for
Well, user was asserting that advanced static type systems eliminate the need for metaprogramming, so there should be a good way to accomplish my example task.

>What are your criteria for [runtime reflection]
Relying on runtime knowledge of the structure of an entity to iterate through its fields, in this case. If you have to do that to get the job done, how exactly does it illustrate the merits of a static type system?

And there is. Perhaps you should learn an advanced static type system.

>And there is.
Alright, show me. You make it sound trivial, but then spend hours shitposting just to avoid proving that you know what you're talking about by actually implementing it. Why?

I'm still hacking on my amazingly autistic framework.

I want to make an argument for how different the world could have looked if Java took a different approach in about 2005 or so after Generics were released.

I propose that instead of the NoSQL revolution, and the XML-Everywhere fad, what would have happened if people instead decided to go with RDBMSes as the Standard Solution for Storing Stuff, or S4. So everyone actually knew SQL. Now, if everyone knows SQL, and everyone knows Java, there's the O/R impedance mismatch, right?

So what if we instead of thick complex objects in Java went with small lightweight stateless objects instead? You know, like we (try to) do today?

Instead of Hibernate making it big, you'd instead demand better support for views/window functions/something similar, and we'd just put views in front of our selects from Java.

And if that was the case, imagine how smooth the data layer would be? You could in fact imagine a DSL emerging that created the Bean, the Value Object (and those two could act as each other's factories for updating purposes) and the DAO.

Now imagine this. The complexity of storing and retrieving data is now firmly shoved into the database.

The data layer is a translation layer that creates simple lightweight objects that everyone understands, and the business layer can operate on.

I'm doing this as part of a larger point about solving the wrong problem, and how we're making all these advanced tools to make our bad decisions less painful, but how they just provide aspiring for our self imposed headaches.

And in order to show that, I need to show a way to do things people aren't intimately familiar with so they can critique it without criticizing their own favourite methodologies.

I'll also argue things like how IntelliJ's support for refactoring extending to Spring xml files being both useful and a mercy, but also a TERRIBLE TERRIBLE IDEA.

Only type systems with first-class types do because that's the whole point.
Why anyone thinks you don't need templates in a regular old imperative strong static environment is a baka.

I am so fucking lazy

Oh, you don't. It could be completely static but also doesn't preclude a situation where you do want it to be dynamic. The type depends on the description, not the other way around.

me too, i just posted on freelance.com to see if someone would do my work but i only see pajeets

can i trust them?

>Oh, you don't. It could be completely static
If it doesn't rely on runtime knowledge of the structure of the entities and actually accomplishes the task as stated, it passes.

Like I said, I am not confident that Idris would erase the constant descriptions at runtime (thus unfolding the interpolation function for each description) but there is nothing stopping a language with dependent types from doing so.

Employed Haskell programmer here

restaurantjobs.mcdonalds.com/

>tfw want to become a programmer so I can get a decent paying job
>tfw not autistic enough to enjoy programming

Fuck. What do I do?

Learn a real programming language, rajeet. I'm guessing you get 20k each year.

Programming isn't the only decent paying job.

Yea but I'm already studying it so cba to change.

no one is enjoying programming

people enjoy solving problems and creating shit

Employed Java programmer here.

I enjoy programming both by producing something and the beauty of how i did it. Same as regular writing.
Find a new hobby, lad.

>but there is nothing stopping a language with dependent types from doing so
I'll give you the benefit of the doubt. Post something that works and I'll look into it.

Go to sleep, Reyansh.

Fuck I'm going to change to using jvm as platform instead of trying load shared libraries from other shitty dynamic languages.

>and the beauty of how i did it
but your code sucks ass and you know it, Dave

cout makes me cringe
why is that

>Find a new hobby, lad.
Try professional programming my man! Will hate it in no time.

Reminder that Javascript is neither a """dynamic""" nor """interpreted""" language.

>Try professional programming my man
why in the world would i ever want to do that.
working for anyone but yourself in this age is brainlet-tier.

I agree, yeah. No welfare checks for me unfortunately. A man must ship to eat.

What is it then?

It depends.

Do you want to work for Mozilla?`
Yes
No / I am a white, non-trans middle class straight male and don't see any problem with that.

>working for yourself
>in reality begging for clients
>and being subject to their nonsensical requirements

How would you name the following objects:
{ // name the root
"data": { // name the child
"data": [{ // name the childs children
}]
}
}

QA here. Your shits broken and this is a blocking ticket.

But slowly more and more companies want rust developers and the language looks interesting.

For example: how would you name this hierarchy:
final case class Response(
data: ResponseData
)

final case class ResponseData(
children: List[ResponseDataChildren]
)

final case class ResponseDataChildren(
data: ResponseDataChildData
)

final case class ResponseDataChildData(
title: String
)

The only story I have heard about Indian programmers involve C, JavaScript and developing libraries for a set top box.

It ended about as hilariously as you would imagine. But are there really that many Indians writing Java? I mean, Java is not hard to learn, and H1B1 Visas are for people who do jobs that Americans are unable to do. So if there's a bunch of Indians in the US on H1B1 Visas, doesn't that mean that Americans are incapable of writing Java?

I honestly hope so. We need a modern replacement for C++.

But currently, things don't look like that's how it will be to me. Most developers I've seen can't deal with the borrow checker properly, and some weirdness like immutability and crutches like split_at() vs split_at_mut().

Response = List[String]

how do you handle the discouragement that came from constant failures /dpt/? whenever I try to do something I always ended up panicking over my code and even when looking the problem up it's going to make things even complex. I think I'm actually a brainlet retard idk. it sucks

>how do you handle the discouragement that came from constant failures /dpt/?
Do something you're actually good at? (Which, apparently, is not programming)
I'm not even trying to be a dick. If you struggle with it and not getting better, there's no reason to subject yourself to constant failure. Do something you're naturally predisposed for.

I think you're the one who has never done any serious programming. If you're not failing 99% of the time, you're not doing anything innovative.

Don't do ambitious projects. Do something in your comfort zone.

yes

Give it 5-10 years and the pieces will fall into place.

Do your C programs still work on big-endian systems?
Do you always write endian independent I/O code?

just English I guess. Give a kid who doesn't speak the language a shit-ton of movies in his early days and you got yourselves an bilingual after a few years.
still doesn't change the fact that I'm pretty much skill-less

I am debuging some powershell script i am working on and just found out this strange thing

it seems that when I am assigning return value from a function in to a variable I cant fucking debug the function by checking value of stuff inside it.. wtf is going on?
Does this have a name, purpose?

>Do your C programs still work on big-endian systems?
no
>Do you always write endian independent I/O code?
no

>I think you're the one who has never done any serious programming.
>If you're not failing 99% of the time, you're not doing anything innovative.
I think you're the one who has never done any serious programming, because you unironically seem to believe that 99% of the work involves doing "something innovative". But even then, your "innovative" ideas are trash if you have to try a hundred times on average before one of them actually works.

>still doesn't change the fact that I'm pretty much skill-less
Skill is acquired, but is there nothing you have talent for?