/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?

Previous thread:

Attached: Alan_Kay_-_LISP.png (273x185, 85K)

Other urls found in this thread:

eolang.org/
archive.vn/mnbNo
lighttable.com/
docs.idris-lang.org/en/latest/st/machines.html
twitter.com/SFWRedditVideos

(((Lisp)))

That's overstating it.

2hu oriented programming

Attached: 1521545817181.jpg (1268x1800, 232K)

>2020 - 361 days
>still no 2hu AI assistant

>2020 - 361 days
Jesus Christ don't say it like that. You make me feel like I'll die soon.

Actually, I have to say, of all languages so far, lisp even to this day seems the most innovative, despite predating literally everything.

>lisp even to this day seems the most innovative
Why?
Because of AST shit you can do?

What about it is so innovative (even today)?
How is it more innovative than something like idris?

how is lisp innovative when it has 5 commands and the most basic syntax imaginable
its like calling logic gates innovative

Well basically it's how with the complete bare-bones simplicity of the syntax tree being immediately presented to the programmer in how the language is structured it can extend itself to no end WITHOUT needing to become a convoluted and difficult to read mess.
A lot of things build on it and also do other things, and there are languages like elixir which try to hide this fundamental abstraction behind a "nicer" syntax while still allowing for the power of the design. I think that adding to that simple design in these ways detracts from the beauty and the usefulness of the original simplicity.
Never heard of it but looking at some examples my first criticism is (and this is in spite of (((lisp)))) the overly noisy use of random symbols in the language in a not entirely immediately meaningful manner.
But I guess I should give it a fair try first.

well, logic gates were innovative.

but user, you will. sooner than you think. and alone.

EO is the most innovative language.
eolang.org/

The symbols aren't random, but were adopted from other functional languages and are based on mathematical notation (or at least as much mathematical notation as is convenient to represent with ascii)

No. I only look at unix time. It'll overflow and it'll be 1970 again. And everything will be great again.

C++ is a fucking retarded lang.
How to define a template type in a struct constructor?
Something like this
template
struct Foo{
template
Foo(T1 foo){
/*...*/
}
};

void somefunction(){
Baz baz;
Foo foobar{baz};
}

How to force the type of T1 when constructing Foo inside the somefunction() in case where baz is ambiguous?

>eolang.org/
>object-oriented
eo is not real programming language, it's shit and you should feel shit.

>If Lisp is so good, how come nobody has even made a text editor with it? No, Emacs doesn't count, it's not pure lisp.
>You have absolutely no clue how Lisp works and 400 other defensive shitposts

archive.vn/mnbNo

IT'S A JOKE

S

Attached: 1535235629653.jpg (389x389, 58K)

how boring, the same old shit spouted by lisplets.
By trying not to be complicated, Lisp ends up being complicated in the form of trying to decipher the fucking jungle of parens. I have no fucking clue how lisp people can refactor large programs without wanting to kill themselves.
Also being infinitely extensible by itself doesn't really mean shit. People want to program, and make things, not program their programming language, and make overly-specific DSLs forever.
>the overly noisy use of random symbols in the language in a not entirely immediately meaningful manner.
Why is having to learn syntax a bad thing?
Let's see Lisp even attempt to have compile-time type-checked state machines.

keyword: were

>le OOP hate meme
Love this meme.

Yes, that is the nature of innovation.

>Latest commit 231d9f3 on 21 Feb 2018
It's dead, Jim.

Lisp was innovative in 1960
Today you can accidentally invent Lisp if you're making a simple DSL for a task

>not even a year
>ded
nah, Elm went an entire 2+ years without any update at all.

There's at least three(3) text editors written in Common Lisp for coding Common Lisp climacs, second-climacs, lem

Lisp is a masturbation concept.
It's neat and all but it has no real use in this Imperative driven world.

You can't explicitly call a constructor, or explicitly specify its type parameters.
Explicitly covert baz to the type you want. Use a cast for example.

Does Light Table count?
lighttable.com/

Yes, something is 'only innovative once'.
That's what innovative means.

Just print an Apple logo on it and it will be permanently "innovative", user.

why are you posting this like someone didn't just post
>Actually, I have to say, of all languages so far, lisp even to this day seems the most innovative

Would be hilarious if some Senior Apple engineer got the greenlight to develop his LIsp flavor and suddenly Lisp became trendy again.

Because I don't care about what the other dude said.
I only came in to say that logic gates were innovative.

Lisp can do imperative programming just fine.

I need to generate a pair of numbers a, b with such characteristics:

gcd(a, b) = 2
a mod(4) = 3
b mod(4) = 3

is there a smart way to do this or should I just brute-force it?

good way to show off your ignorance

This. Lisp IS imperative.

Do your homework yourself.

I'm always amazed how easy CS homework is, even as a complete mathlet.

...

Depends on the course, the Uni, and the professor.

All linux syscall args are 32-bit wide even under amd/ai64, right?

...

GNU/Linux*

GNU+Linux

I'm not a big lisp user, but I'm writing an interpreter for my own little lisp DSL in C right now. Just writing a runtime system for a lisp has made me appreciate it in new ways.
I never need to properly generate an AST- lisp is its own AST, after all. Simply traversing a tokenized lisp program linearly is equivalent to preorder traversal of the AST, and getting a postorder traversal is as simple as adding a stack to the function that does the linear traversal.
Something interesting I hadn't really thought about before is that the entire syntax is self-describing. This sounds kind of retarded, but there's something fractal-like about it. A lisp expression is just some arbitrary cons-ing together of other expressions. It makes perfect sense, then, why lisp macros are the insane drug that people claim them to be. By nature, lisp code is inherently capable of dynamically generating more lisp code. I'm sure this stuff is obvious to a more experienced lisp user, but it's eye-opening to me, as someone who hasn't used it much.

pro tip: if your entire project creates a single 15kb file just fucking include it in the git repo, nobody wants to compile it.

>woah programs that program themselves it's so amazing dude

>what are different architectures

just bruteforcing it worked, thanks

>If Lisp is so good, how come nobody has even made a text editor with it? No, Emacs doesn't count, it's not pure lisp.

Have you ever heard of Lisp Machines? Did you just forgot about that period of history on purpose to fit your argument?

and why arent they around today

Asynchronous electronics are tough to design and build.
Synchronous designs won the race because they are easier to understand and design.

Because Lisp Research died out after government funding stopped. Are you really this new to programming that you never heard of AI winter?

libevent, libev or libuv?

make your own you tool

Sorry for not being 50 years old
Clearly government funding stopped for a reason

libuv hands down

Yeah it stopped because it turns out AI is not an easy problem 50 years ago as it is today. Fucking retarded brainlet.

>By trying not to be complicated, Lisp ends up being complicated in the form of trying to decipher the fucking jungle of parens. I have no fucking clue how lisp people can refactor large programs without wanting to kill themselves.
By not putting everything on one line and using indentation? And also splitting things up where it makes sense?
>Why is having to learn syntax a bad thing?
Because when endless syntax to learn is all your language has, you just make your language more difficult to get a big-picture idea of.
>Let's see Lisp even attempt to have compile-time type-checked state machines.
What the fuck is a type checked state machine supposed to be and why is it essential for lisp to have the ability to implement one for lisp to be the most innovative language to date?
Let's face it, OOP is mostly shit. And nobody can even agree on what it is. Any language which claims to be "object oriented" IS by definition either trying to pander to ooplets by claiming to support OOP by pointing at a loose aggregate of features which kind of resemble OOP but not really or they are actually unironically trying to implement what is commonly described as OOP and then the language is clearly shit.

>Implying tons of the stuff we have and is researched today isn't heavily inspired from the lisp machines

Okay, this is epic.

Damn this board moves slow.

>Stupid for not knowing something
That's not how intelligence works

Now this is epic!

>>>/reddit/

>What the fuck is a type checked state machine
A state machine, which can never produce an invalid state at run-time because states are just types, checked at compile-time.
docs.idris-lang.org/en/latest/st/machines.html

you're stupid for being an ignorant cunt who can't either
1. lurk moar
2. do his homework and google that simple shit
and yet still shares his irrelevant opinion

I didn't share my opinion, I shared a fact that they weren't being made anymore, something which made you immensely butthurt apparently

>Let's face it, OOP is mostly shit.
why is it shit if it can't even be agreed on what it actually is

Very nice

Can't this be done with some formal verification?
I guess it's an interesting idea but wouldn't an FSM generator also be capable of doing this if you formally verified the FSM generator?
Then you just need a formally verified FSM generator for lisp.
I don't think I would use lisp for FSMs anyway. But I guess it's a cool concept, true enough.
Well that's a good question. Nobody can agree on what it is but every time I hear someone unironically claim to be using the end result is a mess so I guess there's AT LEAST a correlation between times when people claim to be using OOP and the generation of spaghetti.
So maybe OOP does have a definition at this point: complete fucking mess. Sounds good to me.

>Then you just need a formally verified FSM generator for lisp.
what happened to simplicity?
i thought the almighty Lisp was powerful enough to do literally anything and still be the most elegant at doing it?

isn't OOP encapsulation, inheritance, polymorphism and abstraction? I consider them all useful apart from encapsulation

Inheritance is one of the least useful ways to do polymorphism, and OOP is just one way to do encapsulation and abstraction.

Slow boards and threads are the best. It seems the higher the post rate the lower the post quality. Take a look at the previous /dpt/ as an example, it was a very quick one.

Attached: 1544551052481.png (1052x1342, 769K)

what's a better way to do polymorphism than inheritance

Encapsulation is the entire purpose of OOP you idiot. If you like inheritance you're a pajeet. polymorphism can be done in other ways.

I should make that runtime polymorphism by the way because I already know there's better ways to do static polymorphism

What's abstraction?

>needs to bubble wrap his code
>calls other people indian

first class functions and type classes, for starters

>Clearly government funding stopped for a reason
Lisp Machines were expensive and highly overpriced
Lisp Machines were big
Lisp Machines were surpassed by PCs
It became obvious that the design of PC CPUs were more efficient than making complex hardware to handle high level languages naively
People wrote Lisp compilers on PC that produced faster code than could be achieved on Lisp Machines, see above.

One of the Lisp Machines Operating Systems still exist to this day: Open-Genera and is a real fascination. It was basically dedicated to Programming Lisp and running those applications. There's lots what would be considered security flaws though due to its decision to make everything shareable between processes which was likely great at the time, but evil people exist today that would take advantage of that if an OS like that existed.

Is there good software for setting up and organising Scrum?

aren't type classes static?
using a function pointer is basically the same thing as using a virtual method

Those words have meaning outside of oop. Oop is separate. Many of the features in oop strive to accomplish some of those as goals. Encapsulation being one of the most important goals.

>i thought the almighty Lisp was powerful enough to do literally anything and still be the most elegant at doing it?
I never claimed that.
But you could certainly write the formally verified FSM generator in lisp if you wanted to.
A language doesn't have to have every feature out of the box, that's called a bad language, but languages can be powerful and extensible, and I think lisp is doing the best there.
I actually am not too sure you NEED to do this type checking at compile time, like I said, you can always formally verify your FSM after you change it. So certainly a compile time type system based check is one option but it is not the only option.
I am quite convinced lisp would have no problem achieving what you desire (a state machine which is verified not to get into an inconsistent state (as long as there's no hardware problem)) but it's just a question of how it is achieved.
The other problem is with languages which are trying to be too general purpose by implementing extra language features (and I'm not saying this is the case for the language you mentioned, but it is the case for a lot of the languages which people insist are much better than lisp because they can do X or Y). With lisp, it can be simple and very general purpose by allowing you to extend the language to specialise it in the appropriate direction. This results in something much simpler than what you might have gotten if you tried to find a language which already had the weird set of features you wanted.
I wouldn't say that just saying that anything which loosely fits this description is "OOP" because you can claim that any sufficiently complex language is an OOP language. It also makes the field ripe for OOPlets to claim that OOP isn't shit by just picking a random example of good code and telling you how it makes use of these four features and is therefore somehow automatically OOP.

>aren't type classes static?
no.
>using a function pointer is basically the same thing as using a virtual method
function pointers are not closures.

Encapsulation exists in all languages. C has file encapsulation. OOP has file and class encapsulation.

>I actually am not too sure you NEED to do this type checking at compile time
So you enjoy run-time errors?
Quit trying to rationalize a great thing away because it makes you realize Lisp is severely limited.

a first class function isn't neccessarily a closure either
is there any language that uses type classes that isn't haskell?

why doesnt it turn into a char array correctly ?

Attached: Captura.png (742x821, 20K)

>So you enjoy run-time errors?
You won't have run-time errors if you formally verify. Do you understand how formal verification works?
>Quit trying to rationalize a great thing away because it makes you realize Lisp is severely limited.
Well it's now obvious you're not in any way interested in having a rational discussion.

Rust traits are close enough, and one of the few bright spots in that disaster of a language.

It probably did but that's not how you print a char array. Google how to print a char array in Java.

You're adding an extra step, for something that is just utilizing another lang's type system?
So why is Lisp "Simple" again?

turns out im retarded thanks man

You're printing array's memory address

Attached: Kay.jpg (327x154, 13K)