World: r4wp
[#Red] Red language group
older newer | first last |
Kaj 14-Mar-2012 [299] | http://development.syllable.org/news/2012-03-14-20-30-RedSystem-bindings-with-C-cURL-SDL-SQLite.html |
Pekr 14-Mar-2012 [300] | Nice. Wil you push to OSNews? :-) |
Kaj 14-Mar-2012 [301] | Already done |
Pekr 14-Mar-2012 [302] | Maybe apart to C lib, you might mention in one sentence, that other big change for Red/S was addition of float support ... |
Kaj 14-Mar-2012 [303] | It's in there |
Pekr 16-Mar-2012 [304] | Implementing basic features for block! datatype support. . RED - finally :-) How Btiffin says - go Doc, go! :-) |
Nicolas 26-Mar-2012 [305] | Does anyone know how to change a float into an integer or round a float to its nearest integer counterpart? |
Pekr 27-Mar-2012 [306] | dunno, maybe via type casting? as integer! ... but not sure if it works for floats, or only pointers ... http://static.red-lang.org/red-system-specs.html#section-4.9 |
PeterWood 27-Mar-2012 [307] | The current partilal support for float does not support casting between float and integer datatypes |
Pekr 27-Mar-2012 [308] | It seems float to integer is not allowed. Maybe some library call wrappers will be needed for that? |
DocKimbel 27-Mar-2012 [309] | Support for converting between integer! and float!/float32! has not been implemented yet. The only way to achieve it right now is to rely on an external lib (libc?) or implement your own conversion routine in Red/System. |
Kaj 27-Mar-2012 [310] | Yes, the C library binding can do that |
DocKimbel 27-Mar-2012 [311] | FYI, I am making good progress on the Red runtime, but I had to start implementing the Red compiler earlier than planned, to be able to define more accurately the right runtime API that the compiler needs. So at the time that the runtime will be ready, I should have a first Red compiler partial implementation working. |
Kaj 27-Mar-2012 [312x3] | Sounds logical to me |
round-ceiling and round-floor in math.reds do rounding to integer, but they still return a float value | |
To convert to an integer value, you have to go through strings. You can use the format function in C-library.reds for that, but I see I haven't defined a shorter float wrapper yet | |
Pekr 27-Mar-2012 [315] | Doc - we are watching your progress via the Twitter messages, and looking into Github :-) |
Kaj 27-Mar-2012 [316x6] | I've added some floating point convenience wrappers matching the other data types |
This should work for conversion: | |
to-integer form-float | |
Note that the string returned by form-float should be freed | |
The other way around is already used in my Fibonacci and Mandelbrot time processing: | |
to-float form-integer | |
Andreas 27-Mar-2012 [322] | On Linux, you could also avoid going through strings and use lrint(3)/lrintf(3). |
Kaj 27-Mar-2012 [323] | Is that GLibC specific? |
Andreas 27-Mar-2012 [324] | ISO C 99 |
Kaj 27-Mar-2012 [325] | OK, that could be considered as a binding enhancement, then |
Andreas 27-Mar-2012 [326] | Should work on anything except Windows. |
Kaj 27-Mar-2012 [327x2] | Once the Red runtime is more fleshed out I'll see what is still useful to add in Red/System |
Windows doesn't support C99? | |
Andreas 27-Mar-2012 [329] | Nope. |
Kaj 27-Mar-2012 [330x4] | Sigh |
I wrote a binding with the Evince document viewer for the Document Freedom Day tomorrow: | |
http://www.documentfreedomday.nl | |
I now have a GTK widget that can show PDF documents | |
Gregg 27-Mar-2012 [334] | That's great Kaj! |
Endo 27-Mar-2012 [335] | Wow, that's cool! |
DocKimbel 27-Mar-2012 [336] | I cannot connect to the URL, it seems to timeout on every attempt. |
GrahamC 27-Mar-2012 [337] | The URL is in dutch |
Kaj 27-Mar-2012 [338x3] | Our server was down for a short while |
I also have WebODF running on my WebKit browser and a local Cheyenne, so I effectively have a viewer for OpenOffice/LibreOffice ODF documents | |
Since the browser is in the form of a GTK widget, this viewer is also a GTK widget | |
Kaj 28-Mar-2012 [341x2] | We're at the Document Freedom Day now. I presented the GTK binding and the Evince and WebODF widgets |
We also have a presentation by the WebODF author every year :-) | |
BrianH 29-Mar-2012 [343x2] | It's just MSC that doesn't support C99. There are other C compilers on Windows that do support it. |
How well they support it varies, I'm sure, as it does on all platforms. | |
Kaj 29-Mar-2012 [345] | Do they come with C libraries that you need to install to get these functions? |
Bas 3-Apr-2012 [346x3] | In this DocumentFreedomDay-2012-playlist you can also find the film of Kaj's presentation about Red bindings with WebODF, LibreOffice and PDF last week in the Royal Library in The Hague, the Netherlands. |
http://www.youtube.com/watch?v=UzdT9s-CfdE&list=PL2736E5F6878491D9&index=5&feature=plpp_video | |
http://www.documentfreedomday.nl/2012/WebODF-LibreOffice-Evince.html | |
older newer | first last |