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
Nenad Rakocevic
@dockimbel
@gltewalt What about logic!? Is it the word representation of the two logic! values which is causing trouble, or the fact that all values are treated as true except false and none?
Gregg Irwin
@greggirwin
What about logic! is confusing?
Greg T
@gltewalt
Sure, but newcomers expect 'a to return 'a, from what I've noticed
Boleslav Březovský
@rebolek
@gltewalt But then this won't work:
>> a: 1
== 1
>> a
== 1
Greg T
@gltewalt
The latter with logic!
I don't think a lot of people are used to everything being true except for false and none
I'm not saying anything is wrong. Just my feedback on what I see tripping people up
Boleslav Březovský
@rebolek
I see. Good points to mention in documentation then.
But as I see, people usually do not read it anyway ;)
Nenad Rakocevic
@dockimbel
@gltewalt Yes, trying to use your knowledge from other languages will just get in the way.
Greg T
@gltewalt
A problem I have is that I will think, "x y and z seem to cause confusion and would be a good document addition", but then I forget about it
Nenad Rakocevic
@dockimbel
@gltewalt The wiki on red/red is there for that, it's public, you can write there. ;-) A page listing all the apparent "traps/gotchas" is welcome, so we can check it while writing the Red docs.
Greg T
@gltewalt
:smile:
@dockimbel Are there currently undocumented hooks for the stack in Red, or are they to be implemented for the next release?
Gregg Irwin
@greggirwin
Nenad Rakocevic
@dockimbel
@gltewalt You mean the Red evaluation stack? What kind of hooks are you thinking about?
@greggirwin Thanks for starting it!
Greg T
@gltewalt
@dockimbel Yes, the evaluation stack. Having handles to retrieve stack information.
It's probably necessary for writing Trace or Debug utilities, isn't it?
Toomas Vooglaid
@toomasv
For noobies (like me) old-falsey?: func [val][either to-logic val [parse to-string val ["0" | ""]][true]]
Nenad Rakocevic
@dockimbel
@gltewalt We have such hooks in our plans, though probably not in the current release, maybe the next one.
Greg T
@gltewalt
Is there a better way to say this? And is it worth putting into a Primer?
To create a function that returns unset! instead of 
a traditional return value, use exit.

>> example: func [value] [value]
== func [value][value]
>> example "value"
== "value"
>> example: func [value] [value exit]
== func [value][value exit]
>> example "value"
>>
>> type? example "value"
== unset!
>>
Boleslav Březovský
@rebolek
@gltewalt I think you said it right, but I don't think it's worth putting there. Do people really need functions that return unset! that much? IMO it's easier to ignore returned value than make functions return unset!.
Greg T
@gltewalt
Ok
Maybe a section on unset! in general, and why it exists?
Boleslav Březovský
@rebolek
Yes, that makes sense.
Nenad Rakocevic
@dockimbel
@gltewalt Redbol languages are based on denotational semantics, where the meaning of every expression needs to have a representation in the language itself. Every expression needs to return a value. Without unset! there would be a hole in the language, several fundamental semantic rules would be collapsing, e.g. reduce [1 print ""] => [1] (reducing 2 expressions would return 1 expression).
Semseddin Moldibi
@endo64
About logic!, most new comers expect to logic! 0 and to logic! "" is false as in most language (ex. PHP)
(bool) 'x'; // true
(bool) '';  // false
(bool) 3;   // true
(bool) 0;   // false
Nenad Rakocevic
@dockimbel
@endo64
>> to logic! 0
== true
>> make logic! 0
== false
Semseddin Moldibi
@endo64
@dockimbel I didn't know that! That's another difference with R2 (R3 is same with Red, sorry R2 is still my main language)
R2> make logic! 0
== false
R2> to logic! 0
== false
Nenad Rakocevic
@dockimbel
"Most languages" are so different than Redbol, that such comparison is quite pointless. What makes sense in one language probably doesn't in another. Many of mainstream languages, are by default, just copying C semantics, which is a bad idea if the language is higher-level.
Semseddin Moldibi
@endo64
I definitely agreed on that.
Greg T
@gltewalt
People reach for comparisons. Many languages are written in C so I can see how C semantics would leak over to the new language
Vladimir Vasilyev
@9214
  • Any ETA on concurrency support in Red?
  • Is it possible (or will be possible) to call SIMD instructions from R/S? Or work directly with xmm[0-7] registers (currently this feature limited to IA32)?
  • Aside from concurrency and data level parallelism, how can I exploit multi-channel commands (i.e. how can I make RAM bus very busy) in Red or R/S? Maybe system/fpu and floating-point bit diddling will do?
  • In R/S, print system/fpu/type returns 1, honestly I don't know how to interpret it :( (see R/S specs). Does it mean x87 FPU or SSE?
Vladimir Vasilyev
@9214
Aha, Trello says concurrency is planed for 0.9.0
Rudolf Meijer
@meijeru
@9214: see in the sources %system/runtime/system.reds for your last question
Vladimir Vasilyev
@9214
@meijeru thanks!
Nenad Rakocevic
@dockimbel
@9214
  • SIMD: we certainly want it, might happen in a 0.9.x version, or post 1.0. Direct access to XMM registers will be possible, though you'll have specific R/S types to abstract SIMD operations.
  • Multi-channel: no plans for that before 1.0 (not sure what are the multi-channel commands you're referring to).
  • Search in the source code, definitions are there (we should probably replace it with an #enum): https://github.com/red/red/blob/master/system/runtime/system.reds#L14. Currently Red relies only on the x87 FPU, SSE is not yet used for general floats support, though such support should happen before 1.0.
Vladimir Vasilyev
@9214

@dockimbel thanks Nenad!

By "multi-channel" I meant instructions which use multiple processing units at once (frankly I'm not completely sure what I'm talking about :D guh, noobiness). I think in real worlds it's called parallelism ;) Perhaps what I want in my case is something that can be considered "costly" operation which fully loads primary system bus and avoids caching mechanism, like SIMD MOVNTDQ instruction.

About codebase: are there any tips for newcomers on how to navigate it? Sometimes I know that my answer is in the sources (like with fpu/type above), but I'm not sure where to find it :(

Nenad Rakocevic
@dockimbel
@9214 I don't remember any instruction on Intel/ARM capable of using multiple processing units at once, maybe you're thinking about hyperthreading?
Codebase: grep is your friend on Unix, or any equivalent feature in your Code editor. I have a "Find in files" feature (<=> grep) in my main code editor, which I use dozens of time everyday to navigate through the source code.
Nenad Rakocevic
@dockimbel
make RAM bus very busy should be achieved by any tight loop intensively reading/writing 32-bit values in memory (until we get 64-bit support). Such operations will go through the caches, there is no specific cache control instructions emitted by the compiler. Such optimizations are planned for 2.0.
Vladimir Vasilyev
@9214
@dockimbel you're right, excuse me my newbiness, it's "multiple memory channels", not "multiple processing units". I just need CPU to write really huge chunks of bytes into RAM and keep RAM bus busy (that's what SIMD and parallelism can do, correct?). Though it could be much easier for me to leave this for you as a weekend reading (ch. 5 specifically) ;)
Nenad Rakocevic
@dockimbel
Looking at the front page of that paper... :-) For ch.5, you can't do that with R/S only for now, though you can code it in an assembler and include the resulting binary inside a R/S function (though I may have removed such option since early days of R/S...).
Vladimir Vasilyev
@9214
You haven't seen the one which shows two PC communicating with each over via "thermal pings" from their heated system units ;)
graduate diploma with tin foil hats, you know
@dockimbel yeah, I thought about that, but, as I understand, it's very platform-dependent
Nenad Rakocevic
@dockimbel
It's always amazing to see what people can achieve by leveraging electromagnetic emissions of PCs. ;-) I read an article a few weeks ago about a technic for guessing digits typed on a smartphone, by using machine learning on the accelerometer data recorded while typing. ;-)
Vladimir Vasilyev
@9214
There's an excellent series of papers about such stuff from Ben Gurion University
Gregg Irwin
@greggirwin

you can code it in an assembler and include the resulting binary inside a R/S function

I never knew that was possible! I learn new things every day.

Petr Krenzelok
@pekr
I do remember only old tricks, Commodore 64 floppy drives, made some sounds reading/writing the data, so guys made it to make some mellody ...
Vladimir Vasilyev
@9214
@greggirwin even the mighty shall fall... ;)