Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 01 2018 17:34
    @greggirwin banned @BIjeuca_twitter
  • Dec 03 2017 05:53
    @PeterWAWood banned @matrixbot
  • Sep 28 2016 12:20
    @PeterWAWood banned @TimeSeriesLord
Boleslav Březovský
@rebolek
@lpvm There are no active FreeBSD users AFAIK, so bug reports will be very appreciated. One thing is doing whole GUI subsystem and another thing is fixing few bugs that prevent Red from running on/compiling for FreeBSD, as it's supported platform.
Luis Vale Mendes
@lpvm
No problem. It also happened to me for some Linux conf file as I copy pasted a line from a site and the initramfs files could not start. The worst part is that one can loose a lot of time going after these errors.
Boleslav Březovský
@rebolek
I may try to install FreeBSD VM and check the build.
Luis Vale Mendes
@lpvm
@rebolek Ok, it's just that I tried compiling a simple print "Hello", so no simpler could it be. But if it can be corrected, please tell me, is https://github.com/red/red/issues the place to raise the issue? Or some other specific place?
You can count me as one active user for the FreeBSD platform from now on!
Boleslav Březovský
@rebolek
@lpvm Yes, https://github.com/red/red/issues is the right place.
@lpvm Cool, so I will add FreeBSD as a target for my automated builds :smile:
Luis Vale Mendes
@lpvm
Issue already raised.
@rebolek You have linux and rpi gui builds?!
Boleslav Březovský
@rebolek
@lpvm these builds are from latest GTK branch version
and latest update in GTK branch is from 22.4, so it's pretty old branch.
Luis Vale Mendes
@lpvm
ok, I'll wait for a new recent one. Have many things to use cli scripts in Linux and FreeBSD.
Luis Vale Mendes
@lpvm
>> big: make block! 1000000000

*** Runtime Error 1: access violation
*** at: 0805D348h
Boleslav Březovský
@rebolek
I believe there's an issue for that
Luis Vale Mendes
@lpvm
was trying to test speed block vs vector, but both fail when provisioning for a billion.
ok
Luis Vale Mendes
@lpvm
How to check for a valid date? Using try and attempt:
>> try [date? a: 29-02-2019]
*** Script Error: cannot MAKE/TO date! from: [day month year]
*** Where: do
*** Stack: load 
>> attempt [date? a: 29-02-2019]
*** Script Error: cannot MAKE/TO date! from: [day month year]
*** Where: do
*** Stack: load
Gregg Irwin
@greggirwin

@lpvm you can see that the error comes in loading the value, which is separate from evaluation (that attempt will catch). attempt/safer also doesn't catch it. A couple alternatives:

>> attempt [make date! [2019 02 29]]
== none
>> load/trap "date? a: 29-02-2019"
== [[date? a:] "29-02-2019" make error! [
    code: 349
    type: 'script
    id: 'bad-to-arg
    arg1: date!
    arg2: [d...

There can be a bigger discussion on loadability and literal values, if needed.

Semseddin Moldibi
@endo64
@lpvm 29-02-2019 should be loaded correctly, if it comes from a file or similar external source then it will be a string, hence you can catch:
>> attempt [date? a: load "29-02-2019"]
== none
>> attempt [date? a: load "22-02-2019"]
== true
Luis Vale Mendes
@lpvm
Thank you for the explanation and the solution @greggirwin and @endo64 . I think I've never used load for strings before. As a general rule, for strings, when should load be used?
Gregg Irwin
@greggirwin

Load is a safe operation, even on untrusted data, though we should always test and ensure that. All it should do is transcode a string of data (text or binary) into Red values. Anytime you get user input (including from other devs in extensible systems), it's going to be in one of those forms. That makes load your first friend in dialect processing, because then you can parse at the block level.

With Red, there is almost never a single way to do things, as with some other langs. load/trap is really powerful, in that you can tell whether an error occurred at all, and point people to the problem. Much easier than trying to do all the parsing on the string yourself.

It can also be incorporated in tools, to syntax check on the fly.
Semseddin Moldibi
@endo64

@lpvm When you load a string you will have a block of values, those values are words (like my-word, print, :call, tuple!) and literals (like 42, "my strig", 1.2.3.4, 0.5, some@one.com etc.), and the words in your loaded block can either have values as well, for example print is a word with a function (native) value, and tuple! is a word that has a value of a datatype!.

So you can execute (evaluate) your loaded block (if you trust it), or parse it, or use that block to create values in your script (like a configuration file etc.)

>> load "print [3 * 5 some@one.com]"
== [print [3 * 5 some@one.com]]   ; here we have a block with words & values only, two words print and *, two literals 3 and 5, and one another literal which is an email
>> do load "print [3 * 5 some@one.com]"
>> do "print [3 * 5 some@one.com]"
15 some@one.com   ; do without load also loads the string (or file) before evaluating 

>> load "a: 1 b: 2"
== [a: 1 b: 2]   ;just two words a: & b:, and two literals 1 & 2, doesn't mean anything without a further process like parsing or evaluating
>> construct load "a: 1 b: 2"
== make object! [
    a: 1
    b: 2
]  ; now we have something more useful

So loadable strings are more valuable then ordinary strings :)

Luis Vale Mendes
@lpvm
Thank you both for these very nice and complementary explanations!
Novvorto
@novvorto_twitter
to-date "31-3-2018" hasn't working since the offcial release of version 0.6.3?
load "31-3-2018" works though.
Toomas Vooglaid
@toomasv
@novvorto_twitter Use this :smile: :
to-date1: func [value][
    to-date switch type?/word :value [
        string! [if find value dot [replace/all value dot space] load value] 
        block! [value] 
        object! map! [reduce [value/year value/month value/day]]
]]
to-date1 "2-12-2000"
;== 2-Dec-2000
to-date1 "2000/12/2"
;== 2-Dec-2000
to-date1 "2.12.2000"
;== 2-Dec-2000
to-date1 #(year: 2000 month: 12 day: 31)
;== 31-Dec-2000
to-date1 [2 12 2000]
;== 2-Dec-2000
Gregg Irwin
@greggirwin
@novvorto_twitter that is an intentional design choice (for now). Feel free to add a note to https://github.com/red/red/wiki/%5BDOC%5D-%60to%60-vs-%60make%60.
Jenny
@justjenny
Hi, just got the new Red-064.exe - but whats's the difference from Red-063.exe or red-062.exe - What's the point of a new version without some docs. show us/ tell us the new features. Love what you all do - keep up the excellent work. Jenny.
Boleslav Březovský
@rebolek
@justjenny Hi, I see it's on red-lang.org, I think that a blog post will follow very soon, probably the download page was updated a bit sooner than it should :)
Jenny
@justjenny
@rebolek thanks, will keep looking, I need to find more time for Red, love it.
Boleslav Březovský
@rebolek
@justjenny to answer you question what's the difference - beside bugfixes, mainly the introduction of garbage collector, that's the biggest feature, I believe.
Gregg Irwin
@greggirwin
@justjenny nice to see you again. Yes, a new blog post is coming. With 1'116 commits in this release, there's a lot. As @rebolek the GC is the big one, and that is really huge for people, because now you can write long-running processes and not have to manually manage series to keep memory use from growing.
We wanted to get the binaries out, and an updated bincheck, so there is no turning back. You can always scan git commits to see if there are any messages related to things that affect you.
Jenny
@justjenny
@rebolek @greggirwin thanks, yes of course memory management is important. hope to learn more and add more to my blog soon - Red is moving forward nicely - congratulations to everyone for their epic work, We Redusers love and appreciate it. Jenny.
Palaing
@Palaing
Excited about trying Red-064.exe . Unfortunately, like previous automated builds, it compiles into a gui-console-xxx.exe but that file won't launch the console (though it will, if copied, on another machine). I Tried everything: check/clean quarantine, completely deactivate virus scanning and delete C:\ProgramData\Red before compiling. Red-064.exe compiles but console does not run. Red-063.exe still compiles and runs. Just as if my PC had some dll compatibility issue with the recent version(s). Any hint ?
dsgeyser
@dsgeyser
@rebolek Are you going to make the editor available as a commercial offering?
Boleslav Březovský
@rebolek
@dsgeyser commercial? I'm not sure if anybody's going to pay for it.
dsgeyser
@dsgeyser
@rebolek Is it available online? This also could possibly be used as a great Red learning tool with a few added features.
Boleslav Březovský
@rebolek
@dsgeyser yeah, it's available, I don't advertise it very much, until I add built-in interactive help-
dsgeyser
@dsgeyser
@rebolek I'm intrigued by all the possibilities your editor has. Any chance of a peek... I really want to play with it. Maybe also provide a few suggestions from my standpoint.
Boleslav Březovský
@rebolek
@dsgeyser you can get it from https://gitlab.com/rebolek/values . To run it, do %values.red and then ve.
Then you are on your own :smile:
I recommend to open a script with :lscript.red, check its structure with vs, take a look at some function with eg. vfenumerate.
dsgeyser
@dsgeyser
@rebolek Thanks. I'll do as to what was suggested in an animation film: "Just keep swimming..."
Boleslav Březovský
@rebolek
@dsgeyser :-) That, or you can ask me :)
Darrell Brogdon
@DarrellBrogdon
Hi all. I'm watching the video from RedCon and I'm wondering if the slides are available for download anywhere?
Semseddin Moldibi
@endo64
@DarrellBrogdon Slides are not yet available @greggirwin is working on it.
Valpal41
@Valpal41
just found Red. nice language. am enjoying learning about it.
Semseddin Moldibi
@endo64
@Valpal41 Welcome! Do not hesitate to ask your questions here.