/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread:

Other urls found in this thread:

time.com/4636953/wikileaks-chelsea-manning-julian-assange/
independent.co.uk/life-style/gadgets-and-tech/news/julian-assange-barack-obama-pardon-chelsea-manning-to-make-life-hard-commute-sentence-wikileaks-us-a7542896.html
twitter.com/NSFWRedditVideo

C++ is the most powerful programming language.

C++ is the liquid feces that comes out of your ass after eating spicy food that expired a month ago.

how do i make it more qt
"Choose an option" println
"1. Rock" println
"2. Paper" println
"3. Scissors" println

rand 3 %
getln 1 -
- 3 %
dup 0 = "You have tied!" "" ifelse swap
dup 1 = "You have lost!" "" ifelse swap
2 = "You have won!" "" ifelse swap
print print println

C++ is for indian brainlets that can't use C.

Shit

Killing myself because the network and OS module at Uni is way over my head.

Is that thing male or female?

13 rupees and a plate of curry has been deposited to your Microsoft Visual C++ shilling account, pajeet. Thanks for your service and keep doing the needful.

Yes

Garbage

Or a rusty trombone eh Chelsea?
Eh?

Fuck off

i figured it out anyway lol have fun with your rust faggotry

brainlet

nerd

how do i make sense of this? i'm expecting it to do (i

Why c-fags and rustfags fighting each other instead both converting their userbases to python?

(i

trolled hard, made you go through the inconvenience of reposting it

Both C and Rust are not very good.

Crust is pretty good tho

So is RustC

stop posting

...

Anyone here played Shenzhen.IO?

...

Great shitposting, faggot

shut up

Nonfree

I have difficulties understand algorithms I wrote 1 month ago.

I have to slowly work through like if someone else wrote it


is this normal?

how do i make sense of this? i'm expecting it to do (i

It's fun.

>is this normal
Yes. This is why you structure your code well and comment things that are potentially ambiguous. Use good names for variables and functions too.

Also if it's a big project, write documentation. A description of modules, functions etc, with a description of what they do, where they are used, what data goes in, what comes out.

Why not do the real thing?

I'm just too tired right now but it needs to be done
slice[1]=largeArray[i-2]
slice[2]=largeArray[i-1]
slice[3]=largeArray[i-0]
slice[4]=largeArray[i+1]
slice[5]=largeArray[i+2]

How do I produce this for a generic range of the large array, if it'd go out of bounds for either side just repeat the last valid value (i.e. index largeArray[clamp(0,maxIndex, i)])

I've played with wolfram alpha in substitute for a brain but I can't figure it out.

Hey /dpt/, I'm looking for an introduction book to compilers. Any recommendations?

>last valid value
closist valid index, jsus

please respond

It's good practice either way and artificial constraints can force you to learn how to be more efficient.

The dragon one.

The shifts are in the asl part of the add/mov instructions.

dragon book

Wew.

rust is reddit: the programming language

Man I don't care if Rust is good or not, I refuse to deal with its syntax. I really like the concepts too which is a bummer, there has to be a better way.

>It's good practice either way and artificial constraints can force you to learn how to be more efficient.
I'm not convinced. It's the same as learning how to play guitar with the game RockSmith.

Where asl is probably arithmetic shift left. Find a doc for whatever isa you're using.

Taking a python for networking class on Udemy. Well rounded and all that

It's just
int count=5
int modifier=-count/2
for (int i=0;i

What language is Sup Forums: the programming language?

lisp

which parts of its syntax do you dislike?

fn

>escapist refuge for edgy teenagers and antisocial unemployed autists
Looks about right.

Does DPT include HDLs? Trying to keep my Verilog skills up over summer break but I'm not sure what to make.

I need more than just odd values. In the case of non-odd values it needs to be biased towards the bottom.
slice[1]=largeArray[i-2]
slice[2]=largeArray[i-1]
slice[3]=largeArray[i-0]
slice[4]=largeArray[i+1]

Lisp is love, Lisp is life.

clojure is highest paid language on avg
I dislike lisp too but i wouldnt lie about it

Get a load of this faggot who hasn't even read SICP.

Most of it to be honest, and there's all that unwrapping and their choices of symbols. What I do like it just what they get from C and what I don't like is everything else which is everything that makes rust, rust.

You're entitled to your opinion but I'm curious if you've tried it, your answer will effect my opinion of you but there's no need to go beyond just your response.

Unwrapping has nothing to do with syntax.
>everything that makes rust, rust
Type system and borrow checker make rust rust, not syntax.

hello there reddit

The syntax is what makes up every language, it's legitimately the thing you read and write, I feel like it's the most important thing if you expect humans to write it, if I don't like the syntax I can't like the language, sorry.

You sound like an edgy teenager.

Has anyone here written a compiler?
I've just finished a very simple one from a C based language to some assembly for a VM I made and I'm about to start w/ output optimisation.

Any tips for me?

all programming games look fucking dumb

get a girlfriend

I've heard LLVM is really good.

Read the dragon book.

I'm 24, I'll be 25 in July. I think I'm more boring and practical than I am edgy although I guess at times I probably can be. I don't know where you're getting that though or how it relates.

I was just curious if you had tried it or not, I think it's unfair to cast something aside as a toy and say it's not valuable for educational purposes if you've not even tried it. The similarities between the fake thing and the real thing are good enough for a beginner but regardless they're fun exercises either way that can be refreshing compared to real tasks, not to mention the tasks are assigned so you don't have to come up with something yourself and you don't have to buy the parts.

That piece of shit is so outdated it's not even funny, and it spend so much goddamn time focusing on parsing when that shit is so easily done with the bajillion tools there are.

>The syntax is what makes up every language
lmao

>using shitty tools for parsing
"no"
If you do not know the theory behind parsing and decide to use a shitty library instead then you should kys.

>that shit is so easily done with the bajillion tools there are
this is how I know you're retarded. why even bother writing one then?

i thought it was in prison now. why is it allowed to tweet?

I haven't tried it and I'll never try it.
Why would I bother with a simulator? I don't need stimulation from a video game in order to program.

obama released it after assange said he would turn himself in in exchange for its release

You still need to know the theory to use any kind of parser generator or combinatoric parser, and the dragon book is not a good source to learn that.

The point of writing a compiler is not to waste your time on hand-writing your parser.

What's the issue? At the end of the day the code you're writing is what is syntactically valid in the language, nothing else defines a language more than the syntax.

He got out.

Read Modern Compiler Implementation in ML, Engineering a Compiler, Second Edition and Compiling with Continuations.

why are you telling all programming beginners to kill themselves
do you not realize people die of old age? if all the beginners die before their time, the discipline itself dies with them, because everyone better and more experienced than them will also eventually die

You sound like an edgy teenager.

False, Obama released him before leaving.

He clearly already has the language parsing you fucking script kiddies.

>non-free software
no u

lol?

Can you please stop using Sup Forums, it's proprietary.

False

obama has no respect for justice

>taking >use the book< seriously

I still don't get you. If you want to learn assembly, read a book and do exercises.

C is only a typed assembly with UB everywhere, everyone can use it.

The tranny did nothing wrong.

when you have an if statement with three pretty long conditions is it good practice to split it into two if statements for readability?

>done with the bajillion tools there are
LALR parsers have terrible error messages. Most compilers that are trying to be taken seriously use hand-written recursive decent parsers.

time.com/4636953/wikileaks-chelsea-manning-julian-assange/
independent.co.uk/life-style/gadgets-and-tech/news/julian-assange-barack-obama-pardon-chelsea-manning-to-make-life-hard-commute-sentence-wikileaks-us-a7542896.html

what reason would obama have to release him other than to virtue signal to sjw transfags

no

what do you do? just three statements over 3 lines?