/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Other urls found in this thread:

admissions.nd.edu/discover/cost-financial-aid/
github.com/nikomatsakis/rust-memory-model
github.com/rust-lang/rfcs/pull/2094
rust-lang.org/en-US/
cppcms.com/
webtoolkit.eu/wt
learnbchs.org/
mcgill.ca/mentalhealth/appointments
lix.polytechnique.fr/~dale/lolli/
twitter.com/SFWRedditVideos

Quit your job and make an indie game

how am I supposed to eat, drink and buy fancy clothes without a job tho

actually really want to do this but I need to survive desu

Please post an anime image next time.

It'll be worth it in the end, didn't you see the Indie Game movie?

Or you can suck my cock for money

>tfw 300k in school debt

i wish i was black so i could have gotten it free

just make a game people want to play
problem solved friendo

How is that possible?

admissions.nd.edu/discover/cost-financial-aid/

What happens to an American who doesn't pay his school debt?

He wrote Mongrel, the Hard Way tutorials, Rails is a Ghetto and the Programming Motherfucker. Dude's the baddest motherfucker in the scene bad enough to diss K&R's faggot C strings.

C strings actually suck though, they're a cute hack for shitty systems that was taken too far.

Can't you just file for bankruptcy, basically getting the education for free?

get a phD in math.

it's 300k starting.

Why? Aren't whites are superior? The superior race should have no problem with it because they work

they pass laws so it stays with you
i think fleeing to another country is the only way

I like haskell, it makes me feel sexual things.

> tfw you can copy directly from your number theory textbook into your code editor

golomb :: Integer -> Integer
golomb n | n == 1 = 1 -- a(1) = 1 by definition
golomb n = 1 + (golomb (n - (golomb (golomb (n - 1) ) ) ) )

why is there still not a strict description of rust's semantics or memory model? is this the power of the sjw language?

What do you think I'm doing?

Student loans are special albatrosses. You cannot get out of them from bankruptcy. It's known that almost everyone who takes student loans will go bankrupt so it's baked into the system that you can't shake them off through bankruptcy.

>300k
How the fuck is that even possible? Just how expensive is education for burgercucks?
I left university with $14K (about $10K USD) on my student loan. Granted I didn't put any sort of living costs onto my student loan, and I did have some scholarships.

Give me one reason I should feel bad that Haskell doesn't have dependent types

A Rust program's memory consists of a static set of items and a heap. Immutable portions of the heap may be safely shared between threads, mutable portions may not be safely shared, but several mechanisms for effectively-safe sharing of mutable values, built on unsafe code but enforcing a safe locking discipline, exist in the standard library.

Allocations in the stack consist of variables, and allocations in the heap consist of boxes.
The items of a program are those functions, modules and types that have their value calculated at compile-time and stored uniquely in the memory image of the rust process. Items are neither dynamically allocated nor freed.

The heap is a general term that describes boxes. The lifetime of an allocation in the heap depends on the lifetime of the box values pointing to it. Since box values may themselves be passed in and out of frames, or stored in the heap, heap allocations may outlive the frame they are allocated within. An allocation in the heap is guaranteed to reside at a single location in the heap for the whole lifetime of the allocation - it will never be relocated as a result of moving a box value. When a stack frame is exited, its local allocations are all released, and its references to boxes are dropped.

Can a C beginner read "Structure and interpretation of computer programs" ? It looks quite interesting.

>I like haskell
same desu. Which textbook? niven/zuckerman/montgomery was a letdown

A variable is a component of a stack frame, either a named function parameter, an anonymous temporary, or a named local variable.

A local variable (or stack-local allocation) holds a value directly, allocated within the stack's memory. The value is a part of the stack frame.

Local variables are immutable unless declared otherwise. For example: let mut x = ....

Function parameters are immutable unless declared with mut. The mut keyword applies only to the following parameter. For example: |mut x, y| and fn f(mut x: Box, y: Box) declare one mutable variable x and one immutable variable y.

Methods that take either self or Box can optionally place them in a mutable variable by prefixing them with mut (similar to regular arguments). For example:

trait Changer: Sized {
fn change(mut self) {}
fn modify(mut self: Box) {}
}

Local variables are not initialized when allocated. Instead, the entire frame worth of local variables are allocated, on frame-entry, in an uninitialized state. Subsequent statements within a function may or may not initialize the local variables. Local variables can be used only after they have been initialized; this is enforced by the compiler.

You shoud feel good, now you can win arguments on Sup Forums against Haskell programmers simply by uttering the word "Agda"

I don't think he was asking you to explain it, he's looking for an official model of Rust's semantics that is supported by the compiler etc.

not even scratching the surface of what a description of a memory model should be

yes. it's for complete beginners

no, its basically impossible to bankrupt on student loans unless you literally get terminal cancer or something AND your cosigner dies prior to them coming after them. your bankruptsy claim will get turned down and then youll be even more in the hole than you already were (court fees are expensive)

if you don't pay your student loans theyll come after your cosigner (normally your parents) and then start taking the money directly from yours and the cosigners paycheck (garnishing wages). student loans are attached to the government so they can literally sue you and you cant really recover from that. your credit score is gone, your social security number is basically tied to a dead man who will never be able to get a loan for a house, car, etc as long as you live

generally speaking though, if they go through your (and your cosigners) income and see you literally cant ever pay it off they're normally very willing to extend your loan period to hilariously long periods. i have a friend that went to the university of michigan and then paralyzed himself after jumping from a boat into a shallow lake. he took his loans through a credit union and they currently have him on a 78 year repayment plan since he can't work any reasonable job

It's really really fucking expensive. Really, really fucking expensive.

I'm going to a state school and my tuition is 17k a year. Out of state tuition easily go to 45k a year. Thank god I got a full ride.

I feel really bad for brainlets. It's not right how much money school costs. College here is a total scam and combined with student loans a modern form of slavery desu.

github.com/nikomatsakis/rust-memory-model

how do I git gud on C? I thought about buying C Programming: A Modern Approach but that shit's expensive and the scans I found are shit

>A crucial part (but not the only part) of these guidelines is a "memory model" that tries to define what kind of aliasing and accesses unsafe code can perform (this in turn implies limitations on the transformations and optimizations the compiler can do). We're still in the 'data gathering' stage of this effort
>We're still in the 'data gathering' stage of this effort
you're really making me think here

get rid of the guard, replace first line with second
golomb n | n == 1 = 1
golomb 1 = 1

also fix your parens
>inb4 reformed lispfag

We conjure the spirits of the computer with our spells

Rust just had an RFC to basically change completely how lifetimes work. Rust is going to forever be in development stage, which means they don't need to formalize anything because it's all subject to change

Source? And what are the chances that it'll get adopted?

Awesome! Thanks!

wow, that's great. just what a language that brags about its "safeness" needs

What are you thinking?

>How the fuck is that even possible? Just how expensive is education for burgercucks?

Depends on where you to go school. Some schools can easily be 30k+ a year not counting housing, especially since most schools will jack up the price for out of state tuition. Factor in housing and other costs? 50k+ is easily possible.

The cheapest you can probably go is close to 10k a year.

github.com/rust-lang/rfcs/pull/2094

Not sure what the chances are, but this PR is written by the same person as which means they are probably a huge Rust contributor.

why is there still not a strict description of rust's semantics or memory model, let alone an official one?

Hard book though. Prepare to get the wind knocked out of you. Part of the reason it's so popular on Sup Forums is because it's so fuckin' hard that completing it gives you the right be a smug weenie. Remember that it was used for a weedout class at MIT.

You don't need the guard in the first clause: just write 'golomb 1 = 1'. And there are too many parentheses, consider using '$'.

>github.com/rust-lang/rfcs/pull/2094
That's actually pretty nice. I also think they are not going to break backwards compat

The link I gave should explain the most of it,

HtDP is for beginners, try it
den sicp

Damn that's fucking brutal

And what a young man supposed to do? Land a job out of college to pay this shit?

>I also think they are not going to break backwards compat
Sure but this would require different models and proofs for the soundness of the type system

2bh they should come up with nice syntax sugars. like String construction in one line etc

>safe language
>permanently "in development"
>no formal standards
>core changes to fundamental language concepts
Jesus.

The chapters of "Concrete Mathematics" about recurrences and number theory

>We're still in the 'data gathering' stage of this effort
no. it's unbelievable that a language that claims to be groundbreakingly safe hasn't sorted this out yet

Most languages are permanently in development

>that claims to be groundbreakingly safe
I don't know about that. Rust is only 2 years old so it certainly doesn't have a mature ecosystem like C, which is like 23 times older than Rust

Sounds like a better plan to read HtDP before SiCp. I shouldn't bite more than I can chew. Thanks for the tips, anons.

Why not web development with C++?
OKcupid is written in C++ too.

C++ is a substandard language that's why

rust-lang.org/en-US/
it says right on their homepage "guaranteed memory safety" (which is a ridiculous statement anyway)
one of the main goals of rust from the start was that it was supposed to be super safe

Productivity is critical in webdev afaik. So massive redflag for C++, unless you have hundreds of drones working for you

It kinda is safer in comparison

cppcms.com/
webtoolkit.eu/wt
learnbchs.org/ (C thou)

Try them, then report back to us

>matching over iterator
hmm, new trick learned. Thanks user.

If you're in the know you can go to community college for the first two years and transfer to a real college. It almost cuts student loans in half since community colleges are actually affordable (~$700 a semester) but looked down upon and a lot of people don't properly consider them as options. They never really talked about community colleges as options at my school and community colleges advertise themselves to adults, not high schoolers. Most of the people at community colleges are adults too.

Technical schools are also way, way cheaper but you'll be looked down upon for being a construction foreman or a welder.

If you have student loans, you have to land a job out of college. If you don't they'll ruin your parent's lives too as they'll start tithe-and-a-half-ing your parents for 15%. I think suicide doesn't liberate your parents of the obligation either so you can't be Japanese about the issue.

>my other car is a cdr

All a c string is is an array of bytes with one byte reserved as the "end of array" byte.

> DUDE having a block of memory with a 1 byte "end" code is a cute hack C should have overloaded operators for strings LMAO

You must have no idea what a computer even is, like a lowly negro ignorantly swinging on a vine through the jungles of Africa.

> Lost In Stupid Parentheses

my other car is a cadr. cdr isn't a car at all.

>You must have no idea what a computer even is, like a lowly negro ignorantly swinging on a vine through the jungles of Africa.
Amazing

Reminder that the reason ADTs are better than classes is because the whole idea of a class or other kind of opaque data type is that you are coming up with a new type from scratch to store instances of your concept which is a huge waste of effort when you have ADTs which let you say that if you had a dedicated type to store instances of your concept then that type would just be an instance of some existing kind because the kinds and the way they interact cover all bases because that is the true nature of what it means to have an expressive type system

>You must have no idea what a computer even is, like a lowly negro ignorantly swinging on a vine through the jungles of Africa.
There is nothing lowly or ignorant about swinging on vines

eli5 why


this.value = this.value++

is not the same as


this.value = this.value + 1

delete this

>eli5

this.value = 1;
printf("%d", this.value + 1); // 1
printf("%d", this.value); // 2

this.value = 1;
printf("%d", thisvalue + 1); 2

Is this JavaScript? Also, wouldn't it suffice to just write

this.value++

Just use Python instead, user. Save yourself the trouble.

this.value = 1;
printf("%d", this.value++); // 1
printf("%d", this.value); // 2

this.value = 1;
printf("%d", thisvalue + 1); 2


I fucked the code up.

>this.
>this
>.
opinion discarded

>discarded
stopped reading there

>there

i will read no further

Your revolution is over, Mr. Church. Condolences. The FPers lost. My advice is to do what your parents did; learn java, sir.

...

>this

...

except now I'm realizing that ADTs can be implemented in OOPs so now I am not so proud of my clever post, and am feeling quite the fool

lol you misinformed prick. Affirmative action doesn't give minorities free school, it gives them higher acceptance rate so they can drop out and have more debt.

but most of them graduate ?

But user, they get swayed by token scholarships so they think they're getting something when in reality they aren't. It makes Mephistopheles seem kind.

The fact is that user was going to college anyway, so it would have been better for him to be black. A black man in his state is still fucked, but less so than user, even if only slightly less.

I identify as asian/anime

mcgill.ca/mentalhealth/appointments

>What do you think I'm doing?
posting on /dpt/

lix.polytechnique.fr/~dale/lolli/
>loli programming language is real

average cost of 4 years of college is 100k USD

that's what makes it ENTERPRISE SOFTWARE buy it goyim

>land of the free

That's fun and all, but please remember efficiency matters. Maybe not right now, but learn to write good Haskell because most abstractions don't come for free.

is there a C linkage cheat sheet? I want to know what kind of stuff can be accessed from different files after the linkage process.

eg.
enums disappear in the linkage, you can't use enums from different source files.
you can use functions from different source files if their prototypes are declared and they aren't static.

/dpt/, what is the most readable language specification and why is it R5RS?