Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
22 user(s) are online (17 user(s) are browsing Forum)

Members: 0
Guests: 22

more...


Browsing this Thread:   1 Anonymous Users




(1) 2 »


Re: How to speed up compilation process
#20
Home away from home
Home away from home


See User information
Quote:
if variables can be declared anywhere in the code. Can this be done in PortablE? AFAIK in standard AmigaE this is not possible?

It's not possible in AmigaE nor PortablE, but it is something I'd like to add, mainly because it could greatly simplify code that uses temporary variables.

However, it would basically be a kludge, in that the variable's scope would still be the whole procedure, no matter where it was declared. So you would not be able to declare two variables with the same name in different parts of the same procedure.

Posted on: 2016/1/10 19:07
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: How to speed up compilation process
#19
Quite a regular
Quite a regular


See User information
Quote:

SamuraiCrow wrote:
The most common types inferred are pointer types. Integer types need not be covered at all. However, the main use of inference is in languages where a syntax like this is legal:

typename varname=new typename(parameter);


True. Primitive data types do not exist anymore. At least not in the languages I know that do type inference.
Everything is an object, a reference type. Or a PTR TO type if you like.
Very little boilerplate code if you just have to type:
val object = SomeClass()

Type inference makes most sense if variables can be declared anywhere in the code. Can this be done in PortablE? AFAIK in standard AmigaE this is not possible?



Manfred

Posted on: 2016/1/10 18:35
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: How to speed up compilation process
#18
Home away from home
Home away from home


See User information
@SamuraiCrow
For different reasons I have idly wondered about adding something like this:

object := NEW ::myClass.new()

The question is what the most E-like syntax would be. The above was my best idea so far, given that E already has :: for casting object types, and NEW is already an expression in E.

Posted on: 2016/1/9 21:27
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: How to speed up compilation process
#17
Home away from home
Home away from home


See User information
Quote:

PortablE wrote:
Quote:
I think this is something that can be implemented iteratively. Improving step-by-step.
For where it is obvious what the type is it can be automatically done, if the user didn't specify it explicitly.

I suppose it would be much easier for PTR TO types. What had stumped me was integer number types, which can become almost anything once a loop is involved.

Guess I'll reconsider this at some point, but at the moment my plate is already rather full, so I won't promise anything.


The most common types inferred are pointer types. Integer types need not be covered at all. However, the main use of inference is in languages where a syntax like this is legal:

typename varname=new typename(parameter);

In other words, the typename is listed twice. In AmigaE, the only assignment that can be made on a pointer type is NIL if the pointer needs to be initialized to no value. In PortablE it doesn't have to be that way but there would have to be some consideration for which constructor will be used since it is more like

VAR varname:PTR TO typename=NEW typename.constructorname(parameter)

so it's a little different in the AmigaE family of languages. Perhaps a different keyword than "new" to take the place of both the new operator and the typename would do the job?

Posted on: 2016/1/9 19:24
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: How to speed up compilation process
#16
Home away from home
Home away from home


See User information
Quote:
I think this is something that can be implemented iteratively. Improving step-by-step.
For where it is obvious what the type is it can be automatically done, if the user didn't specify it explicitly.

I suppose it would be much easier for PTR TO types. What had stumped me was integer number types, which can become almost anything once a loop is involved.

Guess I'll reconsider this at some point, but at the moment my plate is already rather full, so I won't promise anything.

Posted on: 2016/1/9 16:55
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: How to speed up compilation process
#15
Quite a regular
Quite a regular


See User information
Quote:

PortablE wrote:
Quote:
You think type inference would be possible?

Do you mean the ability to NOT have to specify a variable type, because the compiler can work it out from how the variable is used?

Yeah, that's what I mean.

Quote:

PortablE wrote:
That's something I would really like to have... and I've tried to work out how to do it myself (with no prior knowledge of the subject), but control-flow loops stumped me. Probably it'd be too much work, so it seems unlikely.

However, I *am* considering a simpler solution, where you can specify that a variable get's it's type from the first assignment to it. That would still have big benefits for some OOP-heavy programs (like GUIs).

I know from other languages (Scala, Kotlin, etc.) that the compiler isn't always able to infer the type.
I think this is something that can be implemented iteratively. Improving step-by-step.
For where it is obvious what the type is it can be automatically done, if the user didn't specify it explicitly.


Manfred

Posted on: 2016/1/9 14:58
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: How to speed up compilation process
#14
Home away from home
Home away from home


See User information
Quote:
You think type inference would be possible?

Do you mean the ability to NOT have to specify a variable type, because the compiler can work it out from how the variable is used?

That's something I would really like to have... and I've tried to work out how to do it myself (with no prior knowledge of the subject), but control-flow loops stumped me. Probably it'd be too much work, so it seems unlikely.

However, I *am* considering a simpler solution, where you can specify that a variable get's it's type from the first assignment to it. That would still have big benefits for some OOP-heavy programs (like GUIs).

Posted on: 2016/1/9 12:47
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: How to speed up compilation process
#13
Quite a regular
Quite a regular


See User information
Quote:

PortablE wrote:
PortablE also adds many modern features (like type-checking & inter-module procedure inlining), some of which unavoidably reduce it's speed down to that seen in other 'normal' compilers (which don't take questionable shortcuts/cheats).


I'm a big fan of strongly typed languages.
It's great that PortablE has this.

You think type inference would be possible?


Manfred

Posted on: 2016/1/9 11:26
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: How to speed up compilation process
#12
Home away from home
Home away from home


See User information
Quote:
I have just started playing around with it and the more I use it, the more I like it. It seems to be the perfect balance between my old syntax favorite Pascal with the efficiency of C.

That's always nice to hear

Quote:
I use windows most of the times and I noticed that only standard modules work with it + no good syntax highlighting editor.

Yeah, the AmigaOS/AROS modules don't exist on Windows, for hopefully obvious reasons! There are basic POSIX modules for Windows, but I don't encourage their use - you might as well use the "Std" modules instead.

Quote:
I have tried to actually setup a syntax highlighting in Notepad++ (LINK) to help me along the way. I've also found a way to compile the code straight from Notepad++ with the help of a plug-in. I will post it as soon as I find some time to put all the notes together.

While I don't bother with syntax highlighting myself, new users do seem to want it, so that would certainly be appreciated

Posted on: 2014/6/30 21:03
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: How to speed up compilation process
#11
Home away from home
Home away from home


See User information
<p>I completely understand about real life getting in the way.</p><p>I was looking for new features and maybe more integrations on Windows but I am in no rush LOL. I have just started playing around with it and the more I use it, the more I like it. It seems to be the perfect balance between my old syntax favorite Pascal with the efficiency of C. <br />I use windows most of the times and I noticed that only standard modules work with it + no good syntax highlighting editor.</p><p>I have tried to actually setup a syntax highlighting in Notepad++ (<a href="http://arosworld.org/forum/viewthread.php?thread_id=89&pid=520#post_520" target="_blank">LINK</a>) to help me along the way. I've also found a way to compile the code straight from Notepad++ with the help of a plug-in. I will post it as soon as I find some time to put all the notes together.</p><p>Until the next version I will be asking questions on aros-exec/arosworld if you don't mind. Thanks for all your hard work.</p><p>Vince</p>

Posted on: 2014/6/29 18:34
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 




(1) 2 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project