[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: 317
Thread images: 37

old thread: >>62458004

What are you working on, /g/?
>>
>>62465079
Value types do not belong on Java.
Whether an identifier is reference or a value should be implicit in its usage (as in C) or at least in its declaration (as in C++)
>>
>>62465114
True, but it makes for some great optimizations.
>>
File: 20374223.jpg (28KB, 470x418px) Image search: [Google]
20374223.jpg
28KB, 470x418px
>>62463837
I don't think you understand. Friendly reminder that you should return reference to an object iff:
1. The object itself is passed to the scope as a non-const reference
2. If the object is created within the function scope, it is static
3. In no other situation

Reminder that you don't also need multi-return functions, create the expected values first and pass them as non-cost references into the function. These are called out params.
>>
>>62465093
A monad tutorial. It's the third one I'm writing this year.

We need more monad tutorials.
>>
>>62465129
One of the advantages of Java over similar languages like C# is the clarity and lack of mental overhead that its simplicity brings.
I don't mind writing .equals everywhere because it remains obvious that .equals always means value equality and == always means reference equality. With C# where overloading == is a possibility, all bets are off. Even an assignment operation could mean something different depending on whether it's a reference of value type.
>>
>>62465093
What's that pic about? Finding the girl?
>>
>>62465287
>One of the advantages of Java over similar languages like C# is the clarity and lack of mental overhead that its simplicity brings.
I see you've never had to mix arrays with generics or nested type parameters with co(ntra)variant types.
>>
>>62465323
>Otoko no (danshi?) wa kono naka ni iru
>There is a dude here.
>>
>>62465287
The lack of value types actually adds extra mental overhead. You can do this
int[] numbers
, but not
List<int> numbers
. Also
List<Integer>
adds extra indirection which is bad for performance.
Kotlin has a better solution for the developer: the `Int` type. It behaves like `Integer`, but the compiler may optimize it to a primitive.
>>
>>62465398
ALL of them are dudes, my dude.
>>
Valgrind a useless SHIT!
>>
File: 2025-job-interview-question.jpg (1MB, 2560x1440px) Image search: [Google]
2025-job-interview-question.jpg
1MB, 2560x1440px
got an answer? this determines your employment in <10 years time
>>
>>62465093
>What are you working on, /g/?
Made an example program using my library but without requiring any low-level interfaces for mapping physical pages.

Only works with an IOMMU disabled though, so the plan for the rest of today and tomorrow is to make a kernel module that pins pages and sets up IOMMU domains properly as a fallback solution if you don't have the cluster software stack installed.

https://github.com/enfiskutensykkel/ssd-gpu-dma/blob/new-build/samples/identify/no_module.c
>>
>>62465436
>physishit
>>
>>62465398
it says "someone here is a trap!!"
>>
>>62465480
it's a quantum computing book
>>
>>62465436
idk like 2 or something
>>
When I call glUseProgram will OpenGL just be smart enough not to rebind the program if the consecutive calls have the same program ID or should I keep track of it myself and make sure I don't call glUseProgram with the same program ID to avoid performance penalties?
>>
File: 555-come-on-no.jpg (50KB, 600x337px) Image search: [Google]
555-come-on-no.jpg
50KB, 600x337px
>>62465469
>char* colon
>>
>>62465526
What about it?
>>
>>62465550
You have to know what you're talking about to criticize the actual content of the code, but style is something any dipshit can talk shit about.
>>
>>62465550
>be pajeet
>mentions colon in code
Poo in loo
>>
I've been programming for a few years now, but I want to start getting paid for it without
>doing gui
>doing web design
>touching sql or anything like it
>a degree
>any professional experience

is it a pipe dream?
>>
>>62465584
see>>62465436
>>
>>62465493
>quantum computing
the fusion of computing
never happen
but it's a nice area to wank it in academia
>>
>>62465584
UX/GUI stuff and web front-end is pretty entry level stuff, which means that it is the easiest to convince an employer that you can do without having a degree or experience (it's very visible work, so you can always refer to personal projects and portfolios).

If you want to do other types of programming, then that's going to be harder without a degree.
>>
>>62464498
integer i is the nth element of arr
integer is is arr's nth element
since it's just syntactic sugar for int i = *(arr+n), and #2 is closer, #1 is retarded
>>
>>62465601
>but it's a nice area to wank it in academia
Much better than cybersecurity, that's for sure.
>>
>>62465584
Freelance for a bit. Fluff up your personal projects and show them off on a portfolio website. Try to avoid actually stating that you don't have professional experience (but don't lie if directly asked). Use phrases like "worked with" or "used". Focus on your results and not your techniques.

You will probably have to start off with those less glamorous types of project (websites, apps). Later, with that work experience under your belt and demonstrated knowledge of deeper technical aspects via your personal projects, you could start approaching potential employers closer to your desired field.

I'm also degreeless and currently freelancing building webapps and some iOS stuff. I suggest taking what you can get until you have enough experience to bargain with.
>>
>>62465672
that's what you think, kid
>>
>>62465398
otoko no ko is the first bit,
男の娘
means trap but sounds like
男の子
so it's a play on words. all the characters shown are traps.
>>
File: g-tech.jpg (575KB, 3072x2304px) Image search: [Google]
g-tech.jpg
575KB, 3072x2304px
>>62465816
Take trapshit to /b/ will you?
>>
File: tumblr_msts4lqVfy1r0og4mo1_500.gif (573KB, 500x281px) Image search: [Google]
tumblr_msts4lqVfy1r0og4mo1_500.gif
573KB, 500x281px
>>62465816
Oh i see, so both kanjis are read in same way, thanks m8!
>>
>>62465881
>>62465816
>learning Japanese because >lol anime
>meanwhile Japanese people despise foreigners and weeabos

kill yourselves
>>
Which cross platform utility(data structures, string encoding, directory handling, threads and stuff) library to use with C?
Glib(bloated)
qlibc
tbox
klib(covers only data structures... so not enough)
apr
libmowgli2(suggested by suckless)
something else what?
>>
>>62465601
it's already happening
>>
>>62463908
so you mean that if I pass a string by value it won't go through the copy constructor ?
>>
>>62465967
C++17
>>
>>62465989
fuck off dumb sepplesfag
>>
cout << pos << "/" << n << " = " << pos/n;

pos = 3, n = 6, pos/n = 0.
What the fuck is going on?
>>
>>62465987
https://en.wikipedia.org/wiki/Return_value_optimization
>>
>>62466006
I'm gessing pos and n are integers
>>
>>62466002
There's no reason not to use C++ if you want C with handholding.
>>
>>62466020
oh, you meant as return value
that makes more sense
>>
>>62466006
Integer division in C truncates.
>>
>>62466023
Do they have to be floats for cout to output the proper format?
>>
Can someone give me the rundown for good practice with complex header inclusion structures in C?
>>
year 1: introduction to programming, data structures
year 2: algorithms, computer architecture
year 3: operating systems, compilers
year 4: artificial intelligence, quantum computing

refute this
>>
>>62466050
well they have to be floats (or doubles) for the operation result to be correct
>>
>>62466045
No, I gave you the wrong link. Sorry.

https://en.wikipedia.org/wiki/Copy_elision
>>
>>62466057
Use forward declarations, limit the number of symbols you expose in the global scope, chain includes to the minimum so you don't ignore missing includes.
>>
>>62466031
No there isn't dumbfuck.
You should be able to make programming with the low level easy. The need to use libraries is universal.
You should not force name mangling, unstable ABI and the cluster fuck that sepples is to people.
Fucking retard.
> C with handholding
I have implemented all of the features myself except string encoding which is quite trivial if you limit yourself to ascii and utf8. There's still benefit in relying on libraries in bigger projects.
>>
>>62466096
>You should be able to make programming with the low level easy.
That's why C++ exists and is a clear upgrade over C. There's no reason to use C.
>>
>>62466123
>You should not force name mangling, unstable ABI and the cluster fuck that sepples is to people.
dumbfuck
>>
>>62466143
>extern "C" does not exist
>>
>>62466123
C++ is hazardous, other C++ programmers especially. There's no downside on personal projects, but you're fucked on any team project.
>>
>>62466143
>HURR EVERYTHING I WRITE IS IN THE GLOBAL SCOPE SO THAT OTHER PEOPLE CAN LINK TO EVERY SINGLE FUNCTION DURR

You're probably the kind of C programmer that refuse to use the static keyword in function declarations, overuses typedefs and prefers #define constants, aren't you?
>>
>>62466150
t. somebody who has never programmed in sepples and never had to use extern "C"
>>
>>62466067
thanks anon, I learnt something today
what would be the advantage of this over const reference (beside the shortened syntax)?
>>
>>62466090
I have an issue:

Header A is included by B and C, and header B is included by C.

I have forward declarations in B and C for a struct typedef in A, but it seems that C is screwing up somehow because it claims the struct typedef has none of the members it has.
>>
>>62466177
>and prefers #define constants,
const isn't really constant and enum is restricted to ints. #define constants are the least insane option.
>>
>>62466186
I'm not the original guy so my opinion is that you shouldn't.
>>
>>62466060
the Bachelor in my college is like this

year 1:
>introduction to programming (python)
>computer architecture
>logic
>algebra
>c programming
>physics
>statistics

year 2:
>algorithms,
>networks
>data structures
>operating systems
>OOP programming
>information theory
>data analysis (fast Fourier transforms,...)
>simulation

year 3:
>compilers
>artificial intelligence
>computer graphics
>databases
>software engineering
>distributed systems
>advanced data structures
>>
>>62466187
figure out how your code got to be circular in the first place and uncircularize it
>>
>>62466198
>const isn't really constant and enum is restricted to ints
C++ doesn't have this problem with const correctness and enum class.

/thread
>>
>>62466177
Why would anybody refuse to use static in C?
>prefers #define constants
I prefer enums and constant variables that when needed for creating FFI from other languages.
>>
>>62466209
>no QC
enjoy the unemployment line in 2 years
>>
>>62466228
>QC
?
>>
>>62466224
faster executables since there's no memory access, i'd presume
>>
>>62466224
>Why would anybody refuse to use static in C?
The same kind of person that cares about "stable ABIs" for his standalone FizzBuzz program.
>>
>>62466222
Which is why I use const for constants in C++. There's no good option for constants in C.
>>
Rust or C++?
>>
>>62466235
quantum computing
>>
>>62466248
If those are your only options, C++.
>>
>>62466271
Thank you, Boobs.
>>
File: 11.png (63KB, 977x344px) Image search: [Google]
11.png
63KB, 977x344px
>>62466249
we learn that in physics though.

see pic
>>
>>62466276
>Boobs
Sorry, left over name from last night, when some CNN anchor fake-freaked out when someone had the balls to say "Boobs" live on TV.
>>
>>62466271
b-b-but rust is the future, desu!!
>>
>>62466301
Yeah, but currently it's an unstable mess.
>>
File: file.png (115KB, 484x484px) Image search: [Google]
file.png
115KB, 484x484px
>>62466143
>>
>>62466290
ist? laughing at your useless physics
>>
>>62466236
You are writing in C so you are already avoiding lot of overhead that comes from using more dynamic language.
Personally I prefer runtime variables over compile time. Of course when dealing with embedded devices there's reason to do as much as you can compile time and avoid using memory because the devices have like 8k ram or even lower sometimes. Then again when dealing with embedded systems you usually don't even get fully standard confirming C compiler so you can't really use any desktop libraries anyways so I think it's fine to be a little wasteful when writing desktop C libraries.
>>
File: smug.jpg (398KB, 551x600px) Image search: [Google]
smug.jpg
398KB, 551x600px
>>62466060
>quantum computing
>>
>>62466060
year 4: quantum & analog computing

because both are equally useless
>>
>>62466328
ist?

we learn that in a informatics engeneering course, but no once uses that once they found jobs. just to look like a modern course
>>
How does mergesort work?
>>
>>62466309
What about D(ick)?
>>
>>62466377
what is google?
>>
>>62466375
Instituto Superior de Tecnologia

either that or FEUP, I can't see any other university wasting their time teaching QC to undergrads
>>
File: 1417806535276.png (305KB, 900x539px) Image search: [Google]
1417806535276.png
305KB, 900x539px
>>62466228
>enjoy the unemployment line in 2 years
>implying businesses will switch to quantum computers this fast
>implying they will be cheap in 2 years
>>
>>62466394
i'm on FCTUC
>>
>>62466394
*Técnico
>>
>>62466377
Say you have four already sorted lists of integers, in ascending order. In order to make one large sorted list out of those four, you make a loop that always take the smallest element from the top of one of those lists. Repeat until all lists are empty, and you are left with a large sorted list.

Now imagine if this process is repeated, so you start out with 100 lists of only two elements each. And then you continuously make larger lists.
>>
>>62466397
Holy shit, destroyed. How can Pluslets even compete?
>>
>>62466393
I googled, but I still don't understand.
>>
>>62466387
No significant adoption or increase in community the last 15-20 years, so pretty dead.
>>
>>62466413
o técnico é a melhor universidade?
>>
A few question from a C# newbie:

1. What else can be used instead of 'static' when you define a method?

2. Is the 'main' method compulsory in every class you define or in one program only?

3. In a line
static void Main(string[] args)
what does 'string[] args' mean and what can it be replaced with?
>>
>>62466444
>2
You only need one across all your classes, that's where your program begins.
>3
An array of strings named args. When you're running it from the command line, that's where your arguments will be accessible. You can leave it empty instead of you like.
>>
File: mergesort.gif (92KB, 300x180px) Image search: [Google]
mergesort.gif
92KB, 300x180px
>>62466428
>>
>>62466410
I'm surprised that's your physics then

>>62466441
As long as you go to one of the good ones (IST, FEUP, Minho, FCT, apparently Coimbra, possibly also FCUL if you're being generous) and put in enough effort, it doesn't really matter.
>>
File: 1496998730043.jpg (33KB, 493x386px) Image search: [Google]
1496998730043.jpg
33KB, 493x386px
>>62466397
>tfw she looks like a fat cow herself
>>
>>62466502
>As long as you go to one of the good ones
are you Portuguese?
>>
>>62465093
>Astolfo
>Hime
>Dude from Danganronpa
Who are the rest?
>>
>>62466482

thanks.
>>
File: 1502046131411.png (642KB, 785x1077px) Image search: [Google]
1502046131411.png
642KB, 785x1077px
>>62465093
>Astolfo in OP
Finally a good thread
>>
File: 1463364999713.jpg (59KB, 268x237px) Image search: [Google]
1463364999713.jpg
59KB, 268x237px
Employed Haskell programmer here
>>
>>62466517
no, I'm an ameritard who just happens to know the portuguese university system in depth

o que é que achas
>>
File: cheetoh man.jpg (26KB, 444x361px) Image search: [Google]
cheetoh man.jpg
26KB, 444x361px
>>62466557
People employ Haskell programmers?
>>
>>62466536
There's a nipple there.
>>
If I wanted to make an interactive graph in SDL, how would I go about doing it?
Would the graph itself just be a superficial BMP or something with the interactivity tied to certain parts of the window?
>>
>>62466557
Maybe if you keep it up every day, it'll become true eventually.
>>
>>62466591
McDonalds does
>>
File: 1502403006017.jpg (39KB, 500x700px) Image search: [Google]
1502403006017.jpg
39KB, 500x700px
>>62466619
Are male nipples not SFW now?
>>
>>62466418
But if I already have four sorted list why do i need to sort them again?
>>
>>62466608
>Vamos ao que interessa, já trabalhas como programador?
nope, mas o que é que queres saber?
>>
>>62466719
então o que é que fazes?

estudas eng. informática?
>>
File: traps.jpg (36KB, 292x452px) Image search: [Google]
traps.jpg
36KB, 292x452px
>>62466536
>>62466619
>>62466662
>>
Too many fags itt
>>
File: 1502446516456.png (2MB, 1447x2046px) Image search: [Google]
1502446516456.png
2MB, 1447x2046px
>>62466838
How is THIS "fag"?
You're a fag if you don't like it
>>
>>62466786
Estudo, estou no mestrado. E tu? Ainda na licenciatura?

>>62466838
if only the mods did their jobs and removed anime from /dpt/ once and for all
>>
File: 0_0.jpg (143KB, 1280x720px) Image search: [Google]
0_0.jpg
143KB, 1280x720px
>>62465093
this one is a girl.

fuck that pic
>>
>>62466397
>a-normal-life-in-russia.md
>>
File: gay.png (414KB, 1178x1694px) Image search: [Google]
gay.png
414KB, 1178x1694px
>>62466838
>>
>>62466869
>girl
>>
>>62466866
>has a dick
>how is it gay hurr
>>
File: ignore_sepples.jpg (77KB, 677x463px) Image search: [Google]
ignore_sepples.jpg
77KB, 677x463px
Threadly reminder.
>>
 Console.Beep() 
>>
>>62467184
^G
>>
>>62466920
girl
>>
>>62467350
>girl
>>
fuck opengl though
>>
Where does one get started with machine learning/tensor flow stuff? The tensor flow tutorial on MNIST stuff pretty much went right over my head
>>
>>62467380
check out the coursera courses, either from stanford (andrew ng) or uoft (geoffrey hinton)

I also enjoyed these lectures: https://cs231n.github.io/
>>
>>62467358
it's not that bad once you learn its quirks.
>>
>>62467380
this is the numale / reddit answer: >>62467442
the contrarian / patrician answer is to read artificial intelligence: a modern approach
>>
How do character pointers work in C++?
char const *p = "Hello";
cout << *p; //prints H
cout << p; //prints Hello

So a pointer points to a character constant, but why does printing the pointer print the whole string but printing *p print just one character?
>>
i have an interview at an entry level job that has this:
>help maintain and program Internet mapping applications for desktop browsers and mobile devices
>Experience in: C#, VB, and JavaScript is required

anyone want to guess at what they're actually wanting here, i have no idea what they mean by internet mapping applications unless they just mean using google maps or something. this is for the local government in my city
>>
>>62467551
const char *p = "Hello";

Here, p points to the first character of the \0 terminated string.
When you pass a char pointer to cout, it will print all character up to the first \0 byte it encounters.
when you
*p
you dereference the pointer, i.e. you pull the data p points to and print it, this is a single character.

If you don't understand it, look up how raw pointers work in C/C++.
>>
>>62467551
>why does printing the pointer print the whole string
Because the overload for char* assumes that the character pointed to is just the first character of a string.

>but printing *p print just one character
Because the type of the expression *p is a char, and the overload for a char just prints the char.
>>
>>62467551
>*p = Hello
assigns the character H to memory location *p, e to (*p+1), etc. until at (*p+len(Hello)+1) it puts \0

>cout << *p
dereferences the pointer *p to H, then passes it to cout

cout << p
takes the location of the H stored in Hello like before, cout will read (p+i) until *(p+i) == \0, then stops
>>
>>62467614
>>62467631
>>62467687
Thanks
>>
>>62465432

t. brainlet unable to make use of its output
>>
>Knuth came up with a typically clever, lengthy, low-level implementation. McIlroy then somewhat perversely wrote a six-line shell script that did the job, basically changing the subject away from literate programming and toward a critique of Knuth’s doing something low-level and complicated when unnecessary.

Was Knuth a brainlet?
>>
>>62468070
Source?
>>
>>62468107
http://franklinchen.com/blog/2011/12/08/revisiting-knuth-and-mcilroys-word-count-programs/
>>
>>62465967
I regularly code cross platform stuff in APR and have stuff running in production. Pretty solid.
>>
explain me lisp in 2017
>>
>>62468179
Racket is a "modern" Lisp, unlike Scheme or Common Lisp
http://racket-lang.org/
http://www.ccis.northeastern.edu/home/matthias/manifesto/index.html
>>
>>62468221
>racket

fuck you lisplet

as for you >>62468179:
learn scheme ONLY, forget every other language. code is data and data is code, pure ASTs are the only respectable syntax for code and continuations are MAGIC

welcome to the land of scheme
>>
>>62468263
Racket is literally just Scheme but better. Scheme is deprecated, useless
>>
>>62468179
it's as useless now as it was in '59
>>
I am reading K&R and am having some trouble understanding why sending initialized character arrays to the function works, however simply sending strings as the arguments does not. Would someone mind explaining it?
>>
>>62468278
racket is disgusting, it takes the perfect soup that is scheme and puts rat droppings in it

racket is unnecessarily bloated
mit scheme is pure and light

go back to your shack pajeet, the kid wants to learn SCHEME, not the trash you're peddling
>>
>>62468306
Don't you have to send strings as pointers?
>>
>>62468179
>explain me lisp in 2017
It's a homoiconic Python with a "syntax" that is essentially a representation of your program's syntax tree, and to make things fun, it gives you the ability to transform and rewrite this syntax tree using normal functions.
>>
>>62468340
If that is the case, does it work with initialized char arrays because arrays are pointers?
>>
>>62468351
>python

go away

next you'll be saying that javascript is a lisp

these are fucking lies perpetuated by self-aggrandizing webmonkeys

i have been using mit scheme since 199X and hearing these lies for close to 2 decades now, you webmonkeys never change, go die in a fire, scheme is perfect
>>
>>62468325
>unnecessarily bloated
Have fun with your gensyms and non-standard hash tables, kid
>>
>>62468299
>it's as useless now as it was in '59
Then how do you explain the fact that I can use it to solve problems that would take you 5,000 lines and a week in 200 lines and 30 minutes?
>>
>>62468383
I doubt that, and i wouldnt even need to use idris to be extra terse.
>>
>>62468373
>being this monumentally butthurt
Prove that it can't possibly be likened to Python. Protip: you inherently can't. Stay mad, kid.
>>
File: 1480903561397.jpg (40KB, 500x491px) Image search: [Google]
1480903561397.jpg
40KB, 500x491px
>>62468397
>I doubt that
But that's because you're a brainlet.

>Idris
I like how far you have to go to even give yourself a chance. How about you do it in, say, Java?
>>
>>62468403
>anything that isn't statically typed can be likened to Python
- /g/, 2017
>>
>>62468379
>>62468403
like so many others before you, you'll get tired of your shitty meme lang and move on to the next thing while i remain a pure schemer

you are all vermin who don't even deserve the brain you're using to think of these shitposts
>>
>>62468306
The strings you think of are actually immutable array of chars.

>>62468370
Arrays are not pointers. They decay to pointers when you pass them as arguments.

    char *a = "AB"; //causes segfault on edit
char b[3] = "AB"; //alright to edit
>>
>>62468418
>how far
How is picking a language "going far".
My primary choice would be D because I know it better, and it's infinitely better than Lisp.
>>
>>62468424
>t. sepples money who thinks his bait is in any way clever and non-obvious
>>
File: tfw-this-shit-again.jpg (6KB, 139x150px) Image search: [Google]
tfw-this-shit-again.jpg
6KB, 139x150px
>>62468441
>D can compete with any lisp in terms of getting things done quickly and elegantly
You just have to be brain-damaged.
>>
File: semen demon question.png (40KB, 467x400px) Image search: [Google]
semen demon question.png
40KB, 467x400px
My gliders turn into squares when they hit the edge of the grid.
>>
>>62468462
give me a lisp program, tell me what it does and ill do it in d to compare.
>>
>>62468475
Good to know, what else happened today?
>>
>>62468462
>D can compete with any lisp in terms of getting things done quickly and elegantly
But it can. Neither of them get things done.
>>
>>62468485
anything involving continuations
>>
>tfw using Rust
>>
>>62468505
neat, now give me an elegant lisp program to compare to so we can get to you back-peddling and shifting goal-posts.
>>
>>62468278
what does racket add to scheme
>>
File: 1gsk7i.jpg (86KB, 888x499px) Image search: [Google]
1gsk7i.jpg
86KB, 888x499px
>>62468538
>>
>>62468427
Oh, okay. Thanks.
>>
>>62468427
>>62468556
Or do it like this
const char *ab = "AB";
>>
File: misoramen.png (132KB, 418x350px) Image search: [Google]
misoramen.png
132KB, 418x350px
>>62468548
Sensible standards for hash tables & sets (immutable or mutable), regular expressions.
Very powerful iteration over different kinds of sequences ("for" and friends: http://docs.racket-lang.org/reference/for.html)
[note: yes, it's no longer "minimal", but these are features I use on a regular basis so it's nice to have them already available ]
Hygienic macros that aren't a giant hack, still allow you to inject unhygienic identifiers, work very well with the module system (tutorial: http://www.greghendershott.com/fear-of-macros/)
Module system that is simple yet effective. Can be used to create languages simply by exporting identifiers.
Function application, literals, and modules are actually macro invocations, and thus can be extended. This immensely broadens the scope of DSLs that can be made.
Examples:
> http://docs.racket-lang.org/turnstile/index.html
Write type rules like you would specify them formally, get a typed language as a result
> http://docs.racket-lang.org/hackett/index.html
WIP Lisp with Haskell's type system and semantics
>>
File: c-func-ptrs.png (54KB, 535x864px) Image search: [Google]
c-func-ptrs.png
54KB, 535x864px
why do both of these work? ad hoc compiler trickery?
>>
>>62468727
function pointers doing what function pointers do. How is this a surprise?
>>
>>62468727
nm i think i get it, a function name is always a pointer to a place in memory. it has to be dereferenced either way. i was really confused for a second
>>
File: 1496690244379.jpg (43KB, 390x470px) Image search: [Google]
1496690244379.jpg
43KB, 390x470px
>>62468485
>tell me what it does and ill do it in d to compare
Sure. Write a networked game engine. For every field of every game object type, you should be able to set whether it's client-side, server-side or both, and you should be able to set the interpolation type. The engine should take care to create binary delta-compressed packets in network byte order, and deserialize them back into host byte order on the other side (to ensure that (e.g.) servers running on little endian platforms can communicate with big endian clients). The game objects should look like normal objects to the rest of the code. Have fun with your weekend project while I put together a 50 line macro that simply generates all the relevant code.
>>
>>62468824
I know your're not him, but it's funny that lisplets bang on and on about how amazing Lisp is. But when called to actually prove it, they don't reply.
>>
>>62468851
lisp's a good language to teach people programming
>>
>>62468853
no it's not.
You don't teach them types, you don't teach them memory. You don't teach them other data structures.
Teaching anyone programming with a dynamic language is hurting them. Because when they want to learn something else, they will have to un-learn Lisp and realize what a fucking toy it is.
>>
>>62468851
>But when called to actually prove it, they don't reply.
Oh, yeah? What makes you so sure?
>>
>>62468882
see>>62468539
>>
File: 1502448176807.jpg (111KB, 740x740px) Image search: [Google]
1502448176807.jpg
111KB, 740x740px
>>62468727
Is that mess C? Why does it look so unaesthetic?
>>
File: 1493761986855.gif (2MB, 500x500px) Image search: [Google]
1493761986855.gif
2MB, 500x500px
an indian came to my university, became head of the csci department and took away our assembly course and our compilers course
>>
>>62468881
>Because when they want to learn something else, they will have to un-learn Lisp and realize what a fucking toy it is.
Brainlets will never know what a complete reversal of reality their uninformed opinion is.
>>
>>62468898
>give me an elegant lisp program
Sure thing, once you give me your beautiful and concise D implementation. Or are you trying to say it's not going to be beautiful and concise?
>>
>>62468909
If your language doesn't have a strong type system, it's trash. LIsp is no exception.
>>
>>62468931
>m-m-muh subjective opinions
Funnily enough, you can (and people have) written type systems on top of various lisp dialects using macros.
>>
>>62468899
i've only ever used C function pointers when using pthreads. idk why people talk about them as if they're common
>>
>>62468967
>written type systems on top of various lisp dialects using macros.
And you can give Sepples, modules, it won't make your language good, just a disjointed mess.
>>
>>62468906
>>62468906
>>62468906
i need someone to acknowledge this because this really happened to me. he also removed computer architecture as a required class.
>>
>>62468993
have yo tried to tell him something, voice your concerns about his race and role in your establishment
>>
>>62468992
You just gonna keep spewing unsubstantiated opinions, kid? Takes others less effort to dismiss them than for you to type them out.
>>
>>62469041
i don't know if i'm more angry at him or the other professors not saying a word. he's replacing the fundamental building blocks of computer science with tedx-tier classes on big data and machine learning. it's a party school and only 4% of computer science bs majors graduate in 4 years, and he thinks the solution is to start cutting requirements that people fail
>>
>>62468922
are you trying to say you can't provide an elegant lisp program ?
>>
>>62469069
And why do you care so much?
>>
>>62469090
because if everyone who graduates my university knows nothing about computer science, employers will think i'm the same. thick cunt
>>
>>62469090
>why is the quality of the place he's spending years and tens of thousands of dollars at, precious to him

>>62469069
request a refund and get out of there m8.
>>
>>62469110
my tuition's paid for, and it's my last year but still. i think i have a right to be salty. he always pulls the 'i worked in industry and made a lot on wallstreet so i'm really smart' move plus he's one of my references and i don't want to piss him off before he's written any
>>
>>62466096
You should be able to make programming with the low level easy.
Low level programming in C++ is as easy as in C.
>The need to use libraries is universal.
C++ is compatible with C libraries.
>You should not force name mangling, unstable ABI and the cluster fuck that sepples is to people.
Name mangling in C++ is optional. You can use extern "C" to prevent it. If you're worried about broken ABI then program only on bare metal ARM since that requires ARM EABI. C++ clusterfuck isn't needed you can avoid using much of it. And you can use C standard library anyway from within C++ just the same as in C.

There is no reason to use C unless you're targeting a platform for which a C++ compiler does not exist. Or you need VLAs for some reason and can't have to implement alloca for your machine.
>>
>>62469108
Employers definitely, 100% care about compiler theory and assembly language. Keep up the good fight, anon.
>>
>>62469082
>are you trying to say you can't provide an elegant lisp program ?
I will provide it once you either provide your D implementation, or admit that it would take you too much time and effort to even attempt.
>>
>>62469202
you're the cancer turning universities into 4-year-long java workshops. go fuck yourself
>>
C++ question
template<typename U = void> test(U x = void)
doesn't work. It's because void can't be a value, only a type, correct? What should I place there? I don't want to create an empty no_args struct... Thanks
>>
>>62465093
>What are you working on, /g/?
Trying to figure out how Crunchy works, so I can rewrite it in a non-cancerous(not nodejs) form.
>>
Elegant lisp program:
Interpreter and hindly-milner typechecking in 60 lines of code
#lang racket
; type
; a type var is a symbol
; a concrete type is a string
(struct arrow (arg ret)) ; τ → τ
; expression
; a variable is a symbol
(struct app (f e)) ; e e
(struct lam (x e)) ; λx.e
; value
(struct fun (x e env)) ; λx[env].e

;; expr (list (cons symbol value)) -> value
(define (evalu e env)
(match e
[(? symbol? x)
(assoc x env)]

[(lam x body)
(fun x body env)]

[(app e1 e2)
(let ([fun (evalu e1 env)]
[arg (evalu e2 env)])
(match fun
[(fun x ebody clos)
(evalu ebody (cons (cons x arg) clos))]))]))

;; expr (list (cons symbol type)) (hash symbol => type) -> type
(define (infer e ctx subs)
(match e
[(? symbol? x)
(assoc x ctx)]

[(lam x body)
(let* ([arg (gensym)]
[ret (infer body (cons (cons x arg) ctx subs))])
(arrow arg ret))]

[(app e1 e2)
(let ([fun (infer e1 ctx subs)]
[arg (infer e2 ctx subs)]
[ret (gensym)])
(unify! subs fun (arrow arg ret))
ret)]))

;; (hash symbol => type) type type -> void
(define (unify! subs t1 t2)
(match* [(hash-ref subs t1 t1)
(hash-ref subs t2 t2)]

[[t t] (void)]

[[(? symbol? x) t]
(hash-set! subs x t)]

[[t (? symbol? y)]
(hash-set! subs y t)]

[[(arrow a1 r1) (arrow a2 r2)]
(unify! subs a1 a2)
(unify! subs s2 r2)]))
>>
>>62465093
I want to fucking die
>>
>>62469355
just autotorrent horriblesub releases faggot
>>
>>62469361
Nice, did you write it? I'm learning lisp
>>
>>62469361
>Elegant lisp program
>#lang racket
Oh boy, here we go.
>>
File: 1369164630534.png (24KB, 684x737px) Image search: [Google]
1369164630534.png
24KB, 684x737px
>>62469368
>torrent
>>
>>62469379
I just wrote it and there is a bug, it should be
    [(lam x body)
(let* ([arg (gensym)]
[ret (infer body (cons (cons x arg) ctx) subs)])
(arrow arg ret))]


>>62469380
I hope you don't seriously think that Common Lisp is elegant lmao. How about a real argument?
>>
>>62469405
No, I was referring to you triggering our local Lisplets because of their whole purity nonsense.
>>
>>62469361
>hindly-milner typechecking in 60 lines of code
You can do the same in any decent functional language, and even a Java implementation of this isn't going to be that bad.
>>
>>62469405
Yet another bug, should be (cdr (assoc x ...)) both times instead of just assoc

>>62469465
>in any decent functional language
for sure

>Java
In Java this would be an inheritance hierarchy 4 classes deep, spread across 2 packages and 3 classes for each data structure. It would also be full of mutable state because Java doesn't have proper linked lists. I'm curious what a D programming could pull our of their ass. I haven't written much D but I know that it doesn't have variant types
>>
>>62458497
Sentinels are often used in tight loops where we have a known end condition.
The most simple example would be to have a linear search function where you replace the null terminator with the value you're looking for temporarily and then at the end of the loop you fix it up (replace the null terminator index with the null terminator again, check if you're at the end of the array which would indicate you didn't find anything).
I'm surprised not everyone knows this. This optimization is from the 60s I believe. And it's very simple.
I haven't thought about it since I wrote the post but looking st any strcmp you'll certainly get the sense that a sentinel could be used. But I'll have to be in a roundabout way probably.

And don't complain about people's English when you're the one being insufficient. You could just Google it.
>>62458457
Oh yes of course there's super specific situations where it works well but it's not a generally productive measure. A better measure would be which fails a substring check first. i.e. You have a dominant and a non-dominant string. Return 1+ if the dominant string ended before the non-dominant without a check failure (indicating the dominant is a substring of the non-dominant). -1 would be the reverse and 0 just like strcmp is now.
Or maybe even return the first failing index. Allowing the string searching to be picked up more easily. Much more useful for composition.
It should be intuitively obvious how these help. Meanwhile strcmp as it is only helps for sorting.
And its a pretty terrible method for that frankly. It doesn't assume that narrow case and suffers from it. For sorting you absolutely should store the size with the strings. It enables much much more effective algorithms.
>>
>>62469483
>I'm curious what a D programming could pull our of their ass. I haven't written much D but I know that it doesn't have variant types
I don't know hindly-milner and can't be fucked researching it right now.
>but I know that it doesn't have variant types
Wrong.
https://dlang.org/phobos/std_variant.html
>>
>>62469301
not sure exactly what you're going for. do you just want a version of test that takes no parameters? in that case you could just add a non-templated parameterless overload:

template<typename T>
void test(T x)
{
// ...
}

void test()
{
// ...
}
>>
>>62458540
In a sense yes. But not as a compute optimization only as a memory optimization. And not specific to strcmp. There it just hurts.
>>
>>62469538
"variant" is a templated struct
>>
>>62469483
>In Java this would be an inheritance hierarchy 4 classes deep, spread across 2 packages and 3 classes for each data structure. It would also be full of mutable state because Java doesn't have proper linked lists.
Sure, if you write idiomatic Java. Otherwise, you can make something that more or less mirrors your racket implementation. I'm not trying to defend abominations like Java, just pointing out that your example doesn't really illustrate any unique language features.
>>
Now I guess you guys probably want to see some macros, so here are two I wrote for use in a small compiler
;;   (<~- (f a __ d) (g b __ c) (h))
;; becomes
;; (f a (g b (h) c) d)
(define-syntax <~-
(syntax-parser
#:datum-literals (__)
[(<~- expr) #'expr]
[(<~- (fun e1 ... __ e2 ...) . after)
#'(fun e1 ... (<~- . after) e2 ...)]))

;; defines a generator (like gensym), by defining the parameters:
;; (<gen>!) -> X
;; generates a new object by incrementing (current-<gen>-id)
;; and applying it to the format string (<gen>-format),
;; then passing that to 'convert-fn'
(define-syntax define-global-generator
(syntax-parser
[(_ <gen>:id
init-format-expr
convert-fn)
#:with <gen>-format (format-id this-syntax "~a-format" #'<gen>)
#:with current-<gen>-id (format-id this-syntax "current-~a-id" #'<gen>)
#:with <gen>! (format-id this-syntax "~a!" #'<gen>)
#'(begin
(define <gen>-format (make-parameter init-format-expr))
(define current-<gen>-id (make-parameter 1))
(define (<gen>!)
(begin0 (convert-fn (format (<gen>-format)
(current-<gen>-id)))
(current-<gen>-id
(add1 (current-<gen>-id))))))]))

(define-global-generator fresh-ssa-reg
"SSA-r~a"
string->symbol)
;; (fresh-ssa-reg!) -> 'SSA-r1
;; (fresh-ssa-reg!) -> 'SSA-r2
;; (fresh-ssa-reg!) -> 'SSA-r3

(define-global-generator fresh-label
"__L~a"
identity)
;; (fresh-label!) -> '__L1
;; (fresh-label!) -> '__L2


>>62469538
>I don't know hindly-milner
simple text-book type inference. write the evaluator instead
>>
>>62469570
It's still an ADT and can do all ADT things, what's your point?
>>
File: my-sides.jpg (6KB, 200x200px) Image search: [Google]
my-sides.jpg
6KB, 200x200px
>>62469538
>I don't know hindly-milner and can't be fucked researching it right now.
What about my network engine suggestion? You want to give that a shot?
>>
>>62469580
Oops, the fresh-label! function returns strings e.g. "__L1", "__L2"
>>
Why does nobody use Rust anymore? ;_;
>>
>>62465584
>picked up a couple programming books books at the begining of the summer
>only started reading them in august
>My moms Bay area tech firm just hired me
>All I have to do Is automate some price sheets with new prices from amazon
>I just steal things off stack overflow and shit post on /g/ when they don't work
>unpaid graduate interns falling over themselves to help me with my work
>not sure if they trying to get in my pants or trying to get me to talk them up to my mom.
>22$ per hour
>I work from home whenever I am to lazy too come in

IMO pretty easy. Just be a confident and believe in yourself.
>>
>>62469580
>define-syntax
That's the only major thing I have against racket.
>>
>>62469598
>not using de Bruijn indices
>>
>>62469602
Flavor of the month.
And the month has long gone.
>>
>>62469584
It is awful in comparison to a real ADT, like std::variant from C++.
It is absolutely not comparable at all.
>>
File: pepe .jpg (245KB, 1366x768px) Image search: [Google]
pepe .jpg
245KB, 1366x768px
unsure if this goes here or in sqt

c++
Is using cin.fail() (obviously not on it's own) as input validation good practice?
Can i put use it inside my set functions that are in a class in another file?
>>
>>62469615
Why? Have you ever actually used it? Do you know what syntax-parse is?
>>
>>62469625
>ones a templated struct
>the other is a templated class
literally what is your point?
Or is it not valid because you didn't like being wrong?
>>
ATTENTION C PROGRAMMERS

I have a program, myProgram, that is invoked in the following way:

"myProgram otherProg1 otherProg2 otherProg2Arg1 otherProg2Arg2"

myProgram will exec otherProg1 and otherProg2 inside itself. Invoking otherProg1 is as easy as:

execvp(argv[1]);

But how do I invoke otherProg2? Can I do:

execvp(argv[2], argv + 2);

Trying to use fancy pointer arithmetic. Pls help
>>
>>62469642
What the fuck? I'm not saying C++ and D variants aren't comparable, they absolutely fucking are - both are complete utter fucking trash shit.
>>
>>62466048
it's C++
>>
>>62469638
>Why? Have you ever actually used it?
Yup, and I found it more complex and restrictive than defmacro.

>Do you know what syntax-parse is?
Nope.
>>
>>62469650
tell me why then.
What can't my ADT's accomplish that they should?
>>
>>62469661
use a language with ADTs and a language with
that style of library ADTs and tell me they feel the same
>>
>>62469645
int main(int argc, char *argv[])
{
for(int i = 1; i < argc; ++i)
{
execvp(argv[i]);
}
}
>>
>>62469659
It's not any more restrictive than defmacro. Yes, its a bit more complicated.
syntax-parse lets you succinctly write very complex macro syntax. Hackett and Turnstile wouldn't be possible without it.

>>62469661
No pattern matching = basically unusable
>>
>>62469645
this is homework. read the documention. man execvp
>>
>>62469679
sugoi goal-post move, baka-chan
>>
>>62469687
Hmm, note that all argv[i] for i >= 3 are actually just arguments for the program specified by argv[2]
>>
>>62469703
How is this goal post moving?
Everyone I have seen use that term was themselves moving the goal posts and engaging in some semantic bullshit

C has variants because you can just do

struct
enum tag ...
variant ...

that's fucking bullshit
>>
>>62469718
I see, but it's still just a for loop
>>
What programming languages are available in the base windows 7, without downloading anything? I'm trying to make a list:
>Visual Basic Script
>Batch Scripting
>JavaScript
Thanks lads
>>
File: large[1].jpg (88KB, 500x338px) Image search: [Google]
large[1].jpg
88KB, 500x338px
>>62469604
>>
Does anyone here have any experience with Unreal Engine 4? I'm just learning unreal engine, and I'm trying to make a deck of cards as practice.

I have this code for drawing a card from the deck (cards are stored in a std::stack<Card>)

This is the code snippet from Deck.cpp that's causing problems
//Draw a card by removing the top of the deck. Return the drawn card
ACard ADeck::Draw()
{
ACard drawnCard;
drawnCard = (this->deck).top(); //This line is erroneous
(this->deck).pop();
return drawnCard;
}


However, I get the error
Severity Code Description Project File Line Suppression State
Error C2248 'ACard::operator =': cannot access private member declared in class 'ACard' Cards E:\Programs\Epic Games\Projects\Cards\Source\Cards\Deck.cpp 42


Do I have to create my own assignment operator for an actor, or does Unreal Engine do that behind the scenes? I'm confused as to why is says the operator is private.

This is Card.h
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Card.generated.h"

UCLASS()
class CARDS_API ACard : public AActor
{
GENERATED_BODY()

public:
// Sets default values for this actor's properties
ACard();

protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;

public:
// Called every frame
//virtual void Tick(float DeltaTime) override; //Not needed, since the card remains pretty static

UPROPERTY(EditAnywhere)
int value;

void SetValue(int value);
};




Yes, I went to /agdg/, they were no help.
>>
>>62469734
Can I do it without that? Would:

execvp(argv[1]);
execvp(argv[2], argv + 2);

Work? The argv + 2 is super questionable, I'm not sure if pointer arithmetic works like it would with char/int arrays, since it wouldn't know how many bytes to skip (how long the string is)
>>
>>62469696
You can pattern match, it just won't be as pretty.
>>
>>62469696
>It's not any more restrictive than defmacro
So what happens when you actually do want to break hygiene?
>>
>>62469645
>argv[2], argv+2
These are the same thing.
I'm guessing otherProg1 can never have arguments?
The second argument to execvp is an argument list of similar form to the one you were passed. Just starting at the otherProg2 instead.
Go read the man page. It's very simple.
If you otherProg1 can have arguments you need something to differentiate argument from program name.
>>
>>62465093
I know Java and C++. Is it worth to get a C programming book and learn C?
>>
Pattern matching doesn't need to be a language feature.
>>
>>62469786
>I'm guessing otherProg1 can never have arguments?
That is correct.

>The second argument to execvp is an argument list of similar form to the one you were passed. Just starting at the otherProg2 instead.
Exactly, I'm aware the second param of execvp needs to be a char**, I'm just struggling to accomplish that. I suspect argv + 2 might be the way to.
>>
>>62469762
>Video game programming
Ah, I see your a subhuman
>>
>>62469828
Ah. I see.
You want &argv[2]
>>
>>62469837
Ah I didn't think to use &, that's exactly what I want to do. Thanks.
>>
>>62469762
You're defining operator = somewhere. Post that.
And Unreal engine 4 (for the revision I read) is very complicated from the C++ end.
>>
>>62465977
No it's not.
>>
>>62469779
You can inject a symbol into the context of another piece of syntax using datum->syntax. format-id does this automatically (my example define-global-generator breaks hygiene)
>>
>>62469886
Fair enough. Maybe I'm wrong about it being more restrictive.
>>
File: 1488944302180[1].jpg (195KB, 902x762px) Image search: [Google]
1488944302180[1].jpg
195KB, 902x762px
Doing a program that reads out Roman numerals in converts them into arabic numbers. My code is nearly complete, but I need to find a way to print out an message when a non roman interval is inserted. Here is my work so far:
int value(char romanChar) {
switch (romanChar)
{
case 'I':return 1;
case 'V':return 5;
case 'X':return 10;
case 'L':return 50;
case 'C':return 100;
case 'D':return 500;
case 'M':return 1000;
}

}

int roman_to_int(string measure) {
int i, j;
int total = 0;
int max_value_so_far = 0;
j = measure.length() - 1;
for (int i = j; i >= 0; i--) {
if (value(measure[i]) >= max_value_so_far)
total = total + value(measure[i]);
else {
total = total - value(measure[i]);
}
max_value_so_far = value(measure[i]);
}
return total;
}
int main() {

string julius;
string brutus = "b";
int octavian;
cout << "Please enter a Roman numeral :";
cin >> julius;
while (julius != "b") {
// if (julius != ){
// cout << " Sorry, " << julius << " is not a Roman numeral. Please enter a Roman numeral :";
// cin >> julius;}
octavian = roman_to_int(julius);
cout <<"That has the value "<< octavian << ".\n";
cout << "Enter another numeral :";
cin >> julius;
}
cout << "Et tu Brute?\n";
keep_window_open();
return 0;

}
>>
>>62470003
>but I need to find a way to print out an message when a non roman interval is inserted
what is the "default" case.
>>
>>62470003
Read the sticky, stupid newfag
>>
why do people from india hate any computer science course not directly relevant to a job in software development?
>>
>>62470073
Because to them it's only JOB TRAINING, they can't imagine programming for fun unless it's just an act in order to secure a job.
They want a JOB programming, this is their only goal.
They are only interested in programming as a means to an end to make money.
>>
>>62470031
Tried that but it cause a shit ton of loops to occur
>>62470059
Everyone has to start somewhere faggot
>>
>>62470073
Because Poo's embrace no pajeet left behind.
Why raise the bar and make jobs harder to get because you actually have to know things. When we can just get rid of it and over-saturate the market with sub-standard people and their shoddy FOTM work. Thinking and good software are just too hard anon.
>>
>>62470073
you may not realize this
but the $4/hour they make programming on the internet is enough to support their entire family including their parents
it means a lot to them to be able to get that job

which means all of them are competent (comparatively speaking) so they can't afford to waste any time studying anything that wont give them an edge in their job
>>
>>62469792
If you really know C++, you can pick up C in a day or two. The differences are not numerous.

Off topic: when someone says they know C++, does that include template metaprog?
>>
>>62470123
>good software
Your retarded. Good software is software that works. Why should a company pay you $100k a year to make some super optimized, but extremely complicated and unportable software that would take you 2 years to make, when they can hire some pajeets foe $20k a year, and they can develop it in 6 months in a slightly unoptimized form, and slightly slower?
>>
>>62470162
There are literally millions of different languages that people call "C++", so when someone says they "know C++", it's completely meaningless.
>>
Sorry guys, I asked this earlier but couldn't get any responses. What programming languages are available on windows without downloading anything? I know of:
>VBS
>Batch
>JavaScript
>>
>>62470166
>Good software is software that works.
Ah yes, the pajeet-mentality in action.
>to make some super optimized, but extremely complicated and unportable
How does being super optimized have anything to do with portability?
>anything efficient is complicated
quite the opposite
>slightly
>slightly
ah yes, rajeesh, your shit software and programming """""""""skills"""""""""" are only """"slightly""""" worse.
>>
>>62470162
>does that include template metaprog?
no, almost never
>>
>>62465916
But my parents are japanese, wtf are you talking about
>>
File: 35b.jpg (27KB, 455x319px) Image search: [Google]
35b.jpg
27KB, 455x319px
>>62470162
>template metaprog
Never again.
>>
>>62470189
>>JavaScript
how do you figure? if it counts because it runs in iexplore.exe then php counts too depending on your windows version/optional install options on the disc
>>
god java is disgusting
burns my fucking eyes to have definition and implementation in the same file, member variables defined fucking anywhere in the file you damn please, etc
>>
>>62470248
Separating definitions and implementations is redundant C nonsense.
>>
>>62470189
x86 asm if you have 32bit windows
you can open up an assembler in the command prompt
removed in 64bit versions I believe
>>
>>62470275
i think it is still pretty damn useful for getting a general idea of the function of a class and its interface at a glance rather than having to scroll through a whole fucking file and scan for all the method names just to see the class interface
>>
>>62470166
your response is still assuming that a computer science degree is job training for a software development job
>>
>>62470298
I'm someone else but I agree. I think header files should be generated by the computer, however. There could be notation for comments which would be kept.
>>
>>62470162
>template metaprog?
I think I already forgotten about.

Related question: how do you feel about the STL? I've heard some people don't like it.
>>
>>62470209
>how does super optimized have anything to do with portability
Either bait or retardation. Please read manual on basic asm
>>
>>62470397
>you can only optimize if youre using ASM
wew lad
>>
>>62470162
When people say Haskell I always assume they include RankNTypes
>>
>>62470247
I include Javascript because it can run with IE. But PHP you say? How can I run this?
>>
imagine spending 4 years of your life and thousands of dollar to job train for being an application developer
>>
>>62470282
Oh shit, really? If I write a .asm file in notepad, what command can I run to assemble it?
>>
>>62470189
Is PowerShell include on Home and Pro editions of Windows? If so, that might also count.
>>
>>62470446
masm32
>>
>>62470409
>I say X
>"hahaha, your retarded for saying Y! This proves that I am smart in my mind!"
>>
>>62470449
I would count it as well, but would need to check. Will definitely look into this
>>
>>62470467
why'd you tell him to "read manual on basic asm" then, esl?
>>
>>62470460
I thought you needed Micro(botnet)soft Visual Studio for this?
>>
>>62469696
>>62469777
>>62469798
you can achieve pretty clean/concise pattern matching with std::variant using visitation by generic lambda overload set

using my_variant =
std::variant<
int, float,
std::vector<int>,
std::vector<float>>;

template<typename... T>
struct overload_set : T... { using T::operator()...; };
template<typename... T> overload_set(T&&...) -> overload_set<T...>;

int main()
{
// ...

my_variant var = { ... };

std::visit(
overload_set
{
// matches any
[](const auto& x)
{
std::cout << x << std::endl;
},

// matches vector of any
[](const std::vector<auto>& xs)
{
for (const auto& x : xs)
std::cout << x << std::endl;
}
},
var
);

// ...
}


C++20 proposes additional syntax for declaring named type arguments and non-type template arguments in lambda declarations (already available in GCC), enabling even more robust functionality in such overload sets, and often cutting down on syntax considerably. overload sets like these can also simply be stored and called directly with regular non-variant arguments, of course

constexpr auto foo = overload_set
{
[](const auto& x) { ... },

[]<std::size_t N>(const std::array<auto, N>& xs) { ... },

[]<typename K, typename V>(const std::unordered_map<K, V>& m) { ... }
}


really changes the game for generic code in C++
>>
>>62470492
lad, why do you even have this "no downloads" restriction in the first place?
>>
>>62470482
Oh, so I say "super optimized" in my original statement, which you would need asm for. But it's find when he fake news's and starts twisting my words?
>>
>>62470513
ASM is not the only language you can optimize well in, you literal fucking pajeet.
Please fuck off back to >>>/int/ with your broken english.
>>
NEW THREAD!

>>62470536
>>62470536
>>
>>62470510
Just for fun. You know, it's cool when your over a friends house and can make a quick script for them. Can't guarantee they have compilers on their computer. I also know some high level languages, so it's not like I've dodged those by any means
>>
>>62469750

You should have a C# and VB.NET compiler present off the bat. There is also PowerShell, which you should be using instead of VBScript or Batch Scripting.
>>
>>62469635
please
reply
Thread posts: 317
Thread images: 37


[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.