Tuesday, December 25, 2007

Monday, December 17, 2007

Hello world in console and GTK+

Hello,
lately i received a request to show how to print Hello world from Syx and a small example on how to open a GTK+ window.

Here are the two examples:
Have fun!

Friday, December 14, 2007

Syx 0.1.5 has been released

Hello,
after a few months of low activity due to the university, i finally released the new version of Syx. Release notes follows.

This version includes yet more features, compatibility with other build systems on different platforms, important bug fixes and a great performance boost, which will be continued in next releases. A list of the major changes:

  • MSVC support has been improved
  • ANSI C and strict ISO compilation
  • External declarations for C++
  • The ST runtime compiler has been replaced with a C-side compiler
  • Class creation issues from ST has been fixed
  • Tracebacks and error reporting have been improved
  • Install desktop files on GNU/Linux platforms
  • Support for the GNU building system has been added as an alternative to SCons
  • Build under MSYS has been fixed
  • Block ensuring has been fixed
  • New examples have been added such as web code browser and a simple GTK+ application
  • Dictionary rehashing has been fixed
  • A better implentation of OrderedCollection? has been enhanced
  • Internal profiling and gprof support at compile-time
  • Created one stack per process against one stack per context

This version breaks the API for creating new processes and contexts from C and ST too. Thanks for anyone who contributed to Syx.

Tuesday, November 20, 2007

Finally ADSL then Gentoo

Hello,


i was a strong Linux From Scratch user since years.


My small city didn't have ADSL until now. ADSL came here with the Wireless technology.


OK, I've a low 256kb but it's better than a 56k, don't you think so? Then i started getting gentoo and compiling everything, and now I've got a complete Gnome desktop with all network working as well.


Yes, my first ADSL, my first distro!

Thursday, November 01, 2007

Syx to run code browser over CGI

Hello,
lately Dominic Letz in the Syx mailing list showed his simple version of a code browser for Syx for CGI. It has been added in the examples if you want to try it on your web server.

You can find an online working version on its site: http://dominicletz.de/cgi-bin/syx
You can also view the source code from the SVN repository: http://syx.googlecode.com/svn/trunk/examples/web/

Currently i'm not working on Syx so much because of lack of time, but remember the project is not dead and won't be.
Stay tuned, a new release of Syx is coming.

Thanks to everyone.

Saturday, October 13, 2007

Syx architecture

Hello,
did you forget Syx already?
After many months of inactivity (that will continue unfortunately) due to my lack of time, i created two images that briefly explains how the initialization and the scheduler of Smalltalk YX work.

The initialization is explained here: http://code.google.com/p/syx/wiki/InitArch
The scheduler here: http://code.google.com/p/syx/wiki/SchedulerArch

I hope to obtain more time to spend on Syx, i won't leave the project anyway.

Bye.

Tuesday, August 28, 2007

Syx on NAS Linux

Hello,
on the Syx mailing list, Brian Zhou notified about yet another Syx platform compatibility.

He said Syx worked on nslu2, on both unslung (armeb linux 2.4) and slugosbe
(armeb linux 2.6) firmware
.
Porting Smalltalk YX to these devices wasn't hard, in fact it doesn't need any specific patch to the sources.

Of course, would be a very good news if Syx is available in Optware.

Thanks to Brian Zhou and to everyone are currently working on Syx.

Bye.

Monday, August 20, 2007

Syx 0.1.4 has been released

Hello,
release notes follow.

A more stable VM has been reached with this version. Many features have been added for both the embedding and the environment. This version also includes the "image endianness compatibility" target of the 0.2 roadmap and a lot of wrapper methods for GTK+ with a basic GtkWorkspace.
This is the list of the major changes:
  • Running blocking processes inside the scheduler has been fixed
  • Major fixes to the garbage collector, object finalization, number parsing and to the scheduler
  • Rehashing support for hashed collections such as Dictinoary, Set and Bag
  • #perform: and #copyReplace family ANSI methods have been added
  • Interval and StdIOStream classes have been added
  • Missing lexer rules for quoted symbols and double quotes in strings have been added
  • ZeroDivide exception check for number division
  • Comparing methods to String have been added
  • A bunch of improvements for the SyxGtk plugin
  • Rehash dictionaries from C
  • Visual Studio compilation and debugging support
  • Useful functions for embedding Syx have been added
  • Reorganized inline functions to support other compilers and use dllexport and dllimport when building the library on Windows
  • Inheritance for method and block objects has been fixed
  • rootdir and plugindir Scons options have been added
  • Install dependent-machine object files into libdir instead of sharedir
  • Option -c has been added to syx to continue the startup sequence once filed in files from the command line
  • Support for big endian machines has been completed
  • System signal handling has been added
  • Print a bug report to the stdout on SIGSEGV or SIGILL containing informations on the memory state, the execution state and the traceback of the active broken Process
  • Image recovery on SIGSEGV and SIGILL or through the syx --recovery option
  • Scripting header (e.g. #!/usr/bin/env syx) support on fileIn
  • argumentCount check for methods and blocks has been introduced
  • Documentation installation and uninstallation is now supported
  • Support for 'a' and 'w+' mode with O_CREAT flag have been added to FileStream
  • Several issues have been fixed for packaging binary distributions of Syx using Scons
  • Getopt dependency has been removed
  • Desktop files for Posix systems have been added
Syx changed its logo since previous version. The Windows installer will handle .st and .sim files.
Roadmap for 0.5 version includes both internal and OS-level threads based schedulers, with possibly parallel computing support.

Thanks for all critiques and suggestions, and a special thank to everyone who's contributing to Syx.

Bye.

Wednesday, August 15, 2007

Syx image recovering

Hello,
lately Syx gained system signal handling. On Segmentation Violation or Illegal Instruction, a complete traceback of the execution state, the memory state and the active process contexts being entered is printed on stdout.

Sometimes, i had problems with Squeak while developing SqueakGtk, because i did interact with C and it was easy to get into an infinite loop or a segv.

In other words, sometimes these errors come just from one Process (in the above example, i'm talking about the Gtk main loop) that break things each time you start the same image.

In Syx, i managed to automatically create a copy of the image, appending the ".recover" extension, whenever SIGSEGV or SIGILL is signaled and then remove that broken Process from being scheduled.
Also, if this didn't work because the corruption involved the VM, you're still able to use the --recovery option from the command line.

Bye.

Saturday, August 11, 2007

SyxGtk vs SqueakGtk

Hello,
a friend requested me a screenshot of syxgtk, it's the first one here:
http://code.google.com/p/syx/wiki/ScreenShots.

I would like to explain how the 'asd.st' script works:
1) Create the window, and connect buttons with something like button when:
#clicked send: self -> #onClicked
2) Gtk main
2.1) This forks a process that calls a primitive
2.1.1) The primitive create a thread in which gtk_main() will run
2.2) Semaphore new wait (won't never be signaled this semaphore, it's used
just to keep the process suspended so keeping Syx up if no other process
is running)
3) Suspend the current process. This because the console actually is in
blocking mode, so we need to suspend the process. There's a way to let the
console be asyncronous, already tested using Semaphores, but won't work
with readline (any suggestion here?)

Now, we connected signals to a special syxgtk marshaller, which does the
following:
  • transform GValue to SyxOop
  • obtain the callback to call
  • create a new process
  • wait that process for being terminated (remember the callback is called within a OS thread)

These i think are pure Syx callbacks, really very easy to implement for
any other external loop.

How it differs from my old SqueakGtk? Just read:
  • each C call had one more redirection than in Syx, because in C calls using SWIG automatically handles self pointers by accessing instance variables
  • main loop had to be implemented in a Squeak-side method by doing the iteration manually
  • the marshaller had to forward its function to Squeak, because we can't convert from GValues to Squeak objects since we can't lookup classes
  • we save all that GValues in a special C-side stack
  • set the jump for future longjmp and call the interpreter
  • the main loop checks for callbacks, then obtain the list of arguments from that list of GValues and does its job
  • once returned from all callbacks, it's time to do the longjmp to return from the C callback

It was a pain, slow and moreover wasn't so safe to use setjmp/longjmp and a
stack of callbacks.

Bye.

Wednesday, August 08, 2007

Example on how to embed Smalltalk YX

Hello,
Smalltalk YX is born also to be a scripting language to embed in C/C++ applications. Lately, i was looking an article which briefly explains how to use Lua with C.

Then, i decided to remake that article for Syx, and this is the result:
http://code.google.com/p/syx/wiki/ExampleEmbeddingLua

The examples in the article above can be executed if you have an updated working copy of the source repository.

Other examples can be found here. Contact me if you want to contribute to this project.

Thanks to everyone, bye.

Monday, August 06, 2007

SWIG module for Syx

Hello,
lately i've been trying SWIG to test how much it can be useful to interface Syx to C/C++ libraries.
I got a good starting point with a very simple module which wraps C declarations very well. For instance, i wrapped many Glib/Gtk includes entirely without any problem.

Since writing Smalltalk YX primitives is really easy, it wasn't a pain to create a SWIG module for it. In fact, today i wrapped almost all GtkLabel functions as well.

The module is still missing C++ wrapping methods and some other typemaps, but i hope it to be available very soon for normal usage.

If anyone wants to contribute to the Syx project, please let me know.

Stay tuned for the next release of Syx.
Bye!

Monday, July 30, 2007

Syx 0.1.3 has been released

Hello,
this new release of Smalltalk YX adds yet more support for other platforms (Windows CE), a bunch of bug fixes, and many features like the ST compiler. This is a list of what changed since previous release:
  • Fractions, division methods and some other match functions (floor, ceiling, quo, trunc, ...) have been added
  • Some lexer issues (quotes, minus, ...) have been fixed
  • Fixed garbage collection while finalizing objects
  • Many ANSI methods for Character have been covered
  • First attempt to reach endianness image compatibility
  • String to Number methods and viceversa have been added
  • Super messages have been fixed
  • Syntax shortucts such as Object>>#caseOf:otherwise: have been added
  • Fixed cascading parsing
  • A complete Smalltalk compiler has been added
  • Support for cross-compiling and with more options have been added to Scons
  • Save text of methods
  • Increased initial memory size from 20000 objects to 100000 objects
  • More C functions have been documented
  • An important issue in ArrayedCollection?>>#replace:From:To:With: primitive has been fixed
  • Access mode (read, write, read and write) to Streams and more methods to FileStreams? have been added
  • CompiledMethod? and CompiledBlock? inheritance has been reorganized
  • Run Smalltalk scripts from command line
  • New plugin to wrap native Win API to create a simple WinWorkspace
  • Build Syx for Windows CE with WinWorkspace running on the device
  • Support for user-defined startup sequence has been added
  • Support for wide-character strings has been added
  • getopt, errno, fstat, access, getenv and perror are now optional functions

Cross-compiling to Windows CE has been done with host=arm-wince-mingw32ce using CeGCC by disabling all configuration options. Endianness compatibility is not perfectly reached yet.

See the ChangeLog for a complete list of things that changed.

Sunday, July 29, 2007

Smalltalk YX to run on PocketPC

Hello,
Smalltalk YX is known to work on many platforms at this time. However, lately i've been working to port it on PocketPC with a small graphical workspace.
It took me about 3 days of work but now it works very well. Cross compilation has been easily done using CeGCC on Windows with just some changes in the VM.

The only problem is that Syx needs to be installed into the root device to work, it's not working in other directories, but i think this is the last problem to care about.

A plugin has been added, called WinWorkspace, which is a native Windows GUI containing a text box for both the input and the Transcript, and a DoIt button to evaluate the code. This plugin also works on Win32.
I think Syx can be easily ported to Smartphone as well without many changes.

Here you can find some screenshots: http://code.google.com/p/syx/wiki/ScreenShots

Stay tuned with the next 0.1.3 release, bye.

Thursday, July 19, 2007

Smalltalk YX to compile itself

Hello,
lately i've been working on a compiler for Syx in Smalltalk. Actually, it's mostly a plain translation of the C one, but works pretty nice. This is an example without using intermediate shortcuts:

$ syx
> | text lexer parser method context |
> text := 'message ^123+32'.
> lexer := CompilerLexer on: text.
> parser := CompilerParser on: text for: nil class.
> parser parse.
> method := CompiledMethod fromParser: parser.
> context := MethodContext on: method parent: thisContext receiver: nil arguments: #().
> ^Processor enter: context!
155
> EOF

Eventough it's still missing features such as cascading and optimized blocks, i hope to release 0.1.3 version very soon. The purpose is to use this compiler for the console and for files instead of the C one.

Stay tuned, bye!

Friday, July 13, 2007

Syx 0.1.2 has been released

Hello,

this version of Syx has a bunch of new features added to the Smalltalk
environment, and a more stable VM. Major enhancements includes:
  • New compiler flags to build Syx on Mac OS
  • Added Sets and Bags
  • Refactored objects to hold both instance variables and indexed variables
  • Literals in methods are now constant
  • Added basic WriteStream
  • Doubled initial memory size to hold 20000 objects
  • Fixed ByteArray/String small integer to character conversion
  • Added object finalization by fixing GC transactions
  • Added support for infinite-precision numbers using GMP
  • Integer overflow checks when doing sum, difference, multiplication and bit-shift

Note that Syx can be compiled also without GMP. Eventough you use an
image containing LargeIntegers, Syx will run without problems but won't understand that
numbers.


Bye.

Monday, July 09, 2007

Syx on FreeBSD and Sparc

Hello,
actually, Syx is known to work on Linux and Windows with 32-bit and 64-bit support and image compatibility.
Now Syx is available also on Sparc SunOS and FreeBSD.
A contributor sent me two packages after some troubleshoots with Scons on these two platforms.

Also, i would announce the creation of a google group for Syx discussions.

Stay tuned for the next 0.1.2 version. Bye!

Thursday, July 05, 2007

Syx 0.1.1 has been released

Hello,
this second version of Syx includes as many bug fixes as feature enhancements. I wanted to release this version just after 3 days because i think these changes are very important.
  • Implemented linear hash tables, similiar to double hash
  • Added method caching to unary and binary messages too
  • Added bdist command to create a binary distribution
  • Improved exception handling and tracebacks
  • Added Integer class with basic bit-wise operations
  • Inline whileFalse: block
  • Covered most of PositionableStream? standard
  • Added basic subclassing at runtime
See the ChangeLog for a complete list of things that changed.

I've also added binaries for Linux on x86 and x86-64 platforms.

Please comment, give me suggestions but especially critiques ;)
Bye!

Monday, July 02, 2007

Syx 0.1 has been released!

Hello,
finally after a month, i've just released the first version 0.1 of Smalltalk YX.

You can find detailed informations on what Syx reached till now by reading the release notes.
Downloads and installation instructions are provided on the home page, including binaries for Win32 and an installer.

Feel free to add comments of any type, from critiques to suggestions.
You can also email me and ask about the project.

Bye.

Saturday, June 23, 2007

Syx improvements

Hi,
some times ago i talked about my Smalltalk implementation, Syx.
These are the main objectives i reached till now:
  • Working on Windows and Linux indifferently, using the Scons build system
  • Added a very simple garbage collector and memory management
  • Added a basic plugin system
  • Introduced immediate Characters (like SmallIntegers)
  • Exception handling/ensuring
  • Image compatible with both 32bit and 64bit format
This is what's next:
  • Coalesced hash tables with consistent hash functions
  • Add system signal handling
  • Complete the basic environment
  • Implement a strong method caching
  • Use non-blocking functions for I/O
  • Foreign Function Interface (maybe FFICall?)
Here is the ChangeLog and a screenshot of Gtk+ running inside Syx

Sunday, June 03, 2007

Smalltalk YX

Hi,
i'm creating this new Smalltalk-80 vm, based a bit on the blue book, inspired by PDST and Susie, but much different in some aspects.
I talked about it some times ago here:
http://lethalman.blogspot.com/2006/11/new-experimental-smalltalk-version.html

Now, after important refactorings, that are continuing right now, i wished to publish the project under MIT license here: http://code.google.com/p/syx.

Currently, i'm working on speed: i want a fast but complete VM as much as i can trough my very poor knowledges.

At all, i'm learning many things from this project, really... tough it's very close to Little Smalltalk's philosophy, i would like to continue my work even if it could be "yet another insignificant fork", just to learn other cool things about Smalltalk.

Bye!

Thursday, May 03, 2007

Little Smalltalk

FromSqueak to Visual Works, from StrongTalk to GNU Smalltalk, i finally discovered a good smalltalk implementation: Little Smalltalk.

In the previous post i talked about GNU Smalltalk and why it matters, but it's still unstable, it works only on Unix and it's slow.
Also i stopped working on SqueakGtk due to various reasons.
Visual Works is not open and the non commercial version is just for educative purposes.
I dislike StrongTalk even if it's a nice idea.

So, what's next? I tried to create a Smalltalk by my own, the VM is still ready, it works but it needs still some optimizations and hacks to be more stable. When i decided to exploit some of the basic virtual machines on the net, i found the project Little Smalltalk alive... just a reading on the about page, a test on a Windows machine, and i realized this project is just what i tried to make since several months.

Conclusion? Little Smalltalk has a strong base, it's very portable especially its GUI (IUP) and it's at the beginning... it needs help and i guess this version could increase its importance and become a mainstream only if being supported.

Just what Smalltalk wants to be...

Wednesday, May 02, 2007

SqueakGtk again here

Hello,
after many months of inactivity, i'm going to restart working on SqueakGtk.
For anyone who wants to give a contribute, please contact me at lethalman88 at gmail dot com.

Bye.

Sunday, April 15, 2007

Opera 9.2 Speed Dial

Hi, i've updated my Opera browser. I would just say speed dial is amazing.

It's the most useful caching system i've seen ever. You can set up to 9 web sites to be cached and updated regurarly: the result is an incredible speed boost on that sites.

I would want to say something against Gecko forces: i see Firefox, Thunderbird and the other gecko-based applications too heavy and less powerful/featureful than Opera.

Ok, they have extensions, but the extensions they have are handled in Opera in a better and lighter way. Also, Opera introduced widgets, just a beginning toward plugging the browser.

Firefox and Thunderbird are about 30mb of download, Opera just 6 mb, and this is important for my 56k for upgrades.

Gecko is open source, Opera's not... maybe this is the main reason why Opera is less used than Gecko: "i want only open source software because i want open source". For who's using Gecko, compliments for the choice, i guess you got so much computer resources in order to use it :) .

Sunday, February 04, 2007

Java IS the IDE

I read a post about Java and what developers think about its possible future extensions: Why is everything a language extension? So why is everything an IDE?

IDE, IDE, IDE... why are you all Java programmers concentrated on the IDE power? I really can't accept this concept. What this means? This means that Java can be boring on many tasks... what about writing Java GUI and other things without an IDE? Yes, the first reason why i left Java programming is just this: you need an IDE that saves you from the code.

Why is it hard to understand that Java is the only language that needs so much IDE support instead of writing plain code? I'm a Smalltalker/Pythonian but take the closer language to Java: C++ doesn't need as any "magic" stuff as Java does trough IDEs.

Please, let Java become simpler since i have to study it by force against my will.

Sunday, January 28, 2007

Qt and PostgreSQL on Windows

Hello,
in this period i'm creating a simple application with Qt/C++ and Postgres, but i got the usual error "Driver not loaded" when opening the database. This means the qsqlpsql sql driver can't be loaded.

First of all, you may need to compile the driver, this can be done by reading the Qt documentation on how to install sql drivers on windows. After i've done that, the error was the same: Driver not loaded.

The solution is simple, just put these files in the directory where your executable is:
- mingwm10.dll (for who's using MingW)

Ordinary Qt dependencies (found in the bin directory of Qt):
- QtCore4.dll
- QtGui4.dll
- QtSql4.dll

PostgreSQL dependencies (found in the bin directory of PostgreSQL):
- krb5_32.dll
- libeay32.dll
- libiconv-2.dll
- libintl-2.dll
- libpq.dll
- ssleay32.dll

Other dependencies that you maybe should download from internet:
- efsadu.dll
- msjava.dll

After that, your directory should contain the above DLLs with the executable file.
The next step is to create a directory named sqldrivers in the same directory and copy into qsqlpsql.dll from %QTDIR%/plugins/sqldrivers.

Now run your application and everything should work correctly.
In all mailing list i've seen that they needed to recompile Qt with qsqlpsql statically linked, but i adopted this other solution which is more suitable.

Bye.