My Programming Language

Aus Franky
Version vom 19. Januar 2014, 21:33 Uhr von Franky (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche
Dieser Eintrag ist unfertig. Komm lieber später nochmal vorbei.

Somewhere I read[1] everybody should design his own Programming Language. Implementing a compiler is optional, but at least design your own. I will follow this path, because, on a theoretical level, I am not content with the existing programming languages.

This article will only be an exercise. I will not implement a compiler, my definition will not even be complete. Skip forward to my objectives and you will see that they are unattainable for a single man. If I somehow won a billion in the lottery, I would hire a bunch of people to implement, market, maintain and optimize my language. I don't know how much Sun invested in Java or Microsoft in C#, but should I actually have too much money, I and my needs come first before such a stupid thing as designing another language. A successful language (success measured by market share) would be expensive, but there is another reason against it: It is too much fun. Last time I wanted to write here, I got lost at http://www.lambda-the-ultimate.org . I could not find the article again which presented a conservative estimate that over 2600 programming languages were created since the beginning of programming languages 50 years ago. That is one language per week and a less conservative count yielded thrice as much languages. Yes, many people created their own languages and I definitely cannot compete. Anyway, I allow myself to dream and present my wishlist.

Outline: My experience, influences, leads to Objectives.

VORBILDER

Scala, Haskell, (Java), C-style efficiency, fortress, lisp, eiffel

Abilities of syntax tree vs. notation. if, functional if ?:

influences

tim-popl

Objectives

  • reduce boiler-plate
  • static analysis, catch errors early.
  • what cannot be
  • read- and understandability. fuck off hackers with your smart, compact one-liners. I agree there is no need for a discipline&bondage-language when you program alone. Especially for you smug hackers I want restrictions. I've been in the land of self-modifying assembler, I squeezed out every byte in C64-Basic etc. Do you want to read the code where I carefully choose one-character variables to save memory? C64 had no local variables, there are no more than 26 distinct variables in code, but sometimes the character does not match the semantic at all. I take it for granted that you do not want to see my self-modifying assembler code with the burden to change its functionality.
  • performance
  • no null pointers. or better: no invalid references. Identify empty list with null. related to do-while vs. while: while can go with zero iterations, do-while needs one.

Details

(shift following sections to subsections?)

Programming by Contract

  • for optimization
  • variable type is just a contract.

only compiling?

need a detailed report which contracts could be verified statically. An intermediate report is uncommon. I should really have a look at automatic provers etc., I am sure a report

Variables

Either

  • pointer to a typed value
  • a (type, value) pair

This is restricted too much. A variable has many orthogonal properties:

  • value
  • algebraic type (integer, real)
  • storage type (string null terminated or pascal string?)
  • unit (feet or meters? user input string or SQL-escaped string?)
  • immutability?
  • locality (method, thread, process, machine)

Objects alone are not enough. There are too many combinations.

Too many combinations will make a transparent assignment of Immutable null-terminated ASCII user input string to a mutable UTF-8 SQL command string way too complicated to implement.

Footnotes

  1. A comfortable thing when writing a blog as opposed to writing something scientific: I do not have to back up every statement. I can safely say “I heard something somewhere” without the burden of a long research which often leads to reading someone else (or many others) instead of just writing what I want to say. The reader can decide for himself whether he accepts or refuses the premises.