/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Last thread:

Attached: 1543043537368.jpg (237x341, 30K)

Other urls found in this thread:

blog.jle.im/entry/functor-combinatorpedia.html
github.com/rust-lang/rfcs/issues/600
news.ycombinator.com/item?id=11879464
youtube.com/watch?v=R3xX37RGJKE
github.com/janestreet/incremental
pypi.org/project/sqlparse/
clojure.org/community/success_stories
clojure.org/community/failed_attempts
twitter.com/SFWRedditVideos

I'm a ETL/DB developer earning $4 an hour and the boss is on my ass to finish some KPI's.

AMA

C++, but done right this time

How old were you when you grew out of metal?

XeTeX is also not a LaTeX engine.

blog.jle.im/entry/functor-combinatorpedia.html

>What are you working on, Jow Forums?
Still moping around trying to find something productive to work on.

Not him, but I started liking metal when I was about 14 and started to get over it when I was about 23, this past April really. There are some good acts out there like Porcupine Tree, Type O Negative and Bathory and even more good underground ones, but the genre has gotten so stale it’s not worth following for the most part.

Attached: smokey.jpg (338x450, 134K)

let me know how it pans out

>$4 an hour
where do you live? flipping burgers pays 3x that much here.

how did you get the job?
im earning less than you btw

Should I try to re learn Haskell?
Or should I try Erlang instead?

Trying to write a program that solves these kinds of problems (sequence-family probability for Markov chains)

Attached: markov.png (1159x745, 105K)

Maybe he's in a country with a favorable exchange rate and low cost of living. South americans make like 5 of their currency on each dollar, american shit jobs actually compete with their own private sector and frequently outpays everything but government jobs. People in 1st world countries ought to be able to live well with that much money but the jewery is just too strong and the cost of living in places where you'd typically make 300k/y would eat much of your profits

Each edge denotes the probability of progressing to the next nodes?

There's probably a good use case for a "C with classes"-like language that gives you tight control over optimizer behavior, allows register pinning, prevents dead code elimination, etc.
But if you're focusing on powerful abstractions for writing libraries and controlling memory usage, you'll be fighting an uphill battle trying to compete with Rust
Good luck and I hope you have fun making what you're making

re learn Haskell

Hey guys, hoping that someone can help me. Trying to figure out how to do this. I've done some C programming in the past, but nothing spectacular. I'd like to try to do this in python or some other scripting language. This is not for homework, though it is school related. I'm in an SQL class and the INSERT statements we were giving had the date format as (what I think is) '%A, %B %d, %Y' and AFAIK SQL accepts date as '%Y-%m-%d'. The insert statements look like:
>INSERT INTO SKILL VALUES '7','DSD','Tuesday, June 22, 1999');
Is there a way I could write a python script to search through the text file and put the date into the right format? The INSERT table only had around 30 entries so I just manually went through and changed all of them myself, but would like to know how to do it since I may focus on SQL in the future as a career path.
Really appreciate any help.
I've looked up examples online to see if I could find something close enough that I could edit it a bit to fit my needs but haven't had any luck.

Does ayone have Haskell from First Principles pdf?

If you're looking to learn Haskell, I'd highly recommend this book.

Attached: pih.jpg (1012x1345, 965K)

>rust
>libraries

Rust barely has a well defined ABI, let alone a stable one. It's in worse shape in that regard than C++. Unless you throw all the C++ away and wrap the entire thing in a C interface, you generally can't expect your C++ library code to be touched by anything but other C++ code compiled by the same compiler, sometimes the same version range. Rust can't even claim this.

For writing libraries, you're all still competing with C. There's no insane internal machinery to interface with, just symbols you can look up and a calling convention to respect -- that's it. If something ever becomes a fundamental building block of anything, it will eventually be rewritten in C.

gen.lib.rus.ec

whar does the arrows that point to nothing mean?

Correct.

The user is fucking killed. So like another node with a self-loop that has probability 1.

Is it UB to cast from member function pointer to func pointer and use it?

Holy shit, worse ABI stability than C++ is absolutely fucking laughable. No wonder people don't bother with it.

You could make a parser and formatter.
Have you learned regexs yet?
Have you learned context-free grammars yet?

Probably. They likely use different calling conventions. Member functions have a this pointer, who knows what other special semantics they have.

Yup.

github.com/rust-lang/rfcs/issues/600
news.ycombinator.com/item?id=11879464

I did it! I finished my little x64 JIT compiler. It's not very impressive, but it took me 6 months of free time and I learned a ton. I started by implementing an interpreter, then I integrated GNU Lightning, then I ripped out Lightning and replaced it with my own tiny back end.

Rust was deliberately designed to be a drop-in C replacement for libraries that export a C interface and use the C ABI without needing a special linker
The current Debian RISC-V shitstorm happened because library maintainers went ahead and did this, and now something like 4% of core packages depend on Rust

>where do you live? f
Southern Europe
>how did you get the job?
college internship

>register pinning
>prevents dead code elimination
Why?

>regexs
No I keep seeing it in the examples I'm looking at though, kind of reminds me of sed.
>context-free grammars
No I have not, I'll look into it though, thank you.

In general, yeah
However there's a GCC extension that allows you to do it.
Depending on your needs you may also consider templates, std::mem_fn and std::function as portable solutions.

Rust doesn't even have incremental compilation. Rust "modules" are just serialised ASTs. It's an utter joke.

If a programming langiage isn't standardized, and only defined by a "reference implementation", it's shit.

Reminder that Rust is faster than C now.

proof? benchmarks? peer-reviewed papers?

>Rust barely has a well defined ABI
No real need. Rust is mean to be compiled from source with LTO and static linking.

nice retarded opinion, retard
(no it isn't actually nice you retard)

Attached: 1558628049911.png (669x652, 311K)

{{()(={}()(=>{((())})}

Embedded code, motherfucker
C is a disaster there specifically because you don't have fine-grained control over the optimizer

Rust was created by Cniles in order to have a convenient scapegoat to keep shilling C in (1- 2020).

Erlang at least has some practical niches. Haskell is only good for shitposting and academic masturabtion.

>i like being locked down to whatever a single compiler does, bugs included

just wrote an 'invert' function for this jquery terminal rss feed reader, running out of ideas
acktic(dot)github(dot)io

Attached: 9416705396472.png (1366x768, 366K)

>being locked down in a room by your compiler gf(female)
hot

pls stop calling me cnile and sepper it hurts

Attached: 9437107932491.png (1280x720, 1.21M)

You should have 3 different compilers all with different bugs.

gonna get my sql back in shape by making a database of a bunch of porn stars and vids I like

>academic masturabtion
I still don't understand this meme.
Most colleges nowadays are Java schools actually.

benchmark game

Prove it

It's called a "game" for a reason: Only /v/ would take it seriously
You should go back there

>(1- 2020)
Babylonians confirmed to have programmed in C.

Interview question: How could your data model include a recursive relationship?

reading the implementation described in this talk:
youtube.com/watch?v=R3xX37RGJKE
github.com/janestreet/incremental

CFG is way overkill for that task
if you're just looking for a python script a regex is what you're looking for

sex(agesimal) literals when??

I ran a search and it looks like somebody else has already done the heavy lifting for you:
pypi.org/project/sqlparse/

It allows you to write papers about shit nobody will ever use like zygohistomorphic prepromorphisms.

Interview question: How could your data model include an abusive relationship?

using reference keys

I don't see where this would come up, but then again that's why I'm trying to get my sql back in shape

>recursive relationship
69

Not what I asked. Give an example of a recursive relationship

that's rotationally symmetric not recursive

>I don't see where this would come up
Don't call us, we'll call you

I had an interview last week where they asked me data modeling questions and I was nervous but the most complicated question was a simple join

Yeah, and you lose 100% of the benefits of a Rust library. Also known as every single abstraction and safety provided by Rust. Or C++ for that matter. Or anything that "exports a C interface".

Sure you get your benefits on the implementation side but those are local and limited to your project, not really applicable to the entire software ecosystem. If it goes on long enough you'll all end up with C++/Rust/whatever libraries talking to each other via a simple C interface. It's gonna be hilarious.

I'm new to programming, but I've seen people shitting on C++ and C all my time in the internet. I'be read blogs going back to the 90s trashing C++ and C for this reason and that.

Historically, what alternatives were suggested? Fortran and COBOL? Now there's plenty of hip new meme languages that are better because x, y, and z, but what about 20+ years ago?

thing.boss = thing

what were the questions?

Never used a join myself

don't fall for it user. The best languages in the industry right are c/c++/c#/java/python. C/C++ have been the best general languages for decades now

i'm not interviewing yet you bully employer!!!! I'm relearning/heavily de-rusting
I don't see where it would come up in the data model though; an actress will be in a movie, but she won't be a movie

You could have a collection with subcollections. For example, the company HQ contains employees, and those employees contain gut bacteria. And you can use SQL constraints to make sure they all have health insurance and diversity training.

java is not the best, but in the past was, so there is a huge industry based around java code

You're kidding, right? You do realize that pretty much all packaged software by nearly all Linux distros are dynamically linked?

Yes, and?

Let me guess - Spain?

>an actress will be in a movie, but she won't be a movie
What about an employee that manages other employees ?

Suppose you have a linguistic database and you need to keep track of which words of which languages derive from which words of other languages. It's a recursive relationship because all the words are in the same table.

Poortulel

I wasn't planning on including producer/director type roles, but I suppose in the case of one of those being a star as well I'd just toss the fk in the other spot

this is in the context of a database of pornos and porn stars; I understand what a recursive relationship is, I just don't see it coming up in this context

"Best" depends on use case.

Recursion schemes are actually useful. Take histomorphisms for instance. If you implement your histomorphism using memoization, you can now automatically memoize any algorithm that follows the histomorphism scheme.

>I just don't see it coming up in this context
pregnant porn?

Why are Cniles jealous of Rust?

clojure.org/community/success_stories

And Rust is just not going to fit into that ecosystem if it's designed that way. Package maintainers don't want to have to recompile 500 packages because 1 fundamental library they all depend on got updated.

People fucking hate C++ but no one can come up with a suitable replacement and it pisses people off. A lot of people get annoyed with C as well, but the same applies. So many failed C-killers out there.
I think COBOL was intended to be a language to teach business people to write programs, so it was never a serious contender to C. FORTRAN I think was one of the languages that C supplanted. The closest thing to a legit alternative to C out there is probably Ada, but that ended up being restricted to the Department of Defense bubble. Pascal was also historically considered a serious alternative to C, but it died for various reasons. A lot of those anti-C essays were probably written by Pascalbois.

>poortulel

This country still exists

>wget clojure.org/community/failed_attempts
2019-6-20 16:45:43 ERROR 404: Not Found.

But they already do.

why wouldn't it? it's one the oldest in Europe

they're not gonna host your bio, user

No failed attempts? I wish

based portugese ally

i'm actually from poortugal