/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?
Old thread:

Other urls found in this thread:

en.wikipedia.org/wiki/Client–server_model
doc.rust-lang.org/book/second-edition/
rustbyexample.com/
rust-lang.github.io/rfcs/2133-all-the-clones.html
github.com/rust-lang/rust-roadmap/issues/16
github.com/m2ym/optima
en.wikipedia.org/wiki/Flavors_(programming_language)
typedclojure.org/
github.com/eslick/chtml-matcher
common-lisp.net/project/asdf/
twitter.com/SFWRedditImages

fuck opengl

Do you have any technical argument to back that up?

go meme post to >>>/reddit/

>being this ass-blasted when someone points out that you're just spewing opinions instead of taking your bait seriously

After you newfriend.

expound

Holy shit, I just found a really good job opening for a Rust programmer. Like 10 minutes from home

Quick de pee tee redpill me on Rust

Hope you're on HRT

first for lisp is shit

First for don't forget to add a free license to your project.

>renaming attribute/varying to in/out
>es2 doesn't support VAO's but with gl3.3 you have to use at least one VAO
>extension loading
>deprecating immediate functions but still using state machine instead of getting rid of it

>First for don't forget to add a free license to your project.
Fuck you, if you use my code, you're violating my rights.

>the features on said wish list are objectively desirable.
Threadly reminder that the only feature that is "objectively desirable" is the feature of being able to get whatever features you desire, and Lisp is the closest we've gotten to that.

Yes, make sure to release your projects under the MIT license.

What are some fun things to do on c++?
inb4 compile linux

Not him but:
>opinions = bait
Nice meme.
Please explain to me why my opinions should be objective truths.
Lisp is shit. I've already articulated why I feel that way. They were quite good reasons.
And then we started in on "hurr a durr personal wishlist."
This, however, was a misguided path for the conversation to take. It seemed to suggest that my opinions on what makes a language good are invalid because they're opinions. This, of course, is absurd.
So, yes, I do have a reason why I think Lisp should support my personal wishlist out of the box. The reason: I am me. This is quite a good reason for me to believe informed opinions that are mine, that I have developed from my experience.
This of course is no reason for YOU to believe my opinions. And yet, it is a perfectly good reason for me to share them with you, or with anyone else.
So, to reiterate:
Lisp is shit.

(cont from )
And I refuse to explicitly qualify that statement with "in my opinion."
Because it's unnecessary.
That's already implied by the fact that I'm the one saying it.

After using Clojure for a while, I've lost my ethusiasm for the language.
Being a Lispy language comes with benefits, but also suffers from major problems. The biggest drawback is the lack of a static type system. It's a nightmare to refactor. Basic errors are not caught at compile time. I don't consider a language without a static type system relevant in 2017. Even the Java static type system is better than none.
Aside from the static type system, library support is in really bad shape. Most of the libraries are mediocre wrappers around Java libraries. Clojure running on the JVM doesn't help either: interop with Java is a complete nightmare. I don't even have to explain how bad it is to strangle Java code to s-expressions. Clojure also doesn't run on openjdk-9.
So, no Clojure for me. It's a fun toy, but that's all.
I'm currently looking at using Scala and Rust for my projects. From a job perspective, I would pick Scala. Even though Scala has some really messed up parts, the language is quite good. Rust is interesting because it's kinda functional (without a REPL) and compiles to native code. Library support is better in Scala than in Rust because it's more mature. Scala also has the cats library that is really helpful.
TL;DR fuck Clojure, hail Scala

Fuck you

>Please explain to me why my opinions should be objective truths.
Did I say they should be? You're just getting ass-blasted because I don't consider your opinions worthy of discussion.

>Lisp is shit. I've already articulated why I feel that way. They were quite good reasons.
Your entire argument seems to be "Lisp is bad because it doesn't support the features I like out of the box", but you can't actually explain why it should, so it really boils down to "it's bad because I don't like it". And that's fine, user, but nobody cares.

>and Lisp is the closest we've gotten to that.
Wrong, C does it better. Lisp is so slow compared to C that a standalone Turing complete language whose compiler or interpreter was written in C is potentially faster than the fastest possible Turing complete embedded language in lisp

>Wrong, C does it better. Lisp is so slow compared to C that a standalone Turing complete language whose compiler or interpreter was written in C is potentially faster than the fastest possible Turing complete embedded language in lisp
Languages are not fast or slow, the implementations are.

>C does it better
It does? Show us how to implement new syntactic forms in C, then.

It goes beyond liking the features. My opinion is that these features so vastly augment the expressivity of a language that they're essential. Understanding what these features are and knowing they exist makes it unbearable to work without them because of how little you accomplish in comparison.

True, but languages' features put limits on the level of performance even the optimal implementation can achieve. For example, dynamic typing and garbage collecting limit your possible performance to ~1/3 of that of C in the best case (i.e. non-idiomatic case), to 1/10 in a typical case.

1) write a compiler
2) (there is no 2)

>Languages are not fast or slow, the implementations are.
Language implementations are not "fast" or "slow" either. Programs can be fast or slow relative to the requirements/user perception.

>you can implement new features in C by writing a compiler for another language that has them

just use macros and non portable extensions ;)

>My opinio-
And again, no one cares. That's just a long-winded way to say "I like X". I don't consider any of those features necessary in the least. Now what?

python perl or ruby?

C is a complete language, not DIY kit, you don't have to waste your time fixing it.

So you can't.

Correct. I was a retard. Sorry everyone.

let's say I wrote a simple command prompt program with node.js .

how would I make this program available on a webpage? how do I connect these two?

Im very confused

No, you can't. You see, just like every language supports a set of features, there's even bigger set of features it doesn't support. You can't add new syntactic form in C, but you can get efficient code that doesn't use a lot of memory, something you can't get from CL. CL doesn't support static typing, ATD, immutability, linear types, pattern matching, etc. The key isn't to have all the features in a language, but to pick the ones that are actually useful and help to produce an efficient and maintainable code. The ability to add new syntactic forms isn't such feature, but the price of having it in a language is the much more complex specification and implementation.

ditch perl
flip a coin for python and ruby

>Im very confused
You're retarded.
en.wikipedia.org/wiki/Client–server_model

Cross platform(desktop,mobile) GUI library with C API?

>you can get efficient code that doesn't use a lot of memory, something you can't get from CL
You can.

>CL doesn't support static typing, ATD, immutability, linear types, pattern matching, etc
It does.

>The key isn't to have all the features in a language, but to pick the ones that are actually useful and help to produce an efficient and maintainable code
You can't have that, while I can.

>The ability to add new syntactic forms isn't such feature
It is the only such feature.

Vulkan

>Cross platform(desktop,mobile) GUI
Forget it

Whats a good resource to learn Rust?

qt, javafx, kivy, elenctron, there are many ways to do that but you are limited to shitty languages. Why can't they just provide fucking shared library with C API?
not gui library

I should really stop waste my time arguing with people who just deny the reality around them.

I just discovered express.js

am i on the right track?

Why is this funny?

you're going the wrong way! abort, abort!

doc.rust-lang.org/book/second-edition/
rustbyexample.com/

C# shills on suicide watch

>makes a bunch of false statements
>gets called out
>spergs out
Most lisps supports whatever the user wants simply by virtue of erring on the side of flexibility out of the box, having no distinction between runtime and compile time, and providing extensive support for syntactic extensions. As for it not being "efficient" or using "too much memory", that's purely your subjective opinion. CL has been efficient enough for everything I've thrown at it. Your arbitrary standard of "being as fast as C" is irrelevant.

more like 1/3 in a typical case. C tards have their heads up their ass and underestimate programmers of other languages. there is no reason to write god-awful code regardless of the language.

I thought Haskell was one of the least disliked languages.

How do Haskell and ML compare to one another? Which do you prefer?

SML seems way nicer language than haskell

rust-lang.github.io/rfcs/2133-all-the-clones.html

looks like rust finally solved the retarded problem of only copying arrays up to size 32

I have a game-developer acquaintance who has told me that it has a lot of poor abstraction and the need to tweak opengl for different drivers is very annoying.

Can you give an example of this in LISP?

how was this a problem in the most shilled language of the decade

what other retarded problems are there that everyone conveniently doesn't mention?

github.com/rust-lang/rust-roadmap/issues/16

the borrow checker not being as smart as it should be is the only other major issue I can think of

You can definitely get efficient code out of Common Lisp. Operating systems were written in Common Lisp. Once you start adding type declarations, the code starts to become much more performant, but you only need to write code like that when performance matters.

Common Lisp has limited support for static typing, but language like Typed Racket show that this is a limitation of Common Lisp, not Lisp in general.

Pattern matching exists with fairly decent support for tearing objects apart.
CL-USER> (ql:quickload 'optima)
To load "optima":
Load 1 ASDF system:
optima
; Loading "optima"

(OPTIMA)
CL-USER> (defun factorial (n)
(optima:match n
(0 1)
(n (* n (factorial (1- n))))))
FACTORIAL
CL-USER> (factorial 6)
720
CL-USER>


Immutability is really just a matter of writing immutable data structures and you'll probably be able to find at least a few free software libraries with them.

I just don't get it. I keep hearing all the time that software development is flooded with fucking idiots and stack overflow kids, yet I have had the hardest goddamn time getting my foot in the door. Nobody gives a single fuck about me, no replies, not even rejection emails. I'm graduating in december with a bachelors, I've been programming for years, have several significant personal projects, and look what it's done for me. Meanwhile Pajeet and Brad the math major who completed a Node.JS tutorial in two hours one weekend can easily land positions.

Not him but here's a pattern matching library which the user in the other thread claimed CL can't do.

github.com/m2ym/optima

Do you actually call back to inquire "the status of your application"?

I didn't think that was something that was appropriate in the professional world. I used to do that back when I was a retail monkey.

Is your resume any good?

And you wonder why you don't stand out among the billions of others applying.

it's like getting a gf, don't assume it's a "no" unless she explicitly says it (or blocks you or something)

>Can you give an example of this in LISP?
en.wikipedia.org/wiki/Flavors_(programming_language)
typedclojure.org/
github.com/eslick/chtml-matcher
common-lisp.net/project/asdf/

>Common Lisp has limited support for static typing, but language like Typed Racket show that this is a limitation of Common Lisp, not Lisp in general.
You could roll your own static type checking if you really cared to. The main issue would be providing type annotations for all the standard library functions, which would be pretty tedious and would require a community effort to pull off, but (unsurprisingly) people who use CL don't care much for static type checking.

does xhe look like this?

Or just use a proper language where your type system isn't tacked on.

>a simple command prompt program with node.js
What exactly does this mean? Like a wrapper around bash?

Unfortunately my Haskell-fu is weak right now and between Python/Ruby/Lua/Perl6 and C++/Java/Rust/Go/C/C# Common Lisp is the best language I know how to use. That or Racket, but Racket doesn't have a standard.

What's some simple, well written software in C I can use to study good code?

What's wrong with perl

The linux kernel.

>muh subjective opinions about the necessity of static typing
No one cares. The point is that you could have a lisp with static type checking if lisp programmers cared about static type checking. On the other hand, there's an endless number of features I can add to garden variety lisp that you won't be able to add to whatever you use no matter how badly you wanted it.

Ugly and slow.

>simple

And i could have C++ with pattern matching, doesn't mean it will be good to work with.

Right, I noticed that you said that.

Really? I can get its ugly, but how can it be slow?

>linux kernel
>well written
laughing_bsd_developers.png

This isn't really changing the syntax of the language. I'm not seeing anything you couldn't do in C++.

The longer you've used something the more you hate it.
People who are good at Perl can write code that's very hard to understand unless you're also very good at Perl. This makes brainlets furious
Perl has a lot of weirdness that shouldn't exist, like open("ls|").
Perl5 lacks some basic things most people expect, like function signatures. By default, Perl5 just gives you a list of arguments and expects every function to parse them by hand on their own.
Perl6 is still crawling its way back into relevancy.

Run this shell script with 30 as an argument:
#!/bin/bash

match=$(printf "%$1s" | tr ' ' 'a')
regex=$(printf "%$1s" | sed -r 's/ /a\?/g')"$match"

echo "Using regex $regex"
echo "Matching against $match"

echo "grep"
time grep -E "$regex"

Funny how people always say how /could/ have static typing and a lot more cool features very easily yet we never actually see anything and especially anything that's not already common in half other languages.

It's almost as if this highly praised ability is not actually any fucking good because implementing such things properly is still a huge effort and noone does it.

>And i could have C++ with pattern matching, doesn't mean it will be good to work with.
That's an issue with C++. CL doesn't come with pattern matching out of the box either, yet people have implemented very comfy pattern matching libraries for it.

>libraries are my features
It's like im really using JS!

>This isn't really changing the syntax of the language.
All of those examples add new syntactic forms and features to the language. You're simply retarded.

Which language should I use if I want to receive all teh system information like CPU usage, temperature, GPU usage and so on ? Is there a Python module for it ? I wanna get all that information and send it over the network to another device. Suggestions ?

People do add these things. Typed Racket is a racket language where everything is typed. IIRC, typed clojure is the same. Pattern matching does exist. There just isn't that much people need unless it's domain specific. All the low hanging fruit has already been implemented and added to the standard. You can still add compile time regular expression literals if that's how you swing.

You can write an HTML template language without writing a lexer.
You can add arbitrary compile time constants to your language, like regular expression literals.
You can make syntax that describes an adventure game and then have a web server where you can play that game be auto-generated.
You can make a language for describing binary data that will automatically create serialize and deserialize functions for any data described.

Have you tried using Typed Racket? The type system is awful and it's so fucking clumsy to use. It's just really really bad, borderline unusable honestly.

"adds new features to the language" isn't really saying anything. Every library adds new features, that's what they're for. But you're still limited in how you use them by LISP syntax.

>Funny how people always say how /could/ have static typing and a lot more cool features very easily yet we never actually see anything
But you're outright delusional, because static type checking has been implemented in Racket and Clojure, for instance, and examples of new syntactic forms can be found in most domain-specific libraries.

python

I wonder how much the FSF pays him to shill lisp.

asm