/dpt/ - Daily Programming Thread

old thread: What are you working on, Sup Forums?

Other urls found in this thread:

en.cppreference.com/w/cpp/utility/functional/mem_fn
youtube.com/watch?v=oUzXEV5qigQ
codeyarns.com/2012/01/10/c-static-class-definition/
twitter.com/SFWRedditVideos

FIRST4TRAPS!

Second for D

Just finished all my exams.

AMAA about theoretical computer science, cause I'm at the height of my understanding right now and it's all downhill from here lol

ye

please stop the anime cancer on this board

kys

You have been visited by the crossdressing C programmer of Shimoshina Academy!

Good performance, triple indirection, and tail call optimization will come to you, but only if you post "Keep overflowing the stack, Hime!" in this thread.

MOOOODS!
JUST BAN THIS SHITTER ALREADY!

KEEP OVERFLOWING THE STACK, HIME!

Now that exams are over I'm going to start working on my HDL again. And maybe write some simple networked game.

nth for coq

I'm sure on reddit, you would already have 3 automated bots responding to you about how your mod request has already been received and how your little feelings are special and deserve to be protected.

Stop posting this shit every thread.

>desperation

Listen, man, try to contribute something productive to this thread.

Does anyone know of any languages/projects that compile to Haskell? I know there are compilers that translate Haskell to JS, but that's the other direction.

kys

kys

kys

SUCK IT FAGGOT!

Does writing NSIS scripts count as programming? Because that's what I'm doing right now.

kys

>mental illness
you should seek help tho

Thinking about how to deal with reporting errors in my language's compiler.

The issue is that the language is written in a high-level form, which is then elaborated down to a core theory before doing type checking. So errors at the type checking stage that want to report the problematic code will print terms of the core theory, not what the user is expecting to see.

For example, the high-level data type of natural numbers could be encoded in the core theory as a W-type:
-- written
data Nat : Set where
zero : Nat
succ : Nat -> Nat

-- elaborated
Nat : Set
Nat = W Bool \{ff => Empty; tt => Unit}
zero : Nat
zero = sup ff \{}
succ : Nat -> Nat
succ m = sup tt \{tt => m}


I'm sure the user would rather see that a value wasn't of type "Nat" rather than "W Bool \{ff => Empty; tt => Unit}". This will be tricky.

What would be the point of compiling to Haskell? JS is basically the assembly of the web, so it makes sense to go the other way.

>contriboot something productive
>animuuuuuuuuuuuuuuuuuuuu

>assembly of the web
End you're self!

Like it or not.

>assembly of the weeaboo
ftfy

Which programming languages are going to be the top 5 languages in 2020?

I'm just curious. Sometimes people make DSLs which happen to build into a language they're familiar in. Haskell developers tend to be the type that more often understand parsers compiler theory and such, so I thought it would be interesting if I could find at least one example.

Yeah, it's a fact of life whether you like JS or not. He's going to get banned soon enough, don't worry.

Anime babies should just leave Sup Forums.

Honestly, just kill yourself; you can't even program, why are you here?

parsers and*

>soon™
ZEN
E
N

Java
C
C++
C#
D

>it's a fact of life
Is JS really going to stay this ubiquitous?

Why is there no competition?

>animooooooooooooooooo
>mental illness
>muh degeneracy
honestly, can you even average 2 ints?

>no javascript
>D

C
Javascript
C++
Java
C#

In that order.

kys

Javascript
Coffeescript
Clojurescript
Go
ScalaJS

Why are you responding to him?

People like that thrive off of the negative attention. They want to be the counterculture for the smug points.

Just let them tucket themselves out with all the kicking and screaming.

>Haskell developers tend to be the type that more often understand parsers compiler theory and such

That's rich.

int avg(int a, int b)
{
return ((a + b) / 2);
}

>tucket
tucker

Although, tucket should be a word for something.

>Let's just enjoy our mental illness
user...

nao u've dun it m8

>Haskell developers tend to be the type that more often understand parsers compiler theory and such

What if I wanted it to be exponentially smoothed average?

animeshits should off themselves

>what is integer overflow

is it anime?

Question 1:
Write a function to calculate an estimated size of one's penis by programmatically utilizing online sources of your choice.

This estimate should be based on two given inputs: race and height.

The biggest problem is the difficulty to debug translated code which has more than an arm's length difference from JS. Source maps are getting better over time though, and in languages similar enough to JS you can just debug your non-JS code in the browser as if it were JS. But still, even in a language like Coffeescript, which bases its entire type system and model for functions on JS, debugging can be a pain when things go wrong (especially in a poor environment like Safari). Then you have to look at the actual JS it generates and it's terrible.

The most versatile competition that isn't just a wrapper for JS is Emscripten, which ironically results in the most garbled horrific JS you'll ever see. Emscripten is so accurate though that when you debug, so long as you're not debugging the border between your code and browser APIs, you might as well just run the C++ natively and debug it there.

The downside? Emscripten also results extremely large JS files (used to be a lot worse), and sometimes getting things to be interoperable is a pain. For example, to make a game loop, you need to use a special setup to play nicely with JS's asynchronicity (you can't just sleep, that'd hang the browser window if it existed). Emscripten has been making leaps and bounds over time, though.

Hope this answers your question robustly. Also, bonus skirt image.

public float psize (into race, into height) {
return Math.random()*8;
}

How have I fucked up. Errors aren't explaining shit to me/I'm retarded
pic related

So something like Apache Cordova runs on Node.js, and Node.js is just a wrapper for Javascript?

Is the entire internet just Javascript wrappers at this point?

0/10, no APIs.

My boss caught me sleeping on the job again. This coding job literally pulls me to sleep. He wasn't too made since my work was done but fuck. How can I make C interesting?

More pointers

std::thread t1(&TestingObject::graphics, this);

More mental illness

triple redirection!

I think you need to do &TestingObject::graphics but I rarely use C++ so just try it and see

Cordova doesn't use Node.js. It actually uses the JS environment of whatever browser it has available. But yeah, the JS world is a total mess of libraries abstracting each other at this point.

It's probably not C that's the problem, it's what you're being asked to do.

>indirection

>C interesting
C is tedious. That's like asking how to make shelf-stocking in a hardware store interesting.

I mean, yeah, you could use a forklift as a skateboard and have lightsaber fights with flourescent tube light bulbs nigger-rigged to 9-volt batteries. But then people look at you funny and you might get fired anyway.

Hey gee, can you average 2 numbers?
Let's make /dpt/ great again (none of this anime trapshit)!

>C is tedious
>I'm below average

#include
i dont know what im doing help

Thanks that worked

If you C is that tedious, consider writing a C code generator in a higher level language to do the work for you.

Yo dawg, I herd you like to program...

C is tedious, there's no way around that.

By definition you need "this" to be passed to t1 in order for your method to execute, just "graphics" with no explicit receiver won't work. For a way to do this, either use a lambda or something like en.cppreference.com/w/cpp/utility/functional/mem_fn with a bind.

C is tedious, though. Makes no difference whether you are competent.

Maybe for the incompetent.

Do you know what tedious means?

Wait, ignore, that guy is right, the constructor of thread can manage it.

>tedious tho
>trust me, I'm one of the incompetents

Do you?

It doesn't mean "difficult", that's for sure.

There's no this, it's a static class man

Putting "static" before a class declaration doesn't do anything in C++.

>I don't actually know but it sure ain't anime

>static class man
wew laddie

graphics() has to be static too in order to do

std::thread t1(graphics);


(I think?)

Not an argument.

>DELETE THIS
I didn't mean to offend you.

Oh, oops. I was thinking like he had put static before the member functions. My bad.

solution found, ty anyway
here:

Still not an argument.

gulp vs grunt vs bower: go!

>gulp vs grunt vs bower
One of these things is not like the others.

youtube.com/watch?v=oUzXEV5qigQ

standard rectilinear projection is no good when the viewer is far away or the screen is too small! it's why console games have such narrow fov. in this video with just 120 fov everything is distorted like crazy and the things you focus on in the center of the screen are tiny unless you view it in full screen and sit very close to the monitor

>I'm the real webshit
o-ok

why does that girl have a bulge in her pants?

>unless you view it in full screen and sit very close to the monitor

Well, that's sort of the point. People who play PC games are generally playing them in fullscreen and are sitting close to the monitor.

yes but imo it's not the optimal solution in all situations for example mobile games

she's a programmer

>mobile games
please

I usually shoot for ~130 FoV on my 21:9 35" ultrawide that I sit right in front of.

You wouldn't use that FoV on a narrower screen you're setting far away from.

>it's not the optimal solution in all situations
Who said that it was the optimal solution?

I don't understand why you're in /dpt/ posting about this.

sorry i forgot this is the steam greenlight only unity babby thread

>mobile baby
user...

>unity babby
kid...

...

why should i use enums instead of
#define WAIT 0
#define CALL 1
etc

Furthermore.

This sounds like a reasonable assessment. Maybe Python in there somewhere.

assert(avg(INT_MAX, INT_MAX) == INT_MAX);

Get a better sleep schedule. If you have your programming done at work and you still have time, there's always still work to do. Run it through rigorous tests. Help your coworkers with anything they're having difficulty with. Ask your boss if he has any more work to do. You want to get a promotion to a job you might enjoy more, show your boss that you won't be the kind to sleep on the job, but instead, take action without being told he needs to.

>static class TestingObject

This isn't a thing in C++. The only reason C++ allows the keyword static before the keyword class is to allow you to create a static object of that class in the same statement as creating the class.

codeyarns.com/2012/01/10/c-static-class-definition/

So remove the static keyword. It's an eyesore, and it makes you look like you're a retard trying to write C# in C++.

can't see shit captain
can't look around easily because shit controls captain

Okay.