« first day (2122 days earlier)      last day (1658 days later) » 

7:54 PM
@HostileFork I am looking at the inline functions you put in sys-do.h, is it really beneficial to inline them? some of them are really long, for instance DO_NEXT_REFETCH_MAY_THROW
It's causing problem for me to debug the user-natives. I can't set break point in them for the user natives, because the user natives will have a different copy of the code.
 
8:13 PM
@ShixinZeng Debug builds don't inline functions, so you should be able to step through them normally. I'm not quite sure what curveball TCC throws in, it doesn't inline at all I thought...
Modern compilers generally ignore the inline and make the decision to inline or not based on the optimizer. The benefit comes not just from saving on the jump, but saving on the push. e.g. if you have a loop and call an inline function a number of times, it may not inline the code but it will allocate a static amount of stack space for the locals of that function instead of pushing and popping stack space on each call.
4
Q: Do c++11-compatible compilers always ignore inline hints?

Victor PolevoyReading an old answer on When should I write the keyword 'inline' for a function/method? that says: It is said that inline hints to the compiler that you think the function should be inlined. That may have been true in 1998, but a decade later the compiler needs no such hints. Not to mention ...

> You should read inline as "this function definition appears inline in this file" not "calls to this function should be inlined".
> So the inline keyword is useful for allowing the compiler to see function definitions in multiple files, which means it is possible for it to optimise the calls away by inlining them. That doesn't necessarily make it more likely to be inlined than any other function defined in the same translation unit.
 
@HostileFork well, they are defined as "inline static", even if TCC ignores inline, they will be static, because I feed the preprocessed sys-core.h and user code to TCC, it will have a different copy of the function that I can't set break points
 
@ShixinZeng Ah, I see. :-/ Well you can take the static off for debug assistance. The reason I put the static there was for old compiler support so you could define inline to nothing and it would still compile.
There was a long time ago an INLINE macro that was defined to __inline or inline or nothing, used almost nowhere. But I thought with the C99 targeting and -Dinline available that just going with inline would be better. We could go to that if you like.
 
I am taking off "static" and moving the definitions to c-do.c
 
If it helps you for debugging, but it will affect performance.
Without the definitions available in the header file, it can't do the measuring to do less per-instantiation overhead on the calls.
For large functions, again, it doesn't necessarily do full inlining. Just as much as it deems necessary.
 
hmmm, do you have any number about the performance impact?
 
8:26 PM
I have bean counting from valgrind. It always depends on what you're doing. But the thing about the evaluator main code is it runs on every step.
I understand wanting to make the TCC debugging situation better, but GCC is able to debug these inline functions as they are... perhaps you can use GCC when debugging?
 
I don't think GCC can compile a file/string into memory and call the compiled function, can it?
@HostileFork Another question, is calling Apply_Only_Throw the correct way to run a REBOL function from C code?
 
@ShixinZeng That is one way, if you aren't needing to deal with refinements, and if the arguments don't need further evaluation. If you have refinements or need evaluation you can do things like build a path and pass the arguments to Do_Va_Throws...or you could make a frame and run that.
@ShixinZeng Hm, GCC can't but I think clang can, though haven't done it.
 
@HostileFork I'll take a look later.
For the problem I have right now, I suspect there might some incompatibility problems between the TCC va_arg and MS VC.
because if I taking off "static" from Apply_Only_Throws, and let the user native call into the same function compiled by MS VC, it worked fine
If I don't, it just crashes
 
8:42 PM
@ShixinZeng Hm, that may not be a binary standard... can you call MSVC's vfprintf with a TCC va_list?
From [a WINE patch](http://marc.info/?l=wine-patches&m=97137931221973&w=2): + /* FIXME: It seems that the va_list format is compiler dependent. This could
+ * mean serious trouble for Winelib applications. See also the wvsprintf functions.
+ */
 
@HostileFork I haven't tried yet
 
@ShixinZeng For other reasons I was considering just an array of REBVALs as another input form, as opposed to making an array for them.
But the way this is set up is to go through the same evaluator, vs. having lots of copies of the argument processing code.
 
@HostileFork I see
Gotta do something else, talk to you later
 
No array is made for a va_list either (unless it needs to reify to make a "where" for an error message). But I was just pointing out that all the same features are available whichever way you go.
Later...
 
 
1 hour later…
9:56 PM
posted on August 22, 2016 by Hans Schüren

Hi , the email client from the absolute beginners tutorial Nick Antonaccio works with sending. I make a mistake here. After the settings are complete sending is possible by normal input of the receivers e-mailadress in (us...@website.com) for example : jessy...@web.de Dont know what

 
Hi @HostileFork! Plz can you enlighten me about ** Script error: some-function doesn't have RETURN: enabled for function! ?
 
@giuliolunati FUNC and FUNCTION is taken to mean now, that a value is returned...by default. Kind of like how by default you can't say foo: func [x] [print x] and then call it with foo ()...but you can make it take it by saying foo: func [x [<opt> any-value!]] [x] for instance. So the same default now applies to return results.
If your function never returns a value, just use PROC or PROCEDURE
That way, foo: proc [x] [append data x] for instance would suppress the result, and return no value at all. It enforces no value.
If you have something that sometimes returns a value and sometimes does not, which is possible (especially if you chain a result) then you can say foo: func [return: [<opt> any-value!] x] [...]
So basically, it just makes the same rules for return values as for arguments. If no value is a possibility, you say <opt>
I think that this helps avoid accidents, and also the PROC distinction is good for helping avoid "leaking" values out of functions that aren't supposed to return a value. To definitionally exit a procedure, use LEAVE (no argument) instead of RETURN (1 argument).
 
@HostileFork Many thanks! I'm trying to adapt @ingo's websy for Ren-C
 
@giuliolunati I don't know websy. Link?
 
10:12 PM
@HostileFork A tiny webserver based on shttpd:
 
@giuliolunati Glad people are paying attention to the web side... I know also this is an area DocKimbel has opinions on, and people say nice things about uniserve, but I don't know it... if you haven't learned it perhaps you can read up on it: softinnov.org/rebol/uniserve.shtml
As far as I understand it, whatever Red does in the space of web serving would be based on that.
 
10:45 PM
@HostileFork Interesting! Maybe worth trying port it to Ren-C!
 
@giuliolunati Well, it would be good the more of Ren-C and Red that can have compatible source and ideas. And getting there it helps to have people trying both. I could name any particular thing, that could be expression barriers or specialize or definitional returns... but really, it's sort of looking at the source code of things and being able to say "yes, that's expressing what I mean"
The current "view source" on web pages, with the culture of JavaScript and such, might as well not be source at all.
I spoke to some people at a security meetup (who were very receptive to blackhighlighter and would like to speak more about it, possibly in the context of building a startup based on it)... and they said that there are some initiatives kind of "reinvent the web from more easily securable basics", but that these are not aimed at consumers, where the web and trying to sort of quarantine its messiness here and there is still the way people are going.
So perhaps it would be a long time before these alternate ideas gained traction outside of small defense-oriented projects.
I do still want to try something more or less apples-to-apples with node.js
So embed inside of the C++ code that implements the basic TCP and other layers inside Node, but call into Ren-C instead of V8.
It's not impossible given that both Rebol and JavaScript are single threaded, but the lack of "isolates" is a problem, basically just in-process sandboxes for an evaluator each of which is single-thread safe. It wouldn't be that hard to do isolates in Rebol.
 
11:17 PM
posted on August 22, 2016 by Simon Elliot

Is there any way to compile the gui console to the same folder as the red exe instead of ProgramData? (I am unable to run executables from that location due to administrative lockdown at work) Kind regards, Hendry

 

« first day (2122 days earlier)      last day (1658 days later) »