[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
/dpt/ - Daily Programming Thread
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

You are currently reading a thread in /g/ - Technology

Thread replies: 308
Thread images: 19
old thread: >>52369894

bearded komari is for sexual edition
>>
>>52372532
If you're not programming a virtual machine, you ain't nothing
>>
>>52372532
Fuck off weeb
>>
>>52372565
Where do you think you are?
>>
>>52372575
The programming general of the technology board of an anonymous imageboard.
>>
Well, at least you posted a beard image, OP. Programming capability is directly related to the size of one's beard.
>>
File: 1450955979823.jpg (89 KB, 891x810) Image search: [iqdb] [SauceNao] [Google]
1450955979823.jpg
89 KB, 891x810
I'm writing a sudoku puzzle validator as part of my sudoku solver.
I've written a row and column validator, and I still need the 3rd validator that checks if the numbers 1-9 are present and unrepeated in every 3x3 square in a 9 * 9 grid.
I was planning on doing this by splitting the grid into equal parts and calling the other validators on every part.
In order to make it scalable, what's a good way to split an N * N grid into equal pieces of sqrt(N) * sqrt(N) each assuming that sqrt(N) yields a whole number?
>>
Does Rust have any flaw?
Is Rust the perfect language?
>>
>>52372575
/g/. You're clearly mistaken between /g/ and /a/
>>
>>52372583
that's the only thing we CAN make lmao
>>
>>52372595
>>52372625
This is the Anime & Programming thread on the Anime & Technology board on an Anime imageboard.
>>
>>52372622
>there are people on this website that think this drawing of children is sexually arousing.

Look at your life choices, m8s. Introspection is good for the soul.
>>
>>52372622
don't split it in the sense of splitting arrays, do your horizontal and vertical checks, then pass the bounds of each split part into a function which adds all the numbers in it. It needs to total the nth triangular number
>>
>>52372646
who are you quoting?
>>
>>52372532
>This garbage thread
>>
>>52372646
>Look at your life choices, m8s.
Not him, and not an anime fan either, but you are on 4chan. Take your own advice
>>
>>52372667
My trolling pales in comparison to the 24/7 weebdom these faggots fill their lives with. I stop being a troll when I close Chrome.
>>
>>52372551
why does it matter?
>>
Can any haskell artisans here tell me what the following code does?
printAll [] = return ()
printAll (x:xs) = putStrLn x >> printAll xs

Because it makes no sense to me and the references I can find are all written in broken english.
>>
>>52372644
oh lawdy
>>
>>52372622
>I've written a row and column validator, and I still need the 3rd validator that checks if the numbers 1-9 are present and unrepeated in every 3x3 square in a 9 * 9 grid.
Try making a general validator that can check for presence of 1-9 in any arbitrary list of nine squares (or nine numbers, if you prefer). Then you can simply construct such a list for each row, column, and box. A bonus feature of this approach is that you can very easily adapt it to weird sudoku variants with irregularly-shaped boxes, or with 1-9 on the diagonal, or whatever.
>>
>>52372646
Oh wow. So now you can't even be sexually attracted to children.
What is it. the puritan police?
>>
>>52372736
making newfags and redditors mad
>>
>>52372644
ok now this is an honest attempt at getting the anatomy right

not that deviantart shit from the last thread
>>
>>52372703
It prints all the strings in a list recursively.

More accurately, it recursively traverses a list of strings to build up a computation that will print out the strings in the list when run. The >> operator combines two computations without giving the second the result of the first (which is ()) anyways. It could be written as:
printAll [] = return ()
printAll (x : xs) = do
putStrLn x
printAll xs

or, even better, as:
printAll = mapM_ putStrLn


For example:

printAll ["Hello", " ", "World"] = do
putStrLn "Hello"
putStrLn " "
putStrLn "World"
return ()
>>
>>52372758
Don't know what happened to that last code block:
printAll ["Hello", " ", "World"] = do
putStrLn "Hello"
putStrLn " "
putStrLn "World"
return ()
>>
>>52372736
That's bound to be a deleted image, friend.
>>
>daily programming
>half thread is just people posting anime shit

It's sad because it's just the same 2-3 anons ruining the thread.

Can't a mod just ban these fuckers already?
>>
>>52372736
I-I can s-see her naughty bits
>>
>>52372758
Wow that's pretty cool, thanks anon.
>>
>>52372644
>>52372736
>>52372783

I get what you're trying to pull:

You're educating the 4chan file deletion bot to understand what images are safe by posting them on a blue board.

Congrats, anon.
>>
How does this make you feel, /g/?
unsigned **create_2Darray(unsigned r, unsigned c)
{
/* creates r * c sized 2D array */
unsigned i;
unsigned **ptr = (unsigned **) malloc(sizeof(unsigned *) * r);
for (i = 0; i < r; i++)
ptr[i] = (unsigned *) malloc(sizeof(unsigned) * c);
return ptr;
}
>>
>>52372860
I already told you that it was shit last thread.
>>
>>52372860
like bags of memes
>>
>>52372806
You can think of the >> operator as a kind of semicolon: a >> b basically means "do a, then do b".
>>
MOOOOOOOOOODS

https://www.youtube.com/watch?v=SvKY8FJY0Qk
>>
>>52372888
a girl, you intolerant faggot
>>
>Mainly a C++ guy
>love c++ and writing stuff in it
>fool around with functional programming, mainly Haskell
>the more I find out about it the more brilliant it is
>feel like shit whenever I'm writing toy programs in Haskell because I know I'll never use it in the real world
>go back to C++
>>
>>52372796
this

should easily be a 1-3 day ban minimum
>>
The anime degenerates are even bigger faggots than the trip fags
>>
>>52372940
It should be a perma-ban because it's practically child porn

Anyway, how hard is it to go from Java to C?
>>
>>52372928
>john carmack thinks haskell is much bigger than toy programs to the point where he's in the process of writing all of wolfenstein in it
You should try to be better at it. Declarative programming is a completely different beast, but it can be a powerful one if you know how to use it right
>>
File: 1407905937240.jpg (23 KB, 500x375) Image search: [iqdb] [SauceNao] [Google]
1407905937240.jpg
23 KB, 500x375
>>52372964
>because it's practically child porn
>>
>>52372940
I've already reported it. Getting tired of it.
>You have already reported this post, or someone with your IP has already reported it.
>>
Does grid paper help for writing algorithms?
>>
>>52372928
You'll love this guy's blog.

http://bartoszmilewski.com/2009/10/21/what-does-haskell-have-to-do-with-c/
http://bartoszmilewski.com/2014/02/26/c17-i-see-a-monad-in-your-future/
>>
>>52372939
I'm gonna program :^) some programs
>>
>>52372992
No?
Why would you even think that?
>>
>>52372799
Thanks anon, I've been looking for this image.
>>
>>52372928
If it's any consolation your Haskell programs all have wildly unpredictable performance, the compiler is doing crazy shit behind your back to maintain the facade of functional elegance, and nothing you've been doing in it is really practical or usable in the long term.

>>52372949
>degenerates

retard spotted
>>
>>52372646
I think it's comedic.
>>
>>52372796
You're on an anime site, you can post anime.
>>
>>52372939
We shall see.

This is me with a new IP.
>>
What's the difference between functional and imperative?
>>
>>52373011
>your Haskell programs all have wildly unpredictable performance, the compiler is doing crazy shit behind your back to maintain the facade of functional elegance
This is true.

>nothing you've been doing in it is really practical or usable in the long term
I disagree.
>>
module Main where

main :: IO ()
fizz :: Integer -> String

fizz n | n `mod` 15 == 0 = "Fizzbuzz"
| n `mod` 5 == 0 = "Fizz"
| n `mod` 3 == 0 = "Buzz"
| otherwise = show n

main = mapM_ putStrLn $ map fizz [1..100]


My fizzbuzz may not be small, but jesus fuck it is beautiful.
>>
God bless animu children and C
>>
>>52372949
I like anime, but it gets annoying when you want to just visit a thread for the on-topic material,on a SFW board, yet people keep posting sexualized images of children that nearly crosses the line
>>
>>52373046
>children
are you ok?
they're just drawings
>>
>>52373037
Imperative languages start with something useful and add type theory.
Functional languages start with type theory and add useful things.
>>
>>52372981
in some jurisdictions it is
>>
>>52373040
>more fizz buzz scripts
>4chan thread downloader last thread

welp, im out.
>>
>>52373080
>he lives in the UK
my condolences

haha
>>
>>52373080
Australia is ahead of the game

http://www.abc.net.au/news/2015-08-12/anime-not-a-big-leap-to-child-pornography-sa-judge-says/6691372
>>
>>52373070
>they're just drawings
drawings that imitate children, yes.
pedophile either way.
>>
>>52373101
>unironically living in Australia
>>
>>52372964
They're not even doing anything sexual.

It's just you and your paedo brain thinking innocent images of girls are porn.
>>
>>52373101
This guy says "anime" and he means "loli".
>>
>>52372964
>Anyway, how hard is it to go from Java to C?
shouldn't be too hard. C is so simple with the syntax and such. the only thing that will really be new will be pointer syntax and pointer arithmetic but you'll get the hang of it in no time. and different library functions, mallocing and freeing memory, null-terminated char arrays as string, structs, function pointers, minor syntax differences. that's about it
>>
>>52373108
And.
>>
File: 1451091057444.png (253 KB, 620x620) Image search: [iqdb] [SauceNao] [Google]
1451091057444.png
253 KB, 620x620
>>52373108
>imitate children
i don't remember children having gigantic heads, tiny mouths and eyes that take up 50% of their face

anime characters are more ayy lmao than human desu
>>
>>52373122
you have no business spending all day long watching nude drawings of little girls unless you're a pedophile
>>
>>52373122
>They're not even doing anything sexual.

>>52372736
>blushing
>pulling her panties down
>nips exposed
>not sexual

>>52372860
>holding a buttplug in their mouth
>cat pose
>blushing
>not sexual

>>52372888
>fondling boobs while blushing and half nude
>sticky substance dripping from hands
>not sexual

>innocent images
>>
>>52373155
>>holding a buttplug in their mouth

tbqh this one is ok because it's a guy
>>
>>52373037
Imperative languages use statements to change the state of something within the program.
For some examples of state-altering statements, you have variable declarations, variable alterations, or loops.

Functional languages use functions to get results from data.
For example, in Haskell there are no variables or (conventional) loops, and all data is 'immutable'.

The root difference between the two paradigms is that imperative languages were designed to simulate how CPUs actually work, while functional languages were designed to simulate how math works.
>>
>>52373037
>imperative
you describe how you modify the state
>functional
you describe what are the values, without modifying the state
>>
>>52373142
I don't spend all day watching nude drawings of little girls, I think drawing of little girls are cute, them being nude is irrelevant.

You're the paedo here for viewing those images in a sexual manner, anon.
>>
>>52373176
>>52373179
how are you supposed to make anything useful in functional languages then?
>>
 
template<typename F> auto future::then(F&& func) -> future<decltype(func(*this))>;


Why do we like C++ again?
>>
>>52372928
Now try D, I Dare you
>>
File: Bait.png (220 KB, 387x545) Image search: [iqdb] [SauceNao] [Google]
Bait.png
220 KB, 387x545
@52373193
>>
File: char_41563.jpg (16 KB, 210x240) Image search: [iqdb] [SauceNao] [Google]
char_41563.jpg
16 KB, 210x240
Are there really people here questionning the legitimacy of loli?
>>
>>52373155
>this post

Found the pedo.
>>
>>52373204
Why is it worth using over C++? Starting disadvantages: no libs, garbage collection
>>
>>52373193
if I say that
x = 2 + y
I modify no state, but x is equal to y + 2
>>
>>52373193
Functional doesn't mean "no side effects". It means "delimited side effects".
>>
>>52373199
It's the only non-GC'd language with RAII apart from Rust, and Rust's community is a gaggle of bedwetting faggots.
>>
>>52373193
The same way you do anything in a functional language: Completely differently from how you'd do it in any other type of language.
Functional programming has some really nice benefits, and the always-in-always-out nature of the functions themselves means that you can do some fun things with them.
See my fizzbuzz posted earlier for a very elementary example - I can't imagine any imperative language that would let you build a working fizzbuzz program without using any loops or recursion.
>>
File: 1451932034984.png (254 KB, 800x1132) Image search: [iqdb] [SauceNao] [Google]
1451932034984.png
254 KB, 800x1132
The no fun allowed police have arrived.
>>
>>52373220
ok, so how do you tell your function what x is if no variables are allowed in functional programming?
>>
>>52373205
>@
Never fucking reply to me again unless you're contributing to the thread.
>>
>>52373244
>if no variables are allowed in functional programming
Where are you getting that idea?
>>
How good is scheme as a first language?
>>
>>52372860
#define create_2Darray(W, H) (malloc(sizeof (unsigned) * (W) * (H)))
#define index_2Darray(ARR, X, Y, W) ((ARR)[(X) + (W) * (Y)])
>>
>>52372919
dependent haskell, as well as haskell in general, lacks a lot of the elegance of idris. there's really no hope for the type system to adhere to any theory because it started out tied down to an existing type system that just got extended over and over again to make it more powerful without a real driving force/final goal behind it other than "make the language better". Idris has the advantage of being designed from the ground up as a new language with a goal already in place and a lot of other features that would break backwards compatibility with Haskell but are useful nonetheless.
>>
>>52373268
that's gross
I wrote it like that to AVOID ugly pointer arithmetic hacks.
>>
>>52373257
>he doesn't have his own extension that automatically wraps quote links around @ replies
>>
>>52373261
Bad.
Try C.
>>
>>52373285
Last time I asked about C, someone told me C was a terrible first language and I should start with Lisp and I found out about a dialect called scheme, which one should I start with?
>>
>>52373244
Variables are just constants. Like in mathematics.
If I say that
factorial (0) = 1
factorial (n) = n * factorial (n - 1)
I have modified no variables but I have fully define factorial functions.
>>
>>52373281
I deleted that image, I was ashamed of the quality if I'm honest.
>>
>>52373280
Why on earth are you using C?
>>
>>52373220
Same way you'd do it if this were math and you were graphing it: Parameters!
Here's some Haskell:
main :: IO ()
f :: Integer -> Integer

y = 3
z = y + 2

f x = x * 3
main = print $ f z


Running this will result in '15' being printed to stdout.
>>
>>52373218
It's as fast as C++ with identical code, and certain features can make it a lot faster (array slicing springs to mind)

it actively supports functional programming

no libs is wrong. You can use C and C++ code in it with no speed loss
There are D bindings for most noteworthy things

Garbage collection can be turned off (but if you're using the standard library you probably shouldn't)

it's generally prettier. Just a lot nicer to look at, and smoother to write, but this is hard to quantify
>>
>>52373261
if you want to learn how to think algorithmically, it's one of the best choices. if you care more about working with a computer at the lowest level you can listen to >>52373285 but 99% of the time it isn't a good place to start
>Lisp is no harder to understand than other languages. So if you have never learned to program, and you want to start, start with Lisp.
>>
>>52373306
>someone told me C was a terrible first language
That soeone trolled you.
You can learn C in a matter of days.
>>
>>52373193
They use functional constructs to "simulate" imperative code. Basically:

imperative code --> pointlessly abstract layer of theoretical bullshit to compensate for the natural burden of functional semantics (monads, arrows, functors, universes, uniqueness types, whatever) --> intrinsically imperative machine architecture

It's sort of a "the emperor has no clothes type of thing", and it's usually the part in learning Haskell where you have to pretend really hard you haven't been wasting your time learning for the past week or so learning all of it.
>>
>>52373280
>pointer arithmetic
There is no pointer arithmetic here, anon.
>>
>>52373335
>You can use C and C++ code in it with no speed loss
not a valid point, if you have to use inline C/C++ then why not just use it from the start? you chose the wrong language for the job.
>>
>>52373349
Good one, anon.
>>
What the fuck is wrong with you people? Stop posting nude lolis. This is blue board.
>>
How to make an array with malloc in C?
>>
>>52373372
You don't have to, that's a worst case scenario
>There are D bindings for most noteworthy things
>>
>>52373340
Does it really matter if I start with either scheme or lisp?

>>52373342
Why should I start with C over Scheme?
>>
>>52373383
>lolis
They told me they were over 18.
>>
>>52373383
>b-but 4chan is an anime imageboard because it was founded by a guy who used to be a massive weeb
>ergo we can post loli porn on blue boards!
this is their thought process, don't try to reason with it, just report it
>>
>>52373392
because C isn't a meme language and it's syntax has been very widely adopted
>>
>>52373392
((because )))))) lis(p)))) is (((((((((dum))b)))))))))))))))))))
>>
>>52373388

use [spoiler]calloc[/spoiler] instead.
>>
>>52373392
It's gonna be infinitely more useful for starters.
More support, more libraries...
Also it's a nice step toward learning C++ and Java.
Scheme/Lisp/whatever are only useful for educational purpose. Or if you're Lain.
>>
>>52373442
Never fucking reply to me again unless you're contributing to the thread.
>>
>>52373392
nah, i was just quoting Stallman there cause I like the way he puts it. if you read the whole quote he says that when he's talking about Lisp he means Lisp/Scheme. Personally, I prefer Scheme because it's a very minimalist approach to Lisp and defines a small language that's very easy to grasp and read. Some people prefer Common Lisp (or other dialects) because they give you more language features to work with right off the bat, but it's really up to personal choice here.
>>52373416
syntax and adoption don't mean that the language is better to learn. Lisps will be much easier early on because they let you focus on *doing things* with your code/solving problems. with C, there's a whole lot you need to learn to write your first real world program
>>
>>52373447
so C and then scheme after it be better?
>>
>>52373470
Yes.
Both are interesting, but C is more useful.
>>
>>52373470
Scheme then other stuff.
>>
Why haven't you patented your solution for averaging two ints in C, /dpt/?

http://www.google.com/patents/US6007232?dq=6007232
>>
>>52373519
i'm afraid even that solution doesn't work 100%
>>
>>52373464
>with C, there's a whole lot you need to learn to write your first real world program
Toppest kek. You don't get to write "first real world programs" with Lisp variants.
>>
>>52373581
why not?
>>
>>52373593
I mean, do you really wanna compare the achievements on both sides?
>>
>>52372994
>http://bartoszmilewski.com/2009/10/21/what-does-haskell-have-to-do-with-c/
>Just like in Haskell, there are two definitions of fact, except that their order is inverted.
He's wrong though. The C++ actually is two definitions, but Haskell "pattern matching" is just syntactic sugar for case. It's not like C++ template specialization at all. The closest things Haskell has would be typeclasses and type families.
>>
>>52373519
lmao does this mean if an american tries to write code using that algorithm, he's gonna get sued or some shit?
>>
>>52373659
case is pattern matching. You're right that there's only one definition, of course.

And how is template specialization not pattern matching?
>>
>>52373618
it's nothing to do with the achievements of a particular language. when C was first created obviously it had no achievements. the thing that matters _to a beginner_ is how easy it is to start writing code so that you can learn how to design the rest of your code later on. so in Scheme if you have a problem you want to solve, you're taught to write a function to do it and think about the issue at hand first and foremost, whereas in C, you need to already understand memory management and the likes to start writing those kinds of solutions. even though Scheme or Lisp may not be the best language for you to write real world software in once you're an expert, it's much easier for a new programmer to design a calculator or the kinds of things you'd find in the DPT roll chart. maybe it's not the optimal language for writing your high-performance web server or a GUI application, but it can still help you out to learn how programming works at the core and the thought process behind it
>>
My first attemp for averagin two ints in C.
#include <assert.h>

int sign (int a) {
if (a < 0) {
return -1;
} else if (a == 0) {
return 0;
} else {
return 1;
}
}

int avg (int a, int b) {
int c;
switch (sign (a) * sign (b)) {
case -1:
return (a + b) / 2;
case 0:
return a == 0 ? b / 2 : a / 2;
case 1:
c = a - b;
return b + c / 2;
}
assert (0 != 0);
}


Hey /g/, is it correct?
>>
>>52373519
Who needs C when I have Haskell?
module Main where
import Data.Fixed

main :: IO ()
a :: (Double, Double) -> Double

a(x, y) = x / 2 + y / 2 + ( x `mod'` 2.0 ) * ( y `mod'` 2.0 )

main = print $ a(3. 7)
>>
>>52373519
>Calculating the average of two integer numbers rounded towards zero in a single instruction cycle
>in a single instruction cycle
fucking christ who let this shit slide
>>
>>52373573
I do too
>>
>>52373519
>>52373663
>>52373734
>>52373771
Hey guys, you do realise that this patent is for hardware encoders/decoders, right?
>>
>>52372940
>https://www.4chan.org/bans

3 day ban get rekt shitposters
>>
>>52373827
kek
>>
so, compiling in emacs without a makefile for my shitty fizzbuzz, is it possible? cus I'm guessing it's just changing the compile command from
 make -d 
to something else
>>
>>52373827
They're gone so you can stop shitposting now.
>>
File: logo.gif (6 KB, 133x63) Image search: [iqdb] [SauceNao] [Google]
logo.gif
6 KB, 133x63
By the way guys, have you heard about Free Pascal and Lazarus?
They're good.
>>
>>52373841
Yeah just do M-x `compile` and then type in whatever command you want.
>>
>>52373841
>emacs
>>
>>52373856
yeah, obviously, but what? ./configure doesn't work
>>
>Disabled images in Chrome's settings and everything went slower

//No images
/ic/ - 1489ms
/p/ - 2068ms
/g/ - 1413ms
/b/ - 859ms
/toy/ - 1000ms
/vp/ - 545ms
/a/ - 384ms
/pol/ - 684ms
/hc/ - 695ms
/wsg/ - 999ms

//Images
/ic/ - 510ms
/p/ - 422ms
/g/ - 847ms
/b/ - 234ms
/toy/ - 387ms
/vp/ - 358ms
/a/ - 1572ms ??
/pol/ - 529ms
/hc/ - 107ms
/wsg/ - 589ms


What's going on, /dpt/? I cleared cache to make sure the images weren't preloaded the second time.
>>
>>52373822
yes, but the fact is that nobody else will be allowed to create a single instruction for averaging ints in 1 cycle without being sued, which is an extremely general thing to want for an architecture. also, not sure how hardware patents apply to software but couldn't they technically sue someone who used the same pattern of logic operators to emulate what those gates are doing?
>>
>>52373868
...The command you'd run to compile it. You know how to use a compiler, right?
If you're in c that'd like be something like `gcc -o fizzbuzz fizzbuzz.c`.
It's just whatever you'd type into your terminal.
>>
>>52373888
nah, it's one line of code
not like no one would ever replicate that.
>>
>>52373881
Upload a younger looking loli and we'll answer.
>>
>>52373892
>...The command you'd run to compile it
which is exactly what is up for discussion
>You know how to use a compiler, right?
I think we both know that I do
and make isn't working, sutogen.sh isn't working, ./configure also isn't, so I'm lost for what it is I'm missing
>>
Enlighten me about Nim, /dpt/.
>>
>>52373918
...open up a terminal and run those commands. Post the results.
>>
>>52373923
It's the new meme.
>>
>>52373888
>but the fact is that nobody else will be allowed to create a single instruction for averaging ints in 1 cycle without being sued,
If you do it in another way, then yes you could.

Or you can pay royalties. Or you could wait until the patent expire. I didn't read it in detail, so I don't know what class it is. Usually those kind of patents aren't valid for more than 5 years, and since it was patented in 1999...

>not sure how hardware patents apply to software but couldn't they technically sue someone who used the same pattern of logic operators to emulate what those gates are doing?
Technically, but it would be extremely hard to prove (read: totally unfeasible that they are able to prove it)
>>
>>52373952
Or you can do it in software like virtually all non-mobile platform decoders/encoders do these days
>>
>>52373881
that's a hella nice image

infinitely better than last OP's crudely drawn pic
>>
>>52373923
just a meme
use D
>>
>>52373923
it's still obscure but it looks fucking good
>>
>>52374022
I think I'll be adopting it sometime in the future, fuck around in it, write a meme program, etc.
>>
Question for the graybeards of /dpt/: what was programming like in the 90s?
>>
>>52373937
>make
no target specified
>/autogen.sh
no such file
>./configure
no such file
>>
>>52374092

It was impossible because Stack Overflow didn't exist yet.
>>
Back end web dev languages for linux? I don't want to use PHP and javascript/node
>>
>>52374160
Malbolge
>>
Awfully slow in here tbqh.
>>
>>52372697
>chrome
subtle, but i got it.
>>
>>52374160
Piet
>>
>>52372624

All languages have flaws. Rust applications can get rather large if you statically link them (default on Windows) because the standard library is so huge, and not separated into logical modules. So your hello world actually contains some networking and threading code. The language also defaults all strings to UTF-8... which is good if you don't need O(1) random access to individual characters.

Really, it all depends on one's needs.
>>
>>52372624
The syntax for dealing with lifetimes is practically esoteric.
>>
>>52374227
People love to have a big thick whine about that, but it's not bad at all. A couple of days to get the basics down, and a couple of weeks to get good at it.
>>
Does Pascal have any flaw?
Is Pascal the perfect language?
>>
>>52374211
>which is good if you don't need O(1) random access to individual characters.
I was under the impression Rust had char, which is a 32-bit value that can hold all UTF-8 characters?
>>
Does NuPRL have any flaw?
Is NuPRL the perfect language?
>>
>>52373243
Adults*
>>
>>52373715
Or he could learn C instead of a meme language since the majority of software is built with a language that has syntax similar to C. Learning C would allow him to quickly learn other languages using the same syntax.
>>
Does Visual Basic have any flaw?
Is Visual Basic the perfect language?
>>
Does Ook?! have any flaw?
Is Ook?! the perfect language?
>>
>>52374092
Great because there weren't a bunch of codemonkey autists trying to develop games.
>>
>>52374350
it cant average two ints
>>
>>52374359
yes there were, just not as many
>>
['h', 'e', 'l', 'l', 'o', 'w', 'o', 'r', 'l', 'd'].forEach(process.stdout.write)
>>
>>52374389
that looks like an awful way to traverse over string literals desu
>>
>>52374283

Rust strings are encoded as UTF-8 naturally. Presumably, one can interpret this either as bytes or as 32 bit codepoints.
>>
>>52374320
>the majority of software is built with a language that has syntax similar to C
why is that a reason to learn C though? Java uses pretty much the same syntax. PHP uses a similar syntax. but obviously you aren't telling him to learn either of those.
>Learning C would allow him to quickly learn other languages using the same syntax
assuming the challenge of transitioning was not an issue with the underlying principles of the language, yes. however, writing OOP code for Java or C# is an entirely different task than writing procedural C code. likewise, every language with C-like syntax is, semantically and architecturally, a wholly different beast than C and the syntax ends up meaning very little in reality. OOP style is much easier in a Lisp than in C. Rust's declarative semantics are in some ways closer to Lisp's than C's.
>>
>>52374380
Who gives a fuck about averaging integers when you've got this slick syntax
Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.
>>
You are fools.
The real, undisputed king of first languages is Pascal.
>>
>>52374320
you can easily learn the basic syntax in a C-like language such as java, it doesn't have to be C just to learn the syntax
>>
>>52374426
>Java uses pretty much the same syntax. PHP uses a similar syntax.
That's the reason why it's good learning C first.
It paves the way to a lot of programming languages.
On top of being useful all by itself.
>>
>>52374488
>That's the reason why it's good learning C first.
Not really. Go give a programmer who only knows Java the source to a C program and ask them to explain it to you. Do the same with a Java program to a C-only programmer. It will be completely foreign because the difference between the two is semantic and not syntactical. If you gave a Lisp programmer Java code they would probably be able to read it about as well as a C programmer because they would be more likely to get the semantics even though they don't fully understand the syntax. Similar syntax means nothing about mutual intelligence. It would be like having two spoken languages where the words are mostly the same but the grammar is completely unintelligible to speakers of the opposite language and a lot of the words means something different despite sounding the same.
>>
>>52374389

(L<char>('H', 'e', 'l', 'l', 'o')).ForEach(Console.Write);


Weweee
>>
>>52374160
Clojure
Lua
Common Lisp
C
>>
>>52374536
>() for creating arrays / lists
>not lisp
your doing it wrong whatever language that is(I assume its some sort of D).
>>
>>52374582
>>() for creating arrays / lists
>>not lisp

C#, and it's actually just a method.

L<type>(....) is shorter than (new List<type>{...})
>>
>>52374535
I disagree.
As someone who learned both C and Scheme, I fail to see why you wouldn't choose for the language that offers you the most.
I wouldn't have learned C, had I learn Scheme first, because that would have disgusted me.
It may be elegant, but the realm of use you have for it is extremely limited.
>>
>tfw realised my prime fizzbuzz repeated the 5, too
Fixed.
>>
>>52374160
Scala
Python
>>
>>52374632
>I wouldn't have learned C, had I learn Scheme first, because that would have disgusted me.
as you can probably tell from hanging around in these threads for a bit of time, most programmers who use languages with a C-like syntax are equally disgusted with Lisp-like syntax
>>
>>52374160
I've written a server PHP, Javascript, Python, Java, and Haskell. You probably don't want to hear my experiences with PHP or js so:
>Python was simple setup but dynamically typed, which I personally dislike.
>Java was the most productive but was the most painful to set up.
>Haskell was the most fun but also the most challenging.
>>
>>52374649
Both C-like syntax and lisp-like syntax is disgusting to us Wirthian syntax Master Race.
>>
>>52374678
>Wirthian syntax Master Race
that's ALGOL-like syntax to you, mister
>>
>>52374678
Miranda syntax master race
>>
Unix was written in C. LISP machines were written in LISP.
I wanna see the source code to these LISP machines and run one.
>>
>>52372796
why not both

I picture a thread
a magical thread
in which lewd anime and l33t codes live in peace
>>
>>52374782
Impossible, anime rots your brain, so animefags are not capable of programming more complex than script-kiddying and fizzbuzz.
>>
>nobody in this thread is working on anything remotely interesting

where do the cool programmers hang out
>>
>>52374695
actually ISWIM syntax :^)
>>52374757
the most recent Lisp machines used Genera and you can still install it in VMs. there's this https://www.reddit.com/r/programming/comments/2emke/lisp_machine_operating_system_with_complete (for the Genera machines; wouldn't be surprised if the torrent is no longer online~) and http://www.unlambda.com/index.php?n=Main.Mit (for even older MIT machines)
>>
>>52374851
i am but i won't show you it

also i think i'm going to bed now
>>
>>52374782
>chrome addon to pull from extensive library of lewd
>changes everyone's post to have a lewd picture

There, stop picturing it and program it
>>
File: 1451051382875.png (299 KB, 942x848) Image search: [iqdb] [SauceNao] [Google]
1451051382875.png
299 KB, 942x848
r8 my super advanced selector engine, /dpt/

function get(selector) {
if(selector.indexOf(" ") === -1) {
if(selector[0] === "#") {
return document.getElementById(selector.substring(1));
} else if(selector[0] === ".") {
return document.getElementsByClassName(selector.substring(1));
} else {
return document.getElementsByTagName(selector);
}
} else {
return document.querySelectorAll(selector);
}
}


is it as good as jquery yet?
>>
>>52374851

We hang out in universities and large corporations.
>>
>>52374851
Google
Facebook
Amazon

What industry has the least cool programmers?
>>
>>52374452
>ook
>not alphuck
eeeeeeeepaeeeepaeeaeeeaeeeaeccccisaeaeaiaaepcscisaajaiiijeeeeeeejjeeejaajcijcjeeejiiiiiijiiiiiiiijaaejaeej
>>
>>52374851
I hang out on reddit.

/r/ProgrammerHumor is fun.
>>
>>52374921
>Google
>Facebook
>Amazon
normie af
>>
>>52374905
Is there any particular reason to use getElementsBy... over querySelectorAll?
>>
>>52374851
what's something interesting I could work on?
>>
I wish ainmefags would go back to reddit.
>>
>>52374905
function $(expr, container) {
return typeof expr === "string"? (container || document).querySelector(expr) : expr || null;
}
>>
>>52374851
I'm working on a programming language.
>>
>>52374994
What interesting features are you implementing for your programming language?
>>
>>52374994

>nobody in this thread is working on anything remotely interesting

where do the cool programmers hang out
>>
Just rebuilding some databases that got fucked up in a transfer.

I shoulda built these using a PHP file. I'm dumb as fuck.

I'll make a PHP file for them after they're done.

It's for a website I'm working on.

What I'd really like to make, though, is a pressure-sensitive waifu AI.
Maybe after the website starts bringing in a bit of da monies.
>>
>>52374676
I'm amazed Python has been used to much for important production things when it seems so rickety.
>>
>>52375028
Don't you fucking reply to me again unless you're contributing to this thread.
>>
>>52374851
>>52375013
/prog/
oh wait
>>
>>52375024
more people use PHP everyday though
>>
>>52375008
- Dependent types and all the stuff that comes with that (totality, propositional equality, etc.)
- Linearity (full linearity, not uniqueness)
- Codata and corecursion (lazy data structures)
- Compiles to native code with no GC
- Custom mixfix operators
- Approximate types for optimization (e.g. approximate natural numbers to unsigned integers)
>>
>>52374989
What about getElementsBy? It's supposedly a lot faster than querySelector.
>>
>>52375062
PHP is okay.
Obviously a necessity for websites.

Kinda like C/C++ better, but I really can't give up dat switch(string) ability in a production environment.
>>
>>52375063
so you're saying it's not as good as nim
>>
>>52375113
How is Nim better?
>>
>>52375126
http://nim-lang.org/
>>
>>52375113
I didn't realize the compiler crashing constantly was what people thought made a good language.
>>
>>52375211
That's not an answer.
>>
>>52375062
yeah and more people likes justin beibers songs everyday
>>
File: 1452059203558.gif (2 MB, 356x292) Image search: [iqdb] [SauceNao] [Google]
1452059203558.gif
2 MB, 356x292
Hey guise, I have a major problem

I.HATE.TESTING

any test, manual testing, unit testing, any kind of testing. I just like to test 3-5 times then I get bored. How do I deal with this
>>
>>52375216
>the compiler makes the language
>>
>>52375249
What language are you writing in?
>>
>>52372532
>>52372561
>>52372583
>>52372622
>>52372644

>weebshit
>>
>>52372532
are there any anime about programming?
>>
What license should I release my software under?
I don't care if people use it with proprietary software, but I want any modifications to be published.
>>
>>52375266
c# asp
>>
>>52375299
LGPL
>>
>>52375292
No because anime is for children
>>
>>52372624
sjw bullshit is its biggest flaw, which happens to be its death knell as well
>>
>>52375315
tell that to evangelion
>>
>>52375311
Can I put a G in front of my program's name if I use LGPL?
>>
>>52375299
Mozilla Public License
>>
>>52375330
Edgy, "mature" shit is aimed at children trying to look like adults.
>>
Who here programs on notepad++ in rust for github projects for google?
>>
>>52375367
lmao maybe you'd get a lot out of it then
>>
>>52375330
panders to homosexual elementary students
>>
>>52375081
Kek, I'm not sure if this is an accurate way to test it, but if it is, querySelectorAll is slow as shit.

var time = Date.now();

for(var i = 0; i <= 100000; i++) {
document.querySelectorAll("div");
}

console.log("querySelectorAll: " + (Date.now() - time) + "ms");

time = Date.now();

for(var i = 0; i <= 100000; i++) {
document.getElementsByTagName("div");
}

console.log("getElementsByTagName: " + (Date.now() - time) + "ms");
>>
>>52375330
evangelion a shit
>>
>>52375389
the ironing
>>
we HAVE to work in teams of 2-4 on our homework assignments in my algorithms class. he won't even allow you to work solo. i can already tell i'm going to have a stress breakdown before the end of the semester because of this. kill me now
>>
File: YukiCode.gif (1 MB, 1280x1024) Image search: [iqdb] [SauceNao] [Google]
YukiCode.gif
1 MB, 1280x1024
>>52375292
There is one called like Battle Programmer Shirase

Also, one of the main characters in Steins;Gate is a programmer/hacker who... broke into some pretty big shit. Also, he's pretty big. He's fat as hell.
>I'm personally disconcerted by his obesity. I weight more than him, and I'm not that fat. And I'm only slightly taller than him... He's 98kg. I'm like 105...

There's also D-Frag. It's about a game creation club and a fake game creation club (The REAL club actually programs games)

The Melancholy of Haruhi Suzumiya has a main character who is a robot alien who codes fast as fuck in C
>pic related
I love that malloc you can notice if you drag the gif at the right time

Um... anime strictly ABOUT coding, though? Well, I haven't seen Battle Programmer yet.

Sword Art Online does have some interesting stuff. But it's more what you can DO with code than actual coding.
Also, it's mostly action.
Also, it has mixed reviews. Some people love it to death; others would burn it in a fire. I personally liked it a lot, but I'm not by any means gonna say it was the best anime ever.
>On the other hand, I'd like to make a game like that at some point.
That's why I need to get more into the OpenGL.
>>
>>52375396
>querySelectorAll: 11860ms
>getElementsByTagName: 241ms

The biggest number is the winner, right?
>>
>>52375418
wait, do japs code in english? if not, in the year 2060 will we be coding in a global english-japanese hybrid language like from the matrix?
>>
>>52375418
>forgetting your [spoiler] tags
>>
>>52372938
Where the hell does Misaka make that face lmao

>>52372964
>It should be instant because Java is practically C

>>52375416
Are you good enough to do these on your own?

>>52375418
>There is one called like Battle Programmer Shirase
Sounds interesting, I'll take a look

>>52375433
Yeah, that's why Python is 40x better than C
>>
>>52375458
>replying to 5 posts at once
Lol autist.
>>
>>52375448
>do japs code in english
no
>>
>>52375478
>purposely replying to a single post at a time to not appear autistic
spotted the true autist
>>
>>52375478
That's a huge leap in reasoning

>>52375486
Exactly lol, who counts their replies to moderate how autistic they are
>>
>>52375483
No one codes in English.
>>
>>52375485
>"command pattern"
>monoids

disgusting tbhq
>>
>>52375448
I don't think C/C++ has alt language alternatives, but there ARE non-English programming languages.
ひまわり is a Japanese programming language. So is なでしこ and Mind.

https://ja.wikipedia.org/wiki/%E3%81%B2%E3%81%BE%E3%82%8F%E3%82%8A_(%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E8%A8%80%E8%AA%9E)
>>
>>52375530
>that fucking name
Fucking en-normative scum

>delphi
>>
>>52375458
>Are you good enough to do these on your own?
that's not the point. the point is that i'm going to be doing 4 people's worth of work by myself
>>
>>52375530
https://ja.wikipedia.org/wiki/%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E8%A8%80%E8%AA%9E
>>
>>52374909
>working at a for-profit
Kill yourself kudasai
>>
>>52375530
>>52375569
Wow, these URL encodings give me brain cancer

>>52375567
Well what's stopping you from cooperating with them personally? Is it that they'll make shitty code, or you don't do well working with strangers, or what?
>>
>>52375448
yes but they write their comments in Japanese, which is probably better than the alternative (something that looks like English but can't be deciphered by either native English speakers or Japanese speakers)
>>52375485
in java people tend to create 2 stacks and simply move values between them and apply that state. for example, in a text editor, you can have some representation of an action (an Action interface) and Stack<Action> undos as well as Stack<Action> redos. Then you can do (in pseudo-code):
public void doSomething() {
undos.push(new SomethingAction());
}

public void undo() {
Action a = undos.pop();
removeAction(a);
redos.push(a);
}

public void redo() {
Action a = redos.pop();
applyAction(a);
undos.push(a);
}

If an example action was like
class Write implements Action {
public char ch;
void apply(Document d) {
d.getChars().addChar(ch);
}
void remove(Document d) {
d.getChars().removeChar(ch);
}
}
>>
>>52375602
https://en.wikipedia.org/wiki/Social_loafing
>>
Anyone done any coding regarding Rasberry Pi, working on a project atm, concept is opening a door internal clock based, was thinking Python ( my best language) or should I expand my knowledge base and use this chance to learn something else? Thoughts?
>>
HAHAHAHA WEEBSHITS BTFO

PROBABLY DOING PHP ANYWAY AND CALLS THEMSELF SYSTEM ENGINEER

EAT SHIT
>>
>>52375697
A Raspberry Pi is a general purpose computer like any other, just slow. For most purposes Python will do great, just like any other language.

Even without any library you can control the GPIO pins with /sys/class.

>>52375721
Alright, let's trade, anon. Tell me what you're working on, or what you've made in the past, and I'll share mine.
>>
>>52375721
Stop inciting a flame war, anon.
>>
>>52375721
I don't get it, why would they delete some of the posts that were actually contributing to the thread?
>>
>>52375765
im doing swift bruh
>>
>>52375773
then start being serious and let /a/ stay in /a/
>>
>>52375697
Using python on a Pi? you are sking for the shit to be unbearably slow. Use this chance to learn C or C++.
>>
>>52375779
That's cool - what are you working on with Swift? I'm working on a dynamic binary translating emulator for the DCPU-16 in C++. But since I'm translating binaries, I'll inevitably end up generating x86 too.
>>
year 2060 program language prediction
号 max(号* array)
{
号 currentMax = array[0];
つつ(号 index = 1; index < maxArraySize; index++)
{
暁 (array[index] > currentMax)
{
currentMax = array[index];
}
還 currentMax;
}
>>
>>52375697
Swap to nim for C++ performance with python-like syntax, bindings and many very high level features
>>
>>52375831
He's opening a goddamn door with it m8, no reason to jump to C/C++ for that, but I agree he should learn C/C++ just for the sake of experience.
>>
>>52375292
Not exactly related but Ghost in the Shell (The original movie and the Stand Alone Complex anime) is always a good bet
>>
File: 1451141890075.png (144 KB, 600x600) Image search: [iqdb] [SauceNao] [Google]
1451141890075.png
144 KB, 600x600
>>52375794
I think their complaint was lewd images, not anime images, anon.
>>
>>52375862
All anime is lewd
>>
File: lewd anime.gif (1 MB, 478x360) Image search: [iqdb] [SauceNao] [Google]
lewd anime.gif
1 MB, 478x360
>>52375872
>>
>>52375292
Battle Programmer Shirase, but it's shit.
>>
>>52375862
nah, mods have good tastes by default
>>
>>52375855
GPIO using sys is goddamn simple. I might say otherwise if he was going to be doing circuitry shit. Or if he's never used Linux.
>>
>>52375697
Are you doing this to learn programming or as a cool project?

Your best bet is just to use cron if you want something timed.
>>
File: pls.png (154 KB, 1272x448) Image search: [iqdb] [SauceNao] [Google]
pls.png
154 KB, 1272x448
>>52375862
>pic related
>lewd

>>52375885
Yeah, true

I was really relieved when I discovered how simple it was to do GPIO on a Pi
>>
>>52375904
Maybe an anon had all his posts deleted?

The OP image got deleted too and that wasn't lewd.
>>
>>52375904
i've never seen something so lewd
my innocence is ruined
>>
I think this thread is on autosage too.

The mod is worse than Hitler.
>>
>>52375926
Yeah, that's the most likely explanation to me

>>52375934
You're lucky >>52375877 was censored

You would have turned into a lifelong weebslut just by being exposed to it
>>
>>52375954
That's not saying much.
>>
NEW THREAD!

>>52375963
>>52375963

pls no more lewdposting
>>
>>52375904
Well, that was just a shitpost.
>>
>not even 310 yet
fucking deserters
>>
guys? anyone here in true thread?
Thread replies: 308
Thread images: 19
Thread DB ID: 399876



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

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

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 shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.