[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: 313
Thread images: 28

Old thread: >>61496524
What are you working on, /g/?
>>
i want to POUND an anime BUTTHOL
>>
File: defensive.jpg (34KB, 710x720px) Image search: [Google]
defensive.jpg
34KB, 710x720px
T-Thank you f-for anime picture! ....
A-Also, ... first for Ruby is the /c-comfiest/ language ....
...
・゚。(///>﹏<///)。・゚・
>>
>>61500081
>ruby is the comfiest language
only a girl would post this
>>
>>61500064
It is slightly disturbing that the above image brought that to mind for you. Hakase, a savant in engineering and AI, is just a little child, and her robot sistermom Nano is only in high school.
>>
>>61500101
a robot is a robot faggo

hands OFF my sexbots
>>
>>61500101
>her robot sistermom Nano is only in high school.
why is a robot in highschool
why does a robot have an age
why does a robot have a child
so many questions
>>
File: maze.gif (170KB, 250x250px) Image search: [Google]
maze.gif
170KB, 250x250px
Maze generator.

Source code:
https://github.com/MariusMacijauskas/maze/blob/master/maze.c
Compile and run with no input.

user $ gcc main.c -O2 -o maze


The output is a number of .ppm files.
To convert the .ppm files to .gif (with ffmpeg), use the following:

user $ ffmpeg -i maze%05d.ppm maze.gif
>>
>>61500114
rude
it'll be on YOUR guilty conscience to have to lay such a sick burn as "I fucked your mother" upon a hapless unsuspecting child who doesn't even know what fucking is
>>
>>61500040
 def biggest_guy(num1, num2, num3):
if num1 > num2 and num3:
return num1
if num2 > num1 and num3:
return num2
if num3 > num1 and num2:
return num3


Why does it recognize num1 or num2 being larger but throws a bitch fit when num3 is?
>>
File: sicp.jpg (51KB, 400x579px) Image search: [Google]
sicp.jpg
51KB, 400x579px
Have you done your SICP today, /dpt/?
>>
>>61500157
Literally what?
>>
>>61500157
planning on it
my bookmark fell out and it's been a while so I have no idea where I'm at in it
>>
>>61500167
lurk moar, nibba
>>
>>61500064
Nano is like 1 year old you sick fuck
>>
>>61500167
Some irrelevant meme book /dpt/ seems to have a boner about.
>>
>>61500081
I-I like S-Scheme more >.<
Ruby i-is not that bad t-though.

>>61500093
We are both c-cute g-girls *blush*
>>
>>61500182
kys retard
>>
>>61500167
https://sarabander.github.io/sicp/
>>
>>61500124
>why does a robot have an age
Nano does not actually have a real human age but Hakase made her to look and feel that way
>why is a robot in highschool
Nano saw other (real) girls who looked her "age" going to high school and wanted to do it too to learn and make friends
Hakase reluctantly allowed it
>why does a robot have a child
Hakase was sad and lonely without a family and wanted someone bigger, more adult, and more capable to look up to and to love and take care of her
It quite nearly threatens one's already tenuous suspension of disbelief to think she was somehow able to engineer a sentient mind as mature as that of a high school girl without being anywhere near that mature herself
An emergent consequence of more innocuous parameters is clearly the only explanation
>>
>>61500201
no u
>>
File: 1486193500733.jpg (208KB, 600x445px) Image search: [Google]
1486193500733.jpg
208KB, 600x445px
>>61500157
*read
>>
>>61500201
But he is right you fucking creep.

>>61500210
>Hakase was sad and lonely without a family and wanted someone bigger, more adult, and more capable to look up to and to love and take care of her
I call bullshit, she wanted a cute oneechan to dom.
>>
>>61500223
>creep
kys retard
>>
>>61500212
What is the difference between the red and the green ones
>>
>>61500197

Which scheme do you use?
>>
>>61500234
probably edition?
>>
>>61500152
python is a broken language so this doesn't throw an error when you try to use a "duck type" as a boolean. this statement is

if (num3 > num1) and num2
>>
File: 1495572695348.jpg (265KB, 700x987px) Image search: [Google]
1495572695348.jpg
265KB, 700x987px
>>61500237
R-Racket and s-sometimes guile when I get too upset with it >.<
B-But I am making my own in C
>>
>>61500212
Reading it is not sufficient. You must complete the exercises too.
>>
>>61500152
in Haskell this is just

(max . ) . max
>>
>>61500210
>>61500223
There's so much mystery surrounding the Shinonome household, really makes you think
>>
>>61500234
>>61500248
One has the kanji for 'above' after the title and the other has the kanji for 'below' after the title. What did he mean by this?
>>
>>61500265
Stop stuttering. You have a backspace key.
>>
>>61500280
Oh, maybe it's like beginner and advanced?
>>
>>61500270
Yeah but that looks like a pair of tits so it's fucking stupid.
>>
>>61500273
Friendly reminder that Hakase was a grown up professor working for the University of Tokyo.
>>
>>61500265

Tried S7 Scheme? It's easy to hack into whatever you need it to be.
>>
>>61500280
>>61500288
or it might be front and back, maybe it's split into 2

>>61500273
nips are truly mysterious
>>
>>61500252
Thank you, that is what I needed to figure it out.
>>
>>61500300
I-I heard the same about Tiny and Chibi Scheme b-but I never used them ;_;
>>
>>61500296
>he doesn't use the tits operator
>>
>>61500280
Surely it must be some Japanese ordering thing. Like how first and last name are called the below name and above name
>>
Is it weird to like both Idris and C?
I like Idris because it's a true pure functional language with an elegant and expressive type system.
I like C for an opposite but weirdly similar reason.
It's almost like a "pure imperative" language if you can imagine such a thing.
It doesn't hide any complexity from you, what you write is exactly what gets done with nothing extra going on. Or rather, just enough extra going on to let you actually get anything done, and nothing more. Prototyping is a bitch, but once it's done, you can optimize and prioritize to your heart's content, all while maintaining a complete and purely self evident understanding of exactly what you're changing, without any invisible changes that will fuck you over in the long run. (Unless you use malloc, which you shouldn't.)
Its type system sure as hell isn't expressive, but for what it is, it's weirdly elegant anyway. Just like everything else in the language, it just stays out of your way and lets you crunch the numbers.
>>
>>61500311

Tiny Scheme is like 4-5K LOC in C and very easy to hack, but it has a shitty macro system. S7 is like a mature version of Tiny Scheme that's updated to R7RS. Chibi is meh.

Tiny or S7 is what you want to use when you want to embed a Scheme interpreter into a C or C++ program... or conversely, make it very easy to embed a bunch of C code into a Scheme program. Think Lua, but not shit.
>>
>>61500340
Thanks! I will check them out!
>>
>>61500210
>without being anywhere near that mature herself
Anon this is what neural networks are for. It's how you create things with capacity beyond your own.
>>61500124
It's a very good anime anon you should watch it instead of spoiling it for yourself. I'm disappointed that shit like Gintama is still around while Nichijou is over.
>>
>>61500168
actually I could probably just ask here.
does anyone know where the part where it's just introduced cdr and lists is?
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
>>61500334
>Is it weird to like [...] C?
It's weird to not like C.
>>
>>61500380
>good
>anime

wew
>>
>>61500334
I think something similar about C. I just wish we had a language like C but without all that weird old cruft which pisses me off so fucking much
>>
>>61500340
What about CHICKEN?
>>
>>61500381
That's early in chapter 2.
>>
>>61500381
nevermind
>>
>>61500340
What do you dislike about Lua, Ruby-senpai?
>>
>>61500412
kek, a bit late, but thanks
>>
>>61500334
>it doesn't hide complexity from you
Well it does, quite a bit. But I get what you're saying. It's all about your perception though.
>>
>>61500432
Brotip, use the index in the back of the book.

>>61500400
It's pretty great for embedding C in Scheme, although I've never tried the reverse.

It's definitely a larger scheme though. And the source code is un-fucking-readable. Felix is a madman.
>>
>>61500125
Why not execute ffmpeg from your code so the user doesn't have to do anything. I remember being able to call ffmpeg from Java code so there has to be a way to do it from C code.
>>
>>61500422
Because he knows its better than his shitlang.
>>
>>61500334
>Unless you use malloc, which you shouldn't
Why not?
>>
>>61500571
Its not my code.
>>
>>61500422

Arrays are just tables
Arrays start at index 1, not 0
String + Integer = Integer is allowed and other weak typing shenanigans
Numbers are all floating point, just like JS
>>
>>61500513
Do you think CHICKEN is practical for building an entire program? e.g. a (not very graphically intensive) game?
>>
so qt creator is saying that no valid kits were found
the kit auto-detect says "Cmake has a path to the qmake bianary even though the kit has no valid qt version"

how do I fix this?
I'm on linux mint KDE if it matters
>>
>>61500610
>Arrays are just tables
>Arrays start at index 1, not 0
Those are good things
>String + Integer = Integer is allowed and other weak typing shenanigans
>Numbers are all floating point, just like JS
Fair complaints
>>
What do CS students do in college ? Like, what kind of assignments do they get.
>>
>>61500592
Not him but malloc can often be a crutch and you can end up with memory fragmentation if you abuse it.

>>61500571
It's just
system("echo Easy.");


https://linux.die.net/man/3/system
>>
>>61500422
LOO-uh is utter garbage
>>
>>61500422
While web-development is plagued by PHP/Perl/JS/Ruby/Python scourge, video game development too has its share of bad languages. Most hyped and infamous of them being Lua:

Broken lexical scoping: assignment acts as declaration, clobbering global variables. Even worser: access to undeclared variable doesn't produce error, but silently returns nil. Bad scoping is the single biggest source of bugs and confusion (http://lua-users.org/lists/lua-l/2008-11/msg00008.html). Moreover, every variable access goes through hashtable system, producing several L2 cache misses in process, making Lua slower than comparable alternatives, like Lisp. Lua has no standard way to do OOP or define a module, leading to numerous incompatible and badly designed solutions, resting on top of already deficient hash-table system with a.b[i]:c(d) style scope resolution. Like in all badly designed languages, Lua pollutes global scope with _ prefixed identifiers, instead of keeping them in a separate package.

[cont]
>>
>>61500640
rather than relying on system calls, arent there ffmpeg library bindings?
>>
>>61500040
does nichijou ever explain how a 5 year old managed to build a robot with feelings?
>>
>>61500627
>e.g. a (not very graphically intensive) game?
nibba, there are OpenGl and SDL bindings
>>
>>61500422
>>61500655
Hash-Table as a primary data structure has overwhelming issues. There is no simple and safe way to implement Lisp-like FIRST and REST functions: either you have to copy whole Table or modify it, and sequential access is somewhat slow. There is no easy way to remove an element from a list. Even worse, the size of a list may not be what you expect: "b={'x'};b[2]='y';print(#b)" prints 2, but "b={'x'};b[3]='y';print(#b)" prints 1. Table indexing starts from 1, acting as a source of errors and confusion, when interfacing with external APIs or converting algorithm from Lua to C/C++, while 0 still acts as a dangling pointer. Lua Tables don't provide advantages of immutable catenable queues - a silver bullet data structure, you'll find in modern Lisps and Haskell; Lua Tables are mutable and encourage modification, instead of creation, meaning there is no easy way to do functional programming with Lua. REPL wont pretty-print tables, but dump something like "table: 0x807e978". Table-list features some of the scariest kludges: program can modify the behavior of the length operator for any value but strings through the __len metamethod, while table construction syntax and semantic are impenetrably confusing, like { [f(1)] = g; "x", "y"; x = 1, f(x), [30] = 23; 45 }

Lua uses floating point values to represent integers, so 9999999999999999999==10000000000000000000. In general, Lua's logic seems odd: "nil+1" produces error, while "(not nil)+1" gives 2. Things could be unequal to itself: t={[{1,2,3}]="abc"}; print(t[{1,2,3}]) wont print "abc", meaning that {1,2,3} != {1,2,3}.

[cont]
>>
Reminder that monads solve many programming solutions in better ways than common approaches

https://philipnilsson.github.io/Badness10k/posts/2017-05-07-escaping-hell-with-monads.html
>>
>>61500627
>e.g. a (not very graphically intensive) game?
Considering I'm the minecraft clone guy, yeah lol.

>>61500656
System isn't a system call. It just spawns a process. It's part of libstd.
>>
>>61500422
>>61500655
>>61500672
Lua is unstable: API changes frequently, functions are being added and deleted continuously, table.foreach being a good example of to be deleted function, and then there is table.unpack, which present only in some versions of Lua.

Lua's GC is a naive mark-and-sweep implementation, which stores the mark bit directly inside objects, a GC cycle will thus result in all objects being written to, making their memory pages dirty and Lua's speed proportional to the number of allocated objects. Lua simply was not designed to support hundred thousand objects allocation per second.

Lua was built as a glue language, and it shows. Much of Lua hype comes from it's usage as a simple integrated scripting language in video games industry. That makes typical Lua user a teenage gamer with little expectations or taste for computation features and productivity.
>>
>>61500666
Just because a language has bindings doesn't mean it's practical to build something in it with them.
>>
>>61500678
>It just spawns a process
On glibc it calls fork/exec which both are syscalls.
>>
>Bullying a skid lang
>This hard
You people should stop
>>
>>61500673
I fucking love monads
>>
>>61500210
>Hakase was sad and lonely without a family and wanted someone bigger, more adult, and more capable to look up to and to love and take care of her
really reminds me of this music for some reason
https://www.youtube.com/watch?v=9ae9m_WT6xM
>>
>>61500698
Well of course. Everything ends up using a system call at some point. Half the point of stdlib is to wrap system calls in something portable.
>>
>>61500683
I believe most of the hype comes from luajit being fast
>>
File: trashkell_on_suicide_watch.png (448KB, 580x1500px) Image search: [Google]
trashkell_on_suicide_watch.png
448KB, 580x1500px
>muh "moan ads"
>>
>>61500724
muh LOO-uh Jeet
>>
>>61500661
It's implied that she's just miraculously really fucking smart. You know, like those kids who scrawl crazy equations all over their bedrooms and don't talk to strangers.
It doesn't go into much greater depth about it than that.
>>
>>61500639
see for yourself
this directory has Stanford CS assignments (C++)
they all use a library specifically made by Stanford for these assignments
http://web.stanford.edu/class/cs106b//assn/
>>
>>61500610
Actually, numbers are split into integers and floating point in Lua 5.3
>>
>>61500610
>numbers are all floating point
Not true. They're a special float int combination. Which imo is way worse.
>arrays are just tables
They treat inserts with integer keys differently. But sort-of yeah.
>>
>>61500748
>a special float int combination
Well then.
>>
>>61500678
I mean, ffmpeg must have a core library that does all the shit and a CLI wrapper. Why dont they release that core library so other programs can call it without relying on ffmpeg being installed in its entirety?
>>
File: rly_makes_u_think.png (175KB, 600x600px) Image search: [Google]
rly_makes_u_think.png
175KB, 600x600px
>>61500730
>luajit
>loo pajeet
>>
>>61500780
loojeet
>>
>>61500784
kek
>>
>>61500780
>ints are floating point numbers
>you try to access a specific member of an array and you end up accessing another due to floating point fuckness
>>
>>61500592
I take it back, there actually are good use cases for it. But they're limited. In fact, they're limited in a surprisingly predictable manner: specifically I always say only use malloc either if you need to use realloc as well or if you have a recursive data structure like a linked list or a linked tree. Anything else can be achieved by more portable, less unpredictable, less complicating means. Want to pass something to a function by address? Just declare it on the stack in the calling environment. Want to share information mutually / recursively between two records? Just find some early point before which neither of them have to exist and declare them both on the stack at that point. If there is no such point, just declare them as globals. Worried about globals because they're supposed to be bad? Just declare them as *statically scoped* globals, and everything bad about them is suddenly gone. Really just do anything. But for the love of god don't dynamically allocate them, unless you have a really good reason like not knowing how many of them you're going to need and being unable to place a logical upper bound on the matter.
>>
>>61500759
do it then, ffmpeg is free software, isn't it?
>>
>>61500792
Unless your array has 2^23 elements, you're going to be okay. please learn how floating point numbers work.
>>
>>61500804
did some googling, it already exists - https://en.wikipedia.org/wiki/Libavcodec
>>
File: smug5.jpg (11KB, 212x238px) Image search: [Google]
smug5.jpg
11KB, 212x238px
>>61500780
>>61500784
>>
>>61500683
>lua was simply not designed to handle hundreds of thousands of allocations per second
Great.
>>61500792
An irrational fear at normal float precision.
>>
>>61500824
lol
>>
>>61500805
>Unless your array has 2^23 elements
Which is not that rare at all.

>please learn how floating point numbers work.
There are many different standards concerning floating point numbers, all of which such in different ways. Only "lossless" rational numbers should be used by sane people.
>>
>>61500827
Take your skidshit back to haxornewz
>>
>>61500800
What about when your data usage change based on user input and have no upper limit?
>>
>>61500759
>Why dont they release that core library
They do, how do you think video players are made
>>
>>61500629
please anon, you're my only hope
>>
>>61500840
>which is not that rare at all
Yeah you shouldn't operate on single arrays of 8milion elements in lua. It's not meant for things like that. And id say that generally if you have an array of 8 million elements it's very likely its a poor datastructure choice.
>>
>>61500857
That's a good example of a use case for malloc, but in that case it would be a good idea to hide it behind an opaque data type, so that if you mess it up, there's only one place to go to fix it everywhere it's used.
>>
>>61500859
since it exists, there's no reason to do system("ffmpeg") when you can just call its own libs
>>
>>61500125
Any time I see green and purple I think there's a piccolo doc coming.
>>
>>61500887
>poor datastructure choice
It is probably one of the best choices for unknown sorted inputs that you want to perform search on.
>>
>>61500840
>Unless your array has 2^23 elements
>Which is not that rare at all.
>8 million element array
I'm sure that's what Lua was designed for.

Stop trying to fit a square peg into a round hole. If you want to do operations on 8 million element arrays, consider C or FORTRAN like a non-retard.
>>
>>61500903
Not an excuse for having a critical fault like that.
>>
>>61500895
that adds alot of linking to compile time, and thus also increasing excutable isez
or you could have a big shared object to carry around
just calling ffmpeg causes neither of those issues
>>
>>61500895
Well there are some valid reasons
Like for example doing system("ffmpeg") is easier than learing the ffmpeg API, if you're a lazy fuck
>>
>>61500712
why are there meows
>>
>>61500918
>my philips screwdriver keeps stripping my posidriv screws
>this is unacceptable
>my oscilloscope blew up when i tried to measure a tesla coil
>i'm writing an angry letter
>my car stalled when I filled it with jet A
>it just couldn't handle the power. what a piece of shit
>>
>>61500966
I actually agree with all of these. This is unacceptable.
>>
How far through SICP should I go?
>>
>>61500987
All the way, baby. o/
>>
>>61500629
https://community.nxp.com/docs/DOC-94252
>>
>>61500592
Well people generally wrap malloc and do error checking in the wrapper function to make it safe, and wrap free to zero out pointers after freeing to prevent the dreaded double-free. But most embedded C guidelines say not to use heap memory at all. Although in some security applications there is certain data that you should not put on the stack because the stack contains return addresses. You should not put function pointers on the stack in security focused applications because stack canaries cannot keep track of it so if it is overwritten with the address of a malicious block of memory you will die.
In my opinion you should wrap malloc and free, make sure you do not have malloc in execution hot paths, and pay attention to how your memory will be laid out to obtain best perf.
>>
>>61500945
it's a dirge for rose's beloved childhood cat
>>
>>61500987
Until youre sick of lisp
>>
>Compiler bugging out randomly
Is this a sign?
>>
>>61501204
if the compiler is gcc it is a sign of your memory being fucked up
>>
>>61500040
So I'm using CMake and my project has a "src" directory and a "test" directory for sources and tests respectively. I'm using CUnit to write the unit tests.
How do I reference stuff from my main program in my test program? I have heard of putting all production code into a library and adding that to the CMake project and linking it against your test code.
But how is that any better than simply saying #include "../src/foo.h"?
And is there Another Way™
>>
Why are Qt fags autistic?
>>
>>61501204
How much memory do you have?
Even with 4GB + 4GB swap I can't compile clang with make -j2, it always runs out of memory at the linking step.
>>
>>61500898
>unknown sorted 'inputs'
>8 million
>>
>>61501260
Yes
Or as an ID in a db.
>>
>>61500334
C is very far from pure imperative. Forth is legitimately "purely imperative", it's actually a really cool low level language, with some meta facilities. Every programmer at some point should see that low level languages exist that aren't C.
>>
>>61501270
It's kind of a moot point to discuss this anyway since lua does doubles for its numbers.
>>
>>61501257
Qt was literally designed as a way for people that know nothing about UIs to make UIs
of course they're gonna look like shit
>>
>>61501338
>look it up
>see GNU has a compiler for it because of course they do
>gForth
>.7.3
>last update 3 years ago, been in development for 25 years
why the fuck
>>
>>61501434
it produces smaller binaries than C
have you never used an RPN calculator?
It's a language where your program where you push and pop things from the stack on cue.
>>
>>61501545
that's not what I'm confused about
why the GNU compiler for it just been sitting in development hell unfinished for seemingly no reason
FOR
25
YEARS
>>
>>61501563
What do you mean unfinished?
It works, and you can use it to compile forth code, and it's been in a working state for most of those 25 years.
By this retarded logic, GCC has been in development hell just because it's still receiving regular updates.
>>
>>61501590
> works, and you can use it to compile forth code, and it's been in a working state for most of those 25 years.
why is it .7.3 then instead of having an actual leading digit?
or are they just being arbitrary about versioning and ignoring the universal convention of "1.0 means it does what we originally wanted out of it without many bugs"
>By this retarded logic, GCC has been in development hell just because it's still receiving regular updates.
GCC had its 1.0 in 1987
>>
>>61501563
The thing about Forth is that it isn't standardized, people just create their own implementations because it's really easy to, and that way you get more control over how it's operating. It's used in small embedded systems.
>>
>>61501635
>FORTH, Inc.'s microFORTH was developed for the Intel 8080, Motorola 6800, and Zilog Z80 microprocessors starting in 1976. MicroFORTH was later used by hobbyists to generate Forth systems for other architectures, such as the 6502 in 1978. Wide dissemination finally led to standardization of the language. Common practice was codified in the de facto standards FORTH-79[11] and FORTH-83[12] in the years 1979 and 1983, respectively. These standards were unified by ANSI in 1994, commonly referred to as ANS Forth.[13][14]
>>
Check out this ridiculous Haskell code I came up with:
class C a where
c :: a
instance C r => C (a -> r) where
c _ = c
instance C Integer where
c = 0


This lets you apply the function 'c' as many times as you like with whatever arguments you want, and it will always return zero.

λ> print $ c 1 2 3 4
0
λ> print $ c 1 2 3 4 7 3 4 3 2
0
λ> print $ c "what" "de" "fug"
0
λ> print $ c "!!!!" [1,2,3] (putStrLn "hi") Nothing
0
>>
>>61501627
The GNU project predates semantic versioning.
It's such a stupid concept anyway.
You can jump to 1.0 whenever the fuck you feel like it, not because some text document told you to.
It's reasonably feature complete for what it is.
Also are you gonna complain about major software projects like systemd, firefox and chromium using major number updates to mark minor updates despite not breaking compatibility? Systemd's on the 240s I'm pretty sure.
>>
>>61501659
>Also are you gonna complain about major software projects like systemd, firefox and chromium using major number updates to mark minor updates despite not breaking compatibility
yeah, that's also stupid
and last I checked thinking that was stupid was a pretty common opinion around /g/
>>
>>61501651
>OOP
into teh trash
>>
>>61501651
i'm proud of you anon
>>
>>61501648
The standards exist, but I've heard that power forth users follow the standards to grealy varying degrees. Forth is a language that is easy to manipulate, reprogram features, leave features out, etc. So if you aren't particularily happy with the standards, and your code is just going to be running on one very specific microprocessor, there's little reason not to deviate from the standards.
>>
File: agda conf 2017.png (4KB, 543x97px) Image search: [Google]
agda conf 2017.png
4KB, 543x97px
So this is the power of dependently typed programming languages ...
>>
https://youtu.be/jyTCaVCgXxA#t=2h25m54
I didn't know opengl did this stuff.
I'm a bit scared now. Is d3d better?
>>
>>61501710
Vulkan is the future but its tedious, render bugs are universal though.
Just stick with OGL
>>
>>61501729
But you didn't answer my question.
Does D3d have ways to avoid this? Ask the shader compiler to not optimize away state so aggressively for debug purposes.
>>
>>61501710
>very experienced game dev calls opengl "developer hostile"
Yep, I'm never going to touch GL unless I have absolutely no other options.
>>
>>61501785
Got a single fact to back that up anon? I'm kinda curious. I know microsoft courts game devs a lot more than the opengl guys, but it ain't that bad.
>>
>>61501785
>other options.
you don't have many if you want portability
which unless you a gaymes programmer you almost certainly want

I mean what else is there?
vulkan?
that's hardly mature enough for use
>>
>>61501805
Lots of gamedevs consider Microsoft hostile because their primary goal in servicing devs is to lock them into their platform. That's all they do. The most superficial case of this would be GFWL.
>>61501813
I'm sure he's aware of the dire situation.
>>
does "JavaScript:The Good Parts" actually teach javascript or is it just commentary and tips for people that already know it
>>
>>61501813
If portability is of utmost importance, then it would be in the category of "absolutely no other options". Also I don't really like game dev anyways.
>>
File: upset.png (198KB, 834x468px) Image search: [Google]
upset.png
198KB, 834x468px
>>61501252
Please respond.
>>
>>61501753
No idea as ive never used D3D and have no intention to.
>>
>>61501838
As far as I'm aware, it's "Effective C++" for Javascript.
>>
>>61501113
I barely started and already am
>>
>>61501913
Then just stop and work on something you actually enjoy.
>>
>>61501903
cool
>>
File: sudo.jpg (36KB, 733x646px) Image search: [Google]
sudo.jpg
36KB, 733x646px
When I allocate memory I round it up to the nearest prime number.

Who else a /bignigga/ here?
>>
>>61501972
I allocate memory based a random number.
Your're small time.
>>
>>61501972
Pretty insignificant.
You're most likely within the same page.
>>
>>61500081
Made by japanman.
>>
https://www.youtube.com/watch?v=EaN4wUii0T0&feature=youtu.be&t=33m36s
>John Carmack literally wishes he had written Doom in Lisp
BLUB LANGUAGES BTFO
>>
>>61502454
You should check out his racket demo he did for mobleVR.
A lispdoom could probably work now though, it would have been impossible then.
>>
>>61502652
>There is literally nothing wrong with programming Python.
Which version do you write 2 or 3?
Also scripting languages should not be used for bigger anyways.
>>
Anybody work for Highmark Health here?
>>
@61502652
Python is for programming dropout brainlets.
>>
>>61502652
t second year CS student

calling pythoning programming is an insult to real programmers
>>
Python is best programming language
>>
@61502701
I'm a brainlet myself but im better than python artisans.
>>
@61502740
Brainlet rankings:
JS > Python == Ruby > Lisp > C
>>
>>61502701
it's okay to script in python or even develop libs for python brainlets in real languages

but don't call using python programming
>>
>>61502762
>I'm glad you've come to the inevitable realization
Ive known C was brainlet-tier a few chapters in.
We really need to get things rewritten so we can finally kill it.
>>
@61502774
Are you the hedge-fund monkey from yesterday?
>>
>>61502774
>I program in Python every day
you must be doing something really important, like webshit or calling into a real language which you are unable to learn
>>
long time;

hehehehehehehe
>>
@61502787
>I bet you went to a state school!
>falling for the """""""""higher learning"""""""""" scam
>>
>>61502795
don't worry I'll implement python bindings for my efficient fizzbuzz implementation so brainets like you can use it in their "python programming"
>>
>>61502817
>SMART ENOUGH TO GO TO COLLEGE
tfw not smart enough to invest with Bernie Madoff
>>
>>61502825
>trying random personal insults
getting desperate there, webshit
>>
>>61502851
your posting style screams "intellectual"

please kys
>>
I've dropped Haskell in favor of Rust. Now I'm reading the Rust book.
Haskell is a nice language for academics, but it's not practical for real world applications. I don't care about type theory, but I do care about performance. So Haskell isn't really my thing. If I have to use FP for whatever reason, I'd pick Racket.
I considered alternatives like C++ or D instead of Rust, but Rust is just better. C++ is a clusterfuck and D is too obscure. So Rust it is.
>>
>>61502894
dumb mozilla shill
>>
>>61502894
Rust is literally Haskell
>>
>>61502894
Haskell isn't exactly slow you know, unless you're writing video games it generally isn't a problem

If you are, then what are you doing?
>>
typedef struct {
int x[10];
int dummy[1002];
} dummy;

or

typedef struct {
int x [ 10 ];
int dummy [ 1002 ];
} dummy;


>>
>>61502935
1GB/s
>>
>>61502951
That's fast
>>
>>61502935
But Haskell is slow. At least compared to C, Rust and C++. Besides, Haskell being a lazy language makes it a pain in the ass to optimize.
>>
>>61502955
>generating lot of garbage fast is somehow good
Is it the functional paradigm that has melted your brains or were you always retarded?
>>
>>61502939
struct 
{
int x[10];
int dummy[1002];
}
dummy;
>>
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2944.0xa90]
0x0000002b in ?? ()
(gdb) where
#0 0x0000002b in ?? ()
Backtrace stopped: Cannot access memory at address 0x18
(gdb)


It's going to be one of those days, again. When even GDB can't help you. Let's see if our trusty friend printf() has anything to say.
>>
>>61502957
>compared to C, Rust and C++
Compared to three of the fastest programming languages?

>Lazy makes it a pain
{-# LANGUAGE Strict #-}
non-argument

how often do you calculate O(N) of every function you write?

>>61502965
A large number of programming languages feature GC.
Haskell does not actually generate 1GB/s in all programs, that's a meme believed by impressionable idiots.
>>
>>61500152
This is why you shouldnt start on python
>>
>>61502888
>still doesn't realize how ridiculous he looks
>>
>>61500727
heh
>>
File: hascuck.png (90KB, 1905x977px) Image search: [Google]
hascuck.png
90KB, 1905x977px
>>61502983
Sure it doens't always generate garbage fast but it's still pretty bad
>>
>>61502939
typedef struct dummy {
int x[10];
int dummy[1002];
} dummy;
>>
>>61502980
i still havent touched a debugger in years.
print debugging is comfy.
>>
>>61503029
>constantly fucking with format specifiers
dont have to.
>>
>>61502983
>Compared to three of the fastest programming languages?
http://benchmarksgame.alioth.debian.org/u64q/which-programs-are-fastest.html
It's pretty slow for a native compiled language.
>how often do you calculate O(N) of every function you write?
I don't see the point you're trying to make with this argument.
Haskell is slow and that's because FP languages don't really thrive on todays hardware.
>>
>>61503039
Benchmarksgame isn't exactly reliable, and it depends entirely how the code is written.
>>
>>61502915
Go suck /pol/ dick somewhere else
>>
File: 1495881658365.jpg (7KB, 250x250px) Image search: [Google]
1495881658365.jpg
7KB, 250x250px
>>61503043
>and it depends entirely how the code is written.
no shit

the biggest problem is that people write C++ in C style and so on to get better performance while C++ fags still pretend that they have zero cost abstractions
>>
>>61503057
but style isn't language
>>
>>61503043
I disagree, benchmarksgame gives you a good indication how many times slower language X is compared to language Y.
I'm sure Haskell can be fast if you write it imperatively, but that defeats the purpose of an FP language.
>>
>>61503069
in this case it is, you get C++ in name only

STL and fancy tolls go out he window when they want to show how fast C++ is compared to other languages

it's a scam, it's pathetic
>>
>>61503087
s/tolls/tools/
>>
File: baka.jpg (7KB, 225x225px) Image search: [Google]
baka.jpg
7KB, 225x225px
Who here drunk programming?
>>
https://www.youtube.com/watch?v=1wOjOcVqp2E
who else /feel lied to/
>>
>>61503112
/coffee and kool-aid/ reporting in
2poor for alcohol right now
>>
>>61503112
the only times i get actually "motivated" enough to kode is after i've been up for more than 16 hours and drank alcohol, otherwise even though i get my coffee everyday i rarely put it to use
>>
>>61503112
I usually do it sleep-deprived, has a similar motivating effect for me
>>
>>61503112
>drinking a neurotoxic liquid

please don't be fucking idiots guys
>>
>>61503112
Who here way of the tea?
>>
>>61503112
> Studies clearly indicate that alcohol is neurotoxic, with direct effects on nerve cells. Chronic alcohol abusers are at additional risk for brain injury from related causes, such as poor nutrition, liver disease, and head trauma.

Modern life is hard as is, please don't cripple yourself.
>>
File: frag.png (14KB, 266x214px) Image search: [Google]
frag.png
14KB, 266x214px
>>61500040
In Lisp and Scheme, the symbol type is just a pointer in a table associated with the symbol's text. That's what makes it so fast to compare symbols as opposed to strings.

Does that mean that symbols are hashes? Is it possible for symbols to collide?
>>
>>61503320
If you really want to know you should try asking in the #lisp @freenode because most of the lisp compiler programmers are there.
>>
>>61503223
tons of coffee
>>
>>61503336
People on IRC are old and needlessly hostile.
>>
>>61503352
yeah but those are the only people who know the answer.
>>
>>61503357
I'll make a stackoverflow question.
>>
>>61503320
>Does that mean that symbols are hashes? Is it possible for symbols to collide?
No, they are not.
That being said, a lisp is free to use a hash-table for symbols, though that does not imply collisions.
>>
>>61503320
https://en.wikipedia.org/wiki/Symbol_%28programming%29#Lisp
>>
>>61503057
The thing is, with templates you do get zero cost abstractions (at the cost of compile time and developer time). And there are so many ways of doing the same thing in C++ that benchmarks are hard to take seriously.
>>
>>61503112

I only program sober. If I drink anything while programming, it is Mountain Dew Throwback.
>>
>>61503416
Eww, only neckbeards drink mountain dew.

>>61503112
The patrician beverage for programming is water and purity of will.
>>
>>61503416
>drinking any kind of sugar
it's not good for you even if you're not obese
>>
>>61502454
>I wish I didn't make a new hacky scripting language (quakeC) instead of finding a proper language because lots of people had their first experience in my hacky mess
I'm not sure your paraphrasing is all that accurate.

I think lisp would make sense for scripting.
>>61502652
>t. Second year CS student.
>>
>>61502943
It happens sometimes. Around 1pm my time if the latrine doesn't overflow.
>>
>>61503376
So If I initialize a symbol 'weenis
And specify 'weenis elsewhere at a later time, how is the symbol looked up to see it matches?
>>
>>61503538
Depends on the implementation.
>>
>>61503522

>t. Second year CS student. >>61502680
>>
>>61503548
How about R5RS Scheme?
I've read the entry in the standard, but I'm still not sure how it's implemented in terms of actual computer architecture. What does a symbol table look like and how is an arbitrary symbol referenced from it quickly, if not by hashing?
>>
>>61503576
>How about R5RS Scheme?
This is a standard, not an implementation.
This falls upon the implementations like Guile and whatnot. They are free to handle symbols in any way they want.
Do you have a specific implementation in mind?
>>
>>61503057
Yeah that's the story for every language. Interpreted languages compete in how quickly they can call out to code that was compiled from other languages.
High level languages compete in how little they have to do to get performance like the low level implementations.

There's no regard for how this fits into projects at all. Its a terrible site. Higher level languages should take pride where they can rather than try to pretend they're great languages in other areas.
There should be code elegance benchmarks. Like a site where users can inspect other languages and try to guess what they do. Answer some multiple answer questions on subtleties (if there are any) etc.
>>61503378
>templates
They're a bit of a cop-out in this case. For virtually any of these benchmarks. They don't add anything particularly high level and doesn't fit the benchmark setting.
I don't see how people can stand the dozen second compile times though.
>>
>>61503588
Chicken I guess.
But really somebody explaining how any particular implementation works would be useful.
>>
>>61503557
Hah. I guess it was a bit obvious. But that's the genuine impression I got.
>>
>>61503594
https://github.com/alaricsp/chicken-scheme/blob/master/runtime.c#L851
>>
>>61503447
I am literally a neckbeard.

>>61503497
I know. One of these days I should quit doing it. I really only have two vices: sugary soft drinks and spending every waking moment glued to a laptop or my smartphone unless I absolutely have to do something else, like attend a lecture.
>>
File: 1365375662112.gif (474KB, 214x161px) Image search: [Google]
1365375662112.gif
474KB, 214x161px
Does a simple for loop that prints the integers from 1 up to n actually have a pseudopolynomial time complexity, rather than linear?

This shit is fucking with me at the moment.
>>
>>61503740
why would you think so?
>>
Is this the beauty amd elegance of open source projects? How does Microsoft compare to that?

https://github.com/NetHack/NetHack/blob/NetHack-3.6.0/include/extern.h
>>
>>61503747
An integer is represented by a number of bits. Those bits increase as the integer increases, in a non-linear (exponential) fashion.
>>
>>61500571
How do I know user has ffmpeg installed?

I myself used ImageMagick, I could have just done

system("convert -delay 10 maze*.ppm maze.gif")

but what if the user doesn't have ImageMagick installed, or configures output format string and wonders why nothing works?

The workaround could be:
>link to ffmpeg (madness)
>link to imagemagick (madness)
>link to GIFLIB (plausible, too lazy)

So I guess that

system("convert -delay 10 maze*.ppm maze.gif")

with a disclaimer comment of unportability is good enough. Also should do

system("rm maze*.ppm") before and afterwards.

This would destroy all portability. Currently you can run this program on windows, since it's pure C99.
>>
>>61503883
Well at least I think it should work on Windows, I didn't try it.
>>
>>61503763
I cant wait for non-C OS's, desu.
>>
>>61503740

O(n) times you output O(log(n)) characters to stdout. Runtime complexity is log linear if you really want to be pedantic about it.

>>61503777

>exponential
Wrong. Logarithmic.
>>
>>61503918

Wait, I read Anon wrong on one part.

>Those bits increase as the integer increases, in a non-linear (exponential) fashion.
This is indeed correct.

But Anon is using the wrong dependent and independent variables. You're not trying to calculate the integer from the number of bits, but the number of bits from the integer n, because time to print is based on number of bits (or rather, number of characters, but that's just a matter of a different base).

Point is, it's 4 in the morning, what am I doing?
>>
>>61503963
Being in the wrong time-zone.
>>
>>61503973

Nonsense. West coast is best coast, as long as you're not a commie-fornian.
>>
>>61503982
west cost retard
>>
>>61503989
>Three mistakes in three word sentence.
>>
is there a programming-only 4chan board?
>>
File: java4-front-500.jpg (95KB, 500x659px) Image search: [Google]
java4-front-500.jpg
95KB, 500x659px
starting to learn java using pic related.

how fucked am i?
>>
>>61504035
not anymore
>>
>>61503982
Which college do you go to? University of Washington?
>>
#include <stdio.h>

main()
{
printf("hello, /g/\n");
}
>>
>>61504086

I graduated with my MS from Western Washington University, and will be studying for my PhD at Washington State University starting mid-August.
>>
>>61503918
Does the number of bits for every integer actually increase as the integer increases? If we're using a language that allocates 64-bits per number, is that a cap on the number of bits we can allocate, or is that the number of bits that are always allocated to each number representation?
>>
File: 456px-Abomination_full.jpg (59KB, 456x400px) Image search: [Google]
456px-Abomination_full.jpg
59KB, 456x400px
>>61504058
>thinking in java
>>
>>61504058
>thinking in java
Thinking in Java requires you to think like a Pajeet.
>>
>>61504103
void main()
{
import std.stdio:writeln;
"hello lad".writeln;
}
>>
>>61504145

It does if you're using arbitrary precision numbers.
>>
>>61504103
Implicit function prototypes don't work since C99, gramps.
>>
>>61504169
paren dropping is disgusting, especially when they have side effects rather than being simple getters
>>
>>61504183
No one cares, rustlet.
>>
>>61504176
>arbitrary precision numbers.
How common is that within languages? Do most languages use fixed-precision?
>>
>>61504103

main() {for (int n[]={3,1,2,0,4},i=0;i<5;i++)printf((char*)&(i[n][((int*) "an \0fou\0rch\0hi \0:D\n")]));}
>>
>>61504202
Most languages used fixed precision. Arbitrary precision is rare to use, but most languages have library support for it.
>>
>>61504166
>>61504150
What is the lesser evil: C++ or Java? The other day someone posted this >>61490203 and left me scared.
>>
>>61504190
>when your language is even more ambiguous than sepples
>>
>>61504237
C++.
>>
>>61504237
Also, could I do away with both and just spend my time trying to master C and Python (I think I will drop Lua, one scripting language is enough).
>>
>>61504240
Theres nothing ambiguous about it though.
We dont have ::.
>>
>>61504285
:: is the opposite of ambiguity.
>>
Working on a font download site
>>
>>61504302
>/gdf/
Green Dragon Fonts?
>>
>>61504259
Learn Ruby instead of Python.
>>
>>61504300
its pretty intuitive though, youre just brainwashed on rust.
>>
>>61504305
>>>/gd/ fonts
>>
>>61504237
Don't learn Java because it is a meme language and is actually slowly dying as people start to use other languages like Go and C#, especially C#. C++ is much more stable as a lot of big players have vested interest in C++. Plus, C++ has a lot more concepts which you can use.
>>
>>61504327
How come "a meme language" is the second most used programming language in the world?

http://langpop.corger.nl/
>>
>>61504314
Learn Python instead of Haskell.
>>
>>61504202

Fixed width integers are the default data type in most widely-used languages, but if you have fixed-width integers and arrays, you can have arbitrary-precision integers.
>>
What's the idea place to discard fragments in OpenGL? I'm assuming it's at the end of the fragment shader even if it's not going to be used since at least it doesn't fuck with SIMD.
>>
>>61504342
Well, I said that Java is dying. Nobody really makes new shit in Java anymore, only really Android apps, and even then everyone is moving to kotlin.
>>
>>61504327
You're a nigger. Go is mainly used for web back ends and C# is mainly used for Windows development. Java fills in all other gaps that are not (soft) real-time.
>>
>>61504385
False, everybody is moving to C# because C# is a much nicer language and they want to get away from the Oracle faggotry.
>>
>>61504399
>False, everybody is moving to Java because Java is a much nicer language and they want to get away from the Microsoft faggotry.
>>
>>61504409
What did Microsoft do? They made .NET open source, while Oracle was suing Google over patents of API relating Java Android. A lot of people switched over to C# after that.
>>
>>61504237
C++ probably is best balance in terms of speed/features/ecosystem/popularity
>>
>>61504409
You are fucking retarded. Go back to your Python scripts and fizzbuzz instead of making false shit up about industry when I've been in the industry for longer than you've been alive.
>>
>>61504420
They supported Oracle in that lawsit
...and later they used the linux api to make their ubuntu subsystem shit
>>
>>61504420
[citation needed]
>>
>>61504420
why would people adopt microsoft's retarded orphan if they already spent time taking care of 3d world negro child?
>>
>>61504431
kys boomer
>>
File: happy_chant.gif (664KB, 383x359px) Image search: [Google]
happy_chant.gif
664KB, 383x359px
Does anyone else like programming in Ruby? Ruby just feels so /comfy/.
>>
>>61504424
C++ is utter garbo
>>
>>61504607
Cute girl, but no.
>>
>>61504607
>>>/trash/
>>
>CS senior makes 'tabs v spaces' poll in sophomore Facebook chat
>Jokes that he made it to schedule remedial classes for the (5% of) sophomores who chose spaces
>Posts a gif of a guy tapping space repeatedly and yelling in frustration
>He's a senior and thinks that people who argue for spaces actually type 4 spaces each indented line
>>
>>61504719
>facebook
what did you expect exactly?
>>
Which programming language should I, a cute Jewish girl, use?
>>
File: consider.jpg (29KB, 600x600px) Image search: [Google]
consider.jpg
29KB, 600x600px
new thread
>>61504912
>>
File: Screen 2017-07-22 15-07-55.png (65KB, 1720x1074px) Image search: [Google]
Screen 2017-07-22 15-07-55.png
65KB, 1720x1074px
Set up ELK stack in a VM to manage my finances

Good for a quick overview, but lacks some crucial features like plotting the cumulative sum or grouping items into custom categories (or maybe it doas, but i havent found them yet).

any recommendations for a similar software? Otherwise i go back to my custom python script that does the same for practical purposes but in <1k lines of code
Thread posts: 313
Thread images: 28


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