[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: 320
Thread images: 27

File: mh3P7CD[1].png (211KB, 750x1091px) Image search: [Google]
mh3P7CD[1].png
211KB, 750x1091px
Previous thread: >>59635709

What are you working on, /g/?
>>
1 1 1 GO!!!
>>
>>59642274
life
u?
>>
fourth for lisp
>>
fourth 4 forth
>>
ch3.core=> (first (hash-map :a 1 :b 2))
[:b 2]
ch3.core=> (rest (hash-map :a 1 :b 2))
([:a 1])

nigga... this shit aint right
>>
Trying to find a library for creating OPC DA servers that doesn't cost hundreds of dollars.
>>
>>59642397

expecting any specific order from that datastructure is not right
>>
>>59642408
hey ruby why don't you get a real job?
>>
>>59642413
oh, makes sense
>>
File: 9016407913.jpg (172KB, 431x3341px) Image search: [Google]
9016407913.jpg
172KB, 431x3341px
>>
File: 1488947452762.jpg (63KB, 991x558px) Image search: [Google]
1488947452762.jpg
63KB, 991x558px
>>59642279
good luck!
>>
>>59642274
Currently installilng VS2017 for c++.
So excited to try it out!
>>
>>59642274
Well, what the fuck?
>>
Why is WinAPI such a piece of shit?
>>
>>59642419

I've decided I want to become a professor and do research. That is a real job, although it takes fucking ages to be qualified for that job. In the mean time, I've got a research assistantship.
>>
>>59642643
what is there even to research?
>>
Is there any way to implement custom handlers for 'implement interface' in Visual Studio 2017 or Resharper? Given the special 'Implement IDisposable' and 'Implement INotifyPropertyChanged' routines, it must exist somewhere, but is it exposed anywhere? I'd love to rig up some additional common patterns (IValidatableObject that automatically scaffolds out with all of the properties of the type for example).
>>
>>59642654

Plenty of shit, mostly in cybersecurity and machine learning though.
>>
>>59642654
Quantum Assembly
>>
>>59642640
>Win
Found it.
>>
>>59642693

That brings up a question I've often wondered... what SHOULD an assembly language for a quantum computer look like?
>>
I need to make a method in scala that executes given code with probability. But it needs to return value type T and I have no idea how I do that.
  def withProb[T](prob: Double)(choice1: => Any): withProbElse[T] = {
require(0.0 <= prob && prob <= 100.0)
new withProbElse[T](prob, choice1)
}
protected class withProbElse[T](prob: Double, choice1: => Any) {
def otherwise(choice2: => Any): T = {
if (1.0-prob/100 > rand.nextDouble()) {
choice2
}
else choice1
}
}
}
>>
You have an error detection/correction algorithm that is capable of producing 512 valid, 10-bit codewords.
How many data bits are in each codeword produced by this algorithm?

log2(512) = 9, so would it be 9 data bits??
>>
I'm learning c++ and people keep giving me examples where they use . and -> (seemingly) interchangeably.
What's the difference between them?
>>
>>59642850
>I'm learning c++
>>
>>59642850
. accesses a struct member
to access a struct member in a pointer to a struct, you'd have to do (*ptr).a
this is such a common thing that it has it's own operator, ptr->a
>>
File: Screenshot_20170329_152129.png (324KB, 1157x1622px) Image search: [Google]
Screenshot_20170329_152129.png
324KB, 1157x1622px
>>59642274
Why do they no longer support this in long mode?
>>
>>59642673
OT & random, but are you a coffee shop coder?
Do you have a well groomed and waxed beard and wear flanel shirts with designer jeans?
Do you drink beverages with verbose names?
>>
>>59642887
10/10 thanks
>>
>>59642893
Did they ever? I thought it had been soft deprecated back in the 386 days.
>>
Can anyone recommend some good sources for learning React? the codecademy courses seem a bit out of date
>>
File: 1490513637373.jpg (80KB, 400x597px) Image search: [Google]
1490513637373.jpg
80KB, 400x597px
>>59640422

>>59642123
>>59642040

I have basically nothing but allocated arrays.
What I have assumed:
i, j
00 01
10 01

i, j:
00 01 02
10 11 12
20 21 22

So, we have to compare
1.
00 = 00;
01 = 01;
10 = 10;
11 = 11;

2.
00 = 01;
01 = 02;
10 = 11;
11 = 12;

etc. So, I understand what is meant by overlaying. Am I on the right track? Shit, these loops drive me insane. I have just done matrix multiplication and sorting by row/column, but can't do this shit. Hilarious.
>>
>>59642816
>10-bit codewords
>How many data bits are in each codeword produced by this algorithm?
really makes you think
>>
>>59643039
just the standard tutorial for react & redux should be enough, after that just use the documentation/google
>>
>>59642901

I don't visit coffee shops that often. When I do, I often get hot cocoa or an Italian soda. I've found that most coffee shops offer this on the menu, but can't make them right, either due to not using enough syrup or not stirring the damn thing properly.

My beard looks kind of like a rat's nest, minus the part about being filled with garbage and insects/animals. I don't bother to brush it much, and I never trim it. I don't wear flannel shirts or designer jeans. I do wear a lot of second hand clothes, except of course for my boxers which I buy new for obvious reasons.

I drink a lot of soda, juice, tea, and cocoa, and occasionally a large quantity of milk when I have acid stomach. Not necessarily the most healthy of choices, but everyone has their vices. I don't do any drugs, and I can't stand alcohol, and I can't stand a number of sweets, so I might as well let soda and fried foods be my poison in life. I don't think anything I eat or drink has a super verbose name, except for maybe Sauerbraten and Spatzel around Christmas time.
>>
>lisp
too verbose
>sml
no good implementation
>c
manual memory management, not that it's bad but when prototyping it slows down the development
>sepples
convoluted cluster fuck that no sane person would touch
>every jvm or .net language
requires fuckhuge vm

There just is no good statically typed and compiled language.
>>
>>59643239
What is OCaml?
>>
>>59643260
ml with propably the ugliest syntax.
>>
File: I'm_in.png (1MB, 1357x1281px) Image search: [Google]
I'm_in.png
1MB, 1357x1281px
>>
>>59643239
>convoluted cluster fuck that no sane person would touch

>i dont understand it, lets blame the language
>>
>>59643292
fake as always
post the actual tweet
>>
>>59643281
You judge a language by the less relevant part.
>>
>>59643293
>>i dont understand it, lets blame the language
The language is standardized and it's not that hard, it's really big though.
But sepples enables programmers to write the most unreadable code mess with templates.
>>
>>59643306
fag
https://www.instagram.com/p/5c1WXeESvD/
>>
File: 1414706047254.png (245KB, 287x400px) Image search: [Google]
1414706047254.png
245KB, 287x400px
Ah, the wonders of legacy code.

> be me
> working on timesheet program
> boss says I need to use company's legacy framework
> no documentation
> no comments
> fuck with the API until I get the hang of it
> finally patch a fatal error after almost two weeks
> compile, run unit tests, everything looks good
> open program to double check
> mfw all my date/time components are stuck in Japanese
>>
>>59643353
thanks for the link bro couldn't be bothered finding it myself
>>
>>59643331
If syntax was not relevant propably everybody would be using sepples.
>>
>>59643094
i was bored so i wrote something up, it probably doesn't work tho

int matmat(mat2 *hs, mat2 *n)
{
if (n->size > hs->size)
return 0;
size_t i, j, k = 0, match = 0;
size_t items = n->size * 2;
for (i = 0; i < hs->size; i++)
{
for (j = 0; j < hs->size; j++)
{
if (k + hs->size < (i > j) ? i : j)
{
if (hs->mat[k+i][k+j] == n->mat[k+i][k+j])
match++;
else
match = 0;
}
}
if (match == items)
return 1;
k++;
}
return 0;
}
>>
>>59642274
Java and The Kingdom of Nouns

Read it it's good article
>>
>>59643094
Yes, that is the right track, you can make your life easier by breaking up the task into more than one function. My loops would walk down each i,j of the larger matrix. Then, I would have a function to check if the current i,j is within bounds for checking (i.e. i - small_i > -1, i + small_i < len(A[i], ect), then a function that that passes in i,j for the larger matrix and does the actual looping through the smaller one (if valid to check).
>>
>>59643364
who are you quoting?
>>
>>59643331
# macro square = << fun x -> x * x >>;;
macro square : (int -> int) expr =
<< fun x_1 -> Pervasives(*global*).( * ) x_1 x_1 >>
# macro n = << $square (42+1) >>;;
macro n : int expr =
<< (fun x_3 -> Pervasives(*global*).( * ) x_3 x_3)
(Pervasives(*global*).(+) 42 1) >>
# $n;;
- : int = 1849
>>
>>59643374
oh yeah, the offsets probably shouldn't be applied to the needle matrix
also the nested for loops should probably stop at the limits of the needle matrix and not the haystack matrix
>>
File: --1069.jpg (52KB, 500x522px) Image search: [Google]
--1069.jpg
52KB, 500x522px
>>59643239
>manual memory management, not that it's bad but when prototyping it slows down the development
You know what?
It's your chance.
Make your good statically typed and compiled language. At first you gotta write out where allocate and deallocate memory manually, but when you've set all conditions of memory allocation and deallocation, you can just use your language, because it will do all the work.
It's time to shine for you!
>>
File: post4_2.png (8KB, 1024x1024px) Image search: [Google]
post4_2.png
8KB, 1024x1024px
What does this mean, reddit

http://www.0xbeef.coffee/posts/post4.html
>>
>>59643446
trash
>>
File: fuckingmicrosoft.png (8KB, 366x194px) Image search: [Google]
fuckingmicrosoft.png
8KB, 366x194px
>trying to program
>suddenly this shit starts popping up every few seconds
>dont even use vc++ compiler or their package shit
>>
>>59643189
a codeword is made up of data bits and error detection bits
>>
>>59643651
cl is fucking easy to use
>>
>>59643651
Who said this though?
>>
File: 1487463346405.png (97KB, 1934x1069px) Image search: [Google]
1487463346405.png
97KB, 1934x1069px
>>59642300
>>
There is no real alternative to C++.
>>
>>59643719
Yes, stay with C++.
>>
>>59643719
yess stay with C++ goyi- i mean pajeet
>>
>>59643730
I will stay with C++.
>>
>>59643719
>what is rust
inb4 le functional syntax meme
>>
>>59642816
It's been a while, that would make sense. The error code can only detect if a word is bad, not necessarily which part, thus 1 bit per word is needed, so 9 bits of the 10 are left for actual data.
>>
>>59643747
>le
>meme
>>>/r/ibbit
>>
>>59643747
Rust will have to wait for a bit. It's a better language but it has less libraries than C++
>>
>>59643747
Convince me that rust is better.
>>
>>59643747
Rust is a meme lang created by meme people for meme people
>>
>>59643773
that was ironic newfriend
>>
File: 1487463346465.png (100KB, 1244x1024px) Image search: [Google]
1487463346465.png
100KB, 1244x1024px
>>59643779
It's templates are not broken
>>
>>59643781
>meme
>>>/r/ibbit
>>59643783
Ironic shitposting is still shitposting, newfriend.
>>
>>59643747
Reminder that Rust devs are perfectly okay with memory leaks in their language.

Stick with C and C++, no need for that useless meme language.
>>
>>59643829
>plebbit spacing
>meme
>>>/r/ibbit
>>
File: Lawrence-300x222.jpg (13KB, 300x222px) Image search: [Google]
Lawrence-300x222.jpg
13KB, 300x222px
>over 16 and still no STEM degree
literally LMAOing at you
Ruth Lawrence earned her degree in Mathematics at the age of 13, at Oxford.
>>
>>59643855
>over 16 and still no STEM degree
Cool. Who said that though?
>>
>>59643855
i live in a third world shithole tho
>>
>>59643829
C++ is a barely manageable language. I think that was one of those misunderstood points. My point was that there is no clear flow to work with the language. That can be a blessing, it allows a lot of freedom. That can be a curse. Let’s discuss the downsides.

The split between source and headers, which makes project management quite slow. If you make all header libraries you’ll have a lot of copied code – the binaries will be larger. You’ll have to recompile that code every time you want to use it. And the split between the two is always troublesome – you can’t add a new field to your class without a few CTRL-TABs until you find where to write the proper definition.
You still can’t write template code in .cpp files. You have to write code in the headers. If you mix that with some #ifdef & friends, it becomes a mess quite fast. Not to mention that you include content that is really implementation dependent.
C++ still uses the C preprocessor. That is the first feature that should’ve gone from the language. If you think about it, the header should represent the features that your object offers and not a letter more. However, people ended up delivering these huge files that can be used everywhere even if they will be used in one place and one place alone.
Namespaces are useless and make the code way too verbose. Instead of making your code cleaner and clearer, the programmers will end up doing a using namespace xxx. If you don’t believe me, look at how the code for using the duration_cast looks without some usings (auto only hides the dirt under the rug).
Lack of ABI makes it impossible to deliver C++ components without a C interface. If you don’t, you’ll crash quite fast when you use the flag -fsuper-duper-new-feature because you should’ve used the flag -fsuper-duper-extra-cool-newer-feature.
>>
>>59643829
>2017
>Undefined behaviors
>Treat memory leaks and UBs as features
What’s really unfortunate is that “undefined behavior” is part of the language and its specifications. Initially, some aspects were left undefined in order to be able to efficiently deal with different hardware and to avoid unnecessary overhead due to over-specification.

Do note that programmers often confuse the terms “implementation-defined” with “undefined behavior”. Parts of the language that are “implementation-defined” still allow the developers to write perfectly specified code as long as the target machine is known3.

Again, as it is with all the other bad parts, this will probably never be changed – it can’t be changed. Even Bjarne Stroustrup agrees in an interview over at MSDN that way too many things have been left undefined or implementation-defined. If C++ was redesigned from scratch, there would likely be no undefined behavior at all.

However, I don’t have a time machine and we just cannot break hundreds of millions of lines of code by picking a set of resolutions today

t Bjarne Stroustrup
>>
"I dun wanna write C no no no it bad, it bad, no good, no good"

Joan Carmichael
>>
>>59643829
How can a language have memory leaks?
>>
File: 1490451227334.jpg (25KB, 405x381px) Image search: [Google]
1490451227334.jpg
25KB, 405x381px
>>59643939
>>Undefined behaviors
everyfucking time
>>
>>59643950
He is an idiot
>>
>>59643950
Shit garbage collector and heap manager.
>>
>>59643968
How can a language have a garbage collector or a heap manager?
>>
>>59643939
Ctd.
Some of the semantic elements that have been left undefined involve even simple concepts like the execution order of function calls:

foobar(foo(), bar());

It is not defined, whether foo() will be called before or after bar() has returned. That’s just silly.

Operations, such as division by zero, integer overflows or out-of-bound memory access will also result in undefined behavior. Granted, these things should not occur and can generally be avoided if the code offers even a slight hint of quality. However it would still be nice to have a well-defined behavior here, especially when talking cross-compiler and cross-platform.

1 1 1 GO!!!.jpg
>>
>>59643950
>How can a language have memory leaks?
https://www.google.com/#q=php+memory+leak+bug

PHP "developers" just restart Apache every 10 requests
>>
>>59643999
Is that a "feature" every compiler has to implement?
>>
>>59643999
>PHP "developers" just restart Apache every 10 requests
now that's why i don't want to learn php
>>
File: dpt.jpg (164KB, 800x1000px) Image search: [Google]
dpt.jpg
164KB, 800x1000px
>dpt
>programming
>>
>>59644031
who are you quoting?
>>
>>59644031
woh rae oyu nqouitg?
>>
enum traffic_lights {
RED = 1,
YELLOW = 2,
GREEN = 4
};

As you may expect, this is just an int with some named constants. You can declare multiple values with the same value, you can assign int value to it. And if you do YELLOW++, you don't end up with GREEN, but with a value that isn't defined in the enum (but doesn't raise an exception either). You also cannot iterate over existing enum values. At this point, this is just useless syntax sugar for
#define RED    1
#define YELLOW 2
#define GREEN 4

However C++11 does introduce enum class. It fixes none of the issues described above, but makes you prefix the enum values with the name of the enum.
Well(!) done.
>>
>>59644068
Do you know that OCaml exist?
>>
https://github.com/erikd/libsndfile/blob/master/src/sndfile.c#L300

What in the fuck...
>>
>>59644082
Yeah python does too. What's your point?
>>
>>59644082
Yes, I also know that it's trash.
>>
>>59644091
I don't use C or C++ but is it a good idea to define in the middle of the body?
>>
>>59644095
Enum types in python? No/
>>
>>59644055
It's "Whom are you quoting?".
>>
>>59644138
Libraries on OCaml? No/
>>
>>59644150
I disagree.
>>
>>59644150
the phrase is from /jp/ m8
>>
>>59644091
wtf i hate c now
>>
>>59643939
>it can’t be changed.
Why not? What stops the C++ people from defining a specific semantics for most forms of undefined behavior for C++20? All valid existing code will still work as expected when compiled with a C++20 compiler, for the valid code does not evoke any of the formerly-undefined behavior, and modern code needs to be compiled with a modern compiler just like is already the case when I want to use C++14 features or what have you.

>If C++ was redesigned from scratch, there would likely be no undefined behavior at all.
I'm not sure that is wise. A bunch of the undefined behavior is there for a very good reason. Though it is also clear that there are instances where it makes no sense and/or provides no clear benefit. I think the function call order in >>59643988 is such a case, though I'm not positive.

>However it would still be nice to have a well-defined behavior here, especially when talking cross-compiler and cross-platform.
That would require active checking whenever you perform any division, and therefore also break a bunch of optimization opportunities. This would NOT be cheap.

There is clearly value in a language where all these things are well-defined; yet I think there is also real value in languages where it is not.
>>
>>59644091
{    if ((a) == NULL)                        \
{ sf_errno = SFE_BAD_SNDFILE_PTR ; \
return 0 ; \
} ; \
(b) = (SF_PRIVATE*) (a) ; \
if ((b)->virtual_io == SF_FALSE && \
psf_file_valid (b) == 0) \
{ (b)->error = SFE_BAD_FILE_PTR ; \
return 0 ; \
} ; \
if ((b)->Magick != SNDFILE_MAGICK) \
{ (b)->error = SFE_BAD_SNDFILE_PTR ; \
return 0 ; \
} ; \
if (c) (b)->error = 0 ; \
}


ah yes, what a great language
>>
>>59644068
>I want Sepples to be like Ada
Just use Ada
>>
>>59644163
The quoted person is definitely the question's object.
>>
>>59644196
>What stops the C++ people from defining a specific semantics for most forms of undefined behavior for C++20?
Yeah why not C++17? Or C++11? Ask 'em. C++20 is not going to bring unicorn tears with it.
>>
>>59644227
The rules don't apply when it's a direct quote.
>>
>>59644227
Languages change
>>
File: vomit-clipart-l_074.jpg (21KB, 500x500px) Image search: [Google]
vomit-clipart-l_074.jpg
21KB, 500x500px
>>59644216
Ewww is that C by any chance?
>>
>>59644227
>to whom is that boy running
Looks like something a kraut would say being over-confident in his English.
>>
>>59644219
Really? Is it good?
>>
>>59644196
>I think the function call order in >>59643988 is such a case, though I'm not positive.

This will be well-defined in C++17.
>>
>>59644219
>Ada
No like Rust
>>
>>59644255
Congratulations if that's true. Now they have to fix rest of the pile of complaints
>>
>>59644227
I couldn't care less, "whom" here just sounds ugly.
>>
>>59644233
I don't think they are going to do it at scale either. But I don't think backwards compatibility is the reason, for it would be perfectly compatible. Rather, I think the reason is that most of these forms of undefined behavior are there for a good reason.
>>
a script that collects all the posts that have only one word.
>>
File: hippity_hoppity.jpg (38KB, 480x480px) Image search: [Google]
hippity_hoppity.jpg
38KB, 480x480px
I want all Rust fags to leave this board.
>>
File: test.png (31KB, 287x400px) Image search: [Google]
test.png
31KB, 287x400px
>>59643364
>>59643446
Neat stuff
from PIL import Image
im = Image.open(myPath + "1414706047254.png")
xSize, ySize = im.size
for y in range(ySize):
for x in range(xSize):
if (x * x * y & 0x0400) != 0:
im.putpixel((x, y), (255, 255, 255))
else:
im.putpixel((x, y), (0, 0, 0))
im.save(myPath + "test.png")
>>
>>59644289
Not your safe place
>>
>>59644244
Macro definition.
>>
>>59644289
Im just curious what the rust fags are making 2bh
>inb4 nothing
>>
>>59644308
That's not how you use either "inb4" or quoting.
>>
>>59644291
>>59643446
this reminds me of the stuff I used to make in quickbasic when I was 10
>>
File: Избор_110.png (186KB, 493x632px) Image search: [Google]
Избор_110.png
186KB, 493x632px
hey gays, what do you have to say about this?
is rust the best language for real?
should i learn it?
>>
How much better than Java is C#?
>>
>>59644323
a tiny bit
>>
>>59644251
It's the language for people that like the higher level of C++ but hate how shit it is
>>
>>59643239
Nim
>>
@59644316
(You)
>>
>>59644322
It's mostly bad. But it's still better than pretty much any language which even remotely resembles it.
>>
>>59644308
Currently GNOME/gtk fags are working with their GOBject introspection module. I think many GNOME devs are interested in moving to Rust, they already have made GNOME builder compatible with Rust tools ootb by now
>>
File: 22.png (378KB, 621x465px) Image search: [Google]
22.png
378KB, 621x465px
even Marc Cuban is gitting gud at 卐Python卐
>>
>>59644336
Is it better than Rust?
>>
>>59644403
Rust is inspired by Ada's ideas. Can't say which one is better
>>
Rate my matmat function!
#define max(a, b) (((a) > (b)) ? (a) : (b))
int matmat(mat2 *hs, mat2 *n)
{
if (n->size > hs->size)
return 0;
size_t i, j, k, l;
for (k = 0; k < hs->size; k++)
{
for (l = 0; l < hs->size; l++)
{
size_t matches = 0;
for (i = 0; i < n->size; i++)
for (j = 0; j < n->size; j++)
if (max(k+i, l+j) < hs->size) /* bounds */
if (hs->mat[k+i][l+j] == n->mat[i][j])
matches++;
if (matches == (n->size * 2))
return 1;
}
}
return 0;
}
>>
>>59644416
neither
>>
>>59644397
>normies trying to program
Atleast we have filter languages.
>>
>>59644425
cute
>>
>>59644425
what is a matmat function?
>>
>>59644403
It's not being associated with shitposting idiots, for starters.
>>
>>59644453
Post your Ada code
>>
>>59644295
>Macro definition.
Partial. As done by a complete shitlord idiot.
>>
>>59644416
What is the best resource for learning it? I'll try both I guess.
>>59644435
That seems to impossible.
>>59644453
How would that impact the language itself?
>>
>>59644451
it searches for a submatrix within a larger matrix

like strstr
>>
>>59644464
https://rust-lang.github.io/book/second-edition/index.html
>>
>>59644443
>he implies programming isn't basic skill like cooking food
in 10 years every illiterate negro will be able to write fizzbuzz, you better skill up anon
>>
>>59644453
if Rust can cut back on the tediousness, people will take it more serious.
>>59644489
Maybe hello world or webshit. But beyond that takes too much isolated time and effort. Unless you fall for the mob programming meme.
>>
>>59644397
is programming a celebrity meme now?
>>
>>59642274
https://gcc.godbolt.org/
Good tool to see if your code smaller/faster depending on how you write it.
>>
>>59644425
Nice! Looks to be correct. If this is for a class/online code grader, I would also make sure to check for being passed NULL, and that f(A, B) == f(B, A). You also assume square matrices, but it should be simple enough to extend it such that it can handle both hs and n being non-square. But those are just mechanical steps, the algo part is always the hardest.
>>
>>59643651

Install gentoo, visual studio don't works properly.
>>
>>59644479
I meant Ada. Thanks for that too, though.
>>
>>59644464
http://libgen.io/search.php?req=Programming+in+Ada+2012&open=0&res=25&view=simple&phrase=1&column=def
>>
>>59644512
>hello world or webshit
but these cover 99% normie programming needs

>is programming a celebrity meme now?
no, its on its' way to become a general skill like driving a car, cooking, etc. which makes sense since compy with wifi is already in our fridge/heart transplants/etc.

maybe as a side effect this will force mass-adoption of linux, oss and privacy as normies will educate themselves about compy stuff
>>
>>59644519

Helps learn ASM also.
>>
>>59643968

But Rust does not have a garbage collector.
>>
>>59644605
>maybe as a side effect this will force mass-adoption of linux, oss and privacy
i don't think i've ever seen a more delusional G*Utard
>>
>>59644637
>But Rust does not have a garbage collector.
because if it had one, it would have collected rust amirite?

>>59644638
i want to believe
>>
>>59644638
GNU did nothing wrong
>>
>>59644667
Yeah, aside from about 90% of what it did.
>>
>>59644638
If Linux can steady improve its flagship software, then were on the way.
Linux people on average pay more for games. More people are porting or porting from. Combined with a package manager and already relatively painless just werks install.

Obviously still a long way to go, but with the path MS are on, the gaming community at the very least will start to switch.
>>
>>59644667
i first started to hate opensource when i realized i have to link dynamically. literally fuck GPL and LGPL
>>
>>59644678
Which were not wrong
>>
>>59644702
GPL is not the entirety of Open source, idiot
>>
>>59644702
>opensource
>(((GPL)))
Are you retarded by any chance?
>>
>>59644702
What is your problem?
>>
>>59644716
this is true, what i've really meant by opensource is GNU. chill anon
>>
>>59644702
You not have to. Use musl and static linking
>>
>>59644764
>musl
kek
>>
>>59644704
Only if you're an idiot.
>>
>>59644795
which you are
>>
>>59644805
Me being an idiot wouldn't change the wrongness of G*U's existence itself.
>>
>>59644816
Which is wrong because you are an idiot
>>
licences more than a sentence long were a mistake.
>>
>>59644832
How does me being an idiot change past events? You seem to be some sort of a retard.
>>
>>59644557
T H I C C
>>
>>59644843
Not a mistake. A deliberate plot.
>>
>>59644845
>How does me being an idiot change past events?
Because you are an idiot and what you think is idiotic
>>
>>59644843
Copyright was a mistake
>>
>>59644874
So me thinking something right now can somehow change past events? You're even more delusional than I initially thought.
>>
>>59644880
money was a mistake.
>>
>>59644843

>One sentence license
Microsoft EULA:
From that moment we own your ass.
>>
>>59644764
>musl
this is glibc replacement? i was thinking more about stuff like gtk which requires to ship 30 dll for hello world app. i just want one .exe
>>
>>59644891
>So me thinking something right now
That's where you are wrong
>>
>>59644892
Society was a mistake.
>>
>>59644912
Qt you also can't link staticly.
>musl
It's not replacement, it's library for embedded systems, small, not very fast, but sometimes faster than glibc.
>>
>>59644921
existing was a mistake.
>>
>>59642274
Symbolic computation library for ML applications in rust.
>>
>>59642901
He is a larping neet.
>>
>>59644920
Neither of those are actual arguments.
>>
>>59644963

none
use C++
>>
>>59644936
>Qt you also can't link statically
i hope it needs less than 30 dll though
>>
>>59643239
Rust.
>>
>>59643239
>sml
>no good implementation
is this true?
>>
>>59644995
>too verbose
>>
>>59644986
Why would I be using C(IA)++?
>>
>>59644322
It's bar none the best language currently available. it's not perfect, but it's still pretty close. No other language remotely comes close in any application except scripting.
>>
>>59645020
What does the CIA use for much of its software? I cant imagine just sepples
>>
>>59645054
How can something with a toy type system be "the best language currently available"?
>>
>>59644986
What the fuck is that supposed to mean? Did you quote the wrong post or are you just clinically retarded?
>>
>>59645018
Demonstrate this fact.
>>
>>59645084
>C++
Do you really have to ask if he's clinically retarded?
>>
>>59645054
>its the best language because it prevents memory errors
>except when you use unsafe
Nah.
>>
>>59645083
Because it's focused on actually working instead of rejecting all programs that aren't hello world.
>>
File: wayland-screenshot.png (184KB, 1920x1080px) Image search: [Google]
wayland-screenshot.png
184KB, 1920x1080px
>>59644987

No.
>dll
are you windows-cuck?
GTK requires 11 libs, see screenshot output of pkg-config
>>59645020
Becouse it supports machine learning.
>>
>>59645117
snoring, huh?
>>
>>59645068
CIA doesn't use C++ for its software, they use safe languages. However, the CIA loves when other people use C++ (and even more when they use C) because it all but guarantees severe security flaws allowing them to do whatever they want are present in the software. That is why they're hardcore FUDing against languages that serve as safe alternatives to C or C++ while retaining the same performance characteristics and expressive power.
>>
>>59645115
>Because it's focused on actually working
What do you mean? How can a language be focused on "working"?
>rejecting all programs that aren't hello world
How would you determine if a program is hello world or not? I don't even know of a single language which does that.
>>
>>59645113
Not an argument
>>
>>59645113
who are you quoting?
>>
File: TOTALCMD64_2017-03-30_01-46-39.png (60KB, 402x709px) Image search: [Google]
TOTALCMD64_2017-03-30_01-46-39.png
60KB, 402x709px
>>59645117
>are you windows-cuck
sorry, i like money
>GTK requires 11 libs
more like 30 libs and also ~3 win libs
>>
>>59645117
Child, you don't even know the L in ML.
>>
>>59645136
Have they atleast put any examples out, whether true or not?
>>
>>59645163
holy shit
>>
File: goofytime.gif (43KB, 468x670px) Image search: [Google]
goofytime.gif
43KB, 468x670px
>>59642274
pyspark. And it's killing me.

Why apache? Why? I'll be good next time. Honest! Nooooooo
>>
>>59645163
>879,243
wew
>>
>>59645165
Haven't you seen the recent leaks?
>>
>>59645068
Probably Ada or something similar.
>>
>>59645197
Nah, im off and on /pol/ due to the rampant porn shitters. And rarely leave /dpt/ & /flt/
>>
>>59645163
>muh my system doesn't have package manager
>muh GNU is bad!
Qt helloworld requires much more, and executable file about 5 times larger.
>>
@59645222
who are you quoting, plebbitor?
>>
File: wayland-screenshot.png (214KB, 1920x1080px) Image search: [Google]
wayland-screenshot.png
214KB, 1920x1080px
>>59645163

>879.243
What is it?
On normal os helloworld gtk has size of 12Kb.
>i like money
Then like to suffer also.
>>
>>59642274
I approve of this op.
>>
how hard is to write my own compiler and design my own language?
>>
>>59645274
Not as hard as you might think. A lot harder if you want it to be actually good.
>>
>>59645274
Not hard if you you let someone else generate machine code.
Harder if you generate it yourself but it's still perfectly doable.
llvm is the way to go if you want it to actually be good too.
>>
>>59645274
You need to read at least one book about language design, know C already. How many time depends on how many functionality language will have, it's never-ending process.
1-3 months probably.
>>
>>59645274
its not hard, just incredibly time consuming and tedious.
Because you dont even start at the compiler itself. But a lexer/parser. And itll be years before you self host.

And on top of all that, if you want any kind of graphics youll need a C abi
>>
>>59645274
Not that hard. The harder part is the optimization, writing the standard library, and complex type systems.
>>
>>59645302
Not him, but can llvm be used for any type of language?
>>
>>59645293
>>59645302
So the actual dificulty is the design aspect?
>>
Say I worked on a research project at uni, this project would be technically the universities property correct?

Am I allowed to go off and rewrite it all based off the algorithm and release it without getting into trouble or is the algorithm alone the issue?
>>
>>59645325
Anything compiled. There's some support for interpreted llvm ir somewhere but I think it's not very mature.
>>
>>59645321
Why do self-host?
What if it's not low-level language, and doesn't need to be self-hosted.
>>
>>59645333
No and no, unless your research group is an institute instead of a normal lab. If that weren't the case, you would have to hire someone to cleanroom reimplement your code to get anything legal.
>>
>>59645350
Because self-hosting is a sign of a good language. And the less dependencies, the better.
>>
File: 2017-03-30_01-58-42.gif (244KB, 350x228px) Image search: [Google]
2017-03-30_01-58-42.gif
244KB, 350x228px
>>59645222
>Qt helloworld requires much more
i will see soon, i am gitting good at C++ as we speak. at least with Qt i won't be stuck in exclusive gnome world.

>What is it?
a simple hello world (picrelated) from gtk tutorial. i don't give a shit it's 879.243 to be honest, i just don't want to ship half of linux with my app

>Then like to suffer also
i ll wipe my tears with dead presidents

i just don't get what's the purpose of LGPL. i can still copypaste code and close the source. i can reject updated libs. why can't they make static link available is beyond me. it takes a thief to catch one - GNU is no better than Microsoft or Apple. same shit different toilet
>>
>>59645357
So if I understand this right I just have to sit and watch the project die off?
>>
>>59645325
I think if you're gonna go the virtual machine route you shouldn't use llvm. Llvm does handle interpreted languages too but you shouldn't use it if you're gonna actually use the interpreted nature of the language in any significant way.
The execution performance for interpreting using llvm isn't bad though.
>>
>>59645399
Didn't expect you to understand such simple concepts anyway desu senpai
>>
>If your compiler does not support in-class initializers
Why the fuck is this compiler dependent. C++ has gone too far!
>>
>>59645246
>>59645374
>>
>>59645368
No, it's not.
Language may have complitely different purpose.
Its better to compile every language from one - C.
If it self-hosted it have itself in dependency, awersome.
>>
>>59645274

5 replies and no practical advice.

Use lex and yacc
>>
>>59645321
>self host
Biggest meme in the language world.
It's next to pointless and should only really be a goal when the language is big.
>>59645368
No it's not a sign of a good language it's what people believe is a sign of a good language. Stupid people that is. It's completely irrelevant to any relevant metric for a language.

The one benefit is that your community doesn't need to know multiple languages to sustain itself. But if you're fostering that kind of community you've probably made a shit language. Any decent programmer knows at least two languages.

One of which is C.
>>
>>59645423
C++ is uglier, less safe, and even slower than rust. Stop using a deprecated language, anon!
>>
Can I pause a Javascript function until a condition is changed, rather than pause the function for a specified time?

The problem is that there's an animation I run with recursive requestAnimationFrame, but the function that began the animation doesn't wait for the animation to finish to continue, resulting in things finishing in the wrong order.
>>
>>59643829
Memory leaks are memory safe, that's all there is to it. There are no memory leaks in the language or standard library itself unless it's a bug in the implementation.

Generally, memory leakage only happens because the program aborts without unwinding the stack. It's debatable whether this should even be considered leaking memory since the OS will clean it up immediately.
>>
>>59645480
>Any decent programmer knows at least two languages.
What kind of retard would consider that a "decent" programmer?
>>
>>59645468
You must be 18 or older to browse this site.
>>
>>59645484
>Rust as a C++ alternative
I don't mind this.
Stay away from C though.
>>
>>59645374
You can improve GNU, but can't do the same with Windows /legacy valley.
>>
>>59645468
>C is the end all
alright ivan
>>59645480
sign of != requirement\
>just keep in on C forever

Alright Dennis, thats enough, back to hell.
>>
>>59645496
You must be 18 or older to browse this site.
>>
>>59645474
>whaaa why don't people give garbage advice about something nobody asked about instead of answering the question waaaaaaaa
>>
>>59645492
>at least
I'm not going to fault someone for specialising. But it's inexcusable to never explore.
>>
>>59645499
C++ is already a C alternative and has been used as such for years. C has been deprecated for a decade. Only CIA plants still use it.
>>
>>59645522
How is knowing 2 languages equivalent to "exploring"?
>>
my professor just told my class he would use a functional language to make a videogame.

was he right?
>>
>>59645484
Reading further it seems to be a version issue rather than a compiler issue. Not quite sure though
>>
>>59645532
What about HolyC?
>>
>>59645484
Use C, way faster than RUST.
>>
>>59645509
>sign of != requirement
Good we agree on basic English words but that's not what I said. I argued against it being a sign. It's not a sign at all. It's what stupid people interpret as a good sign.

Arguably because of the relative maturity you need to self host its a sign of language maturity which is a good sign. But it's stupid to reason in that direction. There's far better metrics since self hosting never actually means your language is mature.
>>
>>59645546
It's pretty good. I'm currently writing a HolyC compiler in Haskell.
>>
>>59645541
its the future.
The State_Manager mentality needs to end.
>>
>>59645541
You can use a functional language for everything.
You can, but sometimes you wouldn't like to.
>>
>>59645541
No. Doesn't mean he couldn't do it. I mean, after all, eve online is written in (stackless) python. Anything is possible. More on point, all crash bandicoot games are written in lisp and jak & daxter games heavily use lisp.
>>
>>59645554
Literally what is wrong with self-hosting?
>>59645559
Whats different about it?
>>
>>59645541
Absolutely not. Don't let him play games with you and your class.
>>
>>59645550
Only in theory. In practice, rust is faster. See servo, leaf, collenchyma, ripgrep, xml parser.
>>
>>59645580
lisp is not a purely functional language, especially not the dialect that naughty dog games created.
>>
>>59645534
Knowing one language and being satisfied with whatever potentially shit thing you happened upon is certainly not exploring though. If you know to languages you're given the perspective to see where there's room to grow. At which point you decide if you care to search for that growth, if its worth it.

I wouldn't blame someone for being OK with what they have when they've gone that far.

It's not that difficult to understand anon. It's just an universal truth that 1 measurement gives nothing and 2 gives something. Only a fool stops at nothing.
>>
>>59645504
I think the best way to improve GNU atm is to replace Stallman with someone more chill like GNU version of Linus who can actually appeal to people, doesn't look like a hobo and doesn't eat his dickcheese on camera .
>>
>>59645609
>chill
>linus
MY FUCKING SIDES
>wanting to replace a hobo who's always right with a shill who's always wrong (and mad)
Shoo, shoo M$ shill
>>
>>59645584
it's inspired on God you dummy.
>>
Anyone have that image that was like a program idea roulette with a shit ton of ideas listed?
>>
>>59645541
Sure. Games are basically just functions that take the current state and some input and give back the next state along with graphics/audio commands. The issue is that most usable functional languages aren't very concerned with performance and when writing a game you usually don't want to deal with the costs of a garbage collector, lazy evaluation, etc.

Rust is probably the best language for games, bar the lack of C++ libraries. Even then, many C++ game libraries have C APIs that Rust can use, it's just that you'll probably have to write the bindings yourself. To be fair, that would apply to most languages that aren't C or C++.
>>
>>59645584
>what's wrong with self hosting
As I'm pretty sure I made perfectly clear:
Nothing.
But people attach value to it where there is none. The advantage is very slight and you shouldn't use it as an argument to decide anything.
>>
>>59645609
>linus " I hate people" , "Fuck you MS" torvalds
> a good figure head
>>
>>59645668
what happened to the game development language that blow was making?
>>
>>59645541
He doesn't know what videogames are.
He's just a functional programming zealot who will claim functional programming is appropriate for anything.

If you ask him how he will make the game run at an acceptable framerate his answer will be to have others do it for him. Which is simply not feasible for videogames.
>>
>>59645675
>The advantage is very slight and you shouldn't use it as an argument to decide anything.
I disagree strongly but since you have no real points. were done
>>
>>59645698
Still going strong. Still probably better than anything any of us will have the pleasure of working with.
>>
>>59645702
>make the game run at an acceptable framerate
If he sticks with consoles this isnt an issue
>>
>>59645698
It's literally just a really shitty version of rust without any of the things that makes rust good (including the performance) and with tacked on garba- sorry, I mean go, syntax.
>>
>>59645630
>replace a hobo who's always right
it doesn't matter who's right, i once argued with a roomful of people which were wrong for a fact but still didn't accept it.

if you want to change anything, you need to appeal to normies. while what stallman says is right, the way he does it won't lead GNU anywhere. "who is this paranoid fat hobo hitler?" - is the only reacton he is getting.

while Linus is a passionate man, he is not autistic like Stallman and knows how to play normie crowd
>>
>>59645719
can someone give me an explanation for retarded first year students what he's making?
>>
>>59645706
>you have no points
I'm not repeating myself anon. But if you don't even want to read that's fine. I didn't expect someone as shallow as you to care about this anyway.
>>
>>59645698
Its a clusterfuck of haphazardous decisions, shitty priorities and really shitty syntax.
A lot of its on his youtube
>>
>>59645702
>If you ask him how he will make the game run at an acceptable framerate his answer will be to have others do it for him
>in 2017
Simplest games require gigabytes of the space today. Just throw more computing power!
>>
>>59645724
>there is somehow a point in leading gnu into becoming a literal anti-gnu
>that is somehow the purpose of an ideology: to die
what did he mean by this, /g/?
>>
>>59645736
A language that's meant to address the issues he faces as a game programmer rather than more generalist languages like C++. Also a language built from experience rather than academics.
>>
>>59645736
>>>/reddit/ go and stay go
>>
>>59645550
It's much easier to write code that is correct, efficient, and maintainable in Rust. It's also easy to interface between Rust and C if you absolutely needed to dip down for a critical section.

>>59645698
I believe he's still working on it but at the same time it's not going to be a game changer. The only interesting feature it has is the automatic structure-of-arrays conversion, but you can already do that in any language with integer generics or higher kinded types. I guess that's the one thing Jai can do that Rust can't do without macros yet.
>>
>>59645736
Basically his own C++ & rust bastard for games.
Itll be DOA
>>
>>59645763
>blow
>experience
Did you blow blow's fish?
>>
>>59645785
Well to be fair he started out in traditional software before games, and is generally pretty knowledgeable.

But a pretty shitty language designer.
>>
Any good books on language design?
>>
>>59645768
>automatic soa conversion
I don't know why people think this is the primary feature of the language. It's far better than that.
>>59645785
Compared to people who normally make programming languages he's an actual programmer.
>>59645810
>shitty language designer
Where did you base this opinion? What deadly sin did he commit? I don't see it.
>>
>>59645836
Well, what else does the language offer over say Rust? The SOA conversion is the one thing I know Jai can do that Rust can't do (yet).
>>
>>59645832
speak of the devil
>>
What's the best functional language to make a 2D game?
>>
>>59645836
If you watch his streams he constantly bitches about C++. But even starting with the syntax I dont see an improvement. Also as I said, his priorities are non-existing.
But the language is still new and far from release so im sure lots of things will change.

Also him streaming is a mistake because he'll skip to something else if he thinks its too boring. And even knows his audience are just a bunch of /v/ shitters.
>>
>>59645750
i would like to be able to audit software i use as a basic right. i mean - in ideal world - you can keep source closed for yourself, but if you serve it to the public and make money with it - public should be able to audit code as a basis of trust - same way you go though scan in the airport - to make sure you don't intend to abuse their right for privacy.

but i fail to apprehend how hobo hitler who only listens to himself and freaks everyone out is going to help us move forward open source adoption. he doesn't inspire anyone, he doesn't write code anymore, he makes oss look bad with his pedo and parrot sex quotes. we should update him with someone better
>>
New thread:

>>59645949
>>59645949
>>59645949
>>
>>59645938
Haskell
>>
>>59643292
>>59643306
>>59643353
>>59643366

https://github.com/karliekloss
>>
 int    A, B, C, D;
int i, j, k, l, count = 0;

//////////////////////

std::cin >> A >> B >> C >> D;

int** n = new int*[A];
int** hs = new int*[C];

//////////////////////

for (i = 0; i < A; i++) n[i] = new int[B]; // A x B
for (i = 0; i < C; i++) hs[i] = new int[D]; // C x D

//////////////////////

for (i = 0; i < A; i++)
for (j = 0; j < B; j++)
std::cin >> n[i][j];

for (i = 0; i < C; i++)
for (j = 0; j < D; j++)
std::cin >> hs[i][j];

for (i = 0; i < (C - A); i++)
for (j = 0; j < (D - B); j++)
for (k = 0; k < A; k++)
for (l = 0; l < B; l++) {
if (hs[i + k][j + l] == n[k][l]) count++;
}


What the fuck? Where did I fuck up?
Input:
2 2
3 3

1 1
1 1

1 1 1
1 1 1
2 1 1

Should be 3, shows 4.
>>
>>59645541
Right about what exactly?
Right that he would use an FP lang?
>>
>>59645721
Because low framerates are acceptable on consoles?
>>
>>59646343
>Where did I fuck up?
When you were born
>>
>>59646343
wow are you still stuck on that?
just look at mine >>59643374
>>
>>59642640
25+ years of binary compatibility?
Thread posts: 320
Thread images: 27


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