Skip to main content.
Mayo 5th, 2008  español 

A ZX Spectrum BASIC Compiler

Computer Science

Wow! My last post was two months ago!
What have I been doing meanwhile? Well, right now, besides attending my job ;) I’m attending the PhD course on Physics and Computer Science at Universidad de La Laguna.

My favorite subjects are, yes, you guess it, Parallel computing and Computer languages (Compilers, Language processors, etc…)

I’m currently programming a ZX Spectrum BASIC cross compiler in my (little) spare time. It’s entirely written in python, and almost finished (hope to release V1.0 this month). It’s a three stage retargeable compiler. The backend outputs Z80 code, so it should be easily portable to other Z80 micros such as AMSTRAD or MSX. Porting to other architectures, or even to .NET or Java it’s also possible by changing the backend module could also be implemented.

Regarding to the language, It’s not the ZX Spectrum original BASIC but a dialect very close to FreeBasic which allows function definitions and more complex control-flow structures. The URL contains an almost complete specification, although not all of them has been implemented in the ZX for obvious reasons.

Some features:

  • Function definitions with local variable scopes and parameters by reference or value
  • Multidimensional arrays of any data type
  • Strings passed by value or reference
  • Dynamic memory heap
  • Inline ASM code
  • Completely extensible with your own functions

You can download current alpha builds or visit the forum for suggestions, comments, etc.

Posted by Boriel as Compilers, Computer Science at 8.06 pm

Rate This Post: 1 Stars2 Stars3 Stars4 Stars5 Stars
No Ratings Yet
Put your comment »
Marzo 3rd, 2008  español 

GCC Compiler “now” supports OpenMP

Computer Science

Actually, this isn’t recent news, since GCC supports OpenMP since version 4.2.0 (released on May, 2007). The interesting thing is that it’s being considered really stable and mature now; on the other hand, a new 4.3.0. branch is about to come. So we’ll soon see OpenMP support in our favourite Linux distro :) (it seems Fedora might already have included GCC 4.2.0 with OpenMP support already).

Previously, OpenMP support was done in GCC though the use of GOMP (an OpenMP library), but it has been finally merged into the developing mainline of this compiler collection (yes, Fortran have it too). ;-)

The specification implemented is OpenMP 2.5 (there’s a 3.0 draft on the way), and it seems to be completely supported, as you might read at the GCC Open MP features document.

Posted by Boriel as Parallel Computing, Compilers, Computer Science at 7.26 pm

Rate This Post: 1 Stars2 Stars3 Stars4 Stars5 Stars
No Ratings Yet
Put your comment »
Febrero 6th, 2008  español 

My own compiler written in Python

Computer Science Programming

During these last months I’ve been developing, just for fun and in my *very* little spare time, my own compiler kit tool.
More than a compiler, it’s a tool for building up compilers (there are others over there, like Lex & Yacc, Flex & Bison in its GNU flavour). Mine is called Bparser.

I’ve put it in my wiki, just in case anybody want to give it a glance.

My tool is better than the LEX & YACC couple in the sense it can parse LR(n) grammars whilst LEX/Yacc only parses LALR ones. It uses a Lookahead and mangle-likes estructures to take some decisions when choosing which grammar rule to use for reduction.

If it eventually cannot decide which rule should be used, it will start to backtrack to find out the rule to apply.

This tool allows ambiguos grammars, so it is very similar to a GLR parser. BISON (GNU’s YACC) can also use the GLR algorithm, but it is less efficient and can take exponential space/time to parse some entries depending on the given grammar.

Read the rest of this entry »

Posted by Boriel as Compilers, Computer Science, Programming at 12.05 pm

Rate This Post: 1 Stars2 Stars3 Stars4 Stars5 Stars
No Ratings Yet
2 Comments »
Enero 20th, 2008  español 

Captcha Unsafe?

Wordpress

I’ve recently received an email asking me to fix some Captcha! vulnerabilities that will allow spammers to enter automated spam comments. Such supposed vulnerabilities where published on a Russian Ukranian blog.

Puzzled about this, I checked those post. One of them claimed Captcha! is vulnerable to CSRF and the other post is about XSS.

Basically, CSRF means you visit an insecure website while logged in into our Wordpress blog. If so, and the site is prepared specifically for you (that is, the hacker knows you’re going to browse him while being logged into xxyyzz.com and your’re the admin of xxyyzz.com) then he could create a malicious page to change your WP configuration (Captcha! included) awaiting for you to browse it.

Using this (rather improbable and really tricky) technique, visiting a hackers site can change Captcha! code length to 0, which disables it: Captcha! won’t check 0-length codes. The sames applies for XSS (the second vulnerability).

Protecting against CSRF

This has been fixed on version 2.6 (now avaliable for download).

For previous versions, the best protection against CSRF is to logout your WP site before browsing an insecure web site. If you tend to check the “Remember me” check box when logging in, don’t use it.

Also use a browser like Firefox with the NoScript! extension installed. This extension will warn you about this kinds of attacks even if you have forgotten to logout your WP blog.

How will this impact me?

You can relax. There’s nothing dangerous to fix, and Captcha! is safe. Simply ugprade to the latest version.

Posted by Boriel as Wordpress, Security at 5.22 pm

Rate This Post: 1 Stars2 Stars3 Stars4 Stars5 Stars
1 Votes | Average: 3 out of 51 Votes | Average: 3 out of 51 Votes | Average: 3 out of 51 Votes | Average: 3 out of 51 Votes | Average: 3 out of 5 (1 votes, average: 3 out of 5)
4 Comments »
Enero 1st, 2008  español 

Happy 2008!

Unlike Edanna, I forgot to say Merry Christmas. I’ve been so busy that, as you may see, I haven’t post anything this last two month.

If you’re reading this, yes, I wish you a Happy Year, 2008. It’s a cliche, I know, and it probably will a wish that will die into the oblivion, broken by some life’s setback. But, as Edanna seems to hint at, maybe accepting it and keeping going on is one of the secrets of happiness. ;-)

Posted by Boriel as Sin categoría at 12.40 pm

Rate This Post: 1 Stars2 Stars3 Stars4 Stars5 Stars
No Ratings Yet
3 Comments »
« Previous entries