Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

.

Name: Anonymous 2012-02-03 21:40

There are no good C-like interpreted languages, /prog/. I plan to design a new language with the following features:

* C-like in syntax
* statically typed, not dynamically typed
* strongly typed, not weakly typed
* interpreted in the main implementation, but compilers are possible
* functions are first class objects
* classes, none of that duck typing shit
* basic data structures like vectors, lists, etc. are included, unlike in C
* templates for generic programming

Name: Anonymous 2012-02-03 21:47

Feel free to comment along the way as I ramble about various ideas for the language.

Types

In C, all the basic integral types are defined as a certain minimum of bits or greater (e.g. int is defined as a signed integer at least 16 bits wide). In this new language, all the integral types will follow the C99 fixed types convention, without the _t. That is, int8, uint8, int16, uint16, etc.

Floating point types will be named float32, float64, etc.

I might choose to include things like static storage duration and other variable modifiers like in C. Everything is on the heap though, and garbage collected.

Name: Anonymous 2012-02-03 21:49

check 'em

binary dubs

Name: Anonymous 2012-02-03 21:49

So basically, it would be like the worst of both worlds?

Name: Anonymous 2012-02-03 21:49

Initialisation

Like hosted C executables, the code that is run at the start is put in a function, which must be named main and must be of return type int16.

Name: Anonymous 2012-02-03 21:49

>>4
Worst of which worlds? Why is it bad?

Name: Anonymous 2012-02-03 22:01

>>1
good luck with that!
Here is a challenge, invent a platform independent alternative to typing.

Name: Anonymous 2012-02-03 22:02

>>5
int16
Just fuck off. You know nothing about programming languages and you'll never be talented enough to implement one.

Name: Anonymous 2012-02-03 22:04

>>7
Typing is more than just integers and floats though; classes 'are' types too.

Name: Anonymous 2012-02-03 22:06

Strings

Strings are not the abomination in C that are 'pointers to int8 terminated with a zero-value int8'. Rather, they will be essentially 'vectors of int32', storing unicode codepoints. Vectors store the length separately.

Name: Anonymous 2012-02-03 22:11

Pointers

Pointers will be included in the language, and will work with the same syntax as in C (one or more asterisks after base type for declarations, prefix asterisk to dereference, prefix ampersand to reference). However, because this language is higher level, pointer usage will be more restricted. That means no pointer arithmetic, and no casting of integers to pointers.

Name: Anonymous 2012-02-03 22:15

Why static, strong and require explicit declaration?

To be as far away as Python, et al. Without static typing, type errors only get thrown when the code is reached in runtime. Without strong typing, all sorts of type bugs occur in sloppy code. Without explicit declaration, a variable name typo goes unseen.

Name: Anonymous 2012-02-03 22:16

Pointers without arithmetic are just handles.

Name: Anonymous 2012-02-03 22:16

>>13
Yes. Is there a problem?

Name: Anonymous 2012-02-03 22:17

The aim

The general aim of this language is to create a language that is loosely inspired by C in only the good areas, adding only the good things from sepples, as well as fixing some of the shittiness of C that makes it unsuitable for modern applications, such as C strings, the lack of generic programming, and the lack of simple data structures.

Name: Anonymous 2012-02-03 22:18

Also, the C standard library is shit.

Name: Anonymous 2012-02-03 22:22

You're a fucking retard.

>>16
No it's not, it's a great standard library, you're shit.

Name: Anonymous 2012-02-03 22:24

>>17

durr, I'll just call the OP a retard
There aren't any good interpreted languages outside of Lisp and its descendants.

Name: Anonymous 2012-02-03 22:25

>>17

[C has] a great standard library
ahahahahaha, oh wow.

Name: Anonymous 2012-02-03 22:32

just use perl

Name: Anonymous 2012-02-03 22:33

Interpreted directly or going through a bytecode VM?

Name: Anonymous 2012-02-03 22:34

>>21
I am not sure at the moment, but I think it would be possible either way, and depend on the implementation. Which would you prefer for the canonical implementation, and why?

Name: Anonymous 2012-02-03 22:34

Wow, OP. What a great spec. You got some really big words in there like "syntax" and "statically".

Nothing about dynamic or lexical scope, closures, continuations, co-routines, dynamic dispatch, higher-order functions, modules, functors or monads, but you're off to a great start.

I mean "pointers", that's just WOW.

Name: Anonymous 2012-02-03 22:37

>>22
I would prefer bytecode interpreted, but mostly because I'm in the middle of writing a bytecode VM.

Also, a nice feature would be type inference. Then people might actually see some form of advantage over the more mature, more widely used, faster, yet more verbose C. Who cares if it brings it closer to Python, this is one of the reasons Haskell is so powerful; it is statically typed by inference makes it so much easier.

Name: Anonymous 2012-02-03 22:39

>>23

Your sarcastic and foolish response depends on the false implication that my posts constitute a 'spec'. These are just merely ideas that I'm throwing around. Now fuck off.

Name: Anonymous 2012-02-03 22:40

>>24
I agree on both points.

Name: Anonymous 2012-02-03 22:46

Embedded-C with respect to a microcontroller's architecture is sort of like having a unique language. I've worked with PICs and the language you write has to have knowledge of the arch.

Name: Anonymous 2012-02-03 22:47

>>25
Ideas for a shitty language that will--by the grace of god-- never exist?

Name: Anonymous 2012-02-03 22:48

A wise man once said ``If a programming language doesn't make you think about programming in a completely different way, you shouldn't learn it''.

If you don't make this language worthwhile, op, it will die extremely fast. Emulating C, even with improvements, is not enough to attract users (even if that's not exactly what you're intending to do).

Name: Anonymous 2012-02-03 22:48

>>28
Why is it shitty? Why will it never exist?

Name: Anonymous 2012-02-03 22:50

>>29
That's a good point. However, while Lisp does make me think about programming very differently, I don't think everyone should need to learn it.

Name: Anonymous 2012-02-03 23:01

>>31
No one mentioned Lisp. Plenty of languages have this effect, from Smalltalk to Haskell, which is why they are notable.

The reason why C is notable is because of it's no bullshit approach to memory handling; malloc and free (And their accompanying helper functions) do everything you need and fuck GC. You're taking C and making it high-level; will it still have the complete control? No, no matter how you handle variables, there will still be some functions and wrapper structures between the language and the machine, so the control, at least to the extent it was before, is gone. Taking the advantages of low level and leaving them out leaves only room for advantages of high level, which had better be worth it.

Name: Anonymous 2012-02-03 23:01

check them

Name: Anonymous 2012-02-03 23:10

>>32
So you're basically saying that if I take C, and retarget/adapt it to be more suitable for application development, then all the things that made C great have been washed away?

Name: Anonymous 2012-02-03 23:17

>>34
>more suitable for application development

Why? Because it's slower, has GC (presumably) and has no GUI toolkits (yet)? Although I do suppose the lack of a compile cycle will be a definate benifit.

I don't mean it can't be good or better than any alternative, but I am failing to see enough benifit to use it.

Wow me.

Name: Anonymous 2012-02-03 23:19

>>35
Development time. C doesn't have generic programming (emulating it through void pointers or the preprocessor is disgustingly bad), data structures (who wants to keep implementing vectors, lists and trees over and over again?) or decent string manipulation.

Name: Anonymous 2012-02-03 23:20


Features of this "C-like" language that are actually like C:

* C-like in syntax
* statically typed, not dynamically typed
* strongly typed, not weakly typed
* interpreted in the main implementation, but compilers are possible
* functions are first class objects
* classes, none of that duck typing shit
* basic data structures like vectors, lists, etc. are included, unlike in C
* templates for generic programming

So use Java.

Name: Anonymous 2012-02-03 23:22

>>37
. . . Did you just fail at saging?

Name: Anonymous 2012-02-03 23:22

>>35
I don't see what your argument is. You obviously failed to understand that "C-like" is a weak connection in syntax only, just like PHP is "C-like".

Name: Anonymous 2012-02-03 23:24

>>37
But Java is disgusting

Name: Anonymous 2012-02-03 23:26

>>36
All of these problems have been fixed over and over again. C doesn't have them because that's not what C's for.

Name: Anonymous 2012-02-03 23:28

>>39
>Wow me,

This is a decent argument. Give a reason why this language deserves to exist.

Name: Anonymous 2012-02-03 23:33

>>42
There are many languages which do not 'deserve' to exist: JavaScript, PHP, etc.

Name: Anonymous 2012-02-03 23:39

Check my doubles.

Also, they only way to improve C would be to have anonymous functions. Anything more would make it worse.

Name: Anonymous 2012-02-03 23:40

>>44'
>C11

Name: Anonymous 2012-02-03 23:41

>>2
Everything is on the heap though, and garbage collected.

and this project is shit already

Name: Anonymous 2012-02-03 23:50

>>36
emulating it through void pointers or the preprocessor is disgustingly bad

Welcome to higher-level languages

Name: Anonymous 2012-02-04 0:02

>>1
static strong typing is a guarantee to flamboyant failure. fuck off and die.

Name: Anonymous 2012-02-04 0:09

Also, C syntax is like dicks made of shit to parse. You're begging for a slow, buggy parser.

Name: Anonymous 2012-02-04 0:09

>>48
Ahahaha, oh wait, you're fucking serious? AHAHAHAHAHA

Static strong typing is the only way to go for robust, reliable programs. JavaScript, PHP and Python are the opposite and look what have come out of them.

Name: Anonymous 2012-02-04 0:10

>>49
That's sepples syntax, not C.

Name: Anonymous 2012-02-04 0:35

>>51
They both can't be parsed by LL(0)

Name: Anonymous 2012-02-04 0:44

>>52
That doesn't make C difficult to parse. C is one of the easiest languages to parse.

Name: Anonymous 2012-02-04 1:14

>>53

umeana lisp?

Name: Anonymous 2012-02-04 1:18

>>53

typedef is kind of a bitch.

Name: Anonymous 2012-02-04 5:04

Name: Anonymous 2012-02-04 6:48

This is stupid, fuck off back to /g/ you stupid piece of shit.

Name: Anonymous 2012-02-04 6:49

>>55
So you think typedef makes C hard to parse?

Tell me, are you currently attending "special education" for those with "special needs", and I'm not talking about the good kind of special either.

Name: Anonymous 2012-02-04 6:57

reading [some] C declarations is hard
typedefs to the rescue! of obscure pointers to functions returning pointers and receive some data and function pointers that return pointers.

Name: 59 2012-02-04 7:04

ret_type* (*func_pointer)(data_type*, ret_type* (*)(data_type*))

becomes

typedef ret_type* (*transform_func)(data_type*);
typedef ret_type* (*map_func)(data_type*, transform_func);

map_func ptr;

Name: Anonymous 2012-02-04 7:50

There's Vala >>1. Vala is pretty good, and it's just like you want your language.

Name: Anonymous 2012-02-04 10:29

Static typing has no future. Even Haskell has failed.

Name: Anonymous 2012-02-04 11:32

>>61
You mean the hack-job of a language with no spec of anything, just a bunch of shitty tutorials, and whose entire design and the whole idea behind it is "let's mostly, but not exactly, copy C# but make it generate C code and use the bullshit GObject system behind the scenes"?

Name: Anonymous 2012-02-04 13:12

All but
interpreted in the main implementation
can describe C++. Yes, you can even have functions as first class objects in C++11... but they're not first class objects by default. You have to use some shitstain syntax to make them.

Name: Anonymous 2012-02-04 14:40

>>2
You're describing Go there.

>>1
Check out Limbo. However, it doesn't have classes, thank fuck.

Name: Anonymous 2012-02-04 14:45

>>44
GCC C

Name: Anonymous 2012-02-04 15:11

>>62

ok. Now say that to a medical device manufacturer.

Don't change these.
Name: Email:
Entire Thread Thread List