Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 05:54
    loziniak opened #5178
  • Aug 16 22:27
    dockimbel closed #4516
  • Aug 16 22:27
    dockimbel labeled #4516
  • Aug 16 22:27
    dockimbel labeled #4516
  • Aug 16 22:27
    dockimbel labeled #4516
  • Aug 16 22:26
    dockimbel assigned #4516
  • Aug 16 22:26
    dockimbel commented #4516
  • Aug 16 22:22
    dockimbel milestoned #5177
  • Aug 16 22:22
    dockimbel closed #5177
  • Aug 16 22:22
    dockimbel labeled #5177
  • Aug 16 22:22
    dockimbel labeled #5177
  • Aug 16 22:22
    dockimbel labeled #5177
  • Aug 16 22:22

    dockimbel on master

    FIX: issue #5177 (Deceptive err… (compare)

  • Aug 16 22:08

    qtxie on master

    FIX: improve output speed for s… (compare)

  • Aug 16 16:28
    dockimbel assigned #5177
  • Aug 16 15:13

    dockimbel on master

    FIX: [Linux] regression on CLI … (compare)

  • Aug 16 13:47

    qtxie on master

    FIX: output lagging in gui-cons… (compare)

  • Aug 16 12:19
    hiiamboris commented #5177
  • Aug 16 12:19
    hiiamboris opened #5177
  • Aug 16 11:50
    hiiamboris commented #5008
Gregg Irwin
@greggirwin
Red clearly tells you the offending JSON is invalid @GiuseppeChillemi.
hiiamboris
@hiiamboris

wow such a hot debate..

@dockimbel

@hiiamboris About your Red stack related post :point_up: September 10, 2019 9:59 AM:

I don't understand your point here. The stack is a working place for Red functions, so it's heavily used in many different places, as a lot of processing happens on the stack.
You are making a generality from a specific case (and you've picked up one of the worst). Fortunately, it's not that bad, even though the current stack handling is not fully satisfying.
I don't see how that would be helpful. Which problem are you trying to solve with that?

The point is that when I make Red function calls from R/S, I have to make sure my stack layout is correct. But I have no means to test for that correctness. Okay, sure, I can write a ton of asserts, but this approach has some shortcomings..

Anyway, it was just a vague idea born from pretty brief R/S exposure, that I wanted to share with you. If you say this problem is uncommon, I trust your judgement :)

GiuseppeChillemi
@GiuseppeChillemi
@greggirwin does RED tell you the reason ?
Gregg Irwin
@greggirwin
@GaryMiller thanks for the use case info.
@GiuseppeChillemi do you mean "Your JSON contains comments, which are not valid."? No, because then our codec would become massively bloated with every possible invalid construct someone could come up with.
That could be another external utility though.
Oldes Huhuman
@Oldes
@greggirwin funny thing is, that Red actually don't load the file because other reason than comment:
load/as  {
  "name": "debug_002_RRDB_ESRGAN_x4_DIV2K"
  , "use_tb_logger": true
} 'JSON
*** User Error: {Invalid json string. Near: {^^/  "name": "debug_002_RRDB_ESRGAN_x4_DIV}}
*** Where: ???
Vladimir Vasilyev
@9214
Well, what do you know. There's a missing pair of wrapping {...}.
GiuseppeChillemi
@GiuseppeChillemi
@greggirwin Just remember that our mind tend to fill the uncertainess with its own explanation when no other explanation is provided. Sometime this could put you off track. However, if the combination of error cases is low (< 20 ?) explaining would be good. Otherwhise (cases >20) no explanation or generic one, or divided in classes of error, is advised.
GiuseppeChillemi
@GiuseppeChillemi
@9214 However, I have not followed the debate on the reason why LOAD will not have an /option refinement to pass a block of options to the internal specific data parser/codec. Has this happened here ?
Gregg Irwin
@greggirwin
Load spec blocks are a conversation for a later time.
Gregg Irwin
@greggirwin
@Oldes as @9214 said your example is malformed. If I remove the comments from the original URL-sourced data, it loads fine. So it is the comments.
Oldes Huhuman
@Oldes
:point_up: September 18, 2019 11:20 PM there is no comment.
Gregg Irwin
@greggirwin
Yes, and your content is malformed.
load/as  {{
  "name": "debug_002_RRDB_ESRGAN_x4_DIV2K"
  , "use_tb_logger": true
}} 'JSON
Oldes Huhuman
@Oldes
Ok.. I really have to end with this. Good night.
GiuseppeChillemi
@GiuseppeChillemi
Good night Oldes, do not despair! We are humans. Our difficulties let us all exchange opinions and evolve. It's falling down and emitting strange sounds we learn to walk and talk.
koba-yu
@koba-yu

Though I have not read and understood all discussion here(Sorry, not have enough time and knowledge for me), I just want to comment
VS Code treats JSON and JSON with Comments as different languages.

https://drive.google.com/file/d/1rH2lXn1Nms_BDHamyNFMOBin7hgf-ufK/view?usp=sharing

Maybe this is one practical choice example that JSON and JSON with Comments are different.
If Red distinguishes them in the same way, JSON codec(if it is not JSON with Comments codec) does not allow comments is understandable.

Gregg Irwin
@greggirwin
Thanks for the info @koba-yu.
koba-yu
@koba-yu
@greggirwin Thank you for your reading!
packetrhino
@packetrhino
Question: is anyone familiar with the "expect" program that was based on TCL? Is there an equivalent for Red, at least under Linux/Unix systems?
Gregg Irwin
@greggirwin
There is no Excpect for Red...yet. I have Exploring Expect on my shelf, and have thought about implementing it at times. Step 1, I think is a CLI dialect that offers interrogation and feedback for itself, and sub-commands it may launch.
xqlab
@xqlab
@dockimbel maybe I was too hasty. I was thinking about something like a load-json: function with the optional refinement. But even with load/asis a solution possible. Offer a json-comment field under system\options, that can contain the wanted comment ways.
xqlab
@xqlab
from IParser (HAPI FHIR Structures - DSTU3 3.8.0 API)
   getHandleComments

    boolean getHandleComments()

    Whether to parse or ignore comments - either reading or writing

    setHandleComments

    IParser setHandleComments(boolean value)
Gringo
@15926222352
I now want to develop a DAPP in EOS block chain don't know if the community have the programmer would like to help me develop the DAPP I would like to pay with RED TOKEN
Gringo
@15926222352
Red team you should let the Red Community Token can play out the value of ICO for one year I didn't find Red scrip have any real value can not correctly reflect value
Boleslav Březovský
@rebolek
@15926222352 please, don't post same messages into multiple rooms. Thanks!
Gringo
@15926222352
@rebolek ok
Rudolf Meijer
@meijeru
I am using the Red progress site (https://progress.red-lang.org/) to stay abreast of developments. Until recently, it tracked all branches of the red/red repository on Github, but the latest activity on refactoring the lexer is not appearing there. Can @x8x, who I think is behind this site, explain?
Or is the site using a fixed list of branches?
Gringo
@15926222352
There will be language development in red DAPP programmers? I want to use red token to pay for development costs. Thanks
Gringo
@15926222352
Red language project team should organize more activities for example use red language as the foundation of application development or DAPP game development contract
@dockimbel
Petr Krenzelok
@pekr
I don't want to re-open the JSON codec, but codecs in general. As Gregg pointed out, we might have several codecs, given their size it might or might not be an ideal solution. Given the Redbol dynamic nature, I can imagine codecs having some /parsefunction and/or local storage of available parsers in a block. Imagine if some standard develops, and you might welcome versioning, it could be codec/parsers: [1.0 [.....] 1.2 [....]]. Any such storage is dynamically extendable, sortable, searchable, as it is a block or a map.
Vladimir Vasilyev
@9214
@15926222352 please use dedicated room to ask blockchain-specific questions (related to Red of course), and refrain from spamming.
FLuX
@x8x
@meijeru Hello Rudolf, please send me the links of what is not showing up so I can have a look, thank you!
Maciej Łoziński
@loziniak
>> load-json {^{^/  "name": "debug_002_RRDB_ESRGAN_x4_DIV2K"^}}
== #(
    name: "debug_002_RRDB_ESRGAN_x4_DIV2K"
)
>> load-json {^{^/  "name": "debug_002_RRDB_ESRGAN_x4_DIV2K" // comment ^/ ^}}
*** User Error: {Invalid json string. Near: ^{^^^{^^/  "name": "debug_002_RRDB_ESRGAN_x4_DI^}}
*** Where: ???

My thoughts are that @Oldes problem is perhaps not lack of comments support, but poor Red error message? A problem I also stumbled upon many times. Useful message would be Invalid json string. Near: ^{// comment^}, which would point exactly where the problem is.

Red is expressive enough that (provided you know where exactly your problem is) it's faster to write your own parse rule to clean comments than looking for a suitable npm library in JavaScript world.

Oldes Huhuman
@Oldes
@loziniak please... the JSON case is closed! But you are right, that the message should be better.. first of all it should not be User Error
Maciej Łoziński
@loziniak
Sometimes a closed case is a good start for a new case :-)
Vladimir Vasilyev
@9214

@loziniak in current codec implementation (which is not even 1.0, mind you), error reporting has coarse granularity, i.e. it marks location before malformed JSON value (object in this case), and reports it only after parsing have failed.

As for "poor Red messages" see red/red#3282 thread. Informative error reporting in dynamic and homoiconic language (such as Red) is not a trivial problem to solve.

Maciej Łoziński
@loziniak
@9214 great info, thanks! Apparently not a new case.
JacobGood1
@JacobGood1
I have probably linked these before, but I am just refreshing everyone's memory in case these examples, the ones from Pharo and Common Lisp, are forgotten.
lucindamichele
@lucindamichele
Thank you, @JacobGood1!
dsunanda
@dsunanda

@9214

I appreciate that error reporting is not trivial, but what we have at the moment is not fit for purpose. It may be more-or-less adequate when debugging the latest dozen lines of code writte while developing (9/10 times the problem is in those lines). But it seems to fundamentally put a limit on the size of Red systems - and/or the ability to easily integrate two separate code bases.

User example - a couple of weeks ago, I experimentally tried to convert a Rebol/Core system (60 scripts, 25,000 lines of code) to Red. I did not expect it to be easy or fun. But I was not expecting to be so misled by errors messages.

Take this one - it took a couple of hours of my life to resolve:

 type: 'script  id: 'invalid-type  arg1: word!  near: none  where: 'set-path

There is not a single instance of SET-PATH in the 60 scripts / 25,000 lines of code. So basically, not a single clue in the message where to start looking.

(If you are interested, the bug fix was to make the 'word in a FOREACH local to its function). I got a log of around 20 other errors which might as well have just said "Shrug. Magic bad".

So attacking the non-trivial problem with some priority could well be a unique selling point for Red.

Vladimir Vasilyev
@9214

There is not a single instance of SET-PATH

Error doesn't tell you that there's a problem with set-path! value, it prints out stack trace, in which set-path was the last called action. Not very informative, true, but hardly misleading.

dirtbagger
@dirtbagger
I am not a programmer, but from time to time I have a data-manipulation problem that I can't handle using off-the-shelf software. In cases like that I write the program I need. For the latest such project I set out wanting to try to write the program in Red, but when I found that I would have to learn using the Rebol documentation I decided to write in Rebol, with the aim of eventually converting to Red.
dirtbagger
@dirtbagger
Hmm, just learned not to hit return if I'm not finished a message. I'm new to this sort of message board. Anyway, to carry on, I now have a working program in Rebol. I started looking at what I'd have to do to convert it to Red. One problem I've found is that in Rebol I made extensive use of ports for file I/O. In other words, I used "open" and "close" a lot. These instructions don't seem to exist in Red. Am I missing something. Does Red not have a facility like ports for file I/O?
GiuseppeChillemi
@GiuseppeChillemi
@dirtbagger ports are being implemented, soon you will see them. Be patient, they are doing lot of work behind the scenes.