LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PNFHA: Is it High Level, or Mid Level? (https://www.linuxquestions.org/questions/programming-9/pnfha-is-it-high-level-or-mid-level-4175603073/)

des_a 04-17-2017 12:52 AM

I realized that there is a little more to be said here as I'm documenting.

des_a 04-17-2017 12:55 AM

In the code:
Code:

var i;

print "Enter a number: ";
read number i;


switch (i)
{
 case 0: {
  println "Too small!";
  break;
 }

 case 5: { println "Good job!"; // Fall through...
 }
 case 4: { println "Nice pick!"; // Fall through...
 }
 case 3: { println "Excelent!"; // Fall through...
 }
 case 2: { println "Masterful!"; // Fall through...
 }
 case 1: {
  println "Incredible!";
  break;
 }


 default:
  println "Too big!"; 
}


end 0;

This will work at compile time.

This:
Code:

var i;

print "Enter a number: ";
read number i;


cswitch ( load %accumulator variable i; )
{
 ccase load aload 0;: {
  println "Too small!";
  break;
 }

 ccase load aload 5;: { println "Good job!"; // Fall through...
 }
 ccase load aload 4;: { println "Nice pick!"; // Fall through...
 }
 ccase load aload 3;: { println "Excelent!"; // Fall through...
 }
 ccase load aload 2;: { println "Masterful!"; // Fall through...
 }
 ccase load aload 1;: {
  println "Incredible!";
  break;
 }


 cdefault:
  println "Too big!"; 
}


end 0;

...Will work at run time. This is another example of the pecularility of this language I want to note. It was still by design as a feature. However, the way the language makes you make use of it, and the act of coding it and what you need to think about is kind of pecular...

des_a 04-17-2017 01:02 AM

While this is certainly pretty much as easy to code in as some high level languages are that exist, it's weirdness makes me decide that I will probably put as many features in this as I can, document them, but then create another language with the same general feel, but without the weirdness in it. I will have it compile to this language. This will somewhat be part of the standard tools I provide (or possibly options), with my interpreter. Maybe separate it into run time componenents and development components like Java? Anyway, the best practice with what I include will be to code at the highest level possible for your project, and eventually, as I include more languages, choose the best language for the job. Then, you can "tweak" at all the lower levels if your program doesn't quite work or do as you desire, including at the lowest level possible. The act of "tweaking" is made very easy comparatively to other lower level languages. This will eventually be very good for an OS programmer.

des_a 04-17-2017 01:11 AM

My eventual goal is to create the language I call English-Like, which is essentially a subset of real English writing, though it's more of the formal kind. As soon as this is possible, it will really be my killer app, and will probably revolutionize programming. If you could eventually create a program with your voice, or with the keyboard and know it would be valid English, though a specialized form of it, why would you ever actually mess with other programming languages again? Except, of course, to meet the computer in more of the middle, and "tweak" your program. The high level languages are designed to use for more of the computer meeting YOU in the middle. But you can meet the computer at any level you wish to. Nobody has done this before, but I can do it with my simple algorithm that I have been able to create.

The problem, is that no languages yet exist to make this algorithm possible. Welcome to part of the purpose of creating these languages! At a later point than the first release, you will be able to code an entire OS in it. I have to learn more about OS programming itself to make this possible though. I hope these possibilities excite everyone!

astrogeek 04-17-2017 03:34 AM

Most programming languages share common characteristics for some very good reasons.

One is that, without a very clear reason for doing things radically differently, and an equally clear advantage that derives directly from that difference, new languages must allow programmers to use or easily adapt their existing skills or the new language will meet with little adoption.

Another is that the underlying hardware imposes some obvious templates, types and sequence paradigms on all languages which must produce code to run on it. At the most basic level, organization by various registers, instruction sets and mapped memory and I/O addressing are pretty similar across the board. Until there is some fundamental shift in the underlying physics of computing technology, that is not likely to change, and results in similarities up through the levels of languages.

Introducing things peculiar to existing concepts and technology is potentially an exciting way forward, but it must have very sound fundamental reasons for the peculiarity, clearly expressed. If you have such fundamentally new concepts, then I would think the emphasis should be on documenting and communicating the concepts themselves, more-so than on writing code. In other words, tell us why it is peculiar and why that is a good thing, not how it is peculiar. Once the concepts are communicated and understood the code will more or less write itself (metaphorically).

You clearly have some ideas which you have put much effort into developing over a long period of time, and for which you make some bold claims. But as someone who has participated in your threads here for some time I must say that I have not been able to understand much about those ideas at the concept level. That is surely due in no small part to my own shortcomings! But if you want others to understand and adopt your ideas, I am exactly the sort of ordinary computer user that you will need to communicate those ideas to.

As I have suggested before, I would strongly urge you to make use of your blog space here on LQ for the purpose of documentation, and use the forums more for specific questions which have an "answer". The blog space would allow a free-form means of writing, organizing and maintaining both the concept documentation and the implementation notes without the restrictions imposed by forum rules.

You can find your blog space through a link in the right sidebar of most pages here on LQ, titled My Blog. If you need help getting started with it, please post questions to the Questions and Feedback forum.

A few pages of well written revolutionary concepts would be well subscribed, I am sure!

I would suggest that you start with a single core concept on which others are to be built. Explain it in the clearest and simplest terms possible, in a single document or place which you can update as required. Then, once you can see that your audience has grasped that concept, place the next brick on that foundation, with the same simplicity and clarity. Before long you will have a self-supporting superstructure of concepts and sufficient understanding among others to begin to build some real excitment!

Good luck!

des_a 04-18-2017 08:04 PM

Quote:

Introducing things peculiar to existing concepts and technology is potentially an exciting way forward, but it must have very sound fundamental reasons for the peculiarity, clearly expressed. If you have such fundamentally new concepts, then I would think the emphasis should be on documenting and communicating the concepts themselves, more-so than on writing code. In other words, tell us why it is peculiar and why that is a good thing, not how it is peculiar. Once the concepts are communicated and understood the code will more or less write itself (metaphorically).
Okay. In the code with the switch statement, I'd made two versions of the switch almost by accident, but left it in because they both have their uses.

The regular switch statement acts on the switch at compile time. This was not what I origionally meant to do, so I wanted to change it, thus the cswitch statement was born. But I left it in because it has it's theoretical uses in some programs, just as C++ left goto in because it has it's uses. The reason the switch statement and anywhere you put an expression only works at compile time, is because the compiler keeps track of it's state, but there is really no way to communicate the state information to the lower levels for it to make use of that state as well. It will essentially generate some code, but the code it generates is figured out all at compile time and put in as a hardcoded figure as there's no way to communicate the changes in it's state to the lower level. But it has it's uses and although I can't think of a specific example where you'd want to use it, there is some uses for it out there yet to be discovered. The use of the cswitch statement is more obvious. You'd know why you might want a switch at run-time.

However, to make the cswitch statement work okay, I had to change the basic syntax from "expression" to "stmt", and allow more statements to be made in it. Then it worked okay. You can use an expression with a cswitch if you want, because an expression is a stmt, but it would be inadvisable to do so, unless that's really what you want.

It was unfortunate, but true that when I use a stmt instead of an expression, it adds some strangeness into the syntax of the language. I'm actually unhappy with this, which is why I am still developing this language, but will probably create another level at which the same things are possible, but the strangeness is gone and the syntax is straight forward. Unless I add two parsers and two scanners into the program though, I have to have two separate programs, and effectively two separate languages. But unless I use two parsers in some way or another as well as two scanners, the syntax is too complicated to create with bison and flex. It'd be even more of a nightmare to describe it in C++, however.

Nevertheless, there are some things I want to do with this language and fully develop it before I move on to that next level though. As it works okay, I could always if I was ready for it at that time, distribute just this much when it's ready enough, and then users could get used to using it before I add more capability and back out of the weirdness.

Ideally, I want it to feel natural to program in my language at the highest level. However, I want it to have different and better features than C++ has itself, or I wouldn't be creating a new language in the first place...

des_a 04-18-2017 08:21 PM

One of the compelling features about this language, is like C++ and really like C, it was developed with a general purpose attitude in mind, but with a bias toward system programming, namely, in this case, OS programming. I'm trying to make the basics of a language in which I will be able to write an OS, and I know some about what the OS I have in mind will be like. The OS will be different from any other OS out there so far. I am also trying to make it possible to create a new type of computer, which I could get built by asking for help from someone such as Dell, which will be designed for running my new OS, but configurable enough for other OSs to be written for people who want to write them. It will be based off of the PC archetechture, and I will call it (so far), the PNF-PC. It will be exactly like the PC, except for it will be coded to always boot from a USB port inside the computer, which will contain by default a SD or micro SD card reader, which by default will contain a card with my PNF interpreter on it's boot sector, which will be a standard PC operating system. Then it will not only provide that interpreter, but will be configured to boot a PNF operating system, which will be what I call the PNF-BIOS. That will be responsible for using the PNF language and interpreter, to boot a real operating system from any disk, in the same manor as the PC already does, except for it will boot it in the PNF language instead of ordinary PC machine code. Then I'd write an OS to use for it.

Where the higher level languages come in, is they make it easier to write PNF code, which you can then, "tweak" in the lower levels to make the program you want to really create.

Each level of language that goes upwards, will allow you to do all the stuff the lower level can, plus more. That is why there is a little weirdness as well. C doesn't allow you to do everything the machine can do, nor does C++. Java doesn't even allow you to do everything the bytecode interpreter can do. But my language allows you to do everything that the lower levels can do, plus some more.

des_a 04-18-2017 08:23 PM

Quote:

You clearly have some ideas which you have put much effort into developing over a long period of time, and for which you make some bold claims. But as someone who has participated in your threads here for some time I must say that I have not been able to understand much about those ideas at the concept level. That is surely due in no small part to my own shortcomings! But if you want others to understand and adopt your ideas, I am exactly the sort of ordinary computer user that you will need to communicate those ideas to.
I'll keep on trying to make these ideas clear to you and others like you. Tell me if I can make anything clearer that I have already stated. Tell me specifics on what you need to know...

des_a 04-18-2017 08:25 PM

Quote:

As I have suggested before, I would strongly urge you to make use of your blog space here on LQ for the purpose of documentation, and use the forums more for specific questions which have an "answer". The blog space would allow a free-form means of writing, organizing and maintaining both the concept documentation and the implementation notes without the restrictions imposed by forum rules.
I'll check it out. I'll first try to figure it out for myself, but I'd want it to be some sort of interactive blog. I didn't mean to be bloggy like in this forum. There is an answer for this question, and it'd had been answered until I had some new information. But perhaps since it is turning out to be bloggy like I could attempt to continue it in my blog. I have some other blogs, but they don't have the community that this has...

des_a 04-18-2017 08:27 PM

Quote:

I would suggest that you start with a single core concept on which others are to be built. Explain it in the clearest and simplest terms possible, in a single document or place which you can update as required. Then, once you can see that your audience has grasped that concept, place the next brick on that foundation, with the same simplicity and clarity. Before long you will have a self-supporting superstructure of concepts and sufficient understanding among others to begin to build some real excitment!
I'm not quite sure what you mean. Please explain while I check out the blog.

des_a 04-18-2017 08:27 PM

I'm going to check out the blog now.

des_a 04-18-2017 08:28 PM

If anyone has any more opinions that this generated, please tell me and I'll try to take them into consideration too. But I'm going to check out the blog as well, and possibly continue this there.

des_a 04-18-2017 08:38 PM

I tried out my blog and learned a bit about it. I want to transfer this discussion there, and make it more general. It looks like it is interactive, like this, and might have the same community.

des_a 04-18-2017 08:40 PM

The blog can be found here: http://smileynetmain.createaforum.co...questions-org/.

des_a 04-18-2017 08:44 PM

Marking as solved. For any more discussion, see my blog. Please answer the questions there and we'll start ourselves a discussion for those interested, which I hope are a few people at least. We can use the comments for feedback. If however, I have a general question which has a definite answer, like I need some coding help, then I will use the forum instead of the blog and will await a response, including if I need to know about how to code this language. Thanks and sorry if it took awhile to get good enough socially and programmatically to understand some of the responses I was getting!


All times are GMT -5. The time now is 10:11 PM.