Jump to content
LordJashin

Auto-licious IDE Development, uses FPC compiler

Recommended Posts

Damn! GUIs are really simple in FPC (I bet delphi as well)! :D

 

Anyways: GJ, I like that you published the source here, so I could see how easily this can be achieved in FPC! :)

 

Well, this is mostly Win32 controls. They probably use default controls that come with each system, e.g. Linux, Windows, Mac. If not, well, they look way too similar xD. Yeah I'd prefer a GUI in Qt, or with some other library.

 

Isn't what you're doing, basically just building a new IDE for FPC?

 

Yep. Never really messed with compilers before, its been fun so far. Maybe the title of this thread should have just been "IDE for FPC" instead of IDE, uses FPC lol.

 

I wanted to use Lazarus's editor, and other things, but I had no idea how to just take it from their code. So I opted to just using the SynEdit port they made into a component.

 

I figure, most of the Automation IDE's/Scripts are built off Pascal Script (exception with SCAR 4), C++, or Auto-It, Java, and other things. Why not build one off of FPC. It doesn't really compete with SCAR 4, and Simba. But since FPC is compatible with Delphi (so they say), I think it'd be super easy to port MSSL, or etc. over to it. It might be a good alternative. It even compiles to EXE. I'll be basically wrapping a lot of what FPC and its RTL already provide (or lazarus).

 

I don't think its a bad alternative to "script engines". I mean is there really any difference? Could FPC be worse then Pascal Script with Compilation, and run time? Anyway, I think this is a pretty cool project, and I'll try to make it really good.

 

I might be up the creek a bit, but Simba is built with Lazarus too. Some of the same components. Idk, how they integrated a Debugger into it. Must've taken some searching for that one.

Edited by LordJashin
Link to comment
Share on other sites

I might be up the creek a bit, but Simba is built with Lazarus too. Some of the same components. Idk, how they integrated a Debugger into it. Must've taken some searching for that one.

 

Simba is built with Lazarus, but it doesn't use FPC as an engine. Afaik they just use(d) pascalscript, which comes with a debugger.

Link to comment
Share on other sites

Been finishing the GUI first. I tried putting the form resources into Code version, but had problems. And ran into some hurdles there.

The thing I'm tackling right now, is how to implement Anchor Docking, with Forms into this. I'd have to make a new Unit for each form. The units would have to access each other. I wonder if I could avoid Circular dependencies. I think Implementation, then do uses, and it'll work out.

 

Pic: Z13uQcu.png

 

Pic2: MS0nKEW.png

 

Note: For now a lot of the ICONS, and moreeeeeeeeee is based off SCAR Divi/Simba/Lazarus. Mostly SCAR though. Ofc SCAR didn't make these icons, but you know what I mean.

 

EDIT, Update 7/26/2013:

 

Docking implemented finally. Took a while to figure it out. Now going to fine tune it.

 

rBwdrz2.png

 

Had to create separate Unit files for each one, AND tons of procedures/etc.

Edited by LordJashin
Link to comment
Share on other sites

The simplicity here makes me wonder if I can manage to(/or if I should) port my Rafiki to FPC, and run scripts in PyPy. As it's now I am limited to CPython due to that there exists no GUI-module in PyPy unless i start hacking a lot. Also it would allow me to run the GUI as a standalone application, and not within the CPython VM. All the user would need to get then is PyPy if I can not manage to incorporate PyPy in my program somehow: (Could just deliver PyPy with my software).

 

How is the Lexer u r using? Can it only highlight Pascal-like syntax?

 

 

PS: Not everyone is willing to download Free Pascal just to have your program working. Also imagine re-compiling MSSL each time a script is run (say if you just made a simple chang in mssl for testing)... There is MANY reasons to why we have interpreted languages.

- You could instead test out/and Lape when the small kinks in it get sorted out, or better yet just use DWS+JIT. There are many alternatives to avoid slow scripts.

Edited by slacky
Link to comment
Share on other sites

SynEdit + SynHighlighter for LAZARUS, can highlight the following languages:

Pascal, FreePascal, Cpp, Java, Perl, HTML, XML, LFM (lazarus form model), UNIX shell script, CSS, PHP, TeX, SQL, Python, VB, Bat, InI.

 

But uh. You can setup the Colors for ANY language really. If you know the settings for it. This takes learning though, it took me a while to learn it all. You can see how lazarus sets the different properties through its Options., etc.

 

Yeah I still think the benefits of FPC > interpreted. But um, if the Time/resources is significant difference. I think it'd be cool to integrate LAPE into this. According to nielsie95 (lapes creator), LAPE > Dws Script. Also the sources for both, LAPE is more recently updated versus Dws.

 

Anyway I'm going to start working on the FPC part again. Done messing with the GUI for now. Gave up on the docking altogether for now. But there is TSplitters implemented.

Edited by LordJashin
Link to comment
Share on other sites

"LAPE > Dws Script".. In what scenario?.. Anyway: As soon as one implements the JIT, DWS really kicks of, the speed reaches up to Delphi in some cases from what I've seen, Lape is not even close to that. But lape got a few nice things implemented which DWS does not.

 

-----

Today I created a simple minimalistic "subset" (don't know if I want to call it a subset) of Pascal <-- Well almost, some strong differences exist. IE: "My subset" is dynamicly typed.. I timed it up against Lape to see what the speed differences where, I found a nice problem for it to solve: Problem 12 - Project Euler: Here is a printscreen of the test:

>>> http://s13.postimg.org/sy9tab207/dynamic_pascal.jpg

^ Will not use img-tag *takes up so much space in your thread*. You can see that my hacky subset uses 8sek, while Lape uses 37sek :P

Testcode (both versions): http://pastebin.com/EVJtU2gj

 

That was one (dirty) fun project (written in python), at first I was actually writing a Pascal2Python-thingy but I got bored and abused it :-)

Edited by slacky
Link to comment
Share on other sites

Dws gets multiple updates every week...

 

My bad. The source was last updated in January. On the downloads page though, the last stable release was in 2012. Delphi Web Script...located here? JIT compiler *experimental*.

 

Well anyway here is the results from running Slack's GetSystemTime script:

 

Top half of the code on paste bin:

EpbzUeD.png

 

Bottom half looks like C lols.

 

EDIT: When trying on delphi I got Negative numbers. One time I did with FPC, but I fixed it now somehow.

 

Couldn't get it to work on SCAR either.

Edited by LordJashin
Link to comment
Share on other sites

It uses around 7.0 sec in FreePascal. That versus a dynamically interpreted language that uses 8 sec is pretty small difference. Compare that to Lape which uses 35 sec.. The code works fine in SCAR... But SCAR/PascalScript would use ages on this, I am not willing to even try..

 

The later code does only look like C when you are really drunk...

C would be more like: [C] #include <stdio.h> #include <math.h> #include <windows.h> typedef unsigned - Pastebin.com

- The C-version uses about 6.8sec on my computer.

 

So I am pretty happy with my earlier result :b

Edited by slacky
Link to comment
Share on other sites

Here is the application! Download link: http://www.filedropper.com/autoliciouside

Source is attached for those interested.

 

My bad Freddy it actually said "July"! Not January lol. I must be blind or something.

 

It uses around 7.0 sec in FreePascal. That versus a dynamically interpreted language that uses 8 sec is pretty small difference. Compare that to Lape which uses 35 sec.. The code works fine in SCAR... But SCAR/PascalScript would use ages on this, I am not willing to even try..

 

The later code does only look like C when you are really drunk...

C would be more like: [C] #include <stdio.h> #include <math.h> #include <windows.h> typedef unsigned - Pastebin.com

- The C-version uses about 6.8sec on my computer.

 

So I am pretty happy with my earlier result :b

 

The language is c++ like though lol. I'm not much of a python guru :( .

 

Well I've been doing more work on this. Finished a lot of basic functionality (except the compile button lol). But I added a ton of crap to it. The source code is huge: around 700 lines. I'm going to slow down on the functionality of the program, and see what I need to do first. Still need to research some things. And then go look around at source codez, DWS, and more.

 

Future Plans:

 

1. Work on Compiler Debug Integration.

2. Code Completion

3. DWS script

4. Library Subset based on SCAR/Simba's subset of functionality. For the Function List. Note: basics first.

 

With this idea in mind. Some1 could use this IDE to learn, and make executables too!

Pic: 3bTPNYx.png

 

EDIT: Recently fixed some issues. The Resizing of the controls is handled a lot better now. Also added Save, and Clear button to the Debug control. Note: The one I uploaded doesn't have this yet. Also finished implementing the Saving of files.

Source.zip

Edited by LordJashin
Link to comment
Share on other sites

Why did you have to use GDB? Why didn't you just read the stdout, stdin, and stderr and use SW_HIDE to hide the console?

 

Well, can you Step, Step into, and Step over without using something like GDB? I know you can "Suspend", and "Resume" the process. GDB is only 6mb compressed. Makes the overall project, when compressed in a ZIP file: 14mb. I wonder if I can compress .O, and .ppu files from the RTL somehow. Or compress GDB or make it differently from the source. It was configured as mingw32 (was 64, till i added a flag to it, took forever to figure that out).

 

Lazarus uses GDB, along with tons of IDE's Visual Studio (addin), Mono, Qt, etc.

 

Ran into some complications with hiding the console. FPC opens another window (ppc386.exe) all on its own. But I fixed it just now by opening ppc386 (i386 compiler) instead of going through FPC. So NO console window now! Need to figure out what each file does in the source for that again.

 

EDIT: There is some options in FPC, for generating run time errors, and etc. But Idk if you can step through the program, which for me is a very important ability to have.

Edited by LordJashin
Link to comment
Share on other sites

Identifier Completion! The lazarus project, really is resourceful. Their "Code Tools" make it easy to do harder things.

 

Here's a preview for now, I got the basics down with this. I think Simba might have done the same thing, just copy and paste the source to get this working lols.

 

These are all the "identifiers" associated with the System unit

 

YNV1PMa.png

 

After this. I will finalize some more on this project, and work on a Project Manager for it. The debugger (gdb) still needs more integration as well, I was able to load it up through command line though, and load a test program into it.

 

One of the big problems, is my knowledge on the Command Line is pretty crappy. With GDB loading the program, if it uses WriteLn, I think it outputs right to the gdb command prompt (not good). ladadadada....

Edited by LordJashin
Link to comment
Share on other sites

Going to try and pick this up again. Been months since I've worked on this. Uploaded the source to Assembla

 

If anyone's interested here's the repo ~ https://subversion.assembla.com/svn/autolicious/trunk/Autolicious/

 

I think I was able to get identifier completion, but copying the paint procedure was a pain, and I didn't complete that part yet. It's hard to pick apart the Lazarus source Lol. No where near as hard as creating Lazarus though, every time I look at the Lazarus source, I'm like mind blown. It's such a huge project.

 

EDIT:

 

Well, I give up, for now on using Lazarus source code, to do this. What I'm really stumped on, at the moment is the way you have to setup this event. Look, going to figure this out!:

 

uOCKcuL.png

 

I think it needs to be attached to my form class as well. Anyway, the only Lazarus source that is in this project at the moment, is the colors for the editor code, and executing the completion (ctrl+ space), along with CodeTools stuff.

Edited by LordJashin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...