PNFHA: Is it High Level, or Mid Level?
I've been considering something a lot. Is my language that I've been working on, PNFHA, really a high-level language, or is it more like a mid-level language upon which a true high-level language should be built? I can give examples, if needed. But what I find, is that the best practice so far when coding in it, is to think a bit about both what is happening in your code, and what's going on a the level below it (PNFASM).
|
Where's the language reference for this?
|
Quote:
In my vernacular (which ordinarily doesn't spend too much time thinking about such things ...), a "low-level" language would be "assembler," and a "mid-level" language might be something that is really intended only to be generated by another compiler. (Java's intermediate language, PostScript, and less-known tools such as NME and Lua all come to my mind.) A "high-level" language would be intended for use directly by humans. And there certainly would be cross-overs. "C" was a language that was expressly conceived for the implementation of Unix® at Bell Labs. It supported an asm {...} construct that allows assembler code to be directly inserted, and most but not all subsequent implementations carried-on that tradition. Unix was therefore one of the first operating systems – if not the first – that was implemented in a high-level language. All of these terms are, frankly, "too vague to be very useful," except in a very colloquial way. Your observation of the need to be aware of what is going on "in your code and in 'the level below it'" is very prescient. Always keep this firmly in mind. "The level below it" of course may not or may not directly be "the hardware." |
Unfortunately, I can't remember the example I was thinking of anymore. I'll have to see if I can find it again as I go along.
|
Maybe I'd fixed it?
|
Here is some code that I think begins to show you what I mean, but wasn't the example I was thinking of:
Correct: Code:
var a = 5; Code:
var a = 5; |
Output from the above correct code:
Code:
a = 5 |
Syntax of this language:
Code:
Portable Numbers Format High Level Language A (PNFHA) |
That is straight from my documentation.
|
The original problem I was thinking of stems from the fact that a variable is just a construct in the compiler and can't always update the variable which results in PNFASM. Maybe however, it really is a high-level language. Certainly I'll build on top of it more later though...
|
The syntax listing does not really help us understand what the language actually does. Imagine trying to understand how to use C beginning with only the BNF syntax listing!
You have posted many times about your PNF language, and I have tried to understand much of it, without success. Because you are the author of it and the sole source of information about it, it is really up to you to help us understand its purpose, applications, advantages over other languages, etc. What would be helpful would be a short introduction to the language, to which you could refer when asking questions about it. If that would be very lengthy, I would suggest that you use your blog space here on LQ to build up a useful set of documentation which you, and we could refer to as needed. For example, what does "Portable Number Format" actually mean with regard to your language? What problem does it solve? How does it compare to other languages? You have stated that it is better than Java in some sense. How so? What advantage does it have in such a comparison? How exactly are PNFASM, PNFHA and PNFPP related to each other, and to the problem area of interest? A simple language description and a few very simple, specific and well written examples would go a very long way toward helping others understand its purpose and use. Without such a reference point it is very difficult for others here to offer advice or help, or even to understand the questions and examples. So before posting more lengthy threads about PNF{ASM,HA,PP,etc.}, I would ask that you please devote some effort to providing useful answers to the above questions, some easily accessible language reference docs, and some simple, useful examples of how it may be used to solve some specific, simple test cases. That will allow others to provide answers to your own questions, and help to keep the information in these threads more useful to you and to others. |
I'll try to answer some of your questions here:
Quote:
1. A signature: "!@.PNF" * Like a Windows program, that starts with "MZ", it can help tell it apart from another type of file. 2. The numbers: It uses C++ doubles as defined by my compiler. Whitespace doesn't matter, but it makes sense to logically arrange them in a good order. * This was why I used C++ to create this part, and NOT a compiler compiler. A compiler compiler would have complicated the algorithm for loading the file. C++ makes it easy. First load the signature, which is a String. Then load the numbers, which are doubles. This seems to be part of what makes it comparable in speed to Java bytecode. If it's slower at all, it's not noticeable. * The "numbers" consist of an instruction, a type, and an opcode. The opcode may be longer than one number, if it's a string. Usually, but not always, the type and the opcode type match each other. There are 5 types: * VOID * BOOLEAN * NUMBER * CHARACTER * STRING These are built in types basically. Numbers are all the same precision. Quote:
It will eventually make programming and creating operating systems easier. I will write a real OS, that is a PNF interpreter, later, when I have the skills. Then you can make an OS by using these languages. I'll provide a standard OS, which I want people to use. But I really want to see creativeness out there for programmers as well, so that the average programmer can create an OS with little effort. Bootloaders and everything. I'll make ways to allow it to be native, if the programmer desires it to be, possibly for a higher fee. Quote:
Quote:
Later when voice recognition becomes more standard, a version could be written on, let's say Alexa, that would allow you to use words using your voice to type an "English Like" program, which you could then compile and run on your PNF interpreter. And like always, you can compile that to an actual executable. Quote:
|
This page is just meant to be a discussion of whether PNFHA is high-level or not. Also a sort of informational thread about the language, but mostly the first. It is not meant to solve an actual problem.
|
I'd expect that the first version will flop because even though it's really powerful, it's not powerful enough for my users yet.
|
The first non-textbook and non-test program, I will write in this new language (suite of languages), will be itself re-written in itself. But it can't do that yet. That is how I know the higher level parts are working. When I can do that, the higher level parts are working. It's probably possible, if I wanted to use the lower levels, but even though they're easier to use than other lower level languages, they are still lower level languages, and that act would be crazy. So I need the higher levels to work first before I work on the code for itself.
|
All times are GMT -5. The time now is 09:21 AM. |