Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 15 19:18
    rebred commented #4058
  • Dec 15 16:28
    dockimbel closed #4101
  • Dec 15 16:28
    dockimbel labeled #4101
  • Dec 15 16:28

    dockimbel on master

    TESTS: adds regression test for… (compare)

  • Dec 15 16:20
    dockimbel labeled #4101
  • Dec 15 16:20
    dockimbel labeled #4101
  • Dec 15 16:19
    dockimbel milestoned #4101
  • Dec 15 16:19
    dockimbel commented #4101
  • Dec 15 16:19

    dockimbel on master

    FIX: issue #4101 (Incorrect han… (compare)

  • Dec 15 15:23
    dockimbel labeled #4101
  • Dec 15 15:02
    dockimbel assigned #4101
  • Dec 14 19:51
    greggirwin commented #3340
  • Dec 14 19:46
    greggirwin commented #3340
  • Dec 14 09:26
    hiiamboris commented #3340
  • Dec 14 09:16
    hiiamboris commented #3340
  • Dec 14 07:29

    qtxie on GTK

    FIX: refactor gradient pen/fill… FIX: update grad-pen test FIX: focal gradient's first cir… and 2 more (compare)

  • Dec 14 07:29
    qtxie closed #4188
  • Dec 14 04:31
    greggirwin commented #3340
  • Dec 14 03:32
    greggirwin commented #3340
Boleslav Březovský
@rebolek
Found it.
hiiamboris
@hiiamboris

Red has a higher limit (128 IIRC)

I think it's 32k right now, but can be increased to 1M if the need arises. Plenty of space in the header: https://github.com/red/red/blob/1d32938a2c39286c14173a4ff78f21dd3c17d905/runtime/allocator.reds#L22 Some bit fields only make sense for a certain type so it's easy to unify those.

hiiamboris
@hiiamboris
typeset! becomes the real limit in it's current implementation, 3x32 bits = 96 types. And though the implementation can change, it will be unwise to extend it, since we have typechecks on every function call, and they have to be real fast.
GiuseppeChillemi
@GiuseppeChillemi
So, typeset is based in single bits and not a combination of them?
*on
Pierre
@pierrechtux
Hi, redders! Long time!
Someone is asking me to put up a simple web server to communicate with a postgresql base and deliver answers in json.
And he leaves me free to pick up the tool I wish... So of course I thought of making this in Red, hence I come back here!
So my question: is Red now able to do such things? (I've browsed a bit through the documentation, without finding an answer)
Gregg Irwin
@greggirwin
@pierrechtux JSON is easy, and built in, but we don't have a Postgres driver yet.
Pierre
@pierrechtux
I suppose that the ports are not implemented?
Gregg Irwin
@greggirwin
Not yet. Due in 0.7.0.
Pierre
@pierrechtux
I work daily on postgresql databases with my favorite Rebol 2. I wish I could do this with Red...
Okay; then I'll wait for 0.7. I guess that once ports will be done, the author of that good old Rebol postgresql driver (http://rebol.softinnov.org/pgsql/) may be available to bring this magic to red.
For now, I think that I'll stick to Rebol.
Boleslav Březovský
@rebolek
@hiiamboris from your link:
7-0: datatype ID ;-- datatype number
8 bits, so 256.
hiiamboris
@hiiamboris
And one line above?
Oldes Huhuman
@Oldes
The real problem is not number of datatypes, but the lexical syntax of the new ones. Imho.
Boleslav Březovský
@rebolek
@hiiamboris <reserved> so ignore them :-)
@Oldes I agree. However if something like utype! is added, nothing prevents you from (ab)using system/lexer/pre-load and reinventing whole syntax.
hiiamboris
@hiiamboris

Here's another real problem.

I've digged thru the datatypes enough to say the the code complexity of each action! is not O(n) where n is the number of datatypes in Red. It's not O(n*n) either, but somewhere inbetween. And I've no idea how actions on known datatypes should take care of (possible) user-defined types.

GiuseppeChillemi
@GiuseppeChillemi
If there has been a discussion, and a description, about what are actions and how it relates to datatype working, I would like to read it as actions seems to be at the core of datatypes. Has anyone a link to some documents/threads or would please help me explaining this basic item of RED ?
(node, I modified the text of my message)
GiuseppeChillemi
@GiuseppeChillemi
Note, I have read this but it is not explaining so much to understand the big picture.
Gregg Irwin
@greggirwin

I don't support abusing system/lexer/pre-load, and (in the long view) there will almost certainly be special cases where a new lexical form makes sense. We can't see the future, so we can't rule it out. But, and this is key, how much value does each new one add?

I believe that each new lexical form adds less value, and there is a point of diminishing returns. This is not just a lexical problem for Red, but for humans. We have limited capacity to remember rules, and a constrained hierarchy helps enormously here. Think more like linguists, and less like programmers or mathematicians.

In language we have words and numbers. Numbers can be represented as words, with their notation being a handy shortcut for use in the domain of mathematics. And while we classify nouns, verbs, and adjectives by their use, they are all words, and don't have syntax specific to their particular part of speech. That's important because a single word may be used in more than one context, for more than one purpose.

This is interesting, as a tangent, because human language can be ambiguous, though some synthetic languages try to eliminate that (e.g. Lojban). The funny thing is that it's almost impossible to write poetry or tell jokes in Lojban. Nobodyº speaks Lojban. This ties to programming because, while we all know the strengths and value of strict typing, and even more extreme features and designs meant to promote correctness, dynamic languages are used more at higher levels. Why is that? Humans.

When Carl designed Rebol, it had a goal, and a place in time. He had to choose just how far to go. Even what to call things like email!, which are very specific to a particular type of technology. This is what gives Redbol langs so much of their power. They were designed as a data format, meant for exchanging information. That's the core. What are the "things" we need to talk about with other humans, not just other programmers.

Do I want new types? ....I'm pushing for at least one. Ref! with an @some-name-here syntax. It's not username! or filename+line-number!, or specific in any way. It's very general, as lexical types should be; their use and meaning being context specific (the R in Redbol, which stands for "relative"). I also think ~ could be a leading numeric sigil to denote approximation. It came mainly from wanting a syntax for floats, to make it clear that they are imprecise, but it's tricky, because it could also be much richer, and has to take variables into account. ~.1 is easy, but what about x = ~n+/-5%. Units are also high value, but they are just a combination of words and numbers. Still maybe worth a lexical form.

When we look at what Red should support, and the best way to let users fulfill application and purpose-specific needs, we can learn from the past, and also see that there is no, single right answer. Structs, Maps, Objects, data structures and functions versus OOP, strict vs dynamic.

As Forth was all about "Build a vocabulary and write your program in that.", think about what constitutes a vocabulary; a lexicon. It's a balance, in Red, between generality and specificity, human friendliness and artifice. So when we ask for things, myself and Nenad included, we should first try to answer our need with what is in Red today, and see where our proposed solution falls on the line of diminishing returns. To this end, we can and should abuse system/lexer/pre-load for experimentation.

Rudolf Meijer
@meijeru
@GiuseppeChillemi A basic introduction is to be found in the spec document section 7.4.2, quoted below:
The definitions of the actions are fixed at the start of the toolchain’s operation. No new actions can be made by the user. In fact, during initialization of the toolchain, each action name (word! value) is made to refer to an action! value that consists of a spec similar to the <argument-spec> of a function, and an action number. Also, a table is prepared that contains the addresses of the primary Red/System functions that handle the actions, indexed by the action number (their names are the action names followed by *). Subsequently, a dispatch table (action table) is prepared that contains entries for each combination of action number and type of first argument for which the action is defined. As suggested before, this initialization will fill the entry with the address of a Red/System function handling the action for this combination.
GiuseppeChillemi
@GiuseppeChillemi
@meijeru Thanks, I will reply to this topic in RED/HELP. Very interesting.
GiuseppeChillemi
@GiuseppeChillemi
@greggirwin The relativity of expressions in the human language and its symbols are handled REBOL design in a great way, so they are in RED. I am against the proliferation of datatypes in RED, as many datatypes would be specialized ones that few users would use. Implementing them would waste the human ed economic resources of the RED team. I totally agree with you when you write (it happened at different times) that with the proper mix of actual building blocks of the language you can build quite everything. I think also that the language should make easy to add some features so they could be implemented independently from the core team by the direct ideators.
Also, I think that a new feature should be usable without rewriting, or loosing, half of the most commonly used RED functions, otherwise we have lost simplicity! This is the reason why I asked for UDT, which in its current requirement just a name tied to a block/map with an initializing structure. Those hours needed to create the code to handle insertion of multiple elements in a block (the structure elements and its identifiers); the replacement of FIND, SELECT with custom ones; the writing of special PARSE rules; the analysis of the possible interferences of the preceding words of my structure and many other problems... they all would disappear if I could write find X <alias>![]. With it, magically, all RED code would be able to identify, seek and manage those structures with just 1 word: their ID, and with all language commands. Isn't that simplicity ? One addition and you save (re)writing and complicating everything ! And what about having custom structures in structures ? I would avoid thinking of them now as I am going to sleep and I do not want to have nightmares !!!
And, yes, you are right: system/lexer/pre-load is my (unknown) friend but I still am not at the level needed to use it, so I hope to convince you all how useful and code saving is <alias>![]. I have a great willingness to learn but hope my request will be analyzed and accepted before being able to handle RED pre-lexer.
I could write examples if I have not been able to provide enough arguments for this request, just ask for them if they are needed.
Eddy Parkinson
@eddyparkinson
Database? ... Please can you help. Is there a database that works with Red. I have searched "site:https://www.red-lang.org/ database" but could not find any answers.
Gregg Irwin
@greggirwin
SQLite. @Oldes can probably say if it works with current versions.
Oldes Huhuman
@Oldes
I don't know... I have no use for databases now.. just try it :-) Also I should note that it was just a prove of concept.. there is plenty of room for improvements.. like real port integration (there was no port 2 years ago)
Gregg Irwin
@greggirwin
Thanks @Oldes.
Pierre
@pierrechtux

Database? ... Please can you help. Is there a database that works with Red. I have searched "site:https://www.red-lang.org/ database" but could not find any answers.

I'm not aware of client-server database working now in Red.
However, I use daily Rebol 2 along with PostgreSQL databases, it works very well. As the author of that driver (https://www.softinnov.org/rebol/pgsql.shtml) happens to be the same author of Red (bonjour Nenad! ;-)), I strongly hope that, soon after ports will be implemented in Red, such driver would appear.

Pierre
@pierrechtux
By the way, there is also a MySQL driver from, still, the same author.
And for SQLite, there is also a driver that works well in Rebol: http://www.rebol.org/view-script.r?script=btn-sqlite.r
Gregg Irwin
@greggirwin

From red/bugs @meijeru, I am quite familiar with R2's email design. It works well in simple cases, a single user or application for example. Our goal is not to copy implementations, especially when there are better ways. Persisting it can be done, of course, and ideas are in the works for general app configuration support. This is not to say that system/user is a bad idea in general, but I think it's a bad idea to hard code a send function against email info there. It's simple and seductive, no doubt. Security, as Nenad noted, is a big issue. Another is concurrency. As soon as you need to send 2 emails concurrently with different configurations, or allow editing system/user while sending, global settings fail.

While Dependency Injection can be overdone IMO, it can also make sense at times. This may be one. It also ties to a Capabilities model, which is worth keeping in mind. But all send needs is the information, which can be given to it as an argument. Send could be made even more email like in its interface:

send compose [
    From: a@.b.com
    To: v@w.xyz
    Subject: (rejoin ["This is important! Call me by " now + 1:0:0])
    {
        This gets a little tricky, because we may want to `trim/auto` the body.
    }
]

Where does the mail server info come from? Good question. I have a lot of emails, and don't want to edit %user.red or AppData, or code, to choose. I wrote a fairly extensive R2 email configuration system that made things like this easy and extensible. It's not fancy, by any means, as all the config data is just loadable files.

My long-winded point is that the core should be designed for this, and a higher level wrapper can provide defaults for the simple case if needed later.

Mel Cepstrum
@melcepstrum
Are there plans to support complex numbers?
Vladimir Vasilyev
@9214

@melcepstrum quoting @Oldes response from above, precisely in relation to complex numbers.

Everyone who requests user-defined types should read Brian's comment here

Boleslav Březovský
@rebolek
send is such great name for a general sending function that I always found it bit sand that it was wasted on just email in R2.
Petr Krenzelok
@pekr
Yeah, sand is much more useful, than having it wasted on a desert :-)
Petr Krenzelok
@pekr
Otoh in the past, I was thinking about "polymorphism" (if it is a right term here), because I did not like the do, do-browser, send, send-server, etc. kind of stuff, which was done to not overload the main functions ....
Petr Krenzelok
@pekr
btw - I have found this old gem - Rebol/services ... wonder, if anyone ever tried that in the past? At least it looks like a nice dialected messaging infrastructure .... https://github.com/revault/rebol-wiki/wiki/Rebol-Services-Tutorial
Gregg Irwin
@greggirwin
@pekr, I experimented and even deployed some things with Reb-Services (a.k.a. LNS = Lightweight Network Services). Nice ideas, but never completed. There were some issues that led me away from it, but we can definitely learn from it.
GiuseppeChillemi
@GiuseppeChillemi
@greggirwin why it never took off?
(/chat?)
Gregg Irwin
@greggirwin
I can only guess. Rebol never took off, and it was a subset of that. So only a small number of people ever tried it. It was functional but not "complete". That is, it needed more work. Then it was abandoned.
Petr Krenzelok
@pekr
I thought it would be Rebol/IOS NG, but apparently it never properly took-off. I just hope that in some sense Cheyenne NG will emerge and we will get some RPC stuff :-)
GiuseppeChillemi
@GiuseppeChillemi
@pekr @greggirwin Thanks to your messages today I had a vision of RED sending blocks of code to other machines in a data center to run another instance of a web server for managing part of the traffic or to perform joined computing. I think that once we will have full networking the "only" missing basic requirement would be the transferring of the current state of the interpreter for situations where it is needed live state migration. RED computing cluster ahead !
Rudolf Meijer
@meijeru
@greggirwin I agree that a solution for send could be to supply server information as a separate argument. The function should be kept as basic as possible, while the full capabilities could be implemented using the port schemes smtpand esmtp.
GiuseppeChillemi
@GiuseppeChillemi

@meijeru I agree, actually I do this to query databases using a

query "querystring" [server "servername" user "username" password "password"]

syntax and it is very easy. I can also store access data in a block

[
  serverid1 [server "servername." ...] 
  serverid2 [server "servername." ...]
]

And select the desired destination server

Cale
@trosel
reminder that there's still interest in getting Redlang on Exercism exercism/request-new-language-track#45