[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 327
Thread images: 46

File: 1480235335939.png (503KB, 940x822px) Image search: [Google]
1480235335939.png
503KB, 940x822px
Old thread >>57717232

Official Discord channel: https://discord.gg/xcVHA2Y

What are you working on, /g/?
>>
nothing but thanks for asking
>>
>>57722586
I'M THE QUEEEEEEEEN
QUEEN OF THE RODEO
>>
>>57722586
learning clojure for great good
>>
Most popular posts from previous thread:
>>57720873
>>57717756
>>57717384
>>57717275
>>57721543
>>57721188
>>57721687
>>57720100
>>57720014
>>57722528

var posts = Array.from(document.querySelectorAll(".replyContainer"));
posts.forEach(element => {
element.popularity = element.querySelectorAll(".backlink a").length;
});
console.log(posts.sort((a, b) => b.popularity - a.popularity).slice(0, 10).map(element => ">>" + element.id.slice(2)).join("\n"));
>>
40 years from now, you will be dissappointements.
>>
>>57722667
Well, I'll be close to retirement, so doesn't matter much to me
>>
>>57722667
>Implying I not one already
nice try faggot
>>
>>57722678
doesn't it feel weird.
in the future, you will not have changed
you will have only made people close to you more dissapointed in you.
>>
>depressed
>haven't felt joy in over a year
>want to program because it's my preferred career and I'm just wasting time now
What do? How do I force myself to program and not just read /dpt/ and or watch programming livestreams all the time?
>>
>>57722652
Jesus, fix your font rendering.
>>
>>57722716
>fix
Maybe they prefer fit that way?
>>
>>57722713
don't try, it will be for nothing.
embrace your state
>>
>>57722693
>in the future, you will not have changed
But I will change, I'll just be a older more mature kind of disappointment.
>>
>>57722736
>embrace the state
Nice try anon but I'm not gonna support tyranny just because I feel bad.
>>
how do I find the perfect data type(s) to do a problem?

when is it appropriate to classify data and methods together?
>>
type bit =
| Zero
| One
;;

type num = bit list;;

let add_bits a b c =
let ones =
List.fold_left
(fun count ->
function
| Zero -> count
| One -> succ count)
0
[a; b; c] in
match ones with
| 0 -> Zero, Zero
| 1 -> Zero, One
| 2 -> One, Zero
| 3 -> One, One
| _ -> assert false
;;

let add (a : num) (b : num) : num =
let rec loop accu c a b =
match a, b with
| [], [] ->
begin
match c with
| Zero -> List.rev accu
| One -> List.rev (One :: accu)
end
| [], b1 :: b ->
let c, d = add_bits Zero b1 c in
loop (d :: accu) c [] b
| a1 :: a, [] ->
let c, d = add_bits a1 Zero c in
loop (d :: accu) c a []
| a1 :: a, b1 :: b ->
let c, d = add_bits a1 b1 c in
loop (d :: accu) c a b in
loop [] Zero a b
;;

let of_int n =
let rec loop accu i = function
| 0 -> accu
| n ->
let accu = if n mod 2 = 0 then accu else add accu i in
loop accu (add i i) (n / 2) in
loop [] [One] n
;;
>>
>>57722784
i made a text only, turn based rpg engine in java without using any external libraries. took a couple months but i didn't work on it that much
>>
Continuations make me moist.
>>
>>57722812
No, the C way is to keep things simple (I mean really simple, not hiding complexity behind abstraction).
This won't do with Java.
>>
>>57722864
writing everything from scratch is the c way
>>
can somebody walk me through the state monad, its constructors, how it's implemented
teach me like I'm retarded.
>>
>>57722864
>not hiding complexity behind abstraction
>compiler optimises your code in whatever way it likes so that the output assembly may look unrecognisable
This meme has to end
>>
>>57722626
I'm in this list
>>
File: 1480266417485.jpg (20KB, 210x240px) Image search: [Google]
1480266417485.jpg
20KB, 210x240px
post a screen shot of the last code you wrote
>>
File: SOS.png (47KB, 666x662px) Image search: [Google]
SOS.png
47KB, 666x662px
I have an array of structs in c. In the array there are 198 structs. The structs are seperated into rounds which there are 33 of, in each round there are 6 games, hence the 198 scructs. How do I add the 6 scores of the 6 games together, and check if they are less than 10 for each round? pic related, the round is the Rx and the score is the y - z.
>>
>>57722968
why are you still here
have you made any progress?
>>
>>57722984
what you mean

i just wanna see what people are doing

pls no bully
>>
File: last.png (154KB, 1920x1080px) Image search: [Google]
last.png
154KB, 1920x1080px
>>57722968
>>
>>57722713
>Think what type of game/program you want to make, or what area of programming looks fun to you
>Find which language is best suited for that
>Start with hello world tutorials
>Learn the basics
>Think of a hard-but-possible project
>Work towards it

Working on my second real program, and I'm simulating particles and shit. It's super fun, come and join the cool club anon, close those livestreams
>>
>>57723004
what are you doing here?
have you made progress?
>>
>>57723011
upload a binary of cancer
>>
>>57723011

why tho
>>
>>57723011
dark like my asshole
>>
File: 1480155652479.jpg (29KB, 320x322px) Image search: [Google]
1480155652479.jpg
29KB, 320x322px
>android developer at apple
>ios developer at google
>>
>>57723059
Sounds too hard, it depends on too many system libraries that cannot be compiled in statically.

>>57723066
Why support macOS? Because I can.

>>57723096
How is it being black?
>>
>>57723135
how many years of experience does one need to have to write something like that?

sounds hard as fuck
>>
>>57723019
The thing is I'm not an inexperienced programmer. The explorations I have to do for learning purposes is very effort intensive stuff like understanding when and where I'm going wrong before its obvious.

But when you can't really see any payoff from any of your work _at all_ you're just not built to continue. I've decided to simply not have 'fun' (watching the livestreams or /dpt/) and just focus on bare essentials like workout, food and sleep. Even then, when I sit an entire day with code against my desires my mind just wonders. I forget where I was and keep repeating myself. It's not productive.

It's desperate to ask on /dpt/ but I don't see a good way out.
>>
File: Screenshot_20161127_181030.png (15KB, 925x727px) Image search: [Google]
Screenshot_20161127_181030.png
15KB, 925x727px
>>57722968
>>
>>57723253
Fuck off Linus
>>
>>57723166
I don't know, I just decided I needed a better terminal, so I made one.
>>
>tranny who tells people to not learn C
https://youtu.be/YnWhqhNdYyk
I appreciate it. Not because it's a good idea to introduce the many many problems C++ has to new programmers. Or because C++ is a better language.
But because if we don't tell people to learn C first we can keep it to ourselves. People who want to write C after they've learned C++ are obviously good programmers. Makes our waters less muddy. I'm pretty sick of seeing C++ programmers try and build their high-cost abstractions into C.
Also her thumbnail slide is wrong. The idea of acting like C is a subset of C++ you can learn and then 'add on' C++ is a plainly terrible idea because of how divergent they are. Especially in optimal style.
If you're writing C++ with the aim of writing it like C but you 'just want to use templates' or whatever that's just a recipe for failure.
>>
>>57723310
that doesn't answer his question
>>
>>57723331
you're giving him attention, so jokes on you
>>
>>57723343
What? You clearly didn't read my post. I would love it if this was the most popular Cpp con talk for that year.
>>
>>57723176
Isn't money a motivator?

From the current game I'm working on I plan on making enough money to live on (£10 a day).

I then plan on continuing this neural network I'm working on, and making myself an AI gf inside a platformer that I also want to make. We will explore the world together and defend each other from enemies
>>
All local variables are destroyed once you leave the method, even objects and arrays right?
>>
>>57722923
newtype State s a = State { runState :: s -> (s, a) }

This says that any value of State s a is a computation that can modify the state along with producing a value. The newtype is so we can implement type classes and keep things clean.

instance Functor (State s) where
fmap f ma = State $ \s -> let
(s', a) = runState ma s
in (s', f a)

It's trivially a Functor. Running a mapped computation is running the original computation and then transforming the value.

instance Monad (State s) where
return a = State $ \s -> (s, a)
ma >>= k = State $s -> let
(s', a) = runState ma s
in runState (k a) s'

It's also a Monad. I'm omitting the Applicative here but it's easy to derive from Monad. Returning leaves the state intact. Running the computation you get from binding just runs the two computations (where the second may depend on the value of the first) in sequence, chaining the state along.

Aside: with copatterns it would be a lot neater, but Haskell doesn't have them. If you're struggling to write code in this "newtype record function" style, you can write the copattern-matching definitions out first and translate them.
instance Functor (State s) where
runState (fmap f ma) s = let
(s', a) = runState ma s
in (s', f a)

instance Monad (State s) where
runState (return a) s = (s, a)
runState (ma >>= k) s = let
(s', a) = runState ma s
in runState (k a) s'


The key is to think of values of State s a as computations.
>>
>>57723401
probably
>>
>>57723401
Language? Context?
>>
quickest way to generate 30 text files of random length?
>>
>>57723401
In every language I can think of it's a resounding maybe. Either they're garbage collected, in which case they may be used somewhere else and thus not freed, or they're not, in which case it depends if they are RAII or not.
>>
>>57723427
Befunge
Multi-threaded application
>>
>>57723334
Well, I could have done that 5 years ago, or 10 years ago, so the answer would be fairly arbitrary.
>>
>>57723384
>money
Well ignoring how I'm well off already and probably won't see issues with that in at least 20 years its not a motivator for me either way. It simply isn't to someone who has lost the strength to care.
>>57723401
Yes. The stack allocated variables are destroyed (in the sense of RAII or OOP) when you leave the scope (could be method, could just be an arbitrary block).
Heap allocated stuff needs to be explicitly destroyed/freed
>>
>>57723433
Download Gary's Hood autoclicker and hover above notepad
>>
File: file.png (374KB, 500x492px) Image search: [Google]
file.png
374KB, 500x492px
Am I ready for SICP?
I'm not good at programming and looking to expand knowledge.
Don't know how much math is used, but I've only had "Applied Mathematics and statistics" aka Havo mathematics B.

I don't think I'm ready.
>>
>>57723412
Sorry,
State $s -> let ...
should be
State $ \s -> let ...
.
>>
>>57723455
>Well ignoring how I'm well off already
Then i guess it doesn't matter if you procrastinate. Get a girlfriend though.
>>
>>57723433
Depends on platform. Most systems have a good way of multithreaded IO. see epoll on (Unix? Linux?) or iocompletionports on Windows.
So the fastest way would be to ask those API's to open a bunch of new files for you via multiple threads.

But for your purposes I'm assuming just using fopen a bunch of times is good enough.
>>
>>57723433
would be fastest to just copy some content from /dev/urandom 30x in terminal
>>
>>57722586
>Official Discord channel: https://discord.gg/xcVHA2Y

Fuck off with discord.
>>
>>57723485
>gf
Maybe.
But that doesn't sound very fair.
>>
File: 4.png (29KB, 633x758px) Image search: [Google]
4.png
29KB, 633x758px
>>57723543
>tfw /dpt/ has gone all this time without some cunt including links in the OP and some cunt had to ruin the tradition of no links in the OP
>>
File: 1480289514892.png (9KB, 633x758px) Image search: [Google]
1480289514892.png
9KB, 633x758px
>>57723580
your shitty png is now optimized
>>
>>57723467
SICP is like a Walkabout experience in the Outback in Australia. An unique experience by itself.
>>
>>57723547
How so?
>>
>>57723412
hold on, so:
a state is a computation, a mapping form s to (s, a)
why is there a need for the type a, btw

to map over a state (a computation), means to basically do function composition?, like so
f . runState
but why does it only affect the a

can you reccommend any mini projects that use state alot, so I can hammer it down?
>>
>>57723700
I don't want to meet aboriginals.
>>
File: shot4-0.png (816KB, 1279x727px) Image search: [Google]
shot4-0.png
816KB, 1279x727px
val total = elems.length

type C[A] = ContT[concurrent.Task, Step, A]
val result = elems.zipWithIndex.traverse[C, TransformedElem] { case (elem, idx) =>
ContT[concurrent.Task, Step, TransformedElem] { next =>
transform(elem).map { result =>
Step.PublishAndContinue(message(idx + 1, total), next(result))
}
}
}.run(transformed => concurrent.Task.now(Step.Result(transformed.suml)))

concurrent.Task.now(Step.PublishAndContinue(message(0, total), result))


What did she mean by this, /dpt/?
>>
>>57723760
>why is there a need for the type a, btw
The type a is the type of the value the computation produces. Think about most imperative languages, where function returns a value but also can have a side effect. In this case, a computation in the State monad returns a value but can have the effect of modifying the state.

>to map over a state (a computation), means to basically do function composition?
Not exactly. If you map a function over a State computation, what you get is a computation that has the same effect as the original computation but with a function applied to the value.

>but why does it only affect the a
That's all the monad API allows. Here's how you implement a computation that modifies the state.
modify :: (s -> s) -> State s ()
modify f = State $ \s -> (f s, ())


I don't know about anything that uses State in particular, sorry.
>>
I'm trying to learn graphs.

So far I'm trying to initialize my graph but I'm getting segfault.

int startup(digraph *helper, int n_vert){
Vertex u, v;
if(n_vert > MAX)
return 0;

helper->n_vert = n_vert;
helper->n_ares = 0;

for(u = 0; u < helper->n_vert; u++)
for(v = 0; v < helper->n_vert; v++)
helper->Adj[u][v].it_is = 0;

return 1;
}


My for loop is wrong, help me here /dpt/.
>>
>>57723881
>segfault
BITCH WHERE
>>
>>57723881
lrn to valgrind
>>
File: 1476423673787.jpg (68KB, 754x960px) Image search: [Google]
1476423673787.jpg
68KB, 754x960px
For this project, I have to write a java parser. There's only one part that I haven't completed because I don't know how to do it.

The prof wants us to check if all types that are used are valid, with support for importing other files.

How the hell am I supposed to check if a variable is of a type that Java includes? What if the file includes imports to some other part of java that isn't part of the input locus? How can I account for that?

Types for input files are fine but I don't want it chucking unknown type errors when you try to use String or some shit.
>>
>>57723899
>>57723924

here's what I have so far

#include <stdio.h>
#include <stdlib.h>
#define MAX 100
#define Vertex int

struct Adjac{
int it_is;
Vertex edge;
};
typedef struct Adjac adjac;

struct Digraph{
adjac Adj[MAX][MAX];
int n_vert;
int n_edge;
};
typedef struct Digraph digraph;

int startup(digraph *helper, int n_vert){
Vertex u, v;

if(n_vert > MAX)
return 0;

helper->n_vert = n_vert;
helper->n_edge = 0;

for(u = 0; u < helper->n_vert; u++)
for(v = 0; v < helper->n_vert; v++)
helper->Adj[u][v].it_is = 0;

return 1;
}

int main(){
digraph *graph;
startup(graph, 5);
return 0;
}
>>
Why does every general need a discord ffs? I'm sick of this shit. Wish Hiro would filter it already.
>>
code blocks looks fucking gay

i cannot program shit if the IDE looks as gay as this
>>
>>57722968
>>
>>57724047
I think its popular among gaymeshit, so that's why.
>>
>>57723331
Nice talk. I've always been a proponent of "teach C, then C++" but I think I might be convinced otherwise
>>
>>57724026
int main(){
digraph *graph;

digraph *graph; creates a pointer to a digraph. What is it currently pointing to?
>>
>>57724026
when you create the graph in the main function, you have to *ALLOCATE IT*

something like
digraph *graph = malloc(5*sizeof(struct Digraph));
>>
>>57724071
computer graphics?

what does it do?
>>
>>57724127
I would do
digraph graph;
startup(&graph, 5);
>>
wew I fixed it

int main(){
digraph *graph;
graph = (digraph*)malloc(sizeof(digraph));
// ...
}


fuck C is too hard
>>
>>57723870
I see, I'll try to use it so that it clicks one day.
thanks for the explanation, haskell-guru
>>
>>57723809
bumping this

in reality my boss wrote it and I'm trying to understand it
>>
Still working on my compiler.
>>
>>57724155
>expected ‘struct digraph *’ but argument is of type ‘struct digraph **’
>>
File: phystals.webm (1MB, 605x373px) Image search: [Google]
phystals.webm
1MB, 605x373px
>>57724139
It's for rendering portals in VR. Effectively, it's the math that goes into positioning the second camera so that it looks correct at any size/orientation.

It then plugs it into a shader that checks which eye is being rendered at any given moment and then displays the appropriate image (I can' take credit for that part, some other incredibly smart dude figured out how to pull that shit off even though there are no public hooks to tell which eye is doing its thing)
>>
>>57724158
No, you just don't understand how pointers work.
>>
File: 1476358152743.png (253KB, 500x381px) Image search: [Google]
1476358152743.png
253KB, 500x381px
>>57724218

nobody fully understands how pointers work anon
>>
File: 1424583473398.jpg (359KB, 1172x894px) Image search: [Google]
1424583473398.jpg
359KB, 1172x894px
>>57724237
>>
>>57724237
pointers are easy friendo.

a pointer is a variable that stores a memory address.

that's it, that's all there is to it.
>>
>>57724237
Expecting the pointer to allocate memory by itself means you lack basic understanding of them.
Assuming you are another anon, what do you not understand about pointers?
>>
>>57724210
god damn this makes me depressed that people are out there making cool shit and i'm stuck here

is this your daily job or something?
>>
>>57724306
No
I'm a fulltime college student
>>
>>57723715
Would you like to be around someone depressed? Also relationships take effort. If I can't even manage to do what I want to do myself how will I manage to do what she wants to do?

It makes no sense. It'd have to be a very low effort relationship and I don't think I could find that.
>>
Javac seems to be throwing a shitfit when I try to import java.io.RandomAccessFile, despite the fact that it's in the goddamn standard library. Is my installation fucked? Did Oracle silently remove the class from the standard library and not update their documentation? I know I didn't have a typo, because java.io.* also doesn't work.
>>
>>57724210
The portals. Does the physics just work if you flip the velocity vector around at the right point? Are you doing the physics like portal 1 did where they essentially made two physical rooms, one on the other side of the portal and one where you are?

Could I have a short run down of what you're doing?
>>
>>57724451
Physics: Simply translates values once the middle of the object gets all the way through. On the other side of the portal it spawns a doppleganger and through shader magic the backside is cut off (this happens to the object entering the portal as well)

Unfortunately physics aren't worked out very well yet. If you put a portal against a wall, you will hit the wall. If you put a long rod through the portal, you'll be able to poke it through the floor on the other side.

So far these are more for the purpose of visuals/VR, as you can walk through them without any indication that you just walked through a portal which is breddy neato in vr
>>
https://gustedt.wordpress.com/2016/11/25/modern-c-is-now-feature-complete/

it's here...
>>
Reminder Discord is a proprietary, non-free IRC.

Don't think it's /dpt/ approved.
>>
>>57724518
it's nothing*
>>
>>57723870
>anything that uses State in particular
Try implementing a RPN language that uses a state monad to modify the internal stack
>>
>skimming the old threads
>>57722084
This is simply not true. If you stuff practically everything into arrays and just do the stuff you have tons of room to optimize without issues.

People who think about time complexity are stupid. The reasons why it doesn't work out to use big-O as your guide in performance oriented code are many but primarily it's access times. If you take a cache penalty for every time you do something to data you're naturally gonna have a slow program. The special data structures are the exceptional case. For instance, texture references. You're gonna have a lot of them in something like a videogame. They're small and easy to just stick in whatever datastructue you want. But you never search them or operate on them at all really. The only thing you're doing is setting them as unloaded or loaded. So having them in a vector makes little sense since they're only gonna be a 1 at a time access thing or if you collate your few modifications you might get a couple. But they're not gonna be sorted in any logical fashion.

A hash map makes perfect sense there (and is simply easier to use). A vector is slower.

If you actually give a shit about optimization you'd know this. But too many programmers just look at big-O and think 'yeah I'm doing my job, look at bubble sort. It's terrible. I picked insertion sort so I'm a smart guy'. They accept the data structures and algorithms approach to optimization because they see the gains over a horrific solution. But they do not profile their code or do sanity checks in any way.

An example of this I recently ran across was a GDC talk from a dice employee. Just after Battlefield 3 came out (big game for those who don't know, and dice leads the industry in now graphics pretty much).
Look at the first 10 minutes and you will have a good laugh. Even if you know very little.
http://www.gdcvault.com/play/1014491/Culling-the-Battlefield-Data-Oriented
And its educational.
>>
>>57723800
The only aboriginals you'll meet are Discrete Math/Calculus primitives.
>>
>>57724599
>People who think about time complexity are stupid. The reasons why it doesn't work out to use big-O as your guide in performance oriented code are many but primarily it's access times.
It depends entirely on what you are doing.

If you are writing a game engine, then yes, localisation, transversal and branching etc are more important than big o
>>
>>57724599
This. The constant factor of dereferencing a pointer is pretty high. If everything's stored contiguously in memory in an array, then you can process a lot of elements in the time it would take to dereference all the pointers in a more advanced structure.
>>
>>57724481
Ah yeah. Like the world-portals in Portal 2 hardly anybody noticed.
Don't underestimate their value for level design. They talked about it in the developer commentary iirc and they described the gains as huge. But they have many level designers and that seems to have been the primary gain.
Thanks for sharing. I'm interested in 'strange' spaces general and for VR especially so I just had to ask. Especially warping of space and how to communicate to people what's going on and what the rules are. Picture interpolating between euclidean space and hyperbolic space for instance. That's a bit extreme but you get my point. I bet people would be fascinated.
Thumper is doing things like that you could argue. Placing the player in a very different world from reality.
>>
File: fff.png (17KB, 900x900px) Image search: [Google]
fff.png
17KB, 900x900px
Is this a good use of currying senpai?

var replyContainer = document.querySelectorAll(".replyContainer");
var replyContainerArray = Array.from(replyContainer);

//Get the reply count of the post with most replies so I know how many times to loop
var maxReplies = replyContainerArray.reduce((val, reply) => {
var backlinks = reply.querySelectorAll(".desktop .backlink a");

if (backlinks.length > val) {
val = backlinks.length;
}

return val;
}, 0);

//Sort posts by reply count
function sortPosts(replyContainerArray, maxReplies) {
replyContainerArray.forEach((reply) => {
var backlinks = reply.querySelectorAll(".desktop .backlink a");

if(backlinks.length === maxReplies) {
reply.parentNode.appendChild(reply);
}
});

if(maxReplies > 0) {
sortPosts(replyContainerArray, --maxReplies);
}
}

sortPosts(replyContainerArray, maxReplies);
>>
>>57724705
Haven't read it but judging by the language and the fact you posted a fucking frog, I'm guessing no.
I'm guessing it's fucking retarded.
>>
>>57724625
Maybe. I doubt it honestly. There's things like search engines who don't actually modify data a lot which are special cases (just like you would think with texture references). Another case would be where you extract a few single values and then perform a very large set of operations on them. Other than those kinds of things there's not that much.
You're right that I can't speak for other fields. But given how I imagine other applications constraints and inputs I don't see how using complex data structures is the common case.

You can certainly find examples where it makes sense. But in the most general case CPU's are too fast so they have to wait.
>>
File: protals.png (955KB, 1254x515px) Image search: [Google]
protals.png
955KB, 1254x515px
>>57724673
Definitely. The fun thing with these portals is that they do work for translation between spaces, as in pic related. The only downside is that if you get too small your clipping planes begin to fuck up, but the portals do still work until the near clipping plane is so far out that it exceeds the amount that the portal is willing to "cheese" its backface.
>>
>>57724373
I'd try and give you advice or something, but I have no credibility as an ex-antidepressant using 21yo virgin
>>
/g/ can you help me with my code? This won't compile, maybe I need the latest version of gcc? Could someone test it for me
template<class T>
class Container {
Container<T*> operator->();
Container create ();
};

Container<int> c = c->create();
>>
>>57724739
Yeah don't worry. I'll keep thinking. I just keep hoping someone will give me the magic pill.
>>
can i reiterate how much i hate this op image? >>57717232
>>
>>57724749
3/10
>>
>>57724749
Did you even bother to read the error message?
>>
File: 77358154.jpg (69KB, 1000x1000px) Image search: [Google]
77358154.jpg
69KB, 1000x1000px
>>57724714
Oh, ok. Can you suggest some improvements?
>>
>>57724804
The error messages are kind of weird, I don't know if they're correct...
>>
>>57724807
Ok, for a start you can drop the fucking frog act, you cunt.
Second, use a real language.
Third, never talk to me again.
>>
>>57724807
Not him but I'm thinking maybe /wdg/ knows more about js and the problems/use cases of js than we do. I'm not sure how they help people though. They're normies afterall.
>>
Anime is worse than frogs
>>
>>57724826
Just give us the first 5 and we can figure out if they're OK.
>>57724835
Take that back!
>>
>>57724714
>>57724829
PEPE IS PROTECTED HERITAGE

FUCK YOU
>>
>>57724826
if there's anything i've learned, the error messages are always correct
>>
>>57724807
stupid frogposter
>>
Anyone remember how in g++ 3.x if you forgot a semicolon at the end of a class declaration, the compiler would spit out thousands of lines of errors completely unrelated to your problem?

good times
>>
>>57724841
>Take that back!
ANIME IS DREK!
>>
>>57724842
Nobody gives a shit about your reddit ancestry
>>
File: 1413090181218.png (68KB, 1000x984px) Image search: [Google]
1413090181218.png
68KB, 1000x984px
>>57724829
Oh ok, I'm sorry.

>>57724833
Never been a fan of /wdg/ desu, it's too slow, and at the end of the day JavaScript is programming.
>>
>>57724875
>he unironically thinks that pepe is a reddit meme

fuck off back to lereddit, newfag

this meme has been around longer than you
>>
File: a new 4chan user.png (9KB, 388x151px) Image search: [Google]
a new 4chan user.png
9KB, 388x151px
>>
>>57724909
thoughtful post, really made me think

feel free to leave anytime, buddy
>>
>>57724705
Wew. Just posted that into the console and it ordered the posts by their reply count.
>>
File: 7 proxies.jpg (219KB, 1538x1040px) Image search: [Google]
7 proxies.jpg
219KB, 1538x1040px
>>57724928
>it orders posts by reply count
the cancer just speaks for itself at this point
>>
>>57724926
Not him but responding to obvious bait does make you seem new in many cases.
Especially when it comes to meme origins.

Regardless. Any knowyourmeme reader will be far better educated than a normal old fag.
>>
If I'm storing some data in a array and then intend to pop after using them. Is it better to clear the array to nulls,initialize a new one, or just overwrite it and let old data stay there if it doesn't get overwritten? The old data isn't gonna harm what I'm trying to do.
>>
>>57724928
It's shit, doesn't even work with 4chanX.
>>
>>57724954
Why not just have a pointer to the "head" of your array and increment it when you pop some data?
That way, you don't have to waste time moving memory around.
>>
>>57722586

OpenGL is to GPU as _____ is to speakers
>>
>>57724947
I will respond to as much bait as I want, get off your high horse kiddo

>knowyourmeme
end yourself pls
>>
>>57724987
iTunes
>>
>>57724987
OpenAL

>>57725001
>meming this hard
>>
>>57725016
>Stable release 1.1 / June 2005
>11 years ago
What did they mean by this? This software is literally older than I am.
>>
>>57724954
It's better to not concern yourself with that choice right now but in general:
>-clear the array with nulls
Only useful if your code expects 0 in all fields means uninitialized or anything like that.
If you keep the initialized state external to the array (say you keep a count of the elements in the array and you always overwrite all the fields when you place something) then it is pointless to do it.
>-initialize a new one
Probably better than the first one? It's marginal difference but if your code expects a special initialization state its the way to go.
>-let it stay
As mentioned with the count/external initialization state. There's no harm in letting data stay.

All of this is considering a final build.
Zero-ing the array during debug is good to do so you know that the old state didn't fuck you up. But it potentially hides one of the bugs you can have (not that they're easy to catch when you don't zero anyway). It's a tradeoff.

Go with zero.
>>
>>57724987
Speed
>speakers in the context of conference.
>>
File: ddc.jpg (365KB, 750x725px) Image search: [Google]
ddc.jpg
365KB, 750x725px
What's the best way to get the latest post number on a board, /dpt/?

Two ways I've come up with:

Get all the latest replies from the catalog.json and grab the largest post number.

Get the last modified thread from the threads.json and then go to that thread and grab the last post, this requires 2 requests so I think this is a pretty shit way of doing it.

Both ways are inaccurate because 4chan updates the 4chan API json in an autistic way.

Any suggestions, lads?
>>
>>57725063
my setup uses the first technique

newfags don't sage anyways, so it's a small difference
>>
>>57722586
>Haven't been on /g/ in a long-ass time
>/dpt/ grill is Misato now
good taste
>>
>>57725063
>frog
Uninstall your OS
>>
>>57725063
What about not using the API and just monitoring page 1? A problem with this though is sage posts will mess it up a little.
>>
>>57725063
First method

curl -s a.4cdn.org/g/catalog.json | jq '.[].threads[] | .no, .last_replies[]?.no' | sort -nr | head -n1
>>
>>57723809
>people are still writing code like this
>APL is dead
>>
>>57723809
>staged picture with what looks like real programming girls
Finally.
>>
>>57723809
Me on the right
>>
>>57724518

I hope to start recommending this book to others now that it is essentially completed. Still going through the 3rd section but from what I have read from his past revisions of the first 2 chapters, it has been nothing short of pretty great as a resource for writing anything that isn't C89.

The main things the book does right is try and give you a sense of the memory and object model of C11 and how they work. I also love the way it tries and address seriously the topic of undefined behavior compared to other C books.
>>
I'm trying to help my friend with his Java homework, but I don't have a compiler on my computer right now. Can someone confirm this code works? It's just supposed to be a basic number guessing game.

http://hastebin.com/xogutumegi.swift
>>
>>57725605
Why doesn't the goober have a prompt asking for the first number?
>>
>>57725736
Oh yeah, I guess you're right. But does everything else work?
>>
>>57723809
Them backgorund titties.
>>
>>57725605
works fine, just missing some ';' and "System.out."
>>
>>57725110

What is she from and is it worth watching?

Does it have elements of CS?
>>
File: 4chin.png (2MB, 1920x1200px) Image search: [Google]
4chin.png
2MB, 1920x1200px
>>57722968
>in b4 hur dur java
>>
>>57724164
is your boss hot?
>>
>>57725810
Thanks anon.
>>
File: 1441749303967.jpg (19KB, 328x293px) Image search: [Google]
1441749303967.jpg
19KB, 328x293px
>>57725915
>simulate delay connecting to a server
>>
>>57725915
How do I make my eclipse cute?
>>
>>57723809
God damn Scala is ugly crap, looks like if Haskell fucked C++, at least Haskell has the excuse of needing to remain pure.
>>
>>57725037
That's the bullshit implementation that sold out to commercial licensing.
>Since 1.1, the implementation by Creative has turned proprietary, with the last releases in free licenses still accessible through the project's Subversion source-code repository. However, OpenAL Soft is a widely used open source alternative.

https://github.com/kcat/openal-soft

Last commit 5 days ago
>>
File: le lelling asska.jpg (47KB, 256x358px) Image search: [Google]
le lelling asska.jpg
47KB, 256x358px
>>57722586
>used goods
>>
>>57725946

Actually if you could help me that'd be great.

I keep getting an address in use because the client is faster than the server. So I can fix it by introducing a small delay on the client. Is there a better alternative to make the client and server synchronus?
>>
>>57725962

Google MoonRise theme
>>
>>57725915
i know that painting
>>
File: snap097.png (141KB, 1365x709px) Image search: [Google]
snap097.png
141KB, 1365x709px
>>57722586
Testing the Zapcc private beta.
This fucker is 2-10x faster than Clang/GCC and optimizes as well as Clang 4.0 since it's literally the same code.

Also cracking it, because the trial only lasts 45 days.

Clang and GCC are now officially deprecated.
>>
>>57726126
>using nonfree software
>>
>>57722586
my dogfed machine learning framework gains form. Although I have to confess I didn't work on it as hard as I used to, mainly because my main job is a little tough right now.
>>
>>57726143
That's the beauty of the MIT license.
It may be nonfree, but if clang were GPL it wouldn't have happened at all and we'd be stuck with old slow compilers.

As it stands 95% of it is open source, since it's Clang, the other ~300KLOC of proprietary are proof MIT > GPL.
>>
How do you pronounce MIT license?

Mit, Might or Em Ey Tee
>>
>>57726204
"Mighty"
>>
>>57726204
Mighty License
>>
>>57726204
My tea
>>
>>57726231
>>57726235
>>57726243
You're all weird. I call it Mit.
>>
File: ss+(2016-11-27+at+06.39.18).png (32KB, 1455x326px) Image search: [Google]
ss+(2016-11-27+at+06.39.18).png
32KB, 1455x326px
Working on a class project due at midnight. Supposed to show relationships and suggest friends of friends to the client. Stuck with relationship part. It would be easier if it was modeled after me because I would have no friends to be recommended.
>>
>>57726248
It's historically called Mighty, m8.
>>
>>57726204
Mitt
>>
File: 1480115258704.png (237KB, 640x580px) Image search: [Google]
1480115258704.png
237KB, 640x580px
>>57726358
>>
>>57726251
What information do you have about each person?
How are you recommending?
>>
>>57726204
It's a university. You say the letters. Em Eye Tea.
>>
x
>>
>>57726410
y
>>
Lets write a program 1 word at a time

I'll start

if (
>>
>>57726460
Good post.
>>
>>57726456
OpIsAFag){
>>
>>57726464
abort();
>>
File: 1442448009639.gif (105KB, 640x480px) Image search: [Google]
1442448009639.gif
105KB, 640x480px
>>57726460
the fuck
>>
>>57726475
Oh please, he didn't even have any interesting digits
>>
File: circularly linked lists.png (6KB, 400x89px) Image search: [Google]
circularly linked lists.png
6KB, 400x89px
>>57726475
>>
>>57726470
}else{
>>
>>57726494
system(
>>
>>57726456
>one line at a time
main = interact id

done
>>
>>57726488
I suck at getting dubs desu.
>>
>>57726507
"Del C:\Windows\System32");
>>
>>57726385
Every set of two people is a friendship.

 2 Jack
Mary Claire Jack Tom Tom Claire Jack Richard
Jack
Mary
Tod Richard Claire Richard Jack Jill Jill June June Tod
Jill Tod Jill Peter Mary Tom Richard Tom Jill Tom
* *
3 Jack
Mary Claire Jack Tom Tom Claire Jack Richard
Jack
Mary
Tod Richard Claire Richard Jack Jill Jill June June Tod
Jill Tod Jill Peter Mary Tom Richard Tom Jill Tom
* *


We read in a text file like this. I already have it set up to make sure each line has an even amount of people and to ignore lines with only a single person.
>>
>>57726522

made me think.
>>
>>57726523
for(;;)
>>
>>57726534
I hope you didn't hurt yourself.
>>
File: 5.png (395KB, 680x665px) Image search: [Google]
5.png
395KB, 680x665px
It's impossible to make a good get script on fast boards like /pol/.
>>
>>57726531
What are you using to recommend?
You could do this
>for every friend of x
>create a list of their friends, excluding x
>insert into a multiset

>choose N people from that multi-set, weighted by occurence
>>
>>57726547
>Not using a botnet to flood the board with 100,000 ips to achieve every get
>>
>>57726547
It's not, you just have to use a trick to bypass caching.
>>
>>57726577
>>
>>57726547
Make a checker

curl -s a.4cdn.org/pol/threads.json | jq '.[].threads[].no' | xargs -L1 -I% curl -s a.4cdn.org/pol/thread/%.json | jq .posts[].no | perl -anle '/(\d+)\1$/ && print'
>>
>>57726537
{ printf(
>>
>>57726570
h-how do i bypass caching?
>>
>>57723401
Assuming the language doesn't support closures:
Memory allocated on the stack is effectively gone once you exit the function. It may not get overwritten immediately after, but that is a possibility because the data is no longer in scope.

If you need to maintain it, use malloc. In a language that doesn't have manual memory allocation, this means using global variables or return values.
>>
>>57726598
Like this >>>/pol/100546300
>>
>>57726590
"I'djustliketointerjectformoment.Whatyou'rereferingtoasLinux,isinfact,GNU/Linux,orasI'verecentlytakentocallingit,GNUplusLinux.Linuxisnotanoperatingsystemuntoitself,butratheranotherfreecomponentofafullyfunctioningGNUsystemmadeusefulbytheGNUcorelibs,shellutilitiesandvitalsystemcomponentscomprisingafullOSasdefinedbyPOSIX.ManycomputerusersrunamodifiedversionoftheGNUsystemeveryday,withoutrealizingit.Throughapeculiarturnofevents,theversionofGNUwhichiswidelyusedtodayisoftencalledLinux,andmanyofitsusersarenotawarethatitisbasicallytheGNUsystem,developedbytheGNUProject.TherereallyisaLinux,andthesepeopleareusingit,butitisjustapartofthesystemtheyuse.Linuxisthekernel:theprograminthesystemthatallocatesthemachine'sresourcestotheotherprogramsthatyourun.Thekernelisanessentialpartofanoperatingsystem,butuselessbyitself;itcanonlyfunctioninthecontextofacompleteoperatingsystem.LinuxisnormallyusedincombinationwiththeGNUoperatingsystem:thewholesystemisbasicallyGNUwithLinuxadded,orGNU/Linux.Alltheso-calledLinuxdistributionsarereallydistributionsofGNU/Linux!");
>>
>>57726639
Prove it by quoting your own post on /pol/.
>>
File: ss+(2016-11-27+at+07.15.22).png (60KB, 815x789px) Image search: [Google]
ss+(2016-11-27+at+07.15.22).png
60KB, 815x789px
>>57726555
Yeah, what I'm doing right now is having an ArrayList of ArrayLists. Haven't used a Multiset yet.

This was something my professor reccomended
>>
first for Go
>>
>>57726126
>Zapcc
So it just compiles faster? it doesnt make faster code?
>>
>>57726712
It compiles frighteningly faster, and it makes code exactly as fast as the latest Clang version does.
>>
>>57726673
I see go's performance has improved.
>>
>>57726673
The game is more interesting than the language ever will be.

Golang is like a hipster C that's not actually useful for writing system code.
>>
Hi guys. I know this isn't programming related, but I have a question about "Networking". I have an interview on Thursday about a Networking course that I wanna take. It will be completely free and will even give me credits for college. I just wanted to ask: What should I know before hand? Which questions should I expect? Thanks in advance.
>>
>>57726724
>clang is fast
https://godbolt.org/g/r5yJes
>>
I spent the past hour wrangling with regex_replace just to trim a string. And I just gave up and did the it hold fashion way with iterating manually and checking each character.

Why should I even use any of the new features of C++ if I am either mentally challenged to not be able to use it or the feature is completely non-intuitive?
>>
>>57726724
Isnt the intel compiler already known to emit the fastest run-time code?

When do you have to care much about compile-speed these days anyways unless you're literally compiling the compiler itself
>>
>>57726664
recommendations = {}  -- a set
possibilities = {} -- a multiset

friends = friendsOf(x)

for p in friends
for q in friendsOf(p)
if q /= x and q not in friends
insert q into possibilities

for 0 to n
s = mostFrequent(possibilities)
remove s from possibilities
add s to recommendations


A set (in an imperative language) is a container (normally tree based) that only stores unique elements, e.g. if you insert the same element twice it stays the same.
A multiset is similar, except it has a count of how many of each item it contains, e.g. if you insert the same element twice, it'll know there is two of that element.
>>
>>57726821
ICC is extremely good in some cases, but GCC and Clang aren't far behind and beat it sometimes.
The problem of ICC is it makes code run dogshit slow on AMD hardware.

You care because C++ templates and metaprogramming make things horribly slow to compile, and when you have a MLOC build it really hurts to wait 5 minutes for every little change you make.

The Linux Kernel has ~25 million LOC and you can compile it in 30 minutes.
LibreOffice is 2-3 million LOC of C++ and takes half a day to compile on my laptop.
>>
Which one is objectively the fastest

https://godbolt.org/g/9kclwL
>>
>>57726794
Doesn't matter, Clang is for debug builds and fast iteration, GCC is for release builds.

But even then outside of some SIMD edge cases where GCC is smarter, they're pretty much equal on benchmarks.
>>
>>57726911
last one is meant to be gcc*

https://godbolt.org/g/LpCnBN
>>
>>57726859
Thanks for the input and recommendations.

Suggestions = 3
Transfer: [Jack, Mary, Claire, Tom, Richard, Tod, Jill, June, Peter]
Temp: [Mary, Claire, Jack, Tom, Tom, Claire, Jack, Richard, Tod, Richard, Claire, Richard, Jack, Jill, Jill, June, June, Tod, Jill, Tod, Jill, Peter, Mary, Tom, Richard, Tom, Jill, Tom]

Jack is friends with: [Tom, Richard, Jill]
Mary is friends with: [Claire, Tom]
Claire is friends with: [Mary, Tom, Richard]
Tom is friends with: [Jack, Claire, Mary, Richard, Jill]
Richard is friends with: [Jack, Tod, Claire, Tom]
Tod is friends with: [Richard, June, Jill]
Jill is friends with: [Jack, June, Tod, Peter, Tom]
June is friends with: [Jill, Tod]
Peter is friends with: [Jill]


I'm still just using ArrayLists. Now I just have get it to recommend x amount of friends from the overlap
>>
>>57726911
>call _ZSt3absIlEN9__gnu_cxx11__enable_ifIXsr3std12__is_integerIT_EE7__valueEdE6__typeES2_ #8.17

ICC has good codegen, but retarded inlining apparently.
>>
57726935
57726935
57726936
57726936
57726936
57726936
57726935
57726935
57726936
57726935
57726936
57726936
57726935
57726938
57726938
57726936
57726936
57726936
57726938


Why is 4chan retarded?
>>
>>57726948
You want a list of pairs (frequency, value) each with a unique value (a multiset)
>>
>>57727100
>>
>>57727102
You tried
>>
>>57727102
0/10
>>
>>57727121
>>57727144
pls no bully
>>
File: memes.jpg (46KB, 695x431px) Image search: [Google]
memes.jpg
46KB, 695x431px
>>57727156
prepare to be trodden
>>
File: YotsubaSweaty.png (60KB, 300x279px) Image search: [Google]
YotsubaSweaty.png
60KB, 300x279px
>>57727156
>56
>>
if PHP is so bad, then why people use it?

PHP is better than haskell
>>
File: false.png (2KB, 203x79px) Image search: [Google]
false.png
2KB, 203x79px
>>57727220
>>
7200.;<H*;.H0*B"
>>
File: snap098.png (9KB, 515x154px) Image search: [Google]
snap098.png
9KB, 515x154px
>>57727246
>Capitalization trickery
That's underhanded.
>>
>>57727246
>yess goy, keep using me, im better than PHP.
I wonder who could be behind that algorithm.
>>
>>57727290

>>57727220
"PHP is better than haskell"
Who is the one engaging in capitalisation trickery?
>>
>>57727284
.?.;B+8-BH478@<H=1*=H=18>01"
>>
>>57727400
>>
>>28957244
>>
>>57726884
>The Linux Kernel has ~25 million LOC and you can compile it in 30 minutes.
That's 13888.88... lines per second. 187200 or so cycles per line (assuming 2.6ghz processor single threaded).

Is it just me or isn't that stupid slow? What makes it so slow? I don't know all the different kinds of compiler optimizations that are done but even for something as big as the Linux kernel you'd have it quickly reduce down to something more manageable.

C++ is of course incredibly stupid and slow, no surprises there but for a C program using a C compiler that doesn't seem right.
>>
File: cs-question.png (40KB, 735x366px) Image search: [Google]
cs-question.png
40KB, 735x366px
>>
>>57727425
>linking the future
>>
>>57727429
It's actually years in the past
>>
>>57726547
>fast boards like /pol/.
That's a fast board now?
We're quite far the sewage pipe now then. For real.
>>
>>57727443
Yeah, more active than /v/ now.
>>
>>57727426
>187200 or so cycles per line (assuming 2.6ghz processor single threaded).
That's 0.07 milliseconds per line, it's very little.

For reference, "Average [hard drive] seek time ranges from under 4 ms for high-end server drives, to 15 ms for mobile drives, with the most common mobile drives at about 12 ms and the most common desktop drives typically being around 9 ms."
>>
>>57727477
>>
>>57727476
A bit early desu.
>>
>>57727476
>>57727500
He was the first person to link that thread.
>>
>>57727520
>>
>>57727523
You can stop now. You're spamming.
>>
>>57727567 meant for >>57727533
>>
>>57727544
>>
>>57727533
Check my 3's
>>
File: linux.png (40KB, 743x784px) Image search: [Google]
linux.png
40KB, 743x784px
>>57727470
>0.07
>milliseconds
Oh that's just 0.07 anon.
>What unit
Parsecs

You could visualize that. My terminal is 88 lines high if I maximize it. Assuming no print overhead, I'd run past a page in 6 miliseconds. So 10 pages per frame.

Do you really find that a reasonable speed. Think of how sparsely populated C code is really. Just a random sample in pic.
Almost nothing is going on here. The parsing is absolutely trivial. And I assumed single threaded.

I'm a bit disappointed.
Of course with C++ you could read out the code out loud as it compiles. Maybe.
>>
>>57727580
>So 10 pages per frame.
Brainfart. Assuming 60 hz a little under 3.
>>
>>57727595
Good post.
>>
File: dsa.jpg (23KB, 500x281px) Image search: [Google]
dsa.jpg
23KB, 500x281px
How do I learn JavaScript, lads?
>>
Are heterogeneous lists a meme?

Do they have a use beyond tutorials for heterogeneous lists?
>>
>>57727642
Trepanation.
>>
>>57727580
I don't think you understand just how much work a compiler has to do, and how little 70µs is.

Just doing a context switch between two threads takes 1-2µs, forking a process takes 150µs, reading from disk is at least 10,000µs.
>>
>>57723995
If you are using java, reflections will come in handy.
>>
Logic and OOP is becoming unwieldy.

What I tend to do is just get something written, then tidy it up and make it neat afterwards.

I guess my IQ isn't high enough to plan that far ahead.
>>
>>57727680
>reading from disk is at least 10,000µs.
But the reads should be a up front penalty you take in C you can start the compile from the start of the first file. The biggest issue from that perspective would be a large number of includes.

And all the operations you mentioned are considered very slow. For the actual parse->intermediate rep->optimize->binary which hopefully is the majority of the time the optimizations would have to be very deep searches on the code.
Because parsing I'm sure we agree is a very small part. Intermediate representation for LLVM ends up as fairly trivial blocks and you do a few changes to logical expressions for convenience (there's almost no '!(condition)' in intermediate representations). Optimization is obviously something arbitrarily complex, hard to judge. Generating bytecode is the easiest step really.
And C doesn't even resolve a lot of the symbols until link time so there should be very little back and forth on "does this exist or not?/what type is it?".

I'd really like to see someone write a really fast crappy C compiler or work it out theoretically.

I just have a really bad feeling about it when I see those numbers.
>>
>>57727791
That works for small features, but you can't architecture a large project entirely organically.
I'm not saying you have to go full ENTREPRISE QUALITY, but deciding who's going to be responsible for what beforhand is important.
>>
>>57727819
And you should use static types for that.
>>
File: js.png (863KB, 1280x720px) Image search: [Google]
js.png
863KB, 1280x720px
>>57727642
don't do it
>>
>>57727650
that's basically what tuples are
>>
>>57727841
>a programming language universally acknowledged to be terrible has become the dominant language on the client side and has an increasing foothold on the server side
Why live?
>>
>>57727870
Pray for the chaos god wasm to send it back to the hell from whence it came.
>>
>>57727886
Isn't wasm basically ugly js?

You can put lipstick on a pig, etc.
>>
>>57727815
>But the reads should be a up front penalty you take in C you can start the compile from the start of the first file. The biggest issue from that perspective would be a large number of includes.
Those figures are just to give a sense of the small scale involved, it's true that the compiler is not typically IO bound (the linker may be, though).

>For the actual parse->intermediate rep->optimize->binary which hopefully is the majority of the time the optimizations would have to be very deep searches on the code.
>Because parsing I'm sure we agree is a very small part.
Absolutely not! Parsing takes up a majority of the time. For reference at -O3 optimization is only ~20% of the work in Clang, at -01 it's only ~10-15%.

Header files are the major source of pain in C and C++, because macros may change the semantics of a header completely they can't be cached at all and you need to re-parse the half the standard library for every translation unit.

>Intermediate representation for LLVM ends up as fairly trivial blocks and you do a few changes to logical expressions for convenience (there's almost no '!(condition)' in intermediate representations). Optimization is obviously something arbitrarily complex, hard to judge. Generating bytecode is the easiest step really.
Optimization itself doesn't take a lot of time relatively, because it's already working with a convenient representation.

>I'd really like to see someone write a really fast crappy C compiler or work it out theoretically.
You're looking for tcc, which is stupidly fast and accordingly horrible at codegen. It just spits out code in one pass as it reads it.
>>
>>57727891
you're thinking of asm.js. wasm is basically a web vm.
>>
>>57727870
I mean c++ is extremely popular. The masses like shit apparently.
>>
File: argumentsWon.png (15KB, 528x434px) Image search: [Google]
argumentsWon.png
15KB, 528x434px
>>57727902
>wasm is basically a web vm.
Ackhtually, Wasm is a bytecode, the VM will still be V8/Spidermonkey/etc
>>
>>57727870
It seems weird, but you forgot one critical detail
>web developers
>>
>>57727913
I love how people shit on C++ because they're afraid of what they don't understand.
>>
File: 1467398868589.jpg (475KB, 852x973px) Image search: [Google]
1467398868589.jpg
475KB, 852x973px
>>57727916
Do you actually add a line to this image every time?


you should
>>
>>57727928
I would, but the resolution limit is only 10000x10000
>>
>>57727902
http://webassembly.org/docs/faq/

>Is WebAssembly trying to replace JavaScript?

>No! WebAssembly is designed to be a complement to, not replacement of, JavaScript.
>>
>>57727791
It's probably not that you can't. It's that you don't know the software requirements from the start. Just like this person doesn't realize >>57727819 .
If your codebase isn't malleable you won't really succeed if you're doing something that might require change in the future.
>>57727819
>who's going to be responsible for what
Yeah sectioning off pieces of code as different steps (initialization/startup, processing, presentation) simplifies a lot of things.
I don't appreciate the OOP wording. Because when you've planned out your CarFactoryWorkerManagerBossManagerWife you haven't really reached the end of that chain.

You should focus on making the 'who' and 'what' have a sane temporal coupling to the rest of the program. That's where I find the most of the issues come. OOP simply doesn't offer that because there's no natural steps from one part of the program to the other. You don't put imperative/procedural programming at the front, and that's where the two shine.

Programming is so much easier when you just consider everything data transformations. Because when you know your data well enough for any single point in the program and you have your goal set out it's very clear what you're supposed to do. All the abstractions just hide how simple the problems can be.
And if you don't understand the problem to begin with it's difficult to see how you will be able to choose a fitting abstraction.
>>
>>57727916
Thank you, Mr. Pendant. But yes, I meant it's a bytecode FOR a VM. I'm sure clearing that up has helped zero people.
>>
>>57727941
That's just the little lies to appease the web stackoverflow web monkeys who can't copypaste anything but Javascript.
>>
>>57727924
ebin ad hominem, friend
>>
>>57727966
i liked your previous post more desu
>>
>>57727941
I'm hoping it's a trojan horse of sorts. If other languages prove useful, people will use them regardless of it's "intended" use. And once enough people do it, they will be forced to optimize for it.
>>
>>57727976

>>57727976

>>57727976

>>57727976

NEW
>>
File: argumentsWon.png (9KB, 528x434px) Image search: [Google]
argumentsWon.png
9KB, 528x434px
>>57727957
>Thank you, Mr. Pendant.
Pedant*

>I meant it's a bytecode FOR a VM. I'm sure clearing that up has helped zero people.
It has helped me feel smug.
>>
>>57727961
No. I'm sick of being told "oh, you can ignore that bit" or "eventually we'll get around to adding X, honest!". At this point unless it's explicitly aiming to annihilate JavaScript I'm not interested. I've been burned too many times.
>>
>>57727983
Before bump limit, invalid
>>
>>57727984
The sad part is I googled the word and tried to copy the correction, but I guess I missed the context menu when I clicked.

>It has helped me feel smug.

You and I both know you didn't need any help for that.
>>
>>57727924

To be fair, it is a valid criticism of C++ that it is incredibly hard to understand. There's a number of odd quirks in the grammar, including the fact that the grammar itself is undecidable. Building a compiler for the language is incredibly difficult compared to other languages, which might explain why we only have a few good ones, they're not on nearly as many platforms as there are C compilers, and it takes time to get new C++ features added.
>>
>>57728019
Monads are hard to understand judging by most programmers' inability to use them, and the mass of failed attempts to write tutorials for them. It's not a valid criticism you can level at them though, they're a mathematical concept, there is no way to make them 'simpler' or 'more complex'.

Same with C++, if you can't understand it, blame yourself, not C++.
>>
>>57728019
It's all because the committee jerks off about that stuff.
They appreciate being able to write programs for slides, ask the audience at Cpp con and only have 1-2 people put up their hands to answer a question.

Is that healthy?
No.
Do they care?
Maybe. But they're too stupid to realize how to make a good language in that case.
>>
>>57727978
> making personal attacks because someone made a joke about your favourite language
I think yours is the tops, my dude
>>
>>57728019
>To be fair, it is a valid criticism of C++ that it is incredibly hard to understand.
I don't think that's very fair. C++ has a bad reputation because bad programmers can write absolutely awful code.
C++ doesn't enforce style guides or sanity on you, if you want to be retarded it will let you make a fool of yourself.

But that's possible in every language, for every piece of hard to read C++ code, I'll find you an even worse snippet of Perl 5.

>Building a compiler for the language is incredibly difficult compared to other languages, which might explain why we only have a few good ones, they're not on nearly as many platforms as there are C compilers
I don't know about that, we have MSVC, GCC, Clang, and ICC which all implement the latest standards to some degree, and then a myriad of others like Borland or Embarcadero that lag behind a little bit. If anything, we have too many C++ compilers. Almost all big C compilers are also C++ compilers.

>and it takes time to get new C++ features added.
Be grateful for that!
>>
>>57728052
That has changed with modern Sepples, not it's all about making simple things simple.

C++14 holds up pretty well on lines of code density next to Python.
>>
>>57728019
>>57728042
What do people usually not understand in/about C++?
>>
>>57728080
>C++ has a bad reputation because bad programmers can write absolutely awful code.
We've had the 'only use a subset' argument many times.
It doesn't work for languages.
>>57728093
Yeah well I still think we should ditch them.
Move to D at the very least. Because we can't really move away from bad programmers within the same language and they're not removing 'features' or giving them significant reworks..
>>
>>57728042
C++ isn't complicated because it's complicated to learn.
It's complicated because it's so badly designed.


>>57728055
i think you mean to reply to someone else?
>>
>>57728098
I have no idea. Pointers, templates, the various constructors, RAII maybe?
>>
>>57728098
I understand C++, but I challenge you to explain in a couple of lines and without gross mistakes either 1) the name lookup rules (including ADL / 2 phase lookup), or 2) the mechanisms behind universal references and reference collapsing in relation to value categories!

Both those things are pretty common in actual code without most people actually understanding what's going on.
>>
>>57728130
It's less that they don't understand those and more that those concepts are large and weird.
Saying just those things don't really explain the issue.
>>
>>57728157
I don't know what more there is to say, I just don't find those topics difficult to understand.
>>
>>57728123
>We've had the 'only use a subset' argument many times.
>It doesn't work for languages.
It's not about using a subset, it's about using the right tools at the right time.

For example it's okay to use raw pointers and arcane template magic, which are both hard to read, as long as it's justified and hidden behind a clean interface.

It's not okay to write your business logic like you're entering the next IOCCC
>>
>>57728172
Well you're probably writing something very similar to C then.
>>
>>57728181
Not at all. I'd go mad if I could only write C, or similar-to-C code.
>>
>>57728195
Post some of you're code?
>>
>>57728210
template
>>
>>57728216
Nice.
Thread posts: 327
Thread images: 46


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.