Author Topic: The Imperium programming language - IPL  (Read 86967 times)

0 Members and 6 Guests are viewing this topic.

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4538
  • Country: nz
Re: The Imperium programming language - IPL
« Reply #950 on: January 22, 2023, 04:32:42 am »
At the bottom of the list, for Show quick moderation as select Checkboxes.

Wow! I got the checkboxes. And have now just told the system to ignore this thread. There will be one or two other threads, often years-old, that get the same treatment next time they pop up. And probably a lot of new uninteresting threads on a daily basis, to stop them continually popping up in my "Show unread posts since last visit" list during their lifetime as it appears this feature is also available there. I might now stop ignoring some entire "boards".

That is one well-hidden feature!

Goodbye cruel thread!
 
The following users thanked this post: DiTBho

Offline MIS42N

  • Frequent Contributor
  • **
  • Posts: 520
  • Country: au
Re: The Imperium programming language - IPL
« Reply #951 on: January 22, 2023, 05:06:07 am »
The rabbit hole went so far for me that I looked into the possibility of having the object file format support the definition (down to which register a parameter is passed in, as well as its type) of each parameter.  At some point it gets too far, as in requiring completely new file formats for the toolchain to work on, and not just a completely new toolchain...  ::)
If the concept is workable, then difficulty of implementing it shouldn't be a barrier. A toolchain is written once (conceptually) but used millions of times. If it saves one millionth of the time it takes to create it, bonus. I may have mentioned (if not, I thought it) that letting the compiler decide just how a function/subroutine gets incorporated into final code (i.e pass a value, use a pointer, put it in a register, incorporate the code inline rather than as a callable (at the binary level) module, would improve code efficiency, and the source just gives preferences as to how it happens - fastest speed, minimum code, don't care.

It would require a rethink of the whole object library concept with library modules having flexible interfaces not resolved until link time, which in turn would need the compiler to be aware of how flexible it can be in managing those interfaces.

It could extend to libraries hinting at resource use rather than specifying. On a CPU like ATmega328P there are 32 registers, the C compiler (that I used) avoids using some registers because the libraries that may be incorporated use some of them by convention. But if the compiler was able to know which library components are used, and those components said something like"I need 3 registers but don't care which" then the compiler could optimise its use of registers.

I had not seen the term interval arithmetic before although I think I know the concept well. Maybe a tool? - I have these variables, this is the function, I want this accuracy in the output, what size intermediates are required? - actually no, it would have to be incorporated in the compiler as it would be creating intermediate values not in the source code. A=(1-X^2)/(1-Y^2) would have a few intermediate values, fine in floating point but more information needed to do it in fixed point.

interesting.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6967
  • Country: fi
    • My home page and email address
Re: The Imperium programming language - IPL
« Reply #952 on: January 22, 2023, 06:34:32 am »
Goodbye cruel thread!
;D

But really, our –– those of us still participating –– loss. :'(

[...] having the object file format support the definition (down to which register a parameter is passed in, as well as its type) of each parameter.
If the concept is workable, then difficulty of implementing it shouldn't be a barrier.
It is possible for ELF object files by encoding the parameter type information in the version string.  How practical that would be, I dunno; haven't tried it in real life.

In general, I don't see exactly how a compiler could really use anything but the "default" ABI when compiling library code that will be called by other code: it just does not have sufficient information to make a qualified guess.

However, things like knowing which registers a function overwrites at compile time, would let a compiler generate more efficient code: no need to save unused registers.

On a CPU like ATmega328P there are 32 registers, the C compiler (that I used) avoids using some registers because the libraries that may be incorporated use some of them by convention. But if the compiler was able to know which library components are used, and those components said something like"I need 3 registers but don't care which" then the compiler could optimise its use of registers.
This is exactly why I use extended asm when compiling C or C++ static inline functions with GCC, Clang, or Intel CC (using adding the __attribute__((always_inline)) function attribute, to force inlining of the function).  Instead of specifying the exact registers, you use numbers (%0, %1) or names (%[foo], %[bar]), and use constraints to specify which kind of register can be used for the inlined function.
That way, the compiler includes the code at each call site, but is free to choose different registers to use, within the specified constraints.

It is also useful to think about whether *statically* compiled code needs to conform to a specific ABI or not.  Say, if the compiler does two passes (across the entire project), with the initial pass basically looking at which registers it needs to use across the entire project, for example generating intermediate (but target-specific) code representation, with the second pass doing register selection and related optimizations and generating the final machine code; it could select and record the calling convention for each function.  That calling convention information would not be needed at runtime at all, but it would be necessary for debugging and in-circuit emulation.

Is it worth it?  I dunno.  Like I keep harping, one really should look at and think about the generated code (or what kind of code one wants it to generate), before deciding.

(Dynamically linked code is different, because anything but a specific ABI agreed upon beforehand would require runtime glue code generation.  I don't like that.)
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3527
  • Country: it
Re: The Imperium programming language - IPL
« Reply #953 on: January 22, 2023, 08:03:24 am »
Then there's another variant of the declare statement using "as":

RE: the As keywork, one programming language i use extensively have recently introduced explicit casting.
Since this language is derived from java, it follows the "everything is an object" rule. To cast one object you add .As(Type) after the object name, then you can use all the methods associated with the type
« Last Edit: January 22, 2023, 08:05:50 am by JPortici »
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 4247
  • Country: gb
Re: The Imperium programming language - IPL
« Reply #954 on: January 22, 2023, 11:14:16 am »
@jportici
Scala?
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 20769
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: The Imperium programming language - IPL
« Reply #955 on: January 22, 2023, 11:32:10 am »
There is at least one language that seems to have many of the facilities the OP believes will be useful. It is contempory with his "favoured" language PL/1.

One of the things that is messy in assembler is using fractions in fixed point arithmetic. Floating point is fine when it is part of the instruction set, but not every microprocessor has FP.

Fixed point was implemented in an HLL in the mid 60s....

There are three types of number, floating-point, fixed-point and integer. Except in certain part-word table-elements (see Section 4.4.2.2, “Part-Word Table Elements” [18]), all three types are signed. Numeric type is indicated by the word FLOATING or INTEGER or by the word FIXED followed by the scaling constants which must be given numerically, e.g.
FIXED(13,5) This specifies five fractional bits and a minimum of 13 bits to represent the number as a whole, including the fractional bits and sign. The number of fractional bits may be negative, zero, or positive, and may cause the binary point to fall outside the significant field of the number.

The same language also has something rather nice for bit manipulations...

Part-Words ... the desired field is selected by a prefix of the form BITS[ Totalbits , Bitposition] in front of the primary to be operated upon. The result of this operation is a positive integer value of width Totalbits and in units of the bit at Bitposition.
BITS[2,6]x := 3 has the effect of placing the binary digits 11 in bits 7 and 6 of the word allocated to x

Packed Data ... and one in which the data format is declared in advance. In the latter system, with which this section is concerned, the format is replicated to form a table. A group of n words is arbitrarily partitioned into bit-fields (with no fields crossing a word boundary), and the same partitioning is applied to as many such groups (m say) as are required. The total data-space for a table is thus nm words. Each group is known as a table-entry. The fields are named, so that a combination of field identifier and entry index selects data from all or part of one computer word, known as a table-element. The elements in a table may occupy overlapping fields, and need not together fill all the available space in the entry.
...
Part-Word Table Elements Elements which occupy fields narrower than a computer word (and only such elements) are declared in forms such as
rain UNSIGNED(4, 2) 2,0;
humidity UNSIGNED(6,6) 2,8;
temperature (10,2) 2,14;

It also has macros, for those that like such abominations...

A compiler embodies a macro processor, which may be regarded as a self-contained routine which processes the text of the program before passing it on to the compiler proper. Its function is to enable the programmer to define and to use convenient macro names, in the form of identifiers, to stand in place of cumbersome or obscure portions of text, typically code statements.

The language's definition is online at http://www.xgc-tek.com/manuals/pdf/xgc-c66-1.7-rm.pdf
« Last Edit: January 22, 2023, 04:02:09 pm by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 4247
  • Country: gb
Re: The Imperium programming language - IPL
« Reply #956 on: January 22, 2023, 12:01:42 pm »
ATmega328P there are 32 registers

MIPS has 32 registers, too, 1 is always zero, 4 are always reserved.

And, when you're completly lost with your ICE session, this has always been the best thing to have, a constant of the universe, like the speed of light, from OS to barebones applications, those registers are there to provide exactly the information you need :D

(you appreciate it even better on SPARC)
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 4247
  • Country: gb
Re: The Imperium programming language - IPL
« Reply #957 on: January 22, 2023, 12:16:34 pm »
I had not seen the term interval arithmetic before although I think I know the concept well. Maybe a tool?

Good for fuzzy-logic, so, good for uc-robotics.
(just, it's 90s old-school, but still good)
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3527
  • Country: it
Re: The Imperium programming language - IPL
« Reply #958 on: January 22, 2023, 01:21:10 pm »
@jportici
Scala?

No, Basic 4 Android :D
A huge project that provides a common language framework to write apps for Android, iOS, PC (java).
Free to use for android/pc, paid updates for iOS but actually really cheap compared to other options.
The biggest plus, to me, is how it handles layouts. It's actually easy and the result is predictable and there is none of that declarative bullshit app programmers seem to be fond of these days (kotlin, flutter, looking at you.)
The fact that the language itself is a dialect of basic also means that it's actually understandable by people. It's not trying to reinvent the wheel by changing names to things, or strange cryptic syntax.
Community is great, libraries provided by the community actually work, and if they are popular they are adopted by the project creator, it's not the clusterfuck of cobbled together libraries like you find in flutter (ble library in flutter is too basic. An user threw up a library to give more functionality, the github has 700+ issues and most of the replies are go to this fork of the library, which has 500+ issues. I am terrified by that environment.)
Tutorial are always up to date, when something big changes in the language, like start with a template or with an empty application, or when a class becomes an internal library, the tutorial is rewritten with both approaches. You can't dream of better support
« Last Edit: January 22, 2023, 01:23:27 pm by JPortici »
 
The following users thanked this post: MK14, DiTBho

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #959 on: January 22, 2023, 02:03:49 pm »
One of the things that is messy in assembler is using fractions in fixed point arithmetic. Floating point is fine when it is part of the instruction set, but not every microprocessor has FP.

So being able to define something as (in an arbitrary language) binary [8\8] would be nice, an 8 bit integer part and an 8 bit fraction part. Or [0\24], [16\16] etc. The code required is simple, just shift bits or add zero bytes before computation. But interpreting what goes on is not so clear. Being able to express it in the language would be helpful.

Is this already a thing, or is it too obscure to be worried about? Languages I've encountered assume int is integer (funny about that) and if fractions are thing, it is done in floating point with a floating point library if not native to the architecture.

This is already committed to, PL/I supported this out of the box and there are numerous use cases for it in microcontroller applications.

e.g

Code: [Select]

dcl rate fixed bin(15,8);


That's a 16 bit number, one sign bit, the last 8 digits being after decimal point. I've also added quite flexible notation for literals in different bases.

Code: [Select]

rate = 1101.0011101:b;


Note, PL/I had optional abbreviated forms for many keywords and would default many things too. I think it was too tolerant though, so its likely that area needs reviewing. These are all legal in PL/I

Code: [Select]
dcl counter;     // defaults to fixed decimal 5 digits
declare rate float binary(32);
dcl size bin(15); // defaults to fixed

basically there are various optional attributes and if not specified will be defaulted
« Last Edit: January 22, 2023, 02:21:18 pm by Sherlock Holmes »
“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #960 on: January 22, 2023, 02:36:34 pm »
@jportici
Scala?

No, Basic 4 Android :D
A huge project that provides a common language framework to write apps for Android, iOS, PC (java).
Free to use for android/pc, paid updates for iOS but actually really cheap compared to other options.
The biggest plus, to me, is how it handles layouts. It's actually easy and the result is predictable and there is none of that declarative bullshit app programmers seem to be fond of these days (kotlin, flutter, looking at you.)
The fact that the language itself is a dialect of basic also means that it's actually understandable by people. It's not trying to reinvent the wheel by changing names to things, or strange cryptic syntax.
Community is great, libraries provided by the community actually work, and if they are popular they are adopted by the project creator, it's not the clusterfuck of cobbled together libraries like you find in flutter (ble library in flutter is too basic. An user threw up a library to give more functionality, the github has 700+ issues and most of the replies are go to this fork of the library, which has 500+ issues. I am terrified by that environment.)
Tutorial are always up to date, when something big changes in the language, like start with a template or with an empty application, or when a class becomes an internal library, the tutorial is rewritten with both approaches. You can't dream of better support

Laying out user interfaces declaratively is by far the most logical approach. Stuff like resizing, resolution independence and so on, are much cleaner.

I started using Blazor professionally for new web apps, and Maui is superb for cross platform UI development.

I also used WPF for several years after writing apps with Windows Forms for years, frankly Microsoft are starting own cross platform, ignore them at your peril.

« Last Edit: January 22, 2023, 02:40:26 pm by Sherlock Holmes »
“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #961 on: January 22, 2023, 05:29:58 pm »
The grammar for structures took some experimentation, partly because this is a new grammar, not PL/I not C or anything.

Anyway after some design effort this is now the syntax for enums and structs

Code: [Select]
      type baud_rates enum bit(8);
           first  = 1010 0011:b;
           second = 1110 1101:b;
           third  = 1101 0111:b;
           fourth = 0010 1100:b;
      end;

      type Outer                 structure;
           cpu_id                bin(31);
           Inner                 structure;
                cpu_mode         bin(31);
                cpu_rev          bin(15);
                large as         Header;
                Flag_table       structure;
                   root          pointer;
                   depth         fixed bin(15);
                end;   
                label            string(64);
           end;
           owner                 string(64);
           speed as              baud_rates;
           counter               string(32);
      end;

This passes various tests and nested structures parse recursively without any problems.
“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15439
  • Country: fr
Re: The Imperium programming language - IPL
« Reply #962 on: January 22, 2023, 07:52:50 pm »
I had not seen the term interval arithmetic before although I think I know the concept well. Maybe a tool?

Good for fuzzy-logic, so, good for uc-robotics.
(just, it's 90s old-school, but still good)

It's good for many things. :)
And math concepts are never old school.
 
The following users thanked this post: DiTBho

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #963 on: January 23, 2023, 03:17:12 pm »
Then there's another variant of the declare statement using "as":

RE: the As keywork, one programming language i use extensively have recently introduced explicit casting.
Since this language is derived from java, it follows the "everything is an object" rule. To cast one object you add .As(Type) after the object name, then you can use all the methods associated with the type

Yes, C# too has an 'as' keyword, lets you declare a reference to some object as specifically some class/interface that the object is known to implement rather than the class/interface that the reference was declared to be.



“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #964 on: January 23, 2023, 03:19:23 pm »
I had not seen the term interval arithmetic before although I think I know the concept well. Maybe a tool?

Good for fuzzy-logic, so, good for uc-robotics.
(just, it's 90s old-school, but still good)

It's good for many things. :)
And math concepts are never old school.

Well, I never eve heard of "interval arithmetic" is it something that has specific support in some programming language? (other than Mathematica etc).
“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #965 on: January 23, 2023, 03:22:59 pm »
There is at least one language that seems to have many of the facilities the OP believes will be useful. It is contempory with his "favoured" language PL/1.

One of the things that is messy in assembler is using fractions in fixed point arithmetic. Floating point is fine when it is part of the instruction set, but not every microprocessor has FP.

Fixed point was implemented in an HLL in the mid 60s....

There are three types of number, floating-point, fixed-point and integer. Except in certain part-word table-elements (see Section 4.4.2.2, “Part-Word Table Elements” [18]), all three types are signed. Numeric type is indicated by the word FLOATING or INTEGER or by the word FIXED followed by the scaling constants which must be given numerically, e.g.
FIXED(13,5) This specifies five fractional bits and a minimum of 13 bits to represent the number as a whole, including the fractional bits and sign. The number of fractional bits may be negative, zero, or positive, and may cause the binary point to fall outside the significant field of the number.

The same language also has something rather nice for bit manipulations...

Part-Words ... the desired field is selected by a prefix of the form BITS[ Totalbits , Bitposition] in front of the primary to be operated upon. The result of this operation is a positive integer value of width Totalbits and in units of the bit at Bitposition.
BITS[2,6]x := 3 has the effect of placing the binary digits 11 in bits 7 and 6 of the word allocated to x

Packed Data ... and one in which the data format is declared in advance. In the latter system, with which this section is concerned, the format is replicated to form a table. A group of n words is arbitrarily partitioned into bit-fields (with no fields crossing a word boundary), and the same partitioning is applied to as many such groups (m say) as are required. The total data-space for a table is thus nm words. Each group is known as a table-entry. The fields are named, so that a combination of field identifier and entry index selects data from all or part of one computer word, known as a table-element. The elements in a table may occupy overlapping fields, and need not together fill all the available space in the entry.
...
Part-Word Table Elements Elements which occupy fields narrower than a computer word (and only such elements) are declared in forms such as
rain UNSIGNED(4, 2) 2,0;
humidity UNSIGNED(6,6) 2,8;
temperature (10,2) 2,14;

It also has macros, for those that like such abominations...

A compiler embodies a macro processor, which may be regarded as a self-contained routine which processes the text of the program before passing it on to the compiler proper. Its function is to enable the programmer to define and to use convenient macro names, in the form of identifiers, to stand in place of cumbersome or obscure portions of text, typically code statements.

The language's definition is online at http://www.xgc-tek.com/manuals/pdf/xgc-c66-1.7-rm.pdf

This is interesting, I've not looked at Coral at all and I am always interested in older languages, interested to see how certain ideas were implemented, so thanks for mentioning it. Also nice to see language invented in my home country, other than LEO that is.


“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline AndyBeez

  • Frequent Contributor
  • **
  • Posts: 858
  • Country: nu
Re: The Imperium programming language - IPL
« Reply #966 on: January 23, 2023, 03:34:06 pm »
So from a programmer's perspective, how does this IPL thing handle event/interupt bindings? Is there a notion of asynchronous threading - maybe across DMA boundaries?

In other words, does IPL facilitate a callback or declarative closure pattern that handles events from outside of the main thread/loop/queue?
 

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #967 on: January 23, 2023, 03:46:33 pm »
So from a programmer's perspective, how does this IPL thing handle event/interupt bindings? Is there a notion of asynchronous threading - maybe across DMA boundaries?

In other words, does IPL facilitate a callback or declarative closure pattern that handles events from outside of the main thread/loop/queue?

You'd need to elaborate here, not entirely sure what you're asking me. There is no thread/loop/queue insofar as the language itself is defined. The language supports synchronous interrupts in the form of exception support, an exception can be system generated or explicitly generated by code.

Asynchronous interrupts are supported by defining procedures declared as "interrupt" such procedures have specific register save/restore semantics.

This isn't expected to be particularly challenging to implement but perhaps there's scope for innovation here if there are ideas that could be included in this area, for example you mention DMA, wouldn't that just require basic interrupt support?
“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #968 on: January 23, 2023, 03:52:08 pm »
Regarding CORAL 66, there's a British Standards Document - sadly not free!

“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #969 on: January 23, 2023, 04:02:47 pm »
Not sure why, but reading about CORAL 66 takes me back to my childhood! When British innovation was more visible. It brings back memories of watching Dr. Who followed by Tomorrow's World and the Sky at night, fond memories...
“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #970 on: January 23, 2023, 06:03:20 pm »
Here's some actual real life CORAL 66 source, it's very odd that the language seems to need single quotes around keywords, never seen that before, I wonder why they did that...
“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #971 on: January 23, 2023, 06:09:17 pm »
This reminds me of serious old days stuff:

Quote
Re: No love for CORAL 66?
It turned out the FORTRAN compiler on the VAX was actually quite clever.

Unfortunately, their CORAL-66 compiler thought it was clever too.

The first professional job I ever did was to help track down a bug in a sonar simulation system, written in CORAL-66 using the MASCOT methodology (defence bods will remember that). It always eventually crashed with a stack overflow, though the amount of run-time before the crash varied considerably.

Turned out that inside a double, nested FOR-loop was an IF statement of the form IF <x> AND <y> THEN... , where x and y were complex expressions.

Of course, if x turns out to be false, you don't have to evaluate y. So the optimising compiler added a jump to the next thing, which happened to be outside of the nested loops. But it left the temporary result for x on the stack. So eventually there would be an overflow.

The number of iterations of the loops and the value of x depended on the input data, but also on how much time the scheduler gave to each of the "concurrent" processes in its simulation of a real-time system. So even if you fed it the same input data, it would run for different times before crashing.

I remember going to a DECUS meeting to tell everyone about this. But it turned out that we were the last to know :(

“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #972 on: January 23, 2023, 06:56:28 pm »
As part of the rationalization of the language, I've replaced "auto" / "automatic" with "stack", were all grown ups, time we stopped using these arcane terms.

“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline Sherlock HolmesTopic starter

  • Frequent Contributor
  • **
  • !
  • Posts: 570
  • Country: us
Re: The Imperium programming language - IPL
« Reply #973 on: January 23, 2023, 07:37:47 pm »
What do others think about namespace privacy, now that namespaces are part of the language?

I want to allow an optional "private" to a namespace defintion:

Code: [Select]
namespace system.kernel private;

   // Everything in here can only be accessed by code that is also inside the "namespace system.kernel private" namespace.

end;

Code like this is public:

Code: [Select]
namespace system.kernel;

   // Code here is not private

end;

There can be multiple source files that contain the same namespace names of course and a single source file can contain multiple namespaces.

During compilation, all like-named namespaces are coalesced and so will have a public part and an optional private part. During the reference resolution stage accessibility can be checked.

This idea strikes me as better than labelling individual procedures and stuff as private, helping to keep all private code together more easily.

In a sense we can think of every namespace having a possibly empty private area.

It might also be feasible to "layer" the privacy too, I have to think about that...





« Last Edit: January 23, 2023, 07:59:36 pm by Sherlock Holmes »
“When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.” ~ Arthur Conan Doyle, The Case-Book of Sherlock Holmes
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1353
  • Country: de
Re: The Imperium programming language - IPL
« Reply #974 on: January 23, 2023, 07:45:14 pm »
As part of the rationalization of the language, I've replaced "auto" / "automatic" with "stack", were all grown ups, time we stopped using these arcane terms.

Hardly anyone uses 'auto' in C, and in C++11 and later it is a placeholder type specifyer, meaning that the declared variable derives its type from the initializer (e.g. 'auto f = 3.0;' declares variable 'f' with type 'double').
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf