A sane programming language

So, given that every programming language seems to suck, what would your ideal programming language look like?

What features would it have? What syntax? What typing system? What standard library, if any? Would it have a garbage collector? Would memory management be manual or something like RAII, or a borrow checker?

Would it be focused on minimalism? Safety? Performance? Provability? Size?

Is it possible to make a sane, ideal programming language?

Other urls found in this thread:

en.wikipedia.org/wiki/Tower_of_Babel
cs.umass.edu/~emery/pubs/04-17.pdf
golang.web.fc2.com
twitter.com/SFWRedditGifs

Technically the point of a programming language is to abstract the ISA below it. C was originally the one to do this and do it well for the time. Rust is now a better alternative for both speed and security.
Rust has many features of C. Uses a similar to C syntax. And is a memory safe, garbage collector free, and easy to use type system. For performance you can inline either C or assembly as needed.
Rust could use C standard libs and eventually rust standard libs when they are made.

The problem with rust arrises from parallesation. It can't handle RISC like arcitectures in the most performant manner. (yet?)

I really want to like Rust, but it's constantly changing and frankly, isn't mature yet. The community surrounding it and making decisions directly impacting the language aren't exactly savory either.

I don't want to turn this into a Rust vs X circlejerk.

It would look and function exactly like C.

No, it'll suck one way or another. Then we'll make another language, which will also suck and so on. It's been going on for close to 70 years and that process recently shat rust and golang.

But user, the sanest programming language already exists.

This. Dubs confirm
/thread

sane programmers program in brainfuck

C++
Why is this even a discussion?

you forgot

It's Javascript. Anyone who says otherwise is either LARPing or a pajeet

I like the idea of programming in C, but then as I'm doing it I ask myself why am I spending time writing 80 lines of code when I can do the same thing in Python in 2 lines.

C is like getting your dick sucked with a condom on. It feels pretty good, but it could feel so much better.

More like

...

A universal programming language doesn't exist and will not exist.
en.wikipedia.org/wiki/Tower_of_Babel

...

...

That image has convinced me, and I shall now use assembly in all my very relevant "hello world" applications.

Universally supported platforms are overrated

That's a shitty excuse. God said that he would continue to scatter the people upon the earth. He said nothing of them having one language again.

To be fair, it shows how the libc and the size of the image hurt the startup time, something to consider if your writing a program that would be run repeatedly in a loop (ie.: in a shell loop).

you faggots just never quit do you? you poz up literally every thread that has to do with programming.

Crappy compilation model, tons of undefined behaviour and a pretty horrid syntax for meta programming. Also, it sure as hell isn't easy to learn unless you love said undefined behaviour.

redstone

Show us how easy is to write quicksort in haskell
not that meme 2-liner, but real, iterative in-place quicksort which will have run time and memory footprint comparable to a proper implementation in C

No.

The best option will be a combination of a simple easy to use scripting language where you don't need to care about safety and the like, and a very low level language like C where you have very high level of control over the data and there's no magical mumbo jumbo doing things for you.

There's already tons of options for the simple language such as Python, but there's no very good modern performance language.

It's already there (Python 3), but implementing it in a way which will do fast speed and correctness proving will be unimaginably hard.
And when language shifts the burden of optimization and correctness hints to the user (Rust), it of course makes it less ergonomic.
You can't have both ergonomics and compiler doing maximum grunt work for free, implementation complexity is a major factor too.
It's certainly possible to define an super duper ideal language but it will be almost impossible to implement, so it will be useless ultimately.

Gee, can't argue with that.


AI-assisted compilation?

No
God fucking no
Jesus christ no
Not as much as C
Runtime yes, compile-time you've got to be fucking kidding me

No double equals operator, '=' is comparison in an expression and assignment outside of one
No assignment in expressions
Object oriented
Dynamically typed
Garbage collected
Optional runtime error checking
Optional type assurance in error checking mode
Every function call silently passes a 'self' variable
Compiled
Copy operator
All objects can have their members modified
No private methods
You can modify operator behaviour for any given object
No brackets around statements
Shortest reasonable names for stuff
In place assignment for unary operations
Global members are addressed via a global object
No line ending or continuation character
I'm already making this btw
Rough example:
obj tamagotchi{ fn new() { self.hunger=100 self.health=100 self.dead=false return self } fn feed() { if self.hunger

You write it in C-- and use FFI. The meme solution isn't slow either, essentially (in machine language) it does the same thing as the iterative C one.

I would like a language that has Lisp's S-expression syntax, but the low-level facilities of a C-like language. Then all the cool high-level stuff could be built as macros on top of that low-level foundation and be part of the standard library. Make garbage collection optional, i.e. provide facilities so that one can allocate and de-allocate memory explicitly, provide the facilities so that the compiler can predict in advance when memory will be safe to release, and provide actual GC-managed memory.

Safety first, performance second, size third.

I'm sorry friend, but that automatically makes it trash.

Please see yourself to the nearest disposal chamber.


Supposedly the TALOS II will allow for stuff like lisp machines.

Enjoy your memory leaks and wasted programmer time :D

Enjoy your java-tier performance and still memory leaks.

What does this mean concretely? I have never used a Lisp machine, not even an emulated one.


Memory leaks can still happen, except now you don't notice them because they are cleaned behind the scenes, but you pay a huge performance overhead.

see

C

Simple.

Good job, now you have to constantly second guess whether each line you write is going to parse as an expression or a statement.
Almost as retarded as Rust's "trailing semicolon changes return value" rule

But GC can often be faster than manual memory management

"Conclusion. The controversy over garbage collection’s performance impact has long overshadowed the software engineering benefit it provides. This paper introduces a tracing and simulation-based oracular memory manager. Using this framework, we execute a range of unaltered Java benchmarks using both garbage collection and explicit memory management. Comparing runtime, space consumption, and virtual memory footprints, we find that when space is plentiful, the runtime performance of garbage collection can be competitive with explicit memory management, and can even outperform it by up to 4%. We find that copying garbage collection can require six times the physical memory as the Lea or Kingsley allocators to provide comparable performance."
cs.umass.edu/~emery/pubs/04-17.pdf


Yes, but they're far more unlikely.

...

protip: rust didn't invent this "retarded rule"

x=1 //assignmentif x=1 //comparisonx=y=z //Assigning value of comparisonx=y y=z //Separate assignments
Eek so much second guessing

XD I know right? What an idiot!

Let me guess, you use C++.

...

I forgot to add, it should at least require parentheses.
Just x=y=z being that is awful.

Actually I quite dislike C++ for it's inconsistency and syntax, I only use C++ when I really have to (like when contributing to an open source C++ project). I much prefer C.

Nah, that'd introduce an inconsistency unless I made people do that for every comparative operator, and that would be even more annoying, I'd rather just leave it up to the user

What would if x=y=z do? if (x=y)=z or if x=(y=z)? I know it's pointless but I've seen way too many times people doing if(x == true), so I'm curious.

this sure is innovative

the only thing wrong with C was pointers
C++ was made to avoid using pointers,,, to make it more practical for large projects. not to make it faster or smaller file size

if you want maximum speed + minimum file size, you use assembly

do yourself a favor and stop wasting time bothering with horse-shit trendy languages
(or the even sillier "Imma make my own language that is BETTER!!!")

---------

some of you guise are like that faggot in the movie, standing on the front of the Titanic, yelling "LINUX AND RUST ARE GONNA RULE THE WOOOORRRRLLDD!!!"
and it isn't going to happen.
Windows and C++ is the iceberg

He's paid by mozilla.
The basis of memes, repeat until someone believes it.

It would do x=(y=z)

Windows is melting fast and C++ won't be prominent for another decade.

You can build a bloated standard library if you want.

What's wrong with pointers?

rust didn't invent much of anything, did it? It's the PHP of Ada wannabes, full of shit the designers don't understand but throw in because it "looks cool".


v=w=x=y=z

Have you ever heard of fucking java?
Call me pajeet but it's ideal as a language can be.

so? is this supposed to be an argument?

v is set to the value of comparing w,x,y and z with each other here

The design philosophy would be "it it doesn't run/compile/gives a warning it's the language's fault"

Just think of the possibilities. You wouldn't ever need to worry about spell-checking your code again. You wouldn't ever need to worry about stray semicolons. You wouldn't ever need to worry about, well, anything. Just think of how many pajeets you could hand a 10-minute youtube tutorial and then replace C++ programmers with decades of experience for $3 an hour.

...

HAHAHAHAHAHA

I'm a C++ programmer and have been doing it for nearly 30 years. I've only once had to use valgrind to find a leak (and it wasn't in my code) as I do everything with RAII. Git gud, faggot.

CANCER

lol kys grandpa

...

How could you then programmer an interpreter for your language in your language?

You are retarded.
Pointers are perfect for what they do. You should be careful though, as C assumes you know what you're doing.


Definitely retarded.
How would you program a desktop PC game with assembly? is there some way of doing it without spending months / years writing stupid subroutines?

You better hope I do. Your packets likely are going through it.

you are not fooling anyone

Pointers are a mixed bag. Numerical folks used fortran instead of C for a very long time because of how aliasing made it impossible for C compilers to optimize as tightly as fortran compilers. They only abandoned it when they moved to CUDA. As a former assembly prorgammer, it's always frustrated me that there's no way to communicate to the compiler when I know there's no aliasing and instead I have to dick around with objdump whenever I need to make a really tight piece of code. 'restrict' helps a little but it's a band-aid on a gaping wound.

Test me. I do networking in Linux. If you've got questions no one's usually able to answer, go for it.

...

Adorable.

how do i poop without having to wipe? you know like dogs?

you claimed that you are hot shit. the burden of proof is you.

what is network endianness?
what is an octet?

Byte order and byte size. The eternal mistake of having designed internet for big endian..

what is a socket?

That's not the only cancerous part.

What do you mean? Everything is implementation specific/undefined behavior.

Representation of an open connection. Has buffers and locking, and the locking causes a lot of trouble. People writing UDP servers often run into an unexpected bottleneck where using the same receive socket (as you do for multiple 'connections' with UDP) from multiple threads kills performance. On other OSes the solution here is to tell the client to use a different port and create a new socket for it. On Linux, you can make use of the fact that sockets do a longest match similar to iptables and you can put multiple sockets on the same port.

I know these and I've very little experience.

Don't you have any interesting questions? I can answer all sorts of deep and juicy things no one can normally answer.

Why aren't all of socket's functions their own system calls instead of needing to be accessed through the socket system call?

It was an ancient UNIX decision that happened before I was alive but it's generally a pain in the ass to create a new system call as you not only need to reserve a slot for it (which is a pain in a patchy kernel like Linux as they don't reserve slots for anything outside of mainline, so you'll have to deal with patches causing conflicts requiring rebuilding your whole firmware) but you also need to add bindings so you aren't doing a raw _syscall(). It's much easier with setsockopt() as the interface doesn't have to change to be able to pass a different kind of message. I have a few custom messages as patches against the TCP stack to dump some internals we use to predict arrival time and it didn't require changing any API.

...

C++ is meant to be generated
if C is "high level assembly language" then C++ is "high level assembly language with more opcode/instructions shoved into it"

All you should care about is correctitude unless you're making a heuristic algorithm.

idiomatic haskell is NEVER fast. all the "as fast as C" benchmarks are written in some awful style to cheat and get optimized code, not the way a normal programmer would do it.

How does Ada perform compared to C?

REEEEEEEEEEEEEEEEEEEE

basically SML without the autistic broken concept of a programming language being written in ASCII or utf8.
t. guy who already half implemented this 3 years ago

golang.web.fc2.com

But it won't werk reliably I guess. Still, interesting to see if some smart ass manages to make something useful with AI.

This is horse shit.
Show me proofs, if you can. (but I know you can't)

What the fuck am I reading.jpg

That's the point I were making. Doesn't look like the ideal language because the ideal language obviously shouldn't be worse than C for drag racing.

Idris.