--NoDr - YGO--

2/5/2006

Calendar for Factor 080

Classé dans: — @ 12:40 am

Update release for of calendar Factor 080

calendar80

As usual, probably buggy, so use it at your own risk

11/7/2005

CALENDAR 068

Classé dans: — @ 9:59 pm

New Release 068

calendar068.tgz

First release with date and calendar working

Aligned with last release of Factor 079 (unit test probably not updated but all rest work)

This release of Factor (079) provide a lot of change and the new UI doesn’t work on my Linux Mandriva
(give an Out Of Memory error probably related to [ SDL_GL_SwapBuffers ]
)
I have also try this release on Windows 2000 - work fine even the UI

New Release 067

calendar067.tgz

First release with date and calendar working

not tested deeply but this release should work for both 2 two datas types calendar and date. Please use it and send me bugs report

You may send comment to : nodrygo at free dot fr

10/3/2005

Calendar Updates

Classé dans: — @ 8:00 pm

Rel: 052

dates052.tgz

Very few modifications - code cleaning


Calendar become Dates Rel: 051

dates051.tgz

Start of some code cleaning and a major change for name

CALENDAR become DATES

WHY :
Main differences with dates and calendar are:

  • date:

    is millisec based
    limited to timespace 01/01/1970 > today
    limited in computations (days+/hour+/minutes+/seconds+)
    use GMT timelag but no timezone
  • calendar:

    (this will be built in far far futur)
    seconds based
    not limited in timespace (since 01/01/0000 to defined)
    Gregorian or other possible
    permit direct setting for day/month/year
    adding year/month/day/hour/minutes/seconds according timezone
    use timezone (winter/summer time according timezone)


Rel: 05

calendar05.tgz

Many changes according Slava suggestions that simplify the code by a lot
WARNING this release doesn’t work with date < 01/01/1970
this is a major bug. Next release should resolve this issue (I hope).
There is still some parts to simplify and finish.
This code si NOT WELL TESTED and it may containt bugs !!!

  • New generic formater

    { %D “/” %M “/” %Y ” ” %h “:” %m “:” %s } datefmt .
    Give “25/07/2005 16:12:18″

  • Calendar functions


    localedate

    give locate value of milliseconds according timezone

    fulldays

    number of days since 1/1/1970

    year

    Year number

    month

    Month number

    monthname

    Name of the month according locales

    day

    Day number

    dayname

    Name of the day according locales

    hour


    minutes


    seconds


    timezone

    Value of timezone GMT based

    hour+

    Add N hours to calendar

    min+

    Add N min to calendar

    sec+

    Add N sec to calendar

    day+

    Add N days to calendar

    Parser

    Warning parsing is limited to date > 01/01/1970 (anterior date give negative millis:-( probably I should change the internal representation for millisec or hack for negative number ).
    calendar-builder take a list in the form [ gmt h mn sec jj mm yyyy ] and build the date. The string date can be parsed like on the exemple parse-fmt-fr in locales.factor.

    - Now all the fiels are computed on demand. Hope this is fast enougth.
    - Now I have set by default
    2 “timezone” set ! default GMT + 2

    “fr” “locales” set ! defaut locales france

calendar05.tgz


Rel: 04

  • few modifications and changes for Factor 078/079

calendar04.tgz

Rel: 03

  • Add simple date parser
  • not sure it is bug free

calendar03.zip

not sure it is bug free

calendar03.zip
Exemple of use
“25/7/2005 16:12:18″ parse-fmt-fr .s
<< calendar [ ] 1122307938000 12989 58338 2005 206 7 25 16 12 18 "fr" 0 "fr" >>
calendar>string .
“25/7/2005 16:12″

Of course you need to write your own parser using parse-fmt-fr as exemple
Now I am stopping for few time on calendar , trying another things on Factor

Rel: 02

Following slava comments, some simplifications

  • remove stupid t f ?
  • remove unusefull GENERIC
  • still TODO replace contain? by member? and string date parser

Still the same request on TUPLE

How to remove some mutator field: >> :private thing ?

calendar0.2.zip
Exemple of use
new-calendar
dup calendar>string .
“20/7/2005 7:47″
dup “fr-full” swap set-calendar-locale
dup calendar>string .
“Mercredi 20/7/2005 7:47:49 GMT:0″
dup 2 set-timezone
dup calendar>string .
“20/7/2005 9:47″

warning still probably buggy

7/18/2005

Factor first lines of code

Classé dans: — @ 9:56 pm

The better way to learn new language is writing code so I do it.

This is the premices of a dates/calendar lib.
Actually it is not finished yet, but some part seem to work. It is not tested at all, so, probably buggy.
I am not sure the code is the clever one because I am still not confident with Factor and also because I am pragmatic … if it works fine … let’s go … I leave the subjective beauty of the code for purist.

Uncompress this CALENDAR in Factor/library and go

  • TEST
    new-calendar .s  (word for today <calendar> )
    << calendar [ ] 1121715062216 12982 70262 2005 199 7 18 19 31 2 “fr” 0 “fr” >>
    dup print-fmt .
    “18/7/2005 19:31″
    dup 2 swap settimezone
    dup print-fmt-fr-full .
    “Lundi 18/7/2005 21:31:2 GMT:2″

COMMENT and QUERY
The <calendar> is immutable ( except the fact TUPLE is not immutable .. I have to learn deeper this)
- The millisec field is ALWAYS express in GMT 0.
- Other fields are the externals representation of the date according the timelag
- settimezone create new calendar with same millisec but different representation (don’t know if it is a good idea)

  • DATES
    primitives for dates computations
  • CALENDAR
    calendar classes
  • LOCALES
    printer and parser (not yet done) for differents locales

I wonder if TUPLE should not have something like :R or :RW modifyer to change the built of the words associated
( :R doesn’t create mutator for field while :RW does and default :R)

I hope I’ll finish calendar soon

7/13/2005

Factor thoughts and dreams

Classé dans: — @ 9:52 am

Factor is a new programming language from Slava Pestov combining some forth, lisp and joy concepts in a great portable environment. Very good key features and a lot of good ideas .. I really like it.

But unfortunatly it is a bit too young to be really usable and there is still some important lack. Some reflexions on this below

  • FFI :

    still the lack of callback (should be usefull for some external lib such as freeGLUT ;-)
  • External LIB:

    I know Slava dislike the idea of external lib but it’s a term of time to market. Re write most of the things in Factor should take too long and use some existing library may be a first good approch awating for anything else.

    • XML:
      libXML2 & libXLST ?
    • SSL:
      open SSL ?
    • IMAGING:
      libpgn libtiif libjpg libmpeg ?
    • PDF
      ??? pdf writer/ exporter
    • ZIP-TGZ
      ??? libZIP
  • GUI

    interesting job but very ugly presentation … need a lot of “graphics” improvement :-) probably next step ?
  • PRINTING Lib.

    most of language makers forget this very important area
  • Asynchonous pre-emptive lite process (like Erlang one)

    - NO EVIL SHARED MEMORY
    - NO EVIL LOCK etc… (I fully agree with this post of Joe Armstrong main author of Erlang)
    but instead synchronous lite process with QUEUE MESSAGES paradigm, LOW MEMORY OVERHEAD, FAST SWITCHING context, like the Erlang one in a Pre-Emptive mode. Erlang can deal with hundred of thousand lite process exploding most of the OS thread system. I am quite sure Factor can do the same.
  • DISTRIBUTED

    distributed Factor at interpretavive level (REPL) between multiple running VM through a SSL connection (should not be too complex re-using some trick of JEDIT)
  • WINDOWS services:

    Shoult be great to have Factor runing as a ’services’ on windows
  • MODULES:

    Partial load/unload of image part ???? plateform independant

My ultimate dream: Factor runing on MAEMO with ARM back end compiler. I plan to buy the NOKIA 770 by the end of this year and I really like to use it for Factor coding pending my long (3H) daily transport in the train to go to work. Factor need few sign for write code so it should be possible even with the tactile keyboard.

I also wonder if Factor permit easilly to write some WORD code using a direct virtual assembly level. I have not closely look a VOP and the doc seem limitated in this area, but it should be great to look closer.

Réalisé avec WordPress  visitors