Browsing this Thread:
1 Anonymous Users
|
Re: How to speed up compilation process
|
||||
|---|---|---|---|---|
|
Quite a regular
![]()
|
Quote:
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
|
|||
|
||||
|
Re: How to speed up compilation process
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
@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
|
|||
|
||||
|
Re: How to speed up compilation process
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
Quote:
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
|
|||
|
||||
|
Re: How to speed up compilation process
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
Quote:
I think this is something that can be implemented iteratively. Improving step-by-step. 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
|
|||
|
||||
|
Re: How to speed up compilation process
|
||||
|---|---|---|---|---|
|
Quite a regular
![]()
|
Quote:
Yeah, that's what I mean. Quote:
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
|
|||
|
||||
|
Re: How to speed up compilation process
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
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
|
|||
|
||||
|
Re: How to speed up compilation process
|
||||
|---|---|---|---|---|
|
Quite a regular
![]()
|
Quote:
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
|
|||
|
||||
|
Re: How to speed up compilation process
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
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
|
|||
|
||||
|
Re: How to speed up compilation process
|
||||
|---|---|---|---|---|
|
Home away from home
![]() |
<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
|
|||
|
||||
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.







