[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: 321
Thread images: 26

File: memory_safety.jpg (263KB, 500x1356px) Image search: [Google]
memory_safety.jpg
263KB, 500x1356px
What are you working on?

Old thread: >>61049799
>>
>>61056544
Thank you for posting no anime.
>>
Fuck man, why is /dpt/ so slow now?
>>
OHH FFFUCK HOLY SHIT

All I have to do is fork servo. It's a fucking game engine. It's fucking designed to exploit GPUs. Electron is so fucking dead!

Fuck off /dpt/, see you in a year.
>>
>>61056601
it's written in rust
>>
File: 0d1.jpg (23KB, 640x559px) Image search: [Google]
0d1.jpg
23KB, 640x559px
>>61056624
>>
the range for is a magical addition to c++11
>>
File: rust.png (60KB, 656x372px) Image search: [Google]
rust.png
60KB, 656x372px
>>61056624
You mean it's written in C using qsort.
>>
>>61056654
I have my own qsort using c11 generics
>>
>>61056662
Post benchmarks.
>>
>>61056674
my personal shorthand for type generic expressions
>>
>>61056601
Fucking reCAPTCHA seems to be slower than usual and it requires way more than it used to.

>>61056620
Why not just use existing game engine, or fork existing game engine. They utilize GPU.
>>
>>61056654
>posting rigged benchmark
rustfags should just leave.
>>
could machine learning solve captchas where you select all cars?
>>
>>61056794
They should just benchmark the default sort implementations, t b h.
>>
File: 1498144740329.gif (100KB, 600x487px) Image search: [Google]
1498144740329.gif
100KB, 600x487px
>>61056794
>muh anything that doesn't go with my opinion it's rigged philosophy
>>
>>61056865
>C implementations have use khash
>not rigged
yeah ok buddy
>>
>>61056892
C is slower than C++
>>
>>61056662
>c11 generics
>not actually generics
>>
>>61056544
Floating point bug
>>61056605
yes because it was lisp


Having fun teaching students how to write programs without explicit recursion in python. They froze when I showed them how z = lambda f: lambda x: f (z(f), x) works but later accepted my breaking of their veiw of python as a procedural language

>>61056804
can solve all of them as captchas use machine learnig to recognize which is correct. It proves it can beat itself
>>
>rust is faster than assembly
Plus you can't even write bugs in your code anymore. Other languages should just give up.
>>
>>61056920
C is faster than machine codes tho
>>
>>61056915
>Floating point bug
you know that meme is always meant to be purely ironic?
>>
>>61056909
False, badly written C is slower but that's if you decide not to play the "be a compiler" game. C is functional if you know how continuations work

>>61056920
can't wait for the day idris kills rust off. Rust being safe? Idris forces proofs!

>>61056927
Read the freebsd guide to memory
>>
>>61056804
you are training googles machine learning algorithm when you solve the captchas, so yes
>>
>>61056920
So why do the Rust devs release 0.x updates?
>>
>>61056942
>badly written C is slower
C's qsort is slower than C++, you can try all you want
>>
File: 1494395441703.gif (3MB, 700x285px) Image search: [Google]
1494395441703.gif
3MB, 700x285px
>>61056942
>idris kills rust off.
Haven't seen anyone this much deluded in a while 2bqh
>>
>>61056942
Idiris can't even kill Haskell, ffs.
>>
File: 1464697671060.png (73KB, 286x255px) Image search: [Google]
1464697671060.png
73KB, 286x255px
>>61056942
>idris kills rust
>>
I was excited about idris until I realized that getting the head of an empty string terminates your program instead of returning Nothing or ""
>>
>>61057010
meme
>>
>>61056985
This, it can't kill the language that can't even kill Lisp, the language that can't absolutely kill anything.
>>
>>61057010
>>61057010
>taking meme pictures serious
enjoy your yous

>>61057013
kek
>>
>>61056960
__asm(...)
>>61056972
it's safer plus uniqueness types brings it to the same level
>>61056985
yet
>>61057027
nothing can kill lisp, lisp is in everything you write with a few exceptions (APL, Forth, &c...)
>>
>>61057047
>asm
Thats not C
>>
>>61057052
muh
>>
>>61057013
because you can't do that....
head : List elem -> elem
head [] = Nothing
head (x::_) = Just x


there, head is haskell crud
>>
>>61057047
>__asm(...)
kek. templates are better and portable.
>>
>>61057063
>>61057075
It was a joke, but you need to play the C game properly to get it running faster
>>
>>61057052
meme
>>
File: 1492638099930.png (89KB, 363x475px) Image search: [Google]
1492638099930.png
89KB, 363x475px
What if you take the safety of rust and put it into C++
>>
>>61057133
it will be in the C++21 with the optional garbarge collector and github integration
>>
>>61056915
>floating point Bug
>he doesn't wrote a float wrapper which tracks the amount of bits of precision that remains after every operation at compile time and gives him the value range to give compile errors on before every operation
I question why this isn't a standard feature in languages. It's not hard to do. All you need is to define the input value range once and you've got the entire program covered.
>>
>>61057142
>optional GC
I don't see why people care about features like this. There's millions of libraries for memory management you can use. The standard will probably be one of the worst systems as it usually is.
>>
>>61057133
C++ will most likely steal shit from D before Rust
>>
>>61056960
Write a C++ qsort that's faster than Cs qsort then.
I'll wait.
>>
>>61057193
check the prior two threads
>>
>>61057200
I've read the discussions and it's about std::sort vs qsort. Not a C++ implementation of qsort vs C implementation of qsort.

Not to mention the entire argument there was about how the C qsort couldn't inline the comparator function because they weren't compiling the C standard library with the program. So it's not even about the different functions it's about the environment.
So silly.
>>
>>61057191
They already did, you can use strings in unions now.
Unions named std::variant, that is.
>>
File: 1_leu._Romania,_2005_a.jpg (129KB, 800x406px) Image search: [Google]
1_leu._Romania,_2005_a.jpg
129KB, 800x406px
>>61057191
>>
>>61057074
yeah but it's a new language so it could be
head :: [a] -> Maybe a
head [] = Nothing
head (x:xs) = Just x
>>
>>61057191
V++ is the niggers of languages
>>
>>61057191
>>61057244
kek
>>61057240
k e k
>>
>>61057244
this
>>
>>61057240
>you can use strings in unions now.
I would have expected some half-ass, wonky mixins first, but alright then.
61057241
hello rajeesh
>>61057244
why improve your own thing when you can just hack on somebody else's work :^)
>>
61057264
spotted the nigger
>>
>>61057264
>wonky mixins
Mixins are nice. Template mp is abysmal.
>>
>>61056605
this fucker again god damn it

>>61056909
>>61056927
>>61056942
>>61056960
>>61057063
>>61057133
>>61057191
>>61057193
daily reminder that if you program in any language other than C then you are a brainlet

t. /sci/
>>
>>61057264
>I would have expected some half-ass, wonky mixins first, but alright then.
doesn't multiple inheritance count
>>
>>61057244
>>61057240
>>61057191
holy shit, legit kek
>>
>>61057280
>sci
Why did you feel the necessity to mention that particular thing?
>>
>>61057274
i see the power of D's actual ones, but i still dont like the idea of them, desu. I feel like they could get easily abused and lead to spaghetti.
>>61057284
sure, but i meant non template shit.
>>
>>61057280
>If you don't calculate square of 25 digit numbers manually you are a brainlet
>trust me, because I happen to use /sci/
Pathetic
>>
>>61057300
>lead to spaghetti
I see that just as the nature of metaprogramming. And programming in general. You can always do wrong things. With metaprogramming you're effectively writing more code so it's easier to write lots of junk.
I don't like how languages prefer catering to the lowest common denominator. (see rust, go, python)
>>
>>61057172
>It's not hard to do.
it's literally impossible
double f = 0
int iters = user_input
for cnt from 0 to iters:
if iters < 100:
f = floating_point_op_a f
else:
f = floating_point_op_a f
f = floating_point_op_b f


how many bits of precisions are left?
>>
>>61057280
>posting on sci makes you smart
>>
>>61057293
see >>61057325
>>
>being racist
>on 4chan of all places
Looks like someone needs to spend some time with the CoC.
>>
>>61057320
I dont feel that way with D's templates since theyre significantly cleaner than sepples.
>>
>>61057293
because it would get me more (You)s. Just check the replies to my post.
>>
>>61057280
I absolutely hate this meme. This is wrong in so many fucking levels it's ridiculous
>>
>>61056920
>you can't even write bugs in your code anymore
You're a fucking retard if you think that.
>>
>>61057342
Who are you quoting
>>
>>61057355
Whom*
>>
>>61057354
>being too retarded to understand the sarcasm
>>
>>61057280
>/sci/
What do you think about JAI?
I hear the research community is interested because game programming is similar in that they share a lot of the ideas of writing fast systems and high level code in front of those systems yet they always demand as much performance as they can get (with research there's always a gain in execution time, with games you always want the best graphics or whatever).

I find the similarities interesting. Is it all just about simulations though? What do /sci/-programmers do other than simulation? I guess the LHC does a lot of data processing/analysis. But they use python as a front-end. I don't see the point.
>>
>>61057342
Whose CoC is it anyway?
>>
>>61057358
Who
>>
>>61057365
reddits
>>
How do I become C++ master programmer?
>>
>>61057342
Yeah it's amazing how people just ignore global rule 3.
Mods especially. I've complained for a decade now and it doesn't seem to help.
We need more janitors.
>>
>>61057133
You'd get back Rust.
>>
>>61057344
Still not the best metaprogramming has to offer.
D should have gone with complete compile time interpretation and an AST manipulation API.
>>
>>61057379
>Rust with templates
I cant even imagine.
and no, generics arent templates.
>>
>>61057373
>how do I learn all of C++
Read the entire C++ spec and consider every part of it with every other part of it in the spec. It's an O(n^2) or greater process. Then start complaining at compiler writers because nobody follows the spec perfectly.
>>
File: github.jpg (261KB, 1388x924px) Image search: [Google]
github.jpg
261KB, 1388x924px
>>61057365
Github has nice CoC's.
>>
>>61057364
I work in numerical dynamics. think electrical circuit sims, differential equation solvers, that stuff. Basically the only graphics I need are plotting software.

A lot of /sci/ programming is sims, yeah. Either sims or massive numerical computation. My personal favorite is numerical algebra. Efficient algorithms for linear algebraic operations are really useful.
>>
>>61057402
I pray to Allah that she gets BLACKED
>>
>>61057395
Different syntax for the same thing.
Explain how they are not the same thing.
>>
>>61057400
Is there a more simpler way?
>>
>>61057412
>she
Looks like someone needs to spend some time with the CoC.
>>
>>61057425
I guess you could read a book. But I doubt you get to be a master programmer that way. Maybe that wasn't really what you wanted?
>>
>>61057379
but isn't C++ faster
>>
File: 1496823833592.jpg (131KB, 500x353px) Image search: [Google]
1496823833592.jpg
131KB, 500x353px
>>61057402
Does that bowl say "NIGGER" off to the right?
>>
>>61057445
No? >>61056654
>>
>>61057446
kek
>>
>>61057446
Looks like they photo edited it. What would a NIGGET- be?
>>
>>61057443
I'm thinking of starting some sort of a project to learn modern C++. I already know a lot of old C++ but I don't get the purpose of new C++ features.
>>
File: github_2017.jpg (315KB, 2048x1152px) Image search: [Google]
github_2017.jpg
315KB, 2048x1152px
Opening github's blog was a mistake.
>>
>>61057484
T H I C C
I
C
C
>>
>>61057455
Is that a question?
>>
>>61056544
Is it wrong to appreciate C++ slowly evolving from shit to less shit but still shit?
>>
>>61057484
That faggot has thicc legs
>>
>>61057481

All you need to know is smart pointers and move semantics desu
>>
>>61057506
Would you appreciate a plate of steaming pile of shit with a cherry on top?
>>
>>61057513
Does it come polished?
>>
Making programming great again.
(use '[clojure.string :only (split)])

(defn make-entry []
(let [kv (split (read-line) #" ")]
{(first kv) (second kv)}))

(defn make-book [n]
(loop [n n book {}]
(if (zero? n)
book
(recur (dec n) (into book (make-entry))))))

(let [n (Integer/parseInt (read-line)) book (make-book n)]
(loop []
(let [query (read-line)]
(when (not-empty query)
(let [number (get book query)]
(if (not-empty number)
(do (println (format "%s=%s" query number)) (recur))
(do (println "Not found") (recur))))))))
>>
>study cs
>do 1 month of work in normie terms project in 1-2 days
>never debug so theres a problem every time
>comment that the program is not working because i couldnt find all the bugs in time
>get ~80/100 every time because most of it is right
>tell this to my normie friends who work their asses off
>they spaz out and get angry, some dont believe me
fucking brainlets when will they learn
>>
>>61057520
no
>>
>>61057522
>)))))))
>>
>>61057522
it looks like all your code is whispering at me.
>>
>>61057484
Imagine how degrading it is young women to be grouped with these people.
Feels really bad.
>>
>>61057542
You forgot one.
>>61057544
What does it whisper to thee?
>>
>>61057528
You willingly take a lower grade. Good going, champ.
>>
>>61057528
You should change your attitude and work for excellence
>>
>>61057522
Mixing parens with brackets and curly braces is an abomination.
>>
>>61057545
i go to a university that has a very outdoors and exercise friendly culture.

All the girls are hot. all the guys are hot. everyone is fucking gorgeous. even in the max sperg tier engineering majors.

>>61057554
>(im formatted like shit)
that's the vibe i'm getting. might be the broken highlighting on 4chan though.
>>
>>61057581
ask the lisp faggots
they're all about that shit for some reason
>>
>>61057581
Already been done with C++17.
>>
>>61057581
Why is sakurano's body a bit more warm than the other girls?
>>
>>61057555
>>61057561
i do it for the vidya
i feel as if i would waste a lot more time for what 10-20 more points
some bugs and problems just take a long time and id rather not bother
>>
I'm working on a crossplatform application where you can view cached and or live versions of connected computers filesystems. so it's basically ftp but it starts on boot of all of my devices and it has a queue system, so if one of my computers are offline and I want to move or delete files I can "queue" from a cached version on my Android device

it's kinda useless I know
>>
>>61057592
How do you know?
>>
>>61057596
Please stay away from any mission-critical software in the future.
>>
>>61057569
I don't like that either, but that's how Clojure works.
(loop ()
(println "fuck reddit"))

user=> (load-file "scratch.clj")
CompilerException java.lang.IllegalArgumentException: loop requires a vector for its binding in user:1, compiling:(/tmp/scratch.clj:1:1)
>>
>>61057596
yeah but you won't get into a good grad school if you don't take the time. everyone knows codemonkeys are gonna be some of the first to be automated out of existence, so you gotta become educated enough to not be replaceable.
>>
>>61057596
Anon finding the bugs isn't difficult or time consuming.
Just spend that little bit of time.
>>
>>61056654
first of all that benchmark clearly shows C is the fastest
besides that, though:
>he did not even write his own qsort as an iterative macro that is faster than both qsort and std::sort
leave
>>
More cancer.
(defn factorial [n] = (reduce * (take n (next (range)))))

(let [n (Integer/parseInt (read-line))]
(println (factorial n)))
>>
>>61057628
yea they're all about wizards and conjuring the spirits of the computer with spells
https://www.youtube.com/watch?v=IOhaI4-2fVc
https://www.youtube.com/watch?v=aHk42kDwesM
>>
>job interview
>whiteboard is wheeled out
>have to implement an inline qsort in C
>>
Lisp will never be popular with syntax from the 50s. I dont understand why lisplets refuse to accept this.
Why not use the """"""""power""""""" of lisp to create a new flavor that actually belongs in this century?
>>
>>61057659
>job interview
>just talk about my resume
>congrats you're hired
>>
>>61057659
>literally just use a macro with a pushdown automaton
i keep saying this but everyone is apparently too retarded???
>>
>>61057659
>you'll only get hired if it's faster than std::sort
>>
>>61057669

CPP =/= C
>>
>>61057671
see: >>61057669
>>
>>61057659
>#include the sort
>use the sort
>say that this is presuming an environment with glib C statically linked rather than relying on a dynamically linked standard library. For speed purposes.
>>
>>61057669
you're hired
>>
File: braveclojure.png (104KB, 900x900px) Image search: [Google]
braveclojure.png
104KB, 900x900px
>>61057522
http://www.braveclojure.com/
>>
>>61057677
that's unrelated. C has macros
>>
>>61057669
Elaborate
t. Python brainlet
>>
>>61057686
Statical linking doesn't mean the compiler has an access to the code tho.
>>
>>61057693
The CPP has macros and they are more disgusting than any TMP
>>
>>61057700
Just ask them their opinion of Rust.
>>
>>61057659
>implement a bionic sort using CUDA
>note that this is just the first draft
>don't even wanna get hired if they only rely on CPUs in this day and age.
>>
What if your favorite MITM tool becomes an orchestrator for a set of REST API you can use as you want? ( discovery, spoofing, etc, etc )
>>
>>61057700
Write a generic sorting function in pure C, it has to be faster than std::sort.
>>
>>61057703
>GLIBC
I suppose I should have said I don't use a binary version of glibc
>>
File: DAQyfOeXsAEawE1.jpg (215KB, 1440x1080px) Image search: [Google]
DAQyfOeXsAEawE1.jpg
215KB, 1440x1080px
>>61057710
>>
>>61057719
>Rust isnt an open problem
>>
How bad of an idea would it be to write multiple pages of html in one php script with 'if post "buttonname" display this' for form actions over having multiple html files?

This idea would save me having entire sub directories. As long as I make sure my post data is meticulous.
>>
File: 16681988.jpg (22KB, 399x225px) Image search: [Google]
16681988.jpg
22KB, 399x225px
>>61057592
>>
>>61057698
i am too sleepy to actually write the code right now but here are the steps:
1) use a macro so that it will be inlined
2) realize you can't because qsort is recursive
3) turn it iterative instead using the fact that all recursive algorithms can be rewritten as iterative depth first traversals of a state graph
>>
>>61057707
and this solution would also be that disgusting
but that's beside the point
the point is it would be an inline qsort
>>
>>61057484
It's okay - it's not like they are making any new products or even improving existing ones.

Actual programmers fucked off and now it's just the useless trolls feeding of the budget.
>>
>>61057761
> turn it iterative instead using the fact that all recursive algorithms can be rewritten as iterative depth first traversals of a state graph
You need a generic stack to do it, and C doesn't have one.
>>
>>61057786
>generic stack
>C doesn't have it
Not true.
>>
Is there a reason why I should be using anything other than notepad++ ?
>>
>>61057786
>You need a generic stack to do it, and C doesn't have one.
1) no you don't, you can use in-node colors and parent pointers
2) you could also just use an amortized dynamic array as a stack
3) it doesn't have to be generic, it just has to hold pointers
>>
Not in the standard library, and most of the third-party ones are void*-based shit.
>>
>>61057803
doesn't look cool
>>
>>61057816
Meant for >>61057792
>>
>>61057816
>Not in the standard library
void*[]
>void*-based shit.
this is all you need for this
>>
>>61057853
Start with using ((()(()()))(())()(())))(())))()()))))(())) instead of syntax.
>>
>>61057853
It's already there and it's called C++
>>
>>61057862
I|¡ Rather.
Maybe have i be optional in places.
>>
>>61057853
Rust is already shit in every aspect.
>>
>>61057853
A language entirely built from throwing exceptions.
a language where everything is UB, and you control how specific that UB is.
a language devoid of any immutability.
a language without structs
a language where absolutely everything is pointers, and explicit casting is the only means of different types.
>>
>>61057853
Make it simulate software floating point unless it's running on Vista
>>
>>61057659
>>61057669
>>61057671
>>61057677
>>61057678
>>61057690
>>61057693
>>61057698
>>61057707
>>61057720
>>61057761
>>61057776
>>61057786
>>61057792
>>61057810
>>61057816
>>61057829
>>61057837
I decided to finally get down to implementing this as a macro, and then I actually look up the implementation and notice they've already done it.
https://code.woboq.org/userspace/glibc/stdlib/qsort.c.html
This implementation of qsort isn't recursive. It's ripe to be inlined, all that's missing is defining it as a macro instead of a function. No need to bother with the DFS of the state graph, it's already there.
>>
File: 1498117439711.png (753KB, 1338x5868px) Image search: [Google]
1498117439711.png
753KB, 1338x5868px
>>61057853
Bjarne beat you to it
>>
File: 1498117439710.png (9KB, 637x130px) Image search: [Google]
1498117439710.png
9KB, 637x130px
>>61057853
>>
>>61057912
B
>>
>>61057940
Isnt B just a really early version of C, no joke intended?
>>
>>61057962
Pretty much. But so early it basically matches the hellish description proposed in the post I quoted above.
>A language entirely built from throwing exceptions.
Not this though.
>a language where everything is UB, and you control how specific that UB is.
This was necessary because int was B's only type. It was so very much B's only type that it wasn't even called int, because names are for distinguishing things of the same sort from one another, and when you only have one thing, you don't have to do that.
>a language devoid of any immutability.
B
>a language without structs
B
>a language where absolutely everything is pointers,
close enough
>and explicit casting is the only means of different types.
It's even worse: there are no different types, so the only means of *pretending* there are different types is writing well documented functions with descriptive names
>>
>>61057983
When Mozilla starts using a technology, you know it's shit.
>>
>>61057983
>proven
They tried, but Idris keeps overfloating the stack.
>>
>>61057983
Yes, it's a C++ is the constant of the shittiest language possible
>>
>>61058003
help, mozilla uses computers
>>
>>61058014
They also use C++ I hear
>>
>>61058003
https://github.com/mozilla/DeepSpeech
ye
>>
>>61058028
>muh machine learning
It's a gimmick like VR and AR.
>>
someone should really create a thumbnail file picker for gtk
>>
>>61058025
well yeah but they also use computers
help mozilla uses clothes (which are technically a kind of technology)
quick everyone get naked
>>
>>61057983
C++ is the bottom of the barrel, so yes.
>>
>>61058035
>gtk
Who the fuck uses C in the current year?
>>
>>61057998
B++ W H E N?
>>
>>61058047
>any other language which is presumably shittier
Impossible
>>
>>61058035
C is deprecated. No one wants to write C unless they have to maintain legacy code.
>>
File: froobmcdoob.png (441KB, 1920x1080px) Image search: [Google]
froobmcdoob.png
441KB, 1920x1080px
>>61058035
why is this misinformation a meme
this meme is as retarded as "mac doesn't have right click"
>inb4 "dumb frogposter"
no u
>>
>>61058073
The end result will be C++
>>
>>61058075
He meant the gtk file chooser widget
>>
>>61058075
I know you can drag stuff from nautilus to upload buttons but I like using a sane filepicker more
>>
>>61058069
there are industries where C and FORTRAN are still standard. Namely high efficiency scientific computing.
>>
File: moobmcmoob.png (445KB, 1920x1080px) Image search: [Google]
moobmcmoob.png
445KB, 1920x1080px
>>61058084
>>61058085
oh
i didn't realize that was what you meant
but even so, pic related
>>
>>61058102
yes

but not because C++ is that bad, more because programmers have no creativity.
>>
>>61058106
The items in the widget has small previews, not talking about the side pane
>>
>>61058106
that nautilus interface is not standard across all applications which work with gtk.

Its shitty. try installing and testing a bunch of apps and you'll know what I mean.
>>
>>61058106
gtk made me hate C
>>
>/dpt/ claims something
>gets proven wrong
>moves the post the extreme use cases
wew lad
>>
File: 1497224186599.jpg (86KB, 942x869px) Image search: [Google]
1497224186599.jpg
86KB, 942x869px
>>61058181
as expected from /dpt/-chan
>>
no no no
we certainly don't have /dpt/-chan, I don't believe it
>>
>>61058223
Do girls(male) use the -chan suffix too?
>>
I've had a few successful iOS games in Unity, making about 10k a year from them. Now, if I want to create a game engine that will eventually run on both the 3DS and Switch, but don't want to use C/C++, what language(s) can I use and how would I start making sure it can run on the 3DS and Switch?

No need to be detailed, but just some keywords that I can start googling would be great.
>>
>>61058298
depends
do you use chan for them?
>>
Why every build tool sucks so much?
>>
>>61058298
no
>>
>>61058073
No.
It will look something more like this.
# "get" is like SQL's "select"
get thread from this
# The only code you can run at top-level is code to retrieve or create threads.
# In this context, "this" refers to the program.
call it main
# You can only define variables before you declare them.
# The definitions are stored in a queue.
# You pop the queue with the "call it" keyword, which takes a name to declare and bind the definition to.
in main: # "in": send commands to a thread or the internal context of an object
get 1
call it x
get function over a and b # "function over": lambda
call it plus
# There are no global functions. The only global variables are threads.
# To create functions, you have to bind lambdas to local variables.
in plus: # if "in" is called on a function, it provides the body
put a + b # put is the opposite of get
get x plus x # all lambdas must be called with infix
call it y
do print y # except unary lambdas since infix is impossible in that case
# also, "do": like "get" but for lambdas that don't end in "put"
do kill this # beyond top level, "this" refers to the current operand of "in"

Without the comments:
get thread from this
call it main
in main:
get 1
call it x
get function over a and b
call it plus
in plus:
put a + b
get x plus x
call it y
do print y
do kill this
>>
File: 1489706370078.jpg (429KB, 1050x700px) Image search: [Google]
1489706370078.jpg
429KB, 1050x700px
This may sound stupid.

How should one go around logging messages for users in command line utilities?
Placing prints right in the middle of the business logic seems awkward as fuck and clutters the code.
What do?
>>
>>61056620
Turns out, HTML is not a 0 cost abstractions over GPUs :^(
>>
>>61058307
what language ~do~ you want to use
>>
>>61058330
to elaborate, get-from differs from plain get in that get-from retrieves a field from a record
get x would just be x in saner languages
get y from x would just be x.y in saner languages
>>
>>61058387
>What do?
End your life.
>>
>>61058460
>Any form of anime* should be banned and outlawed.
You're welcome.
>>
>>61058395
Honestly not very picky. I just don't want to use C/C++. Let's just say D for kicks.
>>
>>61058495
Posted on an imageboard meant to discuss otaku culture.
>>
>>61058460
desu desu

>>61058495
back to ribbit
>>
>>61057853
Like you could beat Perl or Malboge, m8.
Many tried, all failed.
>>
>>61058330
i got you senpai.

 ** all variables can only be defined above the main start

var is-int '3' named myint | ** where | is ;
var is-string ["hello"] named string |

start main ->
#include package : std.stddio;

**/many people were confused by #include and variables sharing #, but nothing was done **/
println!(#string |*| #myint) |
>>
>>61058330
>>61058473
Suggestion to increase badness: variables' types can only be inferred at declaration time so they can't be used in get expressions without specifying their type.
Example:
get number called x plus number called x
call it y
do print number called y
>>
>>61058387
Never really did some serious CLI, but when mocking up software I've always just treated it as just a view in an MVC architecture.
>>
>>61058387
A log file?
>>
void commit_sudoku() {
delete this;
}
>>
>>61058573
void my_life()
{
GC.enable;
}
>>
>>61058541
>This is a website oriented towards japanese culture
Why aren't you writing Japanese?
>>
>>61058573
>>61058583
fn commit_sudoku(self) {
use std::mem::drop as kill;

kill(self)
}
>>
File: 5_lei._Romania,_2005_a.jpg (134KB, 800x414px) Image search: [Google]
5_lei._Romania,_2005_a.jpg
134KB, 800x414px
>>61058508
Good choice.
>>
>>61058588
gomen,gomen, anon-dono~~~
wwwwwwwwwww
>>
>>61058588
>This is a website oriented towards japanese culture
>oriented
>>
>>61058608
Yes, where's your japanese? Why are you using English?
>>
>>61058620
Culture is built around language.
>>
>>61058596
Unsafe
>>
>>61058628
t. non linguist

That hypothesis has been refuted for quite a while now.
>>
>>61058635
>implying
>>
>>61058642
If I had low IQ I would be watching cartoons that are made for 14 year olds.
>>
>>61058642
You have a very low IQ anon.
>>
>>61058566
Not really. I just want to inform the user about the progress of some operation. Like when downloading/compiling a package.
>>
>>61058669
Why is sakurano so warm?
>>
>>61058623
4chan is ORIENTED towards Japanese culture, not to mimic it.
>>
>>61058682
What is this "Japanese culture" you keep referring to? Why do you pretend to know about "Japanese culture"?
>>
>>61058707
Yes. Yui was so cold.
>>
>>61058712
More than you apparently.
>>
>>61058739
That wasn't answer to any of my question.
>>
>>61058745
Anime is part of Japanese culture. What's your problem?
>>
For my job I'm working on coding algorithms to analyze particle collisions in supercolliders
>>
>>61058759
>Anime is part of Japanese culture.
So prior to late 1970's Japan didn't exist?
>>
File: lol.png (103KB, 955x320px) Image search: [Google]
lol.png
103KB, 955x320px
>>61058726
>he uses "lamb duhs"
>he uses "moan ads"
>>
>>61058712
the ideas, customs, and social behaviour of japanese peoples

>>61058771
your logic interpreter is completely fucked. go see a doctor
>>
>>61058771
So anything after the 70's isn't part of Japanese culture?
>>
>>61058789
dumb eggposter
>>
>>61058784
>the ideas, customs, and social behaviour of japanese people
All Japanese people unironically despise weebs, did you know that at all?
>>
>>61058780
I use closures and arrows
>>
>>61058788
Anime didn't create Japanese culture and the Japanese values
>>
>>61058800
What about Japanese weebs?
>>
>>61058801
>he uses "clothes durrs"
>>
>>61058815
Disappointed parents, basement dwellers, societal outcasts
>>
>>61058800
not really. I'm not really into japanese culture
>>
>>61058806
dumb eggposter
>>
>>61058830
Then don't try to mimic the Japanese culture. Japanese people are not weebs
>>
>>61058820
>thinks closures has a d in it
I think you got a D in English
>>
>>61058826
>>61058841
dumb eggposter
>>
>>61058848
That's distinction, m8
>>
>>61058844
how do I try to mimic japanese culture?
>>
>>61058809
Weapons didn't create American culture and American values. It's PART of the culture.
>>
>>61058678
System notification? Or just print it, does it matter if you print it in the middle of other things?
>>
>>61058848
>his english teacher did not try to give him the D
>he is not pretty
>literally why even live
>>
>>61058859
Weapons are also cultures of other societies. There is nothing distinct about Americans and weapons.
>>
>>61058870
So that makes anime part of Japanese culture.
>>
>>61058883
>>61058809
>>
>>61058870
>There is nothing distinct about Americans and weapons.
Bullshit, american gun culture is a thing. Even the swiss aren't as fascinated by the ownership of small arms.
>>
>>61058859
>>61058870
>>61058883
Why is there so much overlap between programmers and gay pedophiles?
Should we really be trusting these rapists with our computers?
>>
Reminder that most of /dpt/ cannot program without GC
>>
>>61058897
Programming/CS is a left wing thing
>>
>>61058896
>Even the swiss aren't as fascinated by the ownership of small arms.
Hence why the Swiss did not elect Donald Trump.
>>
>>61058896
Believe it or not, people from other places in the world use guns too, it's not an American magic
>>
>>61058926
No shit.
It's the culture that's unique, not the fucking fact of it.
>>
>>61058941
So it's unique if you think it is, bullshit by definition
>>
>>61058949
Oh come on.
There's no other western country where the ownership of small arms is so unregulated, isn't tied to military service and is fucking part of the constitution.
>>
New thread:

>>61058989
>>61058989
>>61058989
>>
>>61058508
idk ask nintendo
or search "3ds" on github and see what other languages people have used
>>
File: 1416351921624.jpg (40KB, 499x499px) Image search: [Google]
1416351921624.jpg
40KB, 499x499px
>taking information security class
>have to write x86_64 shellcode with only printable characters (nothing outside 0x20 - 0x7f is allowed)

wtf is this even possible?
>>
>>61059630
You can translate operation by using xor or any operator you can access.
>>
>>61056942
>C is functional if you know how continuations work
I know how continuations work but C still isn't a functional programming language? Wat do?

You're a fucking retard.
>>
>>61056942
>C is functional if you know how continuations work
Please insert example.
>>
who needs functional programming when C has function pointers
>>
>>61061234
Those two things are not the same thing. FP means closure, function pointers are not closures.
>>
>>61061266
>closure
hahaha fuck that gay shit just prefix your variable names so they don't overlap with the global environment
>>
>>61061287
I love when ignorant think that their opinion are relevant.
>>
>>61061330
me too
>>
F influenced languages get an automatic C in my book
>>
>>61057637
>have to reinvent the wheel because the standard lib is garbage
really makes you think
>>
>>61056544
new to programming, retard here. I started taking a summer course at a local college on C. I've got a program that compiles fine (I'm using visual studio) and when I run the program from visual studio it runs fine.

but when I run the actual output .exe file, it doesn't print the last line, doesn't say press any key to continue, it just exits immediately after the last input. what do?


#include <stdio.h>

int main()
{
float miles, mpg;
float fees, tolls, cost;

printf("How many miles do you drive per day?\n");
scanf_s("%f", &miles);

while (miles < 0) {
printf("error: please enter a valid number for miles.\n");
scanf_s("%f", &miles);
}

printf("How much do you pay for a gallon of gas in dollars?\n");
scanf_s("%f", &cost);

while (cost < 0) {
printf("error: please enter a valid number for cost.\n");
scanf_s("%f", &mpg);
}

printf("How many miles per gallon do you typically get?\n");
scanf_s("%f", &mpg);

while (mpg <= 0) {
printf("error: please enter a valid number for mpg.\n");
scanf_s("%f", &mpg);
}

printf("How much do you pay in fees per day, in dollars?\n");
scanf_s("%f", &fees);

while (fees < 0) {
printf("error: please enter a valid number for fees.\n");
scanf_s("%f", &fees);
}

printf("How much do you pay in tolls per day, in dollars?\n");
scanf_s("%f", &tolls);

while (tolls < 0) {
printf("error: please enter a valid number for tolls.\n");
scanf_s("%f", &tolls);
}

float sum1 = fees + tolls;
float sum2 = ((miles * cost) / mpg);
float sumfinal = sum1 + sum2;

printf("Your cost per day is $%.2f dollars\n", sumfinal);

return(0);
}
>>
>>61063953
just add a getchar() after your last printf to wait for a character input so it doesn't inmediatly exit
>>
>>61058635
leaking memory isn't unsafe... in fact in this particular case since self is moved here its dropped regardless
>>
>>61057218
Hence C++ is faster because it doesn't have those problems.
Templates solve it, and it optimizes for the specific type.
>>
File: disgusting.jpg (29KB, 300x260px) Image search: [Google]
disgusting.jpg
29KB, 300x260px
>do android programming
>want to kill myself
Is this normal?
>>
>>61056544
C is for brainlets.
>>
>>61064949
Not so fast. What are macros?

>>61064964
Yes, totally.
>>
>>61064979
>What are macros?
Shit, is what they are.
>>
File: wait.jpg (23KB, 371x321px) Image search: [Google]
wait.jpg
23KB, 371x321px
>>61064979
How do I stop wanting to kill myself when I android dev?
>>
>>61065095
learn kotlin jenner and hope it does not fail.
>>
>>61065095
You pray for google stop being code monkeys.
>>
>>61063953
>scanf_s
This bothers me greatly. Fucking Microshits, using C11 Annex K shit when they don't support C11, even slightly.
You really should be using a different compiler. MSVC is garbage, especially for C.
>>
Working on my cyberpunk imageboard, 4kev.org
>>
>>61065694
>4kev.org
>login
>register
into the trash
>>
>>61057569
it makes lisp more readable for brainlets like >>61057544 and >>61057542
>>61057522
[CODE]
(defn make-entry []
(let [[k v] (str/split (read-line) #" ")]
{k v}))
[/CODE]
learn your desructuring better.
>>
where was the duplicate thread memo, retards?
>>
A proving & programming language that puts implementation first and uses purely logical refinements for reasoning.
>>
I have enjoyed programming a bit but I'm only able to do stuff like school assignments (but dropped out a few years ago).
How did you reach the point where you could actually be productive and make something useful?
>>
File: bsd.png (79KB, 627x754px) Image search: [Google]
bsd.png
79KB, 627x754px
>>61065979
All you need is this
>>
>>61066327
I just kept on programming and learning new things / am lazy and want to automate things to avoid having to do them
>>
>>61066426
There's nothing I do that I'd like to automate. I don't do any simple repetitive tasks like that on my computer.
What could I program then except just exercises from a school book I have?
>>
>>61066495
I meant physical things.

Could use markov chains to guide you while writing essays as sentence auto-complete with fuzzy match to make it resistant to bad spelling. Or even generate complete ones...
>>
I miss d-lang chan.
>>
why many modern languages doesn't require specification of primitive types? is there any advantage?
>>
>>61067425
what do you mean? like specifying the size of the type? in Rust you have u8, i16, f32, etc.
>>
>>61067697
i don't know for sure, i was looking for some python, ruby and haskell i think and they would just do something like this:
a = 15
without declaring this a
>>
>>61067425
>>61067697
Isn't he talking about implicit type declaration? Like you leave to the compiler to decide which type it is. If this is the case, i find it pretty shit.
>>
>>61067847
mm yeah but at that point it's not really a primitive type, is it?

even so, if you can declare something like:
type i32 = 32 bits

it doesn't really do much for you because the compiler is still tying the syntax to the type. basically, primitive types are gonna have special syntax anyways, so it makes more sense to keep everything to do with them as part of the compiler. if you have syntax plugins it might make a little sense but personally it doesn't seem like a huge gain
Thread posts: 321
Thread images: 26


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