[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: 325
Thread images: 20

File: dead things.png (261KB, 1000x310px) Image search: [Google]
dead things.png
261KB, 1000x310px
What are you working on, /g/?

Previous thread: >>60139439
>>
File: 1492377355483.png (198KB, 1920x1055px) Image search: [Google]
1492377355483.png
198KB, 1920x1055px
>>60142581
D is fast. FAST!
>>
File: 1460416516989.gif (148KB, 340x340px) Image search: [Google]
1460416516989.gif
148KB, 340x340px
Implementing a C compiler in simply typed lambda calculus with pen and paper.
>>
>>60142597
D is dead. DEAD!
>>
>>60142625
Doesn't quite look like it. Does that make you upset tho?
>>
>>60142597
Not so fast.
>>
>>60142597
D is so fast that it went through the entire programming life cycle in barely 10 years
>>
Macros are for people who can't understand types.
>>
>>60142655
What about C?
>>
>>60142633
It's definitely dead. It had its chance in the 90s and it blew it. It even still has that GC that it kept promising to get rid of.

Dead dead deady deady dead dead dead.
>>
File: captcha.png (772KB, 1053x961px) Image search: [Google]
captcha.png
772KB, 1053x961px
Making a program that can crack captchas like pic related using C. Anyone has any tips on identifying each digit :^(
>>
HKTs are newbie friendly features for novice programmers who do not understand macros
>>
>>60142597
>Claims D is fast
>Is the slowest one there
Kek. Meanwhile Rust manages to be faster than C.
>>
>>60142662
C is for people who don't understand types, too.
>>
I find drjava ide very usefull.
>>
>>60142680
OK, you're just trolling.
>>
>>60142666
Uh? It's GC'd AND fast.
>>
>>60142655
>>60142674
Formally prove that they are mutually exclusive. That is the only way I am going to accept either of these statements.
>>
>>60142674
This
>>
>>60142674
People who think types and type system features are for hand-holding or there to be "newbie friendly" don't understand types.
>>
>>60142691
>Look at me I'm smart!
>>
>>60142667
Don't use C.

Anyways, general idea would be for each digit to store "possibiltiy", like pixel maps. And you'd have lots of them! Then break digit into pixes, and find the one that is most similar.
>>
>>60142674
>This hurts the shitkell user
>>
>>60142689
>It's GC'd AND fast.
Sure, it's fairly fast for a GC language. But it can't compete with C, C++, or Rust.
>>
>>60142667
Neural networks.
>>
>>60142701
Who said this? And I mean that in the non-"who are you quoting" way.
>>
>>60142667
Train a neural network. Actually there might be something already made for text recognition.
Any reason you want to use C other than torturing yourself?
>>
>>60142713
>getting so upset by a language that you misremember its name
>>
>>60142698
>don't understand types
What is there to understand? Or are you claiming they are so retarded that they don't understand propositions?
>>
>>60142674
Who the fuck cares? Noobs will complain for not holding their hands regardless.
HKT users are brainlets
>>
>>60142718
>>It's GC'd AND fast.
>It's [bad thing] AND [good thing]
Meanwhile C is just [good thing], and Rust is [good thing] AND [good thing].
>>
Asking again
What's /dpt/'s goto choice when picking a completely free license without any restrictions?
I like WTFPL but it requires you to make a no warranty comment in every source file if you want to include a no warranty clause, and ISC requires you to distribute a copy of the license with releases as well.
>>
>>60142745
>What is there to understand?
They don't understand what types can be used for other than rejecting invalid programs, ergo they don't understand types.

>Or are you claiming they are so retarded that they don't understand propositions?
That is a possibility I had not considered.
>>
>>60142739
>misremember its name
Oh, I don't remember irrelevant shitlangs. Was it trashkell?
>>
>>60142749
GCs aren't inherently bad. Enjoy fucking up your shit while doing **********malloc(n*++)
>>
>>60142778
>denial
>>
>>60142796
ignore him, he's just butthurt
>>
>>60142768
>What's /dpt/'s goto choice when picking a completely free license without any restrictions?
Don't use licenses
>>
>>60142796
>>60142799
Shitlel?
>>
>>60142796
>>60142799
Haskfail?
>>
>>60142801
>>60142768
GPL v3
>>
>>60142667
>>
>>60142794
Only a shit programmer would get into that situation.
And only an unsafe programmer would directly call malloc or dereference pointers.
>>
>>60142778
>>60142808
>>60142820
It's Hasklel.
>>
>>60142768
BSD (2 or 3 clause), MIT or ISC.
>>
>>60142667
I'd try to turn the lines into vectors, then compare lines/points to a map of vectors representing the numbers by their relative position.
>>
>>60142877
https://www.gnu.org/licenses/why-not-lgpl
(applies to other licenses too)
>>
>>60142875
>Hasfail
Got it
>>
File: 1492871032584~000.png (786KB, 1000x1300px) Image search: [Google]
1492871032584~000.png
786KB, 1000x1300px
>>60142674
>>60142713
>>60142747
>>60142778
>>60142820
>>60142808
t. brainlets that can't into math
>HURRR DURRR FUNCTIONAL PROGRAMMING TOO HARDDD GUHHHH

Haskell is too good for you and you're insulting a goddess. Pic related get off her board normies REEEEEEEEEEEEE REEEEEEEEEEEEEE REE REE REEEEEEEEEEEEEEEE
>>
Implementing an efficient fizzbuzz algorithm.
>>
>>60142926
please don't false flag thank you

also go back to >>>/r9k/
>>
>>60142926
>Math
>Programming
AHAHAHAHAHAHAHAHAHAHAHAHAHAA

ONLY FAILED MATH/PHYSICS REJECTS STUDY C""""S"""" YOU FUCKING DUMB MOUTH BREATHING BRAINLET
>>
File: 1465212797456.gif (152KB, 500x516px) Image search: [Google]
1465212797456.gif
152KB, 500x516px
>>60142926
I wouldn't really call something inconsistent "math".
>>
File: BHWjTX_CIAEOp1q-large.png (368KB, 498x707px) Image search: [Google]
BHWjTX_CIAEOp1q-large.png
368KB, 498x707px
>>60142942
>>60142943
>>60142947
so many retards in dpt this morning. sad!
>>
>>60142943
Dijkstra:
>Programming is one of the most difficult branches of applied mathematics; the poorer mathematicians had better remain pure mathematicians.
>>
>>60142955
Dumb cartoon poster.
>>
>>60142963
dumb poster
>>
File: 1462625286053.jpg (86KB, 650x650px) Image search: [Google]
1462625286053.jpg
86KB, 650x650px
>>60142955
Why would I be a retard when you said something wrong?
>>
>>60142926
>>>/trash/
>>
>>60142890
He wanted the least amount of restrictions possible, which is technically MIT/BSD/ISC.
I'd argue that it's better to release more software under GPL or LGPL, but webdevs have pretty much killed it.
>>
>>60142961
What is "pure" mathematics?
>>
>>60142969
>>60142971
>HASKELL TOO HARD GIB ME PYTHON JAVASCRIPT AND PYTHON :((((((
sad
>>
>>60142975
>webdevs have pretty much killed it
How so?

My general rule is: do the opposite of webdevs.
>>
>>60142985
Where did I say something even remotely similar to this? I'm not expecting a coherent response though.
>>
>>60142985
>trashkell
>hard
Stupid brainlet.
>>
>>60142983
https://en.wikipedia.org/wiki/Pure_mathematics

>>60142995
It's written all over your face.
>>
>>60142926
>try to make hello world
>main returns an IO monad.
And then you wonder whats wrong with haskell.
>>
>>60142985
1 gb of garbage per second
>>
>>60143008
>Broadly speaking, pure mathematics is mathematics that studies entirely abstract concepts. This was a recognizable category of mathematical activity from the 19th century onwards,
So just buzzwords?
>>
>>60143007
still too hard for you

>>60143012
>using programming languages to make hello world programs
yeah don't try showing off that "skill" to anyone
>>
>>60143008
Point me to a sentence where I have implied something similar to what you implied.
>>
>>60127620
Anyone got an answer to the question?
>>
>>60142991
They've been befuddled into thinking open source == free software.
They don't see the GPL as providing any value, but that's mostly because they believe that most corporations are benign or benevolent and that coding/software isn't political.
>>
>>60143040
Read this: https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
>>
>>60143036
What does it have to do anything with the fact that trashkell being not hard?
>>
>>60143037
Pick any of your posts in this thread. It is not difficult to infer from them.
>>
>>60143040
Why do you need a class for the edges?
>>
>>60142927
Do it with threads
>>
>>60143056
I think a better question is why do you still write hello world programs, brainlet
>>
>>60143059
Here is a list of posts:
>>60142947
>>60142969
Point me to the exact sentence which would allow someone to infer what you claim is easy to infer.
>>
>>60143072
dumb cartoon poster
>>
File: C8XFEP7WsAAsic1.jpg:large.jpg (38KB, 1902x126px) Image search: [Google]
C8XFEP7WsAAsic1.jpg:large.jpg
38KB, 1902x126px
What, exactly, does a "Hello World" example tell anyone about a language? Absolutely nothing. So stop asking for them. Fuckwits.
>>
>>60143053
>They don't see the GPL as providing any value
Yeah, that would make sense. Leftist garbage can't possibly provide any value.
>>
>>60143071
Why is this trashkell brainlet making irrelevant posts?
>>
>>60143082
Anime is the fundamental part of imageboard culture and being disgraceful to the anime must be a punishable offence.
>>
>>60143089
It does provide value to developers, who benefit from others work on their software.
>>
>>60143099
>trashkell
Nice one! Owned! XD

C? More like pee am I right? C++ more like pee puss puss hahaha java more like caca lol
>>
>>60143128
Why is this trashkell brainlet still making irrelevant posts?
>>
>>60143075
Please don't use scanf. Use fscanf, or fgets and strtol.
>>
>>60143140
>trashkell
>>>/v/
>>
>>60143140
haha trashkell YOU SAID IT AGAIN LOL! TRASHkel!

javascript more like cacashit am I right? haha python you mean uhhh hold on can't think of one noooo how will I earn my cool internet points
>>
>>60143160
Is this trashkell user having a mental breakdown?
>>
>>60143075
where's the declarations for i, j, m and n?
>>
>>60143182
lisp more like uhhh lisp because it's gay and gays have a lisp haha

PHP more like pee pee lol
>>
>>60143195
You mean Lithp.
t. /prog/
>>
>>60143182
>trashkell
You mean Garbokell
>>
>>60143242
I personally like hasklet.
>>
>>60143253
>hasklet
kek
>>
>>60143253
>>60143264
Nothing beats hasfail
>>
>>60143265
You can't hide what's inside, hasklet.
>>
>>60143279
trashkell user getting really upset here
>>
>>60143284
fake and gay
>>
>>60143284
Please don't abuse code tags for your haskell propaganda.
>>
>>60143274
>hasfail
That's not funny at all. At least hasklet sounds like brainlet (which some haskell users are).
>>
>>60143291
>>60143303

>i try to make hello world programs but the monad mess me ahhh
loser
>>
>>60143309
Who said this, hasklet?
>>
>>60143309
>haskell still doesnt have dependent types
wew
>>
>>60143317
you
>>60143318
>haskell needs to behave like java REEEEEE I'm too dumb for anything else
>>
>>60143328
>I'm too dumb for anything else
why do people think haskell is literally the only FPL to choose from?
>>
>>60143336
no one uses that other hipster garbage
>>
>>60143328
>you
Point where I said "i try to make hello world programs but the monad mess me ahhh", newbie hasklet
>>
>>60143348
right here>>60143012
>inb4 "th-that wasn't me!"
>>
>>60143344
Haskell is hipster garbage. You may not want to hear this, but it is. I hope you can progress from denial and eventually reach acceptance.
>>
>>60143344
>your're to dumb for haskell
>n-no, other choices are for HIPSTERS
wow, haskell drones are becoming gayer than rust fags
>>
>>60143363
Why are you quoting yourself, hasklet?
>>
>>60143365
>>60143366
>hipster
>taught in academia
wew
>>
>>60143366
>are becoming
They already are. Traskell faggots are mentally ill
>>
>>60143366
>>60143373
>>60143383
this reckless samefagging is irresponsible. stop that
>>
>>60143375
>>taught in academia
No. Your trashlel is used nowhere and taught nowhere
>>
>>60143392
Did the trashkell hasklet get his ass handed right there
>>60143284
>>60143291
>>
>>60143383
>traskell
>webdev brainlet can't even spell his insults without messing up
please don't kill yourself. There's still hope for you, just, computers aren't for you. Try a factory job, I hear they hire just about anyone
>>
Idris > Haskell >> POOP languages
>>
>>60143414
fake and gay
>>
>>60143420
Why is the trashkell user getting so upset there?
>>
>>60143428
Idris is functional poop.
Haskell is dysfunctional poop.
>>
>>60143428
idris is dead
>>
>>60143428
Any language > 60 ft pile of trash > trashkell
>>
>>60143448
>>60143434
webdevs shouldn't be allowed on this board
>>
>>60143445
FP* is dead
>>
/dpt/ is trash now
>>
>>60143309
Let me show you
import System.Environment (getArgs)

hello :: String -> IO ()
hello name = do
putStr "Hello "
putStr name
putStrLn "!"

namesOfArgs :: [String] -> [String]
namesOfArgs [] = ["World"]
namesOfArgs args = args

getNames :: IO [String]
getNames = do
args <- getArgs
return $ namesOfArgs args

main :: IO ()
main = do
names <- getNames
mapM_ hello names
>>
>>60143453
Exactly. Fuck off back to your containment thread, trashkell shit eater
>>
>>60143461
blame haskell autists.
They are throwing up the biggest tantrum right now.
>>
Hasklel dimwit getting BTFO
>>
File: 1464277789592.png (2MB, 1920x1080px) Image search: [Google]
1464277789592.png
2MB, 1920x1080px
Are we being raided?
>>
>>60143463
jfc you do NOT need to do that for a hello world program

putStrLn "Hello World!"
>>
>2017
>MUH HASHFAIL
Some people like having jobs
>>
>>60143506
fuck off, weeb shitter
>>
>>60143510
>knowing haskell means you can't know other languages
shit you're right
>>
>>60143509
You can change the names on the command line. And my Haskell is old. I am rusty.
>>
>>60143506
I think the Rust fags are throwing a tantrum.
>>
Ban shitkell faggots. Why can't they contain themselves in their functional "programming" threads?
>>
>>60143527
Why bother learning garbage?
>>
>>60138282
Thank you, now it displays but break; doesn't work in these loops so I don't know how to end the fight. Any ideas?
public class Fighter
{
public int hitPoints;
public int GenerateAttack()
{
Random r = new Random();
System.Threading.Thread.Sleep(1000);
int randomNumber = r.Next(1, 100 + 1);
//Changed from hitpoints to a flat 100
//System.Threading.Thread.Sleep(1000) pauses the RNG and allows new numbers to generate in the code
return randomNumber;
}
}


private void buttonFight_Click(object sender, EventArgs e)
{
Fighter good = new Fighter();
good.hitPoints = 300; // rand

Fighter bad = new Fighter();
bad.hitPoints = 300; // 1 - 100
lblFight.Text = String.Format("Hero: {0} Enemy: {1}", good.hitPoints, bad.hitPoints);

int damage = (int)(good.GenerateAttack());
bad.hitPoints -= damage;
lblFight.Text = String.Format("Hero dealt {0} DMG", damage);
if (bad.hitPoints <= 0)
{
lblFight.Text = ("Enemy defeated!");
pictureBox1.Visible = false;
this.Hide();
}
damage = bad.GenerateAttack();
good.hitPoints -= damage;
lblFight2.Text = String.Format("Enemy dealt {0} DMG", damage);
//displays enemy damage every attack turn
if (good.hitPoints <= 0)
{
MessageBox.Show("GAME OVER");
pictureBox1.Visible = true;
}
}
>>
>>60143542
because this is a programming thread. not everything needs to cater to your brainlet webdev needs.
>>
>>60143542
Didnt /hpg/ get tried and die just like /fpg/
>>
>>60143510
>>60143542
These
>>
>>60142581
normie CS freshman here. Am I ever actually going to use JApplets or is my professor just a fucking tool?
>>
>>60143557
>because this is a programming thread.
Exactly why shitkell faggots needs to fuck off immediately
>>
>>60143542
>>60143558
stop responding to your own posts

>>60143559
stop upboating your own posts you can't even upboat on 4chan
>>
>>60143558
Trashkell faggots are too edgy to have one website, how can you ask them to stay contained in their daycare thread?
>>
>>60143563
no. you're going to make haskell apps.
>>
>>60142633
Are you kidding? Even Andrei said it. D has no vision and it ultimately failed. It's only use case at Facebook (where Andrei works) was it's only major project.
>>
>>60143580
>Trashkell faggots are too edgy to have one website
What do you mean?
>>
File: 1490258906936.gif (458KB, 256x256px) Image search: [Google]
1490258906936.gif
458KB, 256x256px
>>60142675
>>
>>60143596
Just like your run of the mill functional "programmer", shitkell community got divided into two and now they have two languages under the same name

What a fucking weak joke
>>
Programlets would rather write a hundred lines of code than a single type and have the compiler write the code.
>>
File: 1467299665720.png (81KB, 512x288px) Image search: [Google]
1467299665720.png
81KB, 512x288px
>>60143597
>>
>>60143621
Macros are better than types.
>>
>>60143641
>shitkell slower than java
So this is where the insecurity comes from
>>
>>60143642
Incorrect.
>>
>>60143620
top kek
>>
File: Capture.png (188KB, 666x1329px) Image search: [Google]
Capture.png
188KB, 666x1329px
>>60143594
>t's only use case at Facebook (where Andrei works) was it's only major project.
Love this meme
>>
>>60143620
>>60143661
This is not even false. There are two trashkell variants with the same name
https://www.haskell.org/
https://haskell-lang.org/

It's over for them
>>
>>60143621
>hundred lines of code
>POOP:
Iterator it = listOfThings.iterator()
while(it.hasNext()) {
Element e = it.next();
action(e);
}


Haskell:
map listOfThings action


summary: POOP is tedious garbage.
>>
>>60143661
don't "top kek" your own posts.
>>60143683
don't respond to your own posts.
>>
>>60143683
Seriously, what's up with that?
>>
>>60143688
How many years did the last one take to produce any result?

And how many GB/s did you reach?
>>
>>60143705
faggot
>>
>>60143688
Yes, Haskell is more concise for trivial tasks too. I wasn't talking about those sorts of tasks, though.
>>
>>60143702
Shitkell shitters fighting with themselves
>>
>>60143711
>muh trivial tasks
>i do REAL work, like hello world programs
>>
>>60143705
>And how many GB/s did you reach?
I reached 7 GBps with my superior HASKLEL type system
>>
>>60143719
>>60143702
webdev faggot talking to himself
>>
>>60143719
Seriously.
>>
>>60143705
>muh 1gb/s meme
It's possible to write wasteful code in any language. I've written code that produces 1gb/s of garbage in Java, C#, Python, and Ruby.
>>
>>60143740
>>60143731
Get your trashkell and go fuck youself in your own daycare thread, hasklet
>>
Hello guys good morning what's going on here? :^)
>>
It's very telling that people get so bent out of shape about Haskell's existence.
>>
>>60143740
Why would you brag about being a bad programmer?
>>
>>60143739
Shitkel is deader than it was
>>
>>60143758
your containment board is /v/. What are you doing here?
>>
#!/bin/sh

set -e

HELP=
MIN=1
MAX=100

help () {
echo "usage: $0 [options]"
echo " -h, --help Show this help"
echo " --min Set min"
echo " --max Set max"
}

parse () {
while [ $# -gt 0 ]
do
case "$1" in
-h | --help)
HELP=yes;;
--min=*)
MIN="$(echo "$1" | sed -e s/^--min=//)";;
--max=*)
MAX="$(echo "$1" | sed -e s/^--max=//)";;
*)
echo "unknown option: $1" >&2
help >&2
false;;
esac
shift
done
}

main () {
local N=$1
while [ $N -le $2 ]
do
if [ $(($N % 15)) -eq 0 ]
then
echo "fizzbuzz"
elif [ $(($N % 5)) -eq 0 ]
then
echo "buzz"
elif [ $(($N % 3)) -eq 0 ]
then
echo "fizz"
else
echo "$N"
fi
N=$(($N + 1))
done
}

parse "$@"

if [ -n "$HELP" ]
then
help
else
main "$MIN" "$MAX"
fi
>>
>>60143765
You missed the point spectacularly.
>>
>>60143761
webdev fags can't into haskell
>>
>>60143779
I think it's quite clear you can't write performant code.
>>
>>60143775
Shitkell faggot STILL here. Amazing. Do you want people to make your own containment functional brogramming thread?
>>
>>60143767
Fuck off. Go play video games.
>>
>>60143785
wtf I hate Haskell now
>>
>>60143785
How cares about hasklel?
>>
>>60143792
I wasn't trying to write performant code, I was trying to write wasteful code in order to prove a point.
>>
Why's Haskell getting so much hate here? It's pretty great.
>>
>>60143794
Go fuck off back to your anime board, weeb shit
>>
>>60143809
Stop samefagging, trashlel faggot
>>
>>60143809
It's the same guy spamming his autism and replying to his own posts.
>>
>>60143807
>>60143809
>>>/trash/
>>
>>60143810
Written on an imageboard created to discuss Japanese culture.
>>
>>60143809
>>60143812
>Exactly 1 minute apart
>>
1. Get shitty/no CS education
2. Can't into Haskell/any other FP language
3. Get buttfrustrated
4. Claim loudly and rabidly that Haskell is useless, so people don't realize that the only thing that is useless is in fact you
>>
>>60143463
You write some weird Haskell.

import System.Environment (getArgs)

uncons n _ [] = n
uncons _ k (x:xs) = k x xs

hello name = putStrLn ("Hello " ++ name + "!")
names = fmap (uncons ["World"] (:)) getArgs
main = names >>= mapM_ hello
>>
>>60143816
>>>/jp/
Fuck off weeb
>>
>>60143809
its one ban-evading autist
its a learning language though.
But is pretty much cementing itself as the C++ of functionals.
>>
>>60143809
Rust fags are trying to get their way.
>>
>>60143827
This, really the progression should be ML -> Idris -> Agda
>>
>>60143827
>its a learning language though.
what?
>>
>>60143821
You just rewrite my code by inline functions. Don't make me laugh kiddo.
Except for the ++, but I am rusty.
>>
>>60143830
Reminder that Rust will never have HKTs, and is therefore a language of very limited utility
>>
>>60143824
Why do you even post here? Every board here is related to anime.
>>
>>60143845
It did a lot of things right but is more useful to learn from and improve on than trying to save the language itself.
>>
>>60143845
brain exercises. Makes you a better programmer by learning to program in a new way if you don't know any FP.
>>
>>60143859
Never used HKTs in my life. Why are newbies so dependent on abstractions these days?
>>
>>60143849
IYou ought to know that
do y <- x; return (f y)

is equivalent to
fmap f x

. It's in the Monad laws.
>>
>>60143878
>Makes you a better programmer by learning to program in a new way if you don't know any FP.
What's the point of FP? How is it useful?
>>
>>60143872
It's also in severe danger of the "mtl is too hard!" crowd getting their way, like they have in many other languages
>>
>>60143896
>How is it useful?
To appear cool ITT
>>
>>60143896
I just said, brain exercise. I don't know that it's useful outside of that though.
>>
>>60143879
>why are newbies so dependent
next you're going to tell me that C and the standard library is all you need.
>>
>>60143896
More expressive data manipulation.
>>
>>60143879
Some of us have better things to do than develop RSI from writing the same code over and over again.

If you don't like abstraction then go write assembly.
>>
>>60143839
>Haskell -> Idris -> Coq
Fixed that for you.
>>
>>60143906
>I don't know that it's useful outside of that though.
It's not. Functional programming will inherently produce inefficient binaries and it has no place outside circle jerking forums
>>
>>60143929
I trust you hand-code everything in assembly to avoid having inefficient binaries?
>>
>>60143920
>next you're going to tell me that C and the standard library is all you need.
No I won't. But if you think you cannot do your tasks without useless abstractions you should get proper education
>>
>>60143895
Yes. That's exactly why I said that you just rewrite my code and add nothing of value to it.
>>
I'm getting an error in c# i don't know how to solve. The code is as follows:

public IEnumerable<User> GetUsers(Func<User, bool> predicate)
{
return Users.Where(U => U(predicate));
}

It says method name expected on the second u in the lambda expression.
>>
>>60143925
>writing the same code over and over again.
Why do you think you cannot reuse codes without HKTs? Are you mentally disabled or just new?
>>
>>60143929
there are a specific set of languages and styles that, when used by competent programmers, produce efficient binaries

most languages and styles do not
singling out FP is dumb
>>
>>60143941
>useless abstractions
>help you do your tasks
how is that useless then?

>>60143948
use code tags please
>>
>>60143929
It has a place in multithreaded/concurrent code that is simpler to reason about. Anyone worth their salt will say that the world is imperative, and that using imperative code will get way more performance out of the machine, but there are enough upsides to not managing state, etc., that justify using a functional approach. Hell, all fast functional code looks a hell of a lot like imperative code.
>>
>>60143948
s/U(predicate)/predicate (U)/
>>
>>60143924
>expressive
you meant expensive

>>60143940
I do use inline assembly time to time. Why did you bring tat up?
>>
>>60143926
ML -> Haskell -> Idris -> Coq -> Agda
>>
>>60143959
Let's just say hypothetically that I don't know what code tags are or how to use them
>>
>>60143953
>Why do you think you cannot reuse codes without HKTs?
HKTs enable greater code reuse. If you cannot see this then you are like a Go programmer arguing against generics.

>>60143964
Surely you use it all the time, since you cannot afford inefficient binaries.
>>
>>60143967
>ML -> Haskell
No, that's just retarded.
>Coq -> Agda
Why not end with a superior language?
>>
>>60143955
>when used by competent programmers, produce efficient binaries
Yet to see that oh so called competent programmer.

I wonder why there are no compilers that are self hosted and produces binaries that are NEARLY as fast as C/C++

>>60143959
>help you do your tasks
>How is it not useful
Wrong analogy. The expense is too big
>>
>>60143964
>you meant expensive
FP languages have always been slower than their imperative counterpart. It's just that computers have become blazing fast and applications have become incredibly complex. Some developers are willing to trade speed for simplicity.
>>
HAHAHA LOOK AT ALL THESE FUCKING NERDS ARGUING OVER PROGRAMMING!!! WHAT A BUNCH OF LOSERS!!!

None of you have ever had a girlfriend. You all just need to chillllll ouuuuuuuuttt ;)
>>
>>60143967
Whats so special about agda?
>>
>>60144005
>None of you have ever had a girlfriend.
Why would I want a girlfriend when I have a boyfriend?
>>
>>60143998
Reread my post
>>
Is there really nothing like SDL for Go? I just want to (need to) make a simple game in it.

Azul3d is a live 3D graphics library I found but it's just overkill for what I want to do. Learning how to work with that would waste too much time.
>>
>>60144021
I get that you don't understand HKTs, but that doesn't mean they're not useful or only of use to newbies.

Perhaps you're the newbie, friend.
>>
>>60143993
>HKTs enable greater code reuse
Huh? I'm sorry maybe I know how to write macros, have you heard of them?

>>60143993
>Surely you use it all the time
Quite frequently

>>60143999
Yes, correct. FP is a lost cause, no need to reinvent the wheel there
>>
>>60144019
masturbating doesn't make you your own boyfriend.
>>
>>60144035
No, I'm the other one
>>
>>60144031
Why do you want to use Go?
>>
>>60144035
HKTs are for newbies though, is it hard to admit?
>>
>>60144055
What is an "HKT"?
>>
>>60144031
Stop using Go.

>>60144039
>Quite frequently
No, either you use it all the time or you're a hypocrite.

>>60144039
>Huh? I'm sorry maybe I know how to write macros, have you heard of them?
Macros are a poor man's generic programming. The tool of the barbarian.

>>60144055
Is it so hard for you to admit that you just don't understand them?
>>
>>60144069
An abstraction
>>
>>60144074
Okay, but what does "HKT" itself mean?
>>
>>60144078
Higher-kinded type
>>
>>60144082
you just googled that
>>
>>60144045
Need to get familiar with it for a uni class, and I've had this idea for a simple game in my head for a while so I thought I'd combine the two. Being able to show a finished product in it would be a good bonus.
>>60144070
Don't have much of a choice.
>>
>>60144070
>either you use it all the time or you're a hypocrite.
what exactly do you mean "hypocrite"? Who am I cheating?

>Macros are a poor man's generic programming.
Oh? I take it you are one of those newbies that complain about C's "lack" of beginner friendly abstractions?
>>
>>60144092
What the fuck sort of uni teaches Go?
>>
>>60144082
I don't get it, what does that mean in normal terms?
>>
Is there a command-line interpreter for lisp?

Interpreter might not be the right term to use, I'm going through 'Structure and Interpretations of Computer Programs' and I want to follow along typing line by line and seeing the output, kind of like the python IDLE.
>>
>>60144102
The class isn't about Go specifically, I got it assigned to me from a pool of languages. The class is about developments in software language design.
>>
>>60144078
>>60144112

all values have types
all types have kinds

regular types have the kind *, also called Type
a generic like vector has the kind
Type -> Type
because vector takes a type parameter and returns a type

something like Array has the kind
(Type, Size_t) -> Type

a higher kinded type is a type like the following:
(Type -> Type) -> Type
e.g.
template <template <typename> typename F> // F is a template with 1 type parameter
using X = F<Int>;
>>
Miss me, brainlets?

Time to get to work
https://doc.rust-lang.org/book/
http://rustbyexample.com/

* Not for the brainlets *
https://doc.rust-lang.org/nomicon/
>>
>>60144122
Just hand in a steaming turd, it'll be about as good as any software written in Go.
>>
python is so bad but I am forced to use it

please end my misery
>>
>>60144127
Rust Essentials is a better book
>>
>>60144116
it's called a repl, read-eval print loop

use DrRacket for SICP, it has that
>>
File: 1472489024719.jpg (383KB, 1920x1080px) Image search: [Google]
1472489024719.jpg
383KB, 1920x1080px
>>60144134
i'm so sorry
>>
>>60144146
don't cry for me I am already dead
>>
>>60144136
Indeed it's a decent book.
Whatever works for you, friend.
>>
>>60144101
>relying on the crutches provided by C
>not using assembler for everything
You're the newbie, by your own arguments.
>>
>>60144126
>regular types have the kind *, also called Type
What kind does Type have?
>>
File: d lang.png (909KB, 1280x720px) Image search: [Google]
d lang.png
909KB, 1280x720px
>>60144164
rip
>>
>>60143859
this brainlet again

https://gist.github.com/14427/af90a21b917d2892eace

next?
>>
>>60144127
>>60144136
>>60144172
Rust will never have HKTs, let alone dependent types. Please stop recommending it, you are causing immeasurable damage to the minds of impressionable young programmers who don't know any better.
>>
>>60144177
kinds don't have types (in the same way values don't have kinds)
they have "sorts"
and then they ran out of words so they just started using "Universe n"
Universe n : Universe (n + 1)
>>
>>60144195
see >>60144193

please don't reply to me again, pythonista
>>
>>60144193
That code sample was brought up and dismissed last time. That is not HKTs.

If Rust had HKTs, people wouldn't contort themselves trying (and failing) to emulate them.
>>
>>60144195
>Rust will never have HKT
If your language supporsts macros, you can implement HKTs by yourself

Proof:
>>60144193
>>
>>60144215
>failing too
explain how he failed?
>>
>>60144211
Rust is a stillborn language.

If you're going to create a new language, you should at least make it useful, not ignore 30 years of PLT like most shitlangs have done.
>>
>>60144215
>That is not HKTs.
Except it is.

HKTs are now available in crates too https://crates.io/crates/hkt
It's not a rocket science
>>
>>60144209
wait, i mean kinds don't have kinds
they also don't have types obviously

but the point is

value : type
type : kind
kind : sort
sort : tbd

value : U0
U0 : U1
U1 : U2
U2 : U3

Actually, you can also have a weird system where Type : Type
>>
File: o2619691.jpg (341KB, 1920x1080px) Image search: [Google]
o2619691.jpg
341KB, 1920x1080px
hey guys, everytime I've come to this thread with a question I've gotten good info so I have another for any of you that work full time as a software developer/programmer.
Can you please give me a run down of what your average day at work looks like? How much time is spent doing what, what kind of tasks does your boss give you, deadlines, stresses, things you enjoy, etc.
if you work full time im sure you'd rather do something else on your weekend but I would be very grateful to any anons that take the time to apply. I'm a 24 year old about to finish my first year of college and I love it but I'm worried and unsure of the future.

In exchange I can offer you some fine 2b
>>
>>60144209
But some languages have Type : Type, right?
I've also seen a box and a star, what are those?
>>
>>60144235
>Simulated higher-kinded types for Rust
>>
>>60144253
Your point?
>>
>>60144224
>>60144216
>>60144235
That does not give you HKTs. Please try to understand the concept before claiming Rust supports it.
>>
>>60144253
>too brainlet to use macros
kek
>>
>>60144249
>How much time is spent doing what, what kind of tasks does your boss give you, deadlines, stresses, things you enjoy, etc.
that entirely depends on the workplace
>>
>>60144257
I could ask you the same.
>>
>>60144264
>macros
A sure sign of a deficient language.
>>
>>60144258
Explain semi-formally why those aren't HKTs. I'm genuinely interested.
>>
>>60144258
That's HKT, implemented with macros.
Don't tell me you don't know how to use macros
>>
>>60144145

Thanks for the help. I googled that and found that the program I previously installed was already a repl (clisp), but problem was when I ran it there was a known error with bash for windows.

I'm running it through SSH on my other machine and it works fine now.

Thanks <3
>>
>>60144264
>macros
The surest sign of a shitlang used by a brainlet
>>
>>60144275
What is a deficient language?
>>
>>60144258
I said explain, pythonista. >>60144224

Not dance around the question.
I'll be waiting, anxiously.
>>
>>60144282
>HKTs
The surest sign of a shitlang used by a brainlet
>>
>>60144278
No, it was explained before why that is not HKTs. Kindly stop shilling your deficient language.
>>
>install coqk
>Okay, that's not that exciting but we can't print "Hello, World" in Coq...
wew, well that was fun.
>>
>>60144251
star is a kind, it's what i called Type
i think box is a sort? in which case it would be Kind? dunno
>>
Best programming language for getting shit done?
>>
>>60144297
>it was explained before why that is not HKTs
where?
>>
>>60144290
One that must rely on macros to almost-but-not-quite emulate features that are built into better languages.
>>
>>60144242
What about systems where terms and types are the same thing?
>>
>>60144309
>>60144292
In /dpt/, obviously. But no matter, it is obvious from the code itself that it fails at implementing HKTs.

>>60144307
Pick any dynamic language
>>
>>60144272
I simply have no idea what developing software for a living in a business environment looks like.
I don't know who decides what people should be working on, how much time is given to solve issues, what expectations are held in regards to your output, time spent in meetings, shit like that.

I'm putting a huge amount of effort into getting a real job that I will hopefully enjoy but it dawned on me this morning that I don't really know what I'm getting myself into.
>>
>>60144315
>almost-but-not-quite emulate features
Isn't HKT the same thing? It's implementable by macros, which gives you an idea the uselessness of HKTs
>>
>>60144332
>it is obvious from the code itself that it fails at implementing HKTs.
Prove it
>>
Why are there so many subhumans in this thread today?
>>
>>60144332
>Pick any dynamic language
You'll write an awful lot of shit in it (sent my last post too early)
>>
>>60144320
well they don't really exist afaik, it's just that you have a system where the same AST/syntax describes both terms and types

e.g. dependent types with infinite universes, each term will have a universe that you have to infer and check before checking types/etc
>>
>>60144296
>i dont have it so its bad
wew
>>
>>60144332
>dynamic """""""""""""language"""""""""""""
He didn't ask for garbage
>>
>>60144355
Exactly. No wonder HKTs are not used in any useful languages
>>
File: nVjQ1iE.png (1MB, 1357x1281px) Image search: [Google]
nVjQ1iE.png
1MB, 1357x1281px
>>60144332
>he can't explain it
Are you a Koder by chance?
>>
Dynamic typing is immoral
>>
>>60144375
> Dynamic """typing"""
It's dynamic trash
>>
>>60144375
>Nonexistent thing is immoral
How is that?
>>
New thread:

>>60144368
>>60144368
>>60144368
>>
>>60144315
All non-programmable programming languages are trash.
>>
>>60144391
There are no trash languages, only trash programmers
>>
All this praise for haskell yet anon hasn't posted any haskell examples that apply a solution to any real problems
baka desu
>>
>>60142597
All three of those programs are invalid, tbqh.
>>
I am making a snippet for kate, so I can insert doxygen comments on the next function in the document I am at.
This is what I have so far:
// ${part_one()} ${cursor} ${part_two()}
require("cursor.js");

function get_line(){
var cursor = view.cursorPosition();
var ln = cursor.line + 1;
var error_string = "";
for(var l = ln; l < document.lines(); l++){
var line = document.line(l);
var declar = line.match(/[a-zA-Z ._]*\(/g);
var inputs = line.match(/\(([^\)]*)\)/g);

if(declar != null && inputs != null){
if( declar[0].split(" ").length == 2 ){
return line;
}
}
}
return error_string;
}

function part_one() {
var line = get_line();
if(line == ""){
return "";
}
var declar = line.match(/[a-zA-Z ._]*\(/g);

var func_name = declar[0].split(" ")[1].slice(0,-1);

return "\n/** \n" + " * @brief " + func_name + " - ";
}

function part_two() {
var line = get_line();
if(line == ""){
return "";
}
var declar = line.match(/[a-zA-Z ._]*\(/g);
var inputs = line.match(/\(([^\)]*)\)/g);
var allInputs = inputs[0].slice(1,-1);
var vecInputs = allInputs.split(", ");

var final_string = "\n";
if(allInputs.length > 0){
for(var i = 0; i < vecInputs.length; i++){
final_string += " * @var " + vecInputs[i].split(" ")[1] + "\n";
}
}
var return_val = declar[0].split(" ")[0];
if(return_val != "void"){
final_string += " * @return \n";
}
final_string += " */\n";
return final_string;
}


Does anyone have suggestions for improvements?
Thread posts: 325
Thread images: 20


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