Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:33
    dockimbel commented #5170
  • 21:32
    dockimbel commented #5170
  • 21:32
    dockimbel commented #5170
  • 11:31
    hiiamboris commented #4524
  • 07:23

    qtxie on master

    FEAT: handles PAUSE key and SCR… (compare)

  • 07:06
    qtxie closed #5170
  • 07:06
    qtxie labeled #5170
  • 07:05

    qtxie on master

    FIX: Win: issue #5170 (key in o… FIX: GTK: issue #5170 (key in o… (compare)

  • Aug 13 22:27
    dockimbel closed #5176
  • Aug 13 22:27
    dockimbel commented #5176
  • Aug 13 22:26
    dockimbel edited #5176
  • Aug 13 22:21
    dockimbel labeled #5176
  • Aug 13 22:21
    dockimbel labeled #5176
  • Aug 13 22:19
    dockimbel edited #5176
  • Aug 13 22:18

    dockimbel on master

    FIX: issue #5176 (Lexer events … (compare)

  • Aug 13 22:18
    dockimbel edited #5176
  • Aug 13 22:14
    dockimbel labeled #5176
  • Aug 13 22:14
    dockimbel assigned #5176
  • Aug 13 22:14
    dockimbel opened #5176
  • Aug 13 21:40
    dockimbel assigned #5175
Stan. S. Krupoderov
@iNode
@9214 "quantity isn't quality" - I can agree there, why one would write or use another JSON parser(s) if original one is good enough? Definition of "good enough" may differ of course as in this case. And/but having a number of compeeting libraries may make some sense from "evolution" stand point of view in case if community is quite big and have a lot of spare resources. But it's hardly applicable for Red community and we need more focus there. So duplicate libraries are waste at this stage and proposal to have your own parser when original one is present it is proposal to waste community time. And I'm OK with the point to save core team resources on some "minor" things, from their point of view, but it shouldn't be hidden under "we want to follow the spec in this case".
Vladimir Vasilyev
@9214
@Oldes it's quite easy, technically, to jump from the roof. You know why very few actually do that? Same reason we weight in on JSON comments - it has long-stretching consequences. I think everyone agrees that Red should have an RFC-conforming codec, but whenever or not it needs a JSON5 one is an open question, to answer which we need some first-hand experience.
Oldes Huhuman
@Oldes
My experience was, that I took the first JSON file I found and it failed to load... as a someone who is not following JSON development I was not awared, that comments are not legal anymore and though that it is a Red bug. That's all... and now I can jump elsewhere.
Gregg Irwin
@greggirwin
I declare the JSON comment case...closed. <bangs gavel>
Vladimir Vasilyev
@9214
Actually, two interesting points:
  • Original JSON file that spawned this thread was used, as far as I can tell, to train GANs, and comments in it are a hacky way to manually patch model's options, or debug leftovers.
  • It got replaced by YAML.
GiuseppeChillemi
@GiuseppeChillemi
Developers should receive the reason for the failure to avoid such flow of thougths. Other tools loads this JSON file - > RED does not - > RED codec is buggy. My intuition tells me in such situation it is common to exchange a good compliant implementation for a buggy one: if everything else loads the file and a good tool does not, then the good tool become the bad one. This let me think about people following rules in a territory where people do the opposite: good guys become bad guys and vice versa ! I see a pattern... I could call it an inversion of perceived law
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.