Author Topic: I'm working about a new scripting language right now...  (Read 5513 times)

0 Members and 1 Guest are viewing this topic.

Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
I'm working about a new scripting language right now...
« on: Mon, 26 November 2018, 15:21:20 »
Hi, first of all, I beg your mercy for my bad English... This is not my native tongue.

The reason of this topic is that I'm working about a new scripting language (under Linux), and I think it is useful to talking about it with somebody other people, because this conversation gives me many advantages. Fist of all, I can practice my (broken...) English... It is very useful me because the fact is that I'm ashemed of my Tarzan-style...
On the other hand, my scripting language is "designed" for my own usage primarily, however I think it is good if I take my eyes to viewpoints of others, because "many eyeballs"...
Naturally, this language will be opensource, so I'll share it when being finished, but first of all, this is an one-man-project, so to that time (being finished) I'll not upload it to github or any another place! I'll not share it "early"! This is my hobby, so my aim is now nothing else than talking about the syntax, the keywords, the things like how it can support the OOP-style programming or another programming philosophies, how it is the best to handle the problems with the "dereference" of variables; what thing do you like and hate in the existing languages, how many basic types is useful to be supported by a scripting languages, and so on.

Thus, I do no need ANY help of true/proper programming! The toolchain is already ready, finished.  (The toolchain: my own programs/functions/libs in order to help me in the tokenizing process. etc).

The reality is, that I ___have been created___ even more (more than half dozen...) new scripting languages for the time being, and each of them is WORKING, and most of them aren't slower than the Python, the fact is that even faster in many benchmarks! So, I am a well-practiced guy in the theme "how to create a new scripting language". Well yes, this was one of my main hobby in the last 5 years... The only one/single problem is, that I am not satisfied with the SYNTAX. In the most cases my language (the source written in any my language) is far worse than the Perl, so, not really "human readable". Finally I got the idea maybe it is advisable to talking about it with somebody else...

However I'm a little afraid too, because my bad English knowledge, and because a scripting language cannot be what(so)ever. There are different requirements against a language, and some of them are conflicting. I have many, many sad experiences about this...

So, is there somebody being interested in this theme?




Offline Findecanor

  • Posts: 5036
  • Location: Koriko
Re: I'm working about a new scripting language right now...
« Reply #1 on: Mon, 26 November 2018, 22:45:20 »
Welcome to Geekhack! While this forum is more specifically about keyboards (tool used by geeks and "hacks") I think there are many programmers here who could have opinions about your language. ;)

I have created a couple languages myself in my time, and I'm a stickler for good syntax and clear concepts, so I'm itching to read your descriptions of it and see some examples.

BTW. I've asked a moderator to move this to the "Other Geeky Stuff" subforum.

Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #2 on: Tue, 27 November 2018, 00:58:05 »
Thank you very much for the reply and interestig! I have thinked about it to open this theme in the "Other Geeky Stuff" subforum, but I haven't been enough dare to do it because my language has actually none relations to the keyboards. (Hm, actually this is not perfectly true because I have a very special function in my toolchain in order to obtain the keyboard input under X without the echo to the virtual terminal... and it'll become a built-in feature in my language...)

I have been writing already the documentation about it, so now I can share with you (all) something, first of all my goals with it. Because the situation is quite strange: Actually I'm not a programmer, but author! My English webpage is:
https://haroldking.weebly.com/

There are already 3 downloadable books (at Lulu, after reg), all of them are free. They are in good English (so not in my Tarzan-like broken style...) because I have native publisher's reader... One of these 3 books is about my theory, that our World is just a computer simulation... But, the essence of my thoughts now is, that with the creation of my programming language I would like to support my literary goals! Here is the preface of my (coming soon...) documentation:

BEWARE! Usage of this programming language may lead to mind-injury or cerebral-death!

Preface to the English edition

Dear Reader, you need to know, that the native language of the author of this book, who is me, is not English, but Hungarian. So originally this book have been written in Hungarian, and then I got it translated to English by a translator, who is also a native Hungarian speaker.  Even though I believe that the translator did a good job, IT is not her field of profession; so the professional checking and editing has been done by me, whose “English is broken “. So in case you came across strange mistakes, please, just take it easy, considering, that the English version of the programming language and the book about it, both are available for free. Believe me, I feel embarrassed about not speaking English perfectly, and it cause me plenty of problems; but all I can do is hope, that the possible mistakes in the book will not influence understanding.

INTRODUCTION
UPU is an acronym for:
Ubiquitous Programming Utility,

which is the name of a programming language, and it also means a lot of other things...

Now that we know what it means, still there’s the obvious question: Why did I choose this one? Well, because I’m a writer, a science fiction author. I already have written a novel series of 50 stories, and although not all of it has been published yet, I plan to write more. In the story I’m working on right now, there is a galactic enterprise called UPU. Here the letters stand for „United Planets of Universe”, and of course it’s inhabitants’ language is English. The name of their enterprise is not a coincidence either; they are the remote successors of the present United States of America…

In my book they use this programming language, at least as an interpreter in the whole enterprise as a formal, state-approved programming language. As a matter of fact, to write programs in UPU is not an easy job; not as easy as let’s say BASIC, but they think it’s quite all right this way, because doesn’t everybody have to be a programmer. Only those should chose this field, who is really interested in programming and doesn’t mind to spend their time with learning, those who think that program efficiency comes before the programmers convenience. As a standard rule only this programming language can be used for state functions, including military purposes. A program created in a different language would not be accepted. If there is a very special reason, which would justify the usage of a different programming language, a committee will decide on whether it’s reasonable to make an exception, and whether the recommended language is reliable enough. So, to use anything else, than UPU involves a long bureaucratic procedure, that’s why it’s almost as rare as rocking horse crap. The reason why they do this is because they don’t want to get into vendor-lock-in and they love standardization because it improves efficiency. Only those are considered to be real programmers, who are familiar with this language. The best outcome for all the rest could be a “talented beginner”.

So, the name of this programming language is UPU, because this is the most commonly used, “formal”, “standard” language of UPU Enterprise.

If anyone has wondered about how this two hobbies come together in my life, the writing and programming, I simple can say: Why not? Both of them relates to CREATION. All my life I’ve been involved in both, either simultaneously, or alternately. Now, that I’m over 50, I can say that I couldn’t stick to just one of them, although I’ve spent more time with writing.

On the other hand: Programming is art. Science as well of course, but the bigger part of it (80%) is art. It's not contradiction, because what I think is mathematics itself is art from many aspects, and we can only call something art, if it has a scientific air around. Because artistry is nothing but, the reasonable assumption of scientific rules of an artistic subject that hasn't been fully discovered yet by exact science.

In spite of this, I can’t deny how proud I am of this programming language. Many writers have established their own artificial human languages to serve their novels or series, although mainly those languages can only function in a rudimentary level. Only a few of these are decently elaborated; the most famous of them is Tolkien. Maybe I don’t even have to say, that I have done this too: in my series there is a language, called “mau”, which is a nicely elaborated artificial human language. But I believe I’m the first writer in the world, who has created a whole functioning programming language for his story!

We may say that creating artificial human languages to serve literary purposes are not so exceptional; but a programming language to serve literary purposes is definitely unique.

There are programming languages made as someone’s “hobby”, these are called “esoteric” programming languages. Practically most of them can’t serve any serious purpose. Even though they are Turing-complete, the emerging difficulties, while work with them are unacceptable.

But UPU is usable; not as easy to use as common programming languages, but the difficulty of it has been compensated by the many advantages it offers. To work with UPU is not harder, than working with those programming languages, that were developed for advanced users. In my opinion, using UPU is not more difficult, than using FORTH, I’d even say it’s much easier. FORTH is not a trendy, but a widely used programming language, especially in embedded systems. Designing UPU besides the literary purposes had the aim of accomplishing something similar, than FORTH does. UPU was needed for writing the code for the operating system of an imaginary virtual computer, so practically UPU is the assembly language of that machine.

What the target audience of this programming language?
After reading the followings, you can easily decide, whether it’s for you.
I would recommend this programming language for those, who think similarly of IT questions as I do. Of course not the same as I do, but similarly in most of the subjects. So YOU, who are reading these lines now, the more of the below statements match with your conceptions, the better you can accept this programming language as your own. It may work, even if you feel it’s not quite like what you think, but basically you like this attitude, and would like to become something like that.

So let’s see it:

—You are willing to write a self-modifying program to spare 2 nanoseconds in a routine, that spends 999 thousandths of its time to wait for the input from the user; so obviously even 2-3 seconds would make no difference, not a couple of nanoseconds.
—You are capable of replacing a nice clean switch, which includes only 6 case branches to an array with pointers to functions, because it makes your code faster, even if it also makes your code less clear-cut. You even calculate it based on benchmarks that this new solution will be 8.6% faster, which makes you extremely proud. It doesn’t matter that the earlier version of your program ran with an absolutely fine speed too, even on a ‘486 machine.
—You are not afraid of either using command “goto”, or arithmetic jump statements. Actually you are so wicked, that when you are thinking about your own programming language, you are looking for ways to embed arithmetic subroutine calls.
—You already have looked up, how to execute code, that stored in a string. You are well aware of its risk and the security hazard, you probably have never used this feature before, but you have found the way to solve it, only because you WANT TO KNOW that  too!
—In your opinion, only one useful complex data structure existing, which is the array. Anything else is either only an alteration of it or a specialized variant of it, meaning, that everything else is only bull****.
—Without a doubt, you are willing to not only data but pointers as well make subject of explicit casting, and directly manipulate fields of objects, if it makes the code run faster. You are confident that with caution you can use these possibilities, while you talk anybody else out of it by creating horror stories about the risk. It’s because in reality you are deeply concerned about the risk it holds – for novice programmers...
—You don’t like programs systemd and pulseaudio, you think these are all just bloatware. You really don’t like GRUB2, because you think it’s just plainly idiotic to load a half operating system only to help the booting of the real operating system… You have such a nasty opinion on X Window System’s graphical subsystem, that it can’t be published in any written form, either printed or as digital pixel, because even your monitor would be embarrassed displaying it...
—You are not fond of anti-aliased letters, or vector graphic font sets; you prefer serif, fix-width typefaces.
—You have looked up in references how to set NumLock “on” automatically while booting, because it’s so dull you have to push that button after each restart. For you it’s not illogical, that you spent 3 days to solve this problem, which is way much more time, than what you would have spent with pushing that button till the end of your life.
—In your opinion, among distributions LFS is the “God Emperor”, but in case of emergency it’s acceptable to use other source-based distribution such as Gentoo, Sabayon or GoboLinux… although using something else than LFS without a good cause makes anyone suspicious in your eyes. All the other distributions, that are not source-based belong to the “out of question” category, and only good for elementary school students to get a feel of information technology.
—You already have compiled your own kernel for Linux distribution with unique settings.
—You have written an own programming language, or if not yet, it’s your childhood dream. Or, if writing a programming language is not your dream to come true, it’s only because you want to create a full operating system to start with.
—You deserve a bonus, if you want to write your operating system in your own programming language...
—You think that justifying your endeavor to write a new programming language the fact itself is more than enough, that all the existing programming languages are lacking one common thing; non of them was written by you!
—The other reason why you must write a programming language is that you are convinced, that if you died without completing that noble quest, your ancestors would be ashamed of you, and as a punishment you’d be ruled out not only from Heaven, but also from Hell, and as a deterrent example to the other souls you’d be deported back to life! Terrible fate, painstaking even to think of it! Obviously sane, intelligent people should not take a huge risk like that!
—Your favorite text editor lacking of any better is VIM, but only until you make your own one.
—Even the sight of complicated expressions like “regexp” triggers aesthetic pleasure in you.
—But lately expressions like “regexp” don’t cause you as much enjoyment as before, because you’ve realized, that the one who wrote regexp rules is NOT YOU! And regexp’s analyzing function you use, not yours either! Awful! You can’t live anymore with such a shame, that you don’t have your own regexp analyzing algorithm. It’s barbaric, and miserable… So you plan to write something like it for yourself, or at least something that is capable of accomplishing things like it can do.
—You are filled with revulsion against graphical programs in overall. You accept that graphical platforms are necessary, but you think programs should only be graphical, when pixel manipulation is inevitable. Such as in case of picture viewers, or an WYSIWYG word processor, or desktop-publishing software, picture or video editors. But for activities like chatting, listening to music, sending letters or file handling you can’t imagine to use a graphical program.
—You don’t like watching YouTube videos online in your browser window. You just watch it for a few minutes, and if its interesting, you download it to watch offline in your favorite video player.
—It’s no problem for you, to save only the audio track from a video clip, if you are only interested in the music, but not the video. No way to store a file ten times as large as necessary for the video information...
—Your deep-seated belief is that a window manager program should only manage the operation of windows, and that’s it, nothing else is its job! There is no need for a control center, because instead of manual settings, you rather rewrite configuration files to apply the necessary settings.
—You think, that in case of a window manager the possibility to arrange background pictures is unnecessary, because they are hidden when a program window is open in the work area. When you switch to an empty desktop, you prefer to see an important system file listed by root-tail, or if not by root-tail, then some program you wrote for this purpose...
—The sheer thought of using a window manager with ICONS makes you suffer from a massive stroke. In your opinion, icon is a religious painting, which can be found in Eastern Christian churches, and it has no place in a desktop of a “True Geek”. IT and religion doesn’t blend together well, except for the following possibility:
JESUS HAS CHANGED YOUR LIFE! Do you want to save it? YES - NO
—While other r=0 users are looking for the best distributions and browsers, until you are switching between different terminal emulators, because somehow neither of them is the best for you. So you have made the decision, that maybe not right now, but sometimes in the distant future you will write one, that will serve all of your requirements.
—In the previous paragraph there is the adjective “distant” before the word "future" only because NOW you cannot start writing a terminal emulator, because first you have to put together your own shell… because you think, that all that have been made so far are lacking certain functions, they are like bloatware with too much dependence, and many other idiotic features.
—When you install a new distribution, you always start with the following “musthave” stuff, because there is no life without them:
1. Urxvt (or another UTF-8 supported terminal emulator)
2. MC
3. VIM
4. XBindKeys
5. XChainKeys
6. XdoTool
—You don’t think that decent man would use KDM or GDM or other graphical display manager, because it’s profanity not to start the machine by commandline only, and just after that enter with the startx command to the graphical environment, if we want to boot the graphical environment at all, which is not so sure at all… You think, if someone is pervert enough to do so, it’s recommended to take precautions preventing him to get close to small children, because who knows what else he might be capable of...
—In your opinion the best programming language is the C, everything else is only frivolous playing around and humbug. If you need to put something together quickly, then you use C++, but practically you write C code, only add a few features from C++. But you only do that, when you have high temperature (over 104 F) and drank too much, plus haven’t slept for 3 days, so you are not able to make serious mental efforts.
—In your opinion, in a programming language as a prefix of hexadecimal constants $ is much better, than 0x, because the latter one consists of two characters, which makes processing time longer, takes more time to type it, additionally makes your keyboard worn out sooner, and because of this, entropy increases in the Universe. The fact, that in C it works like this is an awfully irritating mistake of this programming language, about which you have been annoyed for a while.
—You have dreamed about how nice it were, if finally humanity would come to its senses, and switched to the hexadecimal system. It would free a lot of capacity, if machines didn’t have to make all the conversions between decimal and hexadecimal systems all the time. You know this dream will never come true, but still, daydreaming about it is so good...
—It used to be your ambition to learn how to write a daemon, because it’s such a geeky stuff if you know how to write a daemon. But by the time you have learned it, you realized, that what you needed that program for is not necessary to be “daemonized”. It’s enough to run it in the background, so you decided to rewrite the whole program, because without “daemonizing” its size became smaller, approximately half of the original size, which practically means you could spare 16 K! And sparing 16K makes you extremely happy, because your machine has only 16 GIGABYTE RAM, which means, that the 16K you can spare is about the one parts per million of your full capacity! Actually, the truth is, that you never used more than 30% of your 16 GIGABYTE RAM capacity, but still, the 16K memory-spare thrills you!
—There is no file handling software installed on your machine, except for MC. But you feel it’s unnecessary too, since you solve everything with your own scripts!
—You think, the best striptease is, when the beloved lady takes off the... the cover of her machine, so finally you can see the circuits of that topnotch machine in her naked reality...
—Whenever you hear the word "striptease", you associate to the expression "Stripping executables…"
—Whenever you take a look at a source code that includes something at the beginning like
#pragma inline
you know that it’s time to get excited, because a breathtaking intellectual adventure waits ahead of you.
—A feeling, almost as intense as that, sweeps you off from your feet, when you see in the code the directive:
volatile.
—When you write a program, you set all the possible warning levels for the compiler, then in spite of that, you keep working on the code until no warnings will be displayed. Because your opinion is that a programmer, who tolerates warnings while their programs being compiled would deserve a painful execution, which would be broadcast in prime time on TV to deter others from doing so. Maybe, if all the warnings they got belongs to the pedantic category, it’s enough to put them in a pillory locked in the stocks in the middle of a crowded square to became the subject of everybody’s deep contempt.
—It’s happened already that you have mistaken the words "castle" and "casting" while you’ve been browsing on the Internet...
—If it was up to you, to teach languages to children like Pascal or Python were prohibited, because you think it will make them lazy and careless, and later they will not be willing to learn the only (as much as it is…!) acceptable programming language, which is C.
—If you’d lower yourself to the level of writing a program in C++, you don’t make yourself suck with “data hiding”, or using “friend”; everything can be public, because you know how to be careful! Because you are programming C, even if you write the code in C++, as you are only there for those few extra features.
—When listing files, you like to see rights in octal form, because you think style, like "rwxrwxrwx" is obviously a blubber, which is too long, not space utilizing, and not aesthetic, and it’s only for beginners, or rather for "infant" users.
—You hate Windows, but essentially not for because it costs money (not for you, you would never use that so-called "operation system", which is rather a monster rascal) and not because it’s full of bugs, but because its source code is closed: actually it’s even prohibited to modify, so you can’t test it and form it to your own taste.
—Whenever someone asks you to install Windows on their computers, you say no, because you feel like you were getting filthy by doing so in a ritual meaning. It would be something like to clean a toilet for a Hindu maharani, or to eat something that is not kosher for a Jewish rabbi. If a friend asks you to install it, to whom you cannot just say "no", you lie, saying you don’t even know how to install Windows. Actually you don’t feel guilty about this lie, because, the last time you used Windows was in the age of Windows 3.11, or max. Windows 98. Modern Windows operating systems are different, but you really hardly know them, because you only have seen them from a distance, and really just for a few minutes. The thing is, that the sheer sight of a Windows operating system makes you feel sick, and forces you to escape the scene…
—Basically you keep yourself away from programs with closed source codes, you hate them, avoid them as much as possible, you think that the sheer existence of them is evil and disgusting, some kind of a rotten memetic stank of death, which spread must be fight against.
—Your choice can only be Linux or BSD operating system on your home-computer, and wherever you have the right to decide on it. If not one of these, then maybe something even more rare one (perhaps Minix), but it definitely must be open source code.
—You don’t like Android, because it’s full of restrictions, and in spite of the open source system-core it has plenty of **** that is closed source. You think that Android is the Windows of Google, and just slightly better than real Windows.
—You are unable to tolerate the Windows logo key on keyboards, so whenever you get a new one, the first thing to do is to cover the key with a sticker (an expensive penguin sticker maybe?), or paint it with opaque paint, or in the worst case you just put some duct tape on it. Whatever you do, the only thing that matters is to make it invisible, because it’s a shame to let anyone see it on your keyboard, like you were advertising for Windows! But you are not a Windows billboard, especially not because this gigantic company does not pay you anything for it...
—For that same reason, when you buy a new computer, the first thing you do is to scrape it clean from the colorful Windows sticker. Or maybe it’s just the second thing, because the first one is to uninstall the Windows that came with the package, and is already installed on your new machine.
—If you have a task to solve, and you have to choose between the two, you will always choose the open source code even if it has less functions, and hard to handle and even have more bugs, than the other one, the closed source.
—It happened, that you voluntarily contributed money to an open source project, that otherwise was free.
—You consider a commandline, as the most user friendly interface of the world.
—You don’t like touchscreens, and virtual keyboards that are displayed on them; in your opinion, these are absolutely not suitable for serious work.
—You don’t like suits and ties, and shiny shoes, actually, as far as your clothing is concerned, you don’t give a ****. And you think the same about others’ clothing. You think that geniuses like you, should spend their time on making the code “pretty”, not their looks. And spend even more time to assure high quality. If someone makes a remark on your appearance, you just casually say (if you say something at all): "Beautiful can be anybody. Maybe I’m not, but I’m not just anybody."
—The fact, that you don’t care for either yours or others appearance, doesn’t mean that you are intentionally filthy, or ragged or scary looking. Actually, you despise those who express their “personalities” by wearing Cherokee-like purple hair sticking up high in the air, or leather jackets with full of rivets, and often ugly tattoos cover large parts of their bodies. You think, that there is a big chance, that they are IQ-negative idiots, who are unable to create anything important, therefore instead of creation they are trying to get into the focus of attention by being odd looking. You avoid those people, because you think, you are not on the same intellectual level with them.
—When a pretty girl with a flirtatious smile on her face whispers to your ear, that she has no programs for the night yet, you as a heroic knight and genial programmer assure her, that you will put together a program for her in no time, so she will have her entertainment for the night. No question about writing her that program, because you really love her!
—Generally, you show a tendency for calling girls to your room, to show them your programs...
—You are familiar with the programming language, called BRAINFŬCK , and you already wrote your own  BRAINFŬCK interpreter.
—You already have made your own Linux distribution (even if nobody else use it but you).
—There is no TV set in your apartment, or it’s out of work, because when it got broken, you realized, that you never watched it anyway, so you didn’t bother to buy a new one, or maybe didn’t even bother to throw it out, because your potted flowers like it on the top of the TV… Or maybe you have TV in your premises, you use it, but only as an external monitor, because you don’t watch TV channels… Or maybe there is a TV, that works properly and not used as a monitor, but it’s not in your room; it’s either in the kitchen, or in your wife’s room, because you have no time to watch worthless, stupid shows on TV, your time is much more precious than that. Your motto is: "You'll never live this day again. So make it count!"
—You don’t mind, if you are said to be a geek, or a nerd… as a matter of fact, you are proud of it.
—You have defined your own keyboard layout, instead of using those standard, or default layouts. This way you have all the characters you need, and they are right there where you need them.
—The window manager you are willing to use must be extremely minimalist, such as DWM, SithWM, NoWM… But you are thinking about writing your own one. Maybe one day, you will embark on this adventure.
—You agree with the statement, that "Programming is rather art than science; as a matter of fact, the most imperial among arts!". Or, maybe you are not agree perfectly with this statement, but you think, it has some truth in it...

If you feel like, that the above statements are exaggerating, and I was being ironic or funny when I wrote them, I can tell you the big secret, that you are right - in a certain sense... When I started to put together this list, my intention was to intensify it by strong exaggerations! But as I proceeded, I had to recognize, that it’s impossible. Of course I realize that some of those statements may seem rather comic, but as far as my ideology is concerned those statements are not exaggerating; all of them are characteristics of my worldview...
For example, I’m dead serious about, that humanity should come to its senses, and switch to hexadecimal system. And it really happened, that I had a pretty girl to come up with me to my room, but because I read a lot about how girls don’t like to "get to the point" right away, and they need time to "get into the mood", so instead of approaching her directly, I tried the intellectual way; I initiated an interesting conversation about programming… Well, the conversation have failed, but unfortunately not only the conversation…


Offline Findecanor

  • Posts: 5036
  • Location: Koriko
Re: I'm working about a new scripting language right now...
« Reply #3 on: Tue, 27 November 2018, 02:37:46 »
LOL. That could just have been the longest post on Geekhack so far.. But entertaining if you have the time for it.
I can agree with many points. A few notes:

- You use the same name as a another author named Harold King, who died in 2010. It does not sound Hungarian, so I suppose it is a pseudonym. Why?
- Self-modifying code was outmoded in the late '80s, because it breaks on CPUs that have separate data and  instruction caching, or even instruction pipelining: which is now all of them. Only some 8-bit computer enthusiasts do it now, to get more speed for demos and game routines.
- Systemd and pulseaudio were written by the same person, BTW ...
- I would argue that 0x is better than $ because the notation does not reserve a character, and the notation is made to work with other bases: such as 0b for binary or 0o for octal. (not many use octal these days though, except for chmod...). Also, when talking about conventions in general, using a more popular convention could make your work more approachable for other programmers. (Still much preferable than appending an h to the end of the number though IMHO)
- Many practices you see today, even in programming languages were introduced to make things more readable and understandable when you work on other people's code, or even when you take something up after having not worked on it for a while and you don't have it in fresh memory. Personally, I think this aspect has been too overlooked in programming language design.
- I think there are many more pressing needs for humanity to "come to its senses about" than using hexadecimal.  :))
« Last Edit: Thu, 13 December 2018, 15:09:17 by Findecanor »

Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #4 on: Tue, 27 November 2018, 07:42:42 »
Well yes, I note to your last sentence: for example it would be very good if Mankind stop to smoking... yes it would be more important than switch to hexadecimal numeric system. But in my joke-like post above I have been talking just about the problems regarding the programming, the IT...

About the name Harold King: Of course this is not my real name. This is just a pen-name. I chose something English-like name in order to publish my novels which got translated to English, so much the more because I'm deeply disappointed in my "native" nation (there are no more demicracy, but soft-dictatorship, etc). And I like the name "Harold". The King comes from the fact that my original name "Zoltán" means in the very old, prehistoric Hungarian language "Sultan", this is of course a Turkish king, so, I translated Zoltán to King, it is very simple and understandable decision... Unfortunately I have read that "Harold" is not a too frequently name in English, and I omitted/passed_up to verify wether or not exist another Harold King, who is an author as well... When I realized it, it was too late me because to that time 2 of my books got published by Lulu. :(
Naturally, if I had known this in advance I would have chosen another pen name, for example not Harold but Harald... :)


Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #5 on: Wed, 28 November 2018, 17:07:43 »
Comments

In UPU language both C/C++ -style types of comments are recognized:
// comment
and
/* comment */
as well.
You are free to do the next one too:
/* comment // comment */
And this one too:
// comment /* comment */
Even this one:
// comment // this is a comment
Moreover, this one too:
/* comment /* comment */ */

Meaning, that the “slash-star-style” comments can even be embedded!
As far as my taste is concerned, my favorites are // style comments. (But as we know, every man to his taste...)

But don’t worry, all the comments will disappear from our code during tokenizing, so we can go ahead and write all the comments we wish; it will not slowing down execution even a bit.

Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #6 on: Thu, 13 December 2018, 06:57:21 »
Thank you dear Helen! I checked the proposed website, it seems promising, but on the other hand it seems as even "starting project" regarding the fact that in many places in the menus I found just text from the "lorem ipsum"...

As my programming language is concerned, I am almost ready with the first step, to collect the stringconstants, labels, with the tokenizing, etc. Actually it can working on some basic level. But now I got a new idea: I'll create not even one languages, but many. First, a virtual assembly. Because my final goal is to create a virtual operating system written in my language. Thus, my assembly will be the "machine code" of that virtual computer. (Of course not the source code of the assembly, but the created bytecode). The next languages will realize the higher levels of the abstraction, and they'll be translated to this virtual assembly. In those higher-level programming languages - and in my future operating system - each program is actually a quite separate but proper virtual machine. This approach obviously gives a very hard base to the security, but, on the other hand, it makes the creation of an efficient subsystem for the interprocess communication almost impossible. I have to admit, this creates grave difficulties for me.

But before I'll start this project I must refresh my existing Linux operating system. This need a relatively long time because I use LFS, so now I need to create for me a new LFS. My existing "distro" is more than 4 years old, so it is considerably old, and many new programs couldn't being translated already... (This may be attributed to a number of reason). So now I need to create a new LFS. As I said above, even my existing distro is LFS, too, but now I need a new, up-to-date. The creation process however is cosiderably more difficult as a common LFS would be, because I'm using a modifyed filesystem-hierarchy. It is "GoboLinux-like", but I'm not compatible with the GoboLinux distribution. So I'm using my own scripts for installation, removing, etc.

Yesterday the creation of my new LFS has begun, but the temporary system is not finished yet. No problem, it comes the holiday season, I have time...

Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #7 on: Tue, 18 December 2018, 21:49:58 »
Hi, everybody: my language is working already, in a "moderate" level! :)
Namely, I'll develop many new features later, but now, here are 2 testing programs! Both of them does the same thing: they calculate the value of Pi with iteration. These programs has built-in benchmarks, too. The first:

Code: [Select]
suggestedmem 100
goto §kezd
idő: "Time: "
piértéke: "Pi iterated: "
ticktext: " tick.\n"
kezd:
tick STO @0 drop // starting tick
0. STO @1 drop // summarized pi
1.
STO @2 // denominator
STO @3 // reckoner
drop
#d
3000000 {| RCL @3 RCL @2 / sum @1 drop RCL @2 ++++
STO @2 drop RCL @3 +/- STO @3 drop
|}
4. prd @1 drop
#g
tick rcl @0 -
§idő strprint print drop §ticktext strprint
§piértéke strprint rcl @1 #d printnl

The output:

Quote
Time: 360085 tick.
Pi iterated: +3.14159232025637

The second program (It is MUCH MORE faster!):
Code: [Select]
suggestedmem 100
goto §kezd
idő: "Time: "
piértéke: "Pi evaluated: "
ticktext: " tick.\n"
kezd:
tick sto! @0 // starting tick
0.   sto! @1 // summarized pi
1.
STO @2 // denominator
STO @3 // reckoner
drop
#d
3000000 {| rcl+/- @3 rcl++++ @2 / sum! @1 |}
4. prd! @1
#g
tick rcl @0 -
§idő strprint print drop §ticktext strprint
§piértéke strprint rcl @1 #d printnl

Output:

Quote
Time: 118373 tick.
Pi evaluated: +3.14159232025637

Regarding the benchmarks, this 2nd prog is slower than the native code but only 8 times. Because the C equivalent is the following:

Code: [Select]
#include<stdio.h>
#include<stdlib.h>
#include<time.h>

int main(void) {
double p;
double n;
double s;
register unsigned long long i;
clock_t CLOCK1;
clock_t CLOCK2;

p=0;
n=1;s=1;
CLOCK1=clock();
for(i=0;i<3000000; i++) {
p+=s/n;
n+=2;
s=(-1*s);
}
CLOCK2=clock();
p=p*4;
printf("idő: %g\n",(double)CLOCK2 - (double)CLOCK1);
printf("Pí közelítés: %g\n",p);

return 0;
}


Its running time is on my machine: 14625 tick, when I compiled it with the -O2 flag.

So I think my language is EXTREMELY FAST, after all we must keep in mind that my language (named UPU) is a SCRIPTING language, thus, it'll be slower than the C/C++ anyhow.

As you can see above, it uses postfix notations, not infix. This fact makes it similar to the Forth, however it is good visible that it has many diversities as well. You can see that the labels can containing any UTF-8 encoded characters, for example. Labels are case-sensitives, but the keywords (sto, rcl, etc) aren't. Many keywords can being extended with the ! postfix (exclamation mark) which effects that after the execution of the keyword it makes az extra "drop" command on the stack. This feature raises the execution speed of the program very much, and even the code becomes more human-readable, at least as my opinion is concerned.

The topmost ridiculous factor of my language - in the present stage - is, that it is not Turing-complete yet, because it hasn't any conditional jump statement. Of course, it is not hard or "heavy duty" for me to develop them, not at all, but first I want to write the documentation about the present stage, the finished/ready features, after all we programmers know it very well, that:

Programming is like using toilets; you can't say you are done until paperwork's finished!

This pause is good for me for even to thinking about the syntax of the conditional jump statements (and more else future features).

Note: UPU language is and will working only under Linux, I have no any intention to port it to Window$ ! (I haven't even any Windows, I do no need it).






Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #8 on: Thu, 27 December 2018, 22:01:03 »
Hi, there are another examples from my programming language: The following program does no any useful, just prints itself (its source code) to the stdout:
Code: [Select]
// This pgm prints its source code to the stdout
goto §beginhere
"// This pgm prints its source code to the stdout"
"goto §beginhere"
"beginhere:"
"2 {| {} sysstrs + str# nl |}"
"sysstrs strmax {|| quote {} str# quote nl |}"
"2 sysstrs + strmax {|| {} str# nl |}"
"end"
beginhere:
2 {| {} sysstrs + str# nl |}
sysstrs strmax {|| quote {} str# quote nl |}
2 sysstrs + strmax {|| {} str# nl |}
end

And this program is searching for prime numbers in the range 2...100 :
Code: [Select]
suggestedmem 110000
goto §kezd
idő: "Time: "
ticktext: " tick.\n"
kezd:
tick sto! @0 // starting tick
#g
poke @2  1 // count
poke @20 2 // 0th element of primenumbers array, because primenumbers array begins at @20
@20 basex!
2 100 {||
rcl @2 {| // for slots in prime number
{{}} {} getx !/ !{ {{<}} }
|}
{} rcl++ @2 setx "Prime found: " printnl!
|}
tick rcl @0 -
§idő strprint
print! §ticktext strprint
rcl @2 print! " primes\n"

Output:
Code: [Select]
Prime found: 3
Prime found: 5
Prime found: 7
Prime found: 11
Prime found: 13
Prime found: 17
Prime found: 19
Prime found: 23
Prime found: 29
Prime found: 31
Prime found: 37
Prime found: 41
Prime found: 43
Prime found: 47
Prime found: 53
Prime found: 59
Prime found: 61
Prime found: 67
Prime found: 71
Prime found: 73
Prime found: 79
Prime found: 83
Prime found: 89
Prime found: 97
Time: 100 tick.
25 primes

Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #9 on: Fri, 04 January 2019, 17:14:11 »
A new example/test: This program prints a set of the Mandelbrot-fractal to the console (and prints even benchmark):

Code: [Select]
suggestedmem 100
goto §kezd
idő: "Time: "
ticktext: " tick.\n"
kezd:
tick sto! @0
#d
-39. sto! @1
78 {|
nl
-39. sto! @2
78 {|
rcl @2 40. / sto! @3
rcl @1 40. / sto! @4
sbr §mandelbrot
#g
dup !{ drop
7 !/ 4 >= { '*  goto §kiírja }
goto §spckiír }
$28 + dup 127 > { drop
spckiír:
32 } kiírja: #k print!
#d
1. sum! @2
|}
1. sum! @1
|}
nl
#g
tick rcl @0 -
§idő strprint print drop §ticktext strprint
end
mandelbrot:
rcl @4 0.5 - sto! @15
mov @16 @3
0. sto @17 sto! @18
0. sto  @32
   sto! @33
{... // begin the infinite loop
rcl @18 rcl @17 * sto @20
rcl @18 inv sqr sto @21
rcl @17 inv sqr sto @33
- rcl @15 + sto! @18
dup rcl @16 !+ sto! @17
rcl @33 rcl @21 + 16. > { {...} rts }
{...} #g 1000 > { rcl @33 (#g) rcl @21 (#g) #g + 0 rts }
#d
...} // end of the infinite loop

The output:

Code: [Select]
+++++++,,,,,,,,,,,,--------.....//00136 63100//.....--------,,,,,,,,,,,,++++++
+++++++,,,,,,,,,,,,-------.....//001235*532100//.....-------,,,,,,,,,,,,++++++
++++++,,,,,,,,,,,,-------.....//0332377 7732330//.....-------,,,,,,,,,,,,+++++
+++++,,,,,,,,,,,,------......//00:>557J J755>:00//......------,,,,,,,,,,,,++++
+++++,,,,,,,,,,,,-----.....////01238B<E E<B83210////.....-----,,,,,,,,,,,,++++
++++,,,,,,,,,,,,-----..../////001236Y  *  Y632100/////....-----,,,,,,,,,,,,+++
+++,,,,,,,,,,,,,----..//////0001124BI*   *IB4211000//////..----,,,,,,,,,,,,,++
+++,,,,,,,,,,,,-----./00010000122347C** **C74322100001000/.-----,,,,,,,,,,,,++
++,,,,,,,,,,,,-----../22262111257578=  *  =87575211126222/..-----,,,,,,,,,,,,+
+,,,,,,,,,,,,,-----../1678:32234C<<?LV   VL?<<C43223:8761/..-----,,,,,,,,,,,,,
,,,,,,,,,,,,,------../0123654556X]U*** * ***U]X6554563210/..------,,,,,,,,,,,,
,,,,,,,,,,,,,------..//01279688<A* *  * *  * *A<88697210//..------,,,,,,,,,,,,
,,,,,,,,,,,,------...//0025C=KbF***  *****  ***FbK=C5200//...------,,,,,,,,,,,
,,,,,,,,,,,,------....//029=   **             **   =920//....------,,,,,,,,,,,
,,,,,,,,,,,-------...///013:I ****  *     *  **** I:310///...-------,,,,,,,,,,
,,,,,,,,,,,-------...//001359A *** * ** ** * *** A953100//...-------,,,,,,,,,,
,,,,,,,,,,--------...//01235KR **   * * * *   ** RK53210//...--------,,,,,,,,,
,,,,,,,,,,--------...//02666: *   * * *** * *   * :66620//...--------,,,,,,,,,
,,,,,,,,,--------....//197=:E    ***   *   ***    E:=791//....--------,,,,,,,,
,,,,,,,,,--------....//0237L    * *  *   *  * *    L7320//....--------,,,,,,,,
,,,,,,,,---------....//01249N   **** *   * ****   N94210//....---------,,,,,,,
,,,,,,,,--------.....//00136: *      *   *      * :63100//.....--------,,,,,,,
,,,,,,,---------....///0015:[ ** *  *** ***  * ** [:5100///....---------,,,,,,
,,,,,,,--------.....///00124;B **  ***   ***  ** B;42100///.....--------,,,,,,
,,,,,,--------......///001236A**  * *     * *  **A632100///......--------,,,,,
,,,,,,--------.....////0011247?  *  *     *  *  ?7421100////.....--------,,,,,
,,,,,--------......///000112358B *    ***    * B853211000///......--------,,,,
,,,,,-------......///00011223468f  * * * * *  f86432211000///......-------,,,,
,,,,-------......///000112234567:=g**     **g=:765432211000///......-------,,,
,,,,-------.....///0001123345689<?DJTh   hTJD?<9865433211000///.....-------,,,
,,,-------.....///0011223G5:  CV *   * * *   * VC  :5G3221100///.....-------,,
,,,------....////001=>44D ;A* *     *     *     * *A; D44>=100////....------,,
,,-------...///000129L:6:* * *    *         *    * * *:6:L921000///...-------,
,-------.../00000126K m=  ***  ** **   *   ** **  ***  =m K62100000/...-------
,------.../0422212249^ Q***   * **           ** *   ***Q ^9422122240/...------
-------.../1659533458Bh *   * * ****   *   **** * *   * hB8543359561/...------
------...//14HA7kG6S  ** *   **   **   *   **   **   * **  S6Gk7AH41//...-----
-----..../015YhS` =g*** * *    *  *   ***   *  *    * * ***g= `ShY510/....----
-----..../0@@8`**      * * *     * *  ***  * *     * * *      **`8@@0/....----
----....//0135>* *** * ****    ** ***** ***** **    **** * *** *>5310//....---
----....//0124tH *   ** ***  * *     *   *     * *  *** **   * Ht4210//....---
---....///012359?** *  ***** *   *    ***    *   * *****  * **?953210///....--
--.....///01235G    **  *** * * * *  *****  * * * * ***  **    G53210///.....-
--....///0015s8B* ***** *   *      * * * * *      *   * ***** *B8s5100///....-
-....///0012CO P*  ** * ** *  **    *     *    **  * ** * **  *P OC2100///....
....///000127=  * *** *  *  **   * *  * *  * *   **  *  * *** *  =721000///...
...//000112249 ***  *   * **    *  **  *  **  *    ** *   *  *** 942211000//..
.///042112236 i*  ** **    * *  ***    *    ***  * *    ** **  *i 632211240///
///0165347446?* *  *   ***  *  ****         ****  *  ***   *  * *?6447435610//
//016R87 ?967   ** *     *      **   ** **   **      *     * **   769? 78R610/
000159B`P*f :p***       *  ** *       ***       * **  *       ***p: f*P`B95100
011248A*     g**   *  * *   **    ***     ***    **   * *  *   **g     *A84211
122B6> *  * *~ ** **  *   ** *  **  ** * **  **  * **   *  ** ** ~* *  * >6B22
334N>A  * ***u     * ***       * *  *  *  *  * *       *** *     u*** *  A>N43
85=F*  ***  ****     * *   ****  *** ** ** ***  ****   * *     ****  ***  *F=5
5@KA***  ** *t ****  *      * ** * * *   * * * ** *      *  **** t* **  ***AK@
F558B=      *     **  *  *  ** **  * *   * *  ** **  *  *  **     *      =B855
62256;o* * *     * * **** **   * *   *****   * *   ** **** * *     * * *o;6522
3111258 EXiC9  *   *     ** *    *   *****   *    * **     *   *  9CiXE 852111
000029B;7K767@*  * *         * ** *** * * *** ** *         * *  *@767K7;B92000
///0296433345U* **** *  *  *          ***          *  *  * **** *U5433346920//
..//00111123|N *  * **  *   * ***             *** *   *  ** *  * N|32111100//.
....///000123ka ** *     ***  *   * **   ** *   *  ***     * ** ak321000///...
-....////00137l* * * * ****         **   **         **** * * * *l73100////....
--.....///026@*** *    *      * **   *   *   ** *      *    * ***@620///.....-
----....//014R@=** ** ** **   * * *    *    * * *   ** ** ** **=@R410//....---
-----....//01348  *   * * *        *       *        * * *   *  84310//....----
------...//001249   *  **   * ** * *  ***  * * ** *   **  *   942100//...-----
------....//01247= * ***    * *****    *    ***** *    *** * =74210//....-----
-------...//01:6K* *  * *  * *  *    *   *    *  * *  * *  * *K6:10//...------
,------...//015T*   p  * ***  *** **   ;   ** ***  *** *  p   *T510//...------
,,------..//0138R** <K ** * ***  *  *  5  *  *  *** * ** K< **R8310//..------,
,,,-----../01238 V A68I*  *  ***  * * 434 * *  ***  *  *I86A V 83210/..-----,,
,,,,-----./;3879BA>=35T:@*****   ** x32123x **   *****@:T53=>AB9783;/.-----,,,
,,,,,----..0>34<>4421234: *?J*** *:A2100012A:* ***J?* :4321244><43>0..----,,,,
,,,,,-----../01832000013V  867*H5E71000/00017E5H*768  V31000023810/..-----,,,,
,,,,,,-----../000////0126=9324<?1100///////0011?<4239=6210////000/..-----,,,,,
,,,,,,,-----.......///0<:;5101210/////.../////0121015;:<0///.......-----,,,,,,
Time: 730330 tick.

Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #10 on: Sat, 05 January 2019, 21:28:24 »
This small but nice program prints all its commandline parameters to the stdout:

Code: [Select]
suggestedmem 1
20 mem sto! @0
"Commandline parameters:\n"
@0 argc {| {} #g print ". = " argv #s printnl |} drop
rcl @0 inv mem
end

The result of its running with a few parameters:
Code: [Select]
vz@Csiszilla /Releases/2014/U/Common/vz/UPU=>./upu args01.upu UPU is a very efficient programming language!
Commandline parameters:
0. = ./upu
1. = args01.upu
2. = UPU
3. = is
4. = a
5. = very
6. = efficient
7. = programming
8. = language!


Offline Findecanor

  • Posts: 5036
  • Location: Koriko
Re: I'm working about a new scripting language right now...
« Reply #11 on: Sat, 05 January 2019, 23:07:38 »
It may be efficient, but it is not very readable.
"sto!" and "poke" WTF?

Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #12 on: Sun, 06 January 2019, 00:15:11 »
Sto is the abbreviation of "STOre". Rcl is abbreviation of "ReCaLl". These words came from the programming language of the "ancient" Ti-59 programmable calculator from the 1970's years. "Poke" is a well-known keyword for those ones who knows the Commodore-64 microcomputer.

Anyhow, I think the matter is not the words, but the RPN syntax. If you think this is not a really human readable programming language, then maybe you're well, but not exactly because of "poke" or "sto", but the RPN syntax. But it causes problems just in the first 2 or 3 days, after then you become accustomed with it. The RPN is however far, far faster than any infix notation for an interpreter. There are tests (benchmarks) in them UPU is more than 10 times faster than Python. Generally UPU is slower than the native compiled C code only 6...12 times, which is extraordinarily wonderful for an interpreter, a scripting language!

Regarding an another aspect, I think UPU is not extremely hard language, compared with the Perl or the FORTH. I have to admit, C++ or Basic or Fortran or Pascal is more human readable, it is true. Okay. But my goal was not the "Easy learning" primarily. But the efficiency, most of all, then the easy developing in the future with new functions... However I inform you that as my taste is concerned, I think UPU is far more easy to read as a non-trivial Bash script... Or a C++ program filled up with many templates, operator overloadings and exception handling...

And: It's MINE, because I KNOW it!

But okay, no problem: The documentation of UPU is started being created right now, so I'll write above of the preface the following warning:

BEWARE! Usage of this programming language may lead to mind-injury or cerebral-death!

And:
My motto:
- It’s not the smartest thing to make the programming language we are about to create unfathomably difficult. But the programming language, which doesn’t make possible to write unfathomably difficult, hard-to-understand codes is not a good one; it’s not efficient enough, because it offers too little possibilities...

This is simple a programming language with effective line-noises... and scrawls.






Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #13 on: Sun, 06 January 2019, 21:59:14 »
I'm glad to announce that from now on my belowed programming language named UPU has built-in support to run (execute) any BRAINF*CK program!
Look at this, this tiny script execute the brainf*ck program if we give the filename of that brain**** pgm as a commandline parameter (and prints even benchmark...):

Code: [Select]
suggestedmem 4 #g
20 mem sto! @0 100000 mem sto! @1
argc 3 < { "Usage: upu brain****_builtin.upu brain****pgm.brain****\n" sbr §invmem fail }
@0 2 argv #s "The name of the brain****file for execute: " printnl
'f istrue !{ "The file is not exists!\n" sbr §invmem fail }
// Load the file into @1 :
@1 @0 fileinput
tick sto! @2 // starting tick
brain****!
nl #g tick rcl @2 -
§idő strprint print! §ticktext strprint
sbr §invmem
end
invmem: rcl @0 inv mem rcl @1 inv mem rts
idő: "Time: "
ticktext: " tick.\n"

Note: In my original program there are no any **** part of the keywords, but unfortunately this fu**ing forum-software changes the words EVEN IN THE SOURCE CODES! Horrible! Darnit!
« Last Edit: Sun, 06 January 2019, 22:01:14 by fossilcodger »

Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #14 on: Wed, 16 January 2019, 19:53:26 »
Hi, there are a very useful prog written in my UPU programming language: This nice tiny script lists the directory (the current dir or the dir given by commandline parameter) and the output is of course colorized:

Code: [Select]
suggestedmem 10
12 mem sto! @0
12 mem sto! @2
@0 #g argc 3 >= !{ §defaultdir =§ goto §folyt } 2 argv
folyt:
'd istrue !{ "The given directory doesn't exists!\n" rcl @0 inv mem rcl @2 inv mem fail }
dir sto! @1
@1 @0 loaddir dup { "Error! Errorcode = " #g printnl fail } drop
drop // (töröltük a @1 -et a stackból)
// =================================================================================== DIRECTORIES
zero @6
@1 'D amount {_ 35 printcolor 4 printcolor "Subdirectories:" colorreset space 9 printcolor
#g printnl colorreset
{|
'D {} sbr §octal
// @2 @1 'D {} filesize #g (#s) #s print! // Filesize isn't important in case of DIRs
10 printcolor 2 {| space |}
@2 @1 'D {} filename 63 stub #s print!
{} 'D sbr §ownersandtime
|}
}{ drop }
// =================================================================================== REGULAR FILES
@1 'R amount {_ 35 printcolor 4 printcolor "Common files:" colorreset space 9 printcolor
#g printnl colorreset
{|
@1 'R {} executable sto! @6
'R {} sbr §octal
@2 @1 'R {} filesize #g (#s) 14 15 13 12 coloredsize #s print! colorreset space
6 printcolor rcl @6 { 2 printcolor }
@2 @1 'R {} filename
63 stub  print!
{} 'R sbr §ownersandtime
|}
#g
"--------------------------\n"
@2 @1 'R totalsize "TotalSize = " #g (#s) noleftspc 14 15 13 12 coloredsize #s space printnl!
}{ drop }
// =================================================================================== SYMLINKS
@1 'L amount {_ 35 printcolor 4 printcolor "Symlinks:" colorreset space 9 printcolor
#g printnl colorreset
{|
@1 'L {} broken sto! @6
'L {} sbr §octal 2 {| space |}
rcl @6 !{ 8 }{ 13 } printcolor
@2 @1 'L {} filename 20 stub #s print!
rcl @6 !{ 10 printcolor }{ 21 printcolor 10 printcolor }
" ===> " colorreset space
rcl @6 !{ 8 }{ 13 } printcolor
@2 @1 'L {} destination #s print!
colorreset
nl
|}
}{ drop }
rcl @0 inv mem
rcl @1 inv mem
rcl @2 inv mem
nl
end
// ........................................................
defaultdir: "."
// ........................................................
octal: #g sto! @8 sto! @9 @2 @1 rcl @9 rcl @8 octal
colorreset
rcl @6 { 9 }{ 7 } printcolor
#s print! colorreset
rts
// ........................................................
ownersandtime:
colorreset
sto! @9 sto! @8
space 24 printcolor 6 printcolor
@2
@1 rcl @9 rcl @8 ownername 6 stub print ":"
@1 rcl @9 rcl @8 groupname 6 stub print
colorreset space
@1 rcl @9 rcl @8 mtime print
drop nl
rts
// ........................................................

Behold, there are a screenshot in attachment:



Offline Nerd

  • Posts: 19
  • Location: Toronto, ON. Typing in my room.
  • Nerd (Aka Alex) Aka Garbage. Sister: @sintpinty
    • My Youtube channel!
Re: I'm working about a new scripting language right now...
« Reply #15 on: Mon, 25 March 2019, 09:45:06 »
I'd be very interested! :D
"The world's nerdiest nerd that loves Youtube."

Consider subscribing to my channel, TanookiAlex. That would be greatly appreciated, thank you! Link is: Youtube.com/c/tanookialex.

                *  Subscriber Goal - 735/1000 *

Offline fossilcodger

  • Thread Starter
  • Posts: 21
    • Classic sci-fi author
Re: I'm working about a new scripting language right now...
« Reply #16 on: Mon, 25 March 2019, 15:29:58 »
Actually, my belowed programming language (UPU) got ready already. Now I'm working on the documentation. In a certain sense even her documentation is ready, just in my native language which is Hungarian. So, now I'm busy to translate it to English. Don't worry about my broken, Tarzan-like English: I have English-native publisher reader (in Australia...).

In the above sentence I used the "her" personal pronoun to refer UPU, just because I think about UPU always as something "her", and no "it". In my eyes, UPU is female, after all, beautiful, mysterious, and these attributes belong especially to women and girls...

Returning to the more serious themes, UPU has now already far more elaborated and serious possibilities than in the beginning when I opened this topic. These are the following ones for example:

—She can handle symbolic variable names, thus, not only @34 but for example @counter @name @anything
—The variablenames can include even accentuated or another "strange" characters, anything from the UNICODE table: @Äpfel @Σuμμ
—This is valid for even the name of the labels.
—In UPU it is possible to use namespaces, however the syntax of it is very uncommon/unusual than in the most currently used programming languages.
—It is possible (and very easy!) to write external libraries to UPU in order to expand/boost her possiblities. At least in C/C++ language, although it is quite possible the libraries can be written even in another languages, just I know only C/C++. For the time being I created the following external libraries to them:
- X
- ALSA
- PNG
although I have to admit they has just a very few of functions. But now it is easy to enrichment them, after all the skeleton is ready, and there are the many of the example functions...
—There are many useful program written in UPU: statusbar-daemon for the DWM window manager, directory listing, and the "vidir" program rewritten in UPU. This program is originally written in Perl, with it we can edit the directory via our preferred text editor. Now, we do no need Perl, it is ready in UPU as well. It is ready more than a dozen version of BRAINF*CK interpreter written in UPU (many of them are extremely fast!), and the LIFE cellurar automaton game (although only in console mode. But to this console mode UPU doesn't need ncurses at all...)
—There are even screenshot program written in UPU... It creates PNG file from the (graphical) screen.
—UPU has built-in support for the fork() and the pthread, thus, it is very easy to written multithread programs in UPU. Oh, and I must tell you all, naturally UPU has butil-in support for even to working with the shared memory, after all the threads must have some possibility to "talking" with each other for example the child processes with the parent and vice versa, and the fastest method for the interprocess communication is the usage of the shared memory areas.

For the time being, I'm ready with the translation of the documentation approximately in 30%.

But do not forget please, this is not a fancy interpreter for beginners and small children! Here a part from the "work in progress" documentation about this aspect:


At first glance
I try now for You, dear Reader to explain what you may and may not expect at the UPU programming language. First of all, this is not a "beginner-friendly" language! Not at all! During the design-process, at the very beginning, it was absolutely beside the point for me to make it "beginner-friendly". If you want a compiler to worry about code safety for you, go to "Ada" or "Java" or anything else. If you search a nice, fancy interpreter which will make good inclination for your small children to begin learn programming or general IT-technology, then forget it right now, and go to "Basic". You will not find it here. UPU is rather about simplicity and efficiency. But even as efficiency is concerned: it means NOT as "efficiency in the time-consumption of the creating/writing the program", but far rather "efficiency of the execution of the existing/created program"!
Keep in mind this please, because there are huge differences between these two concepts...
In many aspects, UPU is similar to the FORTH language, on another aspects it is similar to the programming language of the very old, "ancient" - but even now famous! - programmable calculator, named "Ti-59". But rather to the FORTH, especially because it too uses RPN syntax: thus, "Reverse Polish Notation". So, it is also true for UPU which is true for FORTH: This language is a "flamethrower crawling with cobras". There is no type checking, no scope, and no separation of data and code. You can do horrible things. You must get into the habit that during the code-writing, time to time the code-parts must be verified, and many times you'll get errormessages as "segfault" or "stack owerflow" or similar ugly messages. It can happen because it is very easy to forget by you how many data are in the stack, or, the data being processed has which "type" yet, and so on. You MUST be very narrow and mindful while you use UPU! Exactly same narrow and observing, moreover PEDANTIC, as you would use an assembly language! Yes, UPU is more easy to be used as an assembly language in many aspects, but not as these things are concerned: it gives you incredible freedom, but with all disadvantages of the perfect freedom...
   In UPU, you can easily jump off into bad sections of memory and crash the system. Here is everyting on YOU, on you exclusively: To writing a good program, you MUST develop a good mental model of what data is on the stack at any given time, or you will suffer. But in exchange, it is guaranted that your program will run extremely quickly! In many tests, UPU is much, much faster than Python (for example), actually I did not even find any test yet in which UPU became slower... at least, when we use good programming methodes. But in any languages it is possible to write suboptimal programs...
   UPU is probably not the language you want to learn if you are designing a control-center of a nuclear reactor... But it is very useful to write some scripts for your personal usage in order to make your daily jobs more easy. UPU is a hacker’s language, in both the laudatory and the pejorative senses.
Today it is not so exceptional and sensational that somebody knows a bit to the programming. If you write a small program in the commandline using Python or Bash or another frequently used language, then it is not enough to achieve the appreciative eyeblicks of the present public who see you. But if you do it in UPU—well, then the situation is totally changed instantly! It makes definitely a great difference! UPU seems not even for the first but for even the umpteenth eyeblick just as something "cat-scrawl", it seems as something very unfathomable difficult trick which is totally impossible to be learnt by everybody who isn't a born genius. UPU seems far more heavy as it is in the very reality, but this fact is very good for everybody who intends to obtain the honorable label by his/her friends: "Well, he/she is a REAL HACKER!". Yes, UPU is NOT an easy programming language - yes, this is true, I have to admit it - but UPU is not SO heavy as it seems!