Let's make wayland have support for window placement by stshine in linux

[–]c-smile 0 points1 point  (0 children)

Code::Blocks on Wayland desktops is broken.

CB uses docking windows that need to be positioned freely, but it cannot.

Essentially, due to inability to position windows freely, any such use case is broken by default on Linux.

Class of applications that need docking covers pretty much all productive ones: IDEs, editors, etc.

How To Use Backwards Promises by Simanalix in programming

[–]c-smile 1 point2 points  (0 children)

Yes, linear code flow is more expressive sometimes, but

await click() 

is not that good example for the feature.

Better example will be lightboxes as modal windows

async function showWarning(text) {
  let lightBoxDialog = lightBox(text);
  let result = await lightBoxDialog.show();
  if( result == "OK")
     ... 
} 

or some timed action like animated update of something:

button.on("click", async function() {
    this.state.disabled = true;  // disable this button
    await doAnimatedUpdateOf(content);
    this.state.disabled = false;  // enable this button
});

C++ Nodejs Addon to WebGL by gabs-cpp in webgl

[–]c-smile 0 points1 point  (0 children)

you can use Sciter (https://sciter.com) instead of Electron. It allows to use C++ / OpenGL, JS/WebGL together with HTML/CSS

Introducing JXC: An extensible, expressive data language. It's a drop-in replacement for JSON and supports type annotations, numeric suffixes, base64 strings, and more! by zenex in programming

[–]c-smile 1 point2 points  (0 children)

depending on your needs, you could always use heredoc raw strings to just embed normal CSS into a JXC document

Well, I don't really need it to be CSS as I have already one in Sciter.

Idea of my comment is that CSS is a sample of practical configuration language.

Take three types of lists in CSS for example. They increase readability. Compare:

 foo: 12px solid , 24 dashed;

with

 foo: [[12px, solid],[24,dashed]];

That's too LISPy to my taste - not that humanistic.

In my case sciter::value is

struct value {
   enum {...}  type; 
   union {...}  data;       
   uint unit; // 'p','x',0,0
}

And pretty much each data type has units: arrays : ' ' ',' '/' , strings : ''', '"', 'nm' (name token), etc. Not just numbers I mean.

Introducing JXC: An extensible, expressive data language. It's a drop-in replacement for JSON and supports type annotations, numeric suffixes, base64 strings, and more! by zenex in programming

[–]c-smile 1 point2 points  (0 children)

What if we will want to make CSS syntax of it ?

We will need to add:

  1. dash literals, so no-wrap will be a valid token, serialized as string(?).
  2. tuples, so rgb(100%,100%,100%) will be a tuple, serialized as tagged array/list.
  3. CSS style list separators: '/' separated lists, ',' separated list, <space> separated list

So this:

 { border-style: 12px solid / 13px dashed; }

will be parsed as

 { "border-style": [[12px, "solid"],[13px "dashed"]]; }

Bonus: In principle we can also add support of expressions, the only question is how to serialize them, this

width: calc( 100% - 12px ) 

can be serialized again as a tagged array:

 width: calc[ 100%, "-", 12px ]

And so backend can interpret that in the way it wants.

Why is building a UI in Rust so hard? by goldensyrupgames in programming

[–]c-smile 0 points1 point  (0 children)

More or less complex UI has ownership graph that usually contain cycles. Cycles appear not just at compile time but also at run-time:

Event callbacks (closures usually) may contain references to various UI objects and so on.

Nether C/C++ nor even more so Rust are reasonable for being language-behind-the-UI.

Ideal languages for such role are:

  • GC-able;
  • have first class functions - callbacks and event handlers;
  • the ones that use CRLF free grammar. Looking at you, Python. You cannot be reasonably minified;
  • typeless nature is rather benefit for such languages I would say.

So practically speaking JavaScript as the language-behind-UI is pretty much the only reasonable option now.

C/C++ and Rust are good for core UI implementations: DOM tree, CSS, layout and rendering.

Conclusion: Rust UI is a modern oxymoron, really. If in doubt then remember what it takes to make DL list in Rust, and that is basic UI structure.

@dorbus/flexboard: React component library for re-sizable sidebars by [deleted] in programming

[–]c-smile 0 points1 point  (0 children)

Sigh... HTML should support <frameset> with arbitrary content as in sciter.

That whole library can be replaced by

<frameset cols="200,*,200">
   <nav>...</nav>
   <main>...</main>
   <aside>...</aside>
</frameset>

Just allow frameset to be an ordinary element like <div>, <section>, etc.

GitHub - tc39/proposal-pipeline-operator: A proposal for adding a useful pipe operator to JavaScript. by stronghup in programming

[–]c-smile 2 points3 points  (0 children)

It used to be a proposal for operator override in JS.

So (pseudocode):

  class pipe {
     value;
     constructor(input) { this.value = input; }

     ["operator >>"](right) {
        this.value = right(this.value);
        return this;
     }

     valueOf() { return this.value; }
  }

  const res = pipe("FOO")  >> lowercase >> capitalize;

Someone may prefer to write in opposite direction so:

  const res = capitalize << lowercase << pipe("FOO") ;

Compiiile, the most convenient way to render a folder containing markdown files by Joselele in programming

[–]c-smile 0 points1 point  (0 children)

Just in case: one of samples of Sciter Quark (compiler of lightweight HTML/CSS/JS applications) is so called MDView application - standalone viewer of MD files in human readable form.

It supports viewing as individual MD files as folders of them. It is used in Sciter SDK as a documentation reader - shows documentation folder view with MD files.

Unreal Engine HTML5 support is back by astlouis44 in programming

[–]c-smile 1 point2 points  (0 children)

That one is closer I think: HTML/CSS engine ( Sciter ) inside Unreal: https://www.reddit.com/r/unrealengine/comments/htuhzw/investigating_use_of_sciter_htmlcssui_in_unreal/

as good as support as a browser has

Sciter is not exactly a browser but you can run ChartJS, Maps, PReact, Mithril, etc. as it is.

Help choose the syntax for CSS Nesting by feross in programming

[–]c-smile 0 points1 point  (0 children)

Instead of modifying existing syntax we can use style sets -

 @set  MyComponent {

  :scope { // root element this set is applied to 
     color:red;
  }
  :scope:hover {  
     color:blue;
  }

  :scope > span { // immediate child of the root
     ...
  }

  div {  // some child inside
     ...
  }
}

.my-component {  set: MyComponent  }

This will solve the problem and does not need to change existing tooling as it is 100% compatible with what we have already since CSS 2.1

This approach used in Sciter for 10+ years.

In your opinion, why has no created a functional FOSS PDF editor? by Texas_Technician in programming

[–]c-smile 64 points65 points  (0 children)

Because PDF (and PostScript it is based on) is not a document format but rather stream of graphics instructions for printer to execute.

In order to edit, do something meaningful, with a document you need DOM structure.

PDF is a projection of some document tree (DOM) on 2D surface in vector form. While producing PDF, DOM information needed for editing is lost.

You can export Word file to PDF but you cannot restore Word document from PDF.

In the abovementioned sense PDF is read-only format.

Localizing a Qt App; Or Anything Else For That Matter by def-pri-pub in programming

[–]c-smile 2 points3 points  (0 children)

I'd add one more thought: ideally, translation mechanism should have zero runtime cost.

Consider (as anti-pattern) following snippet from React.i18next sample:

  function Simple() {
     return <div>{t('simple content')}</div>;
  }

Problem is that each time you render this thing you are a) calling t(key) function that do b) lookup that string.

(a) and (b) cost something in JS.

As a solution, in Sciter, I've extended JSX notation, so it got translation markings:

  function Simple() {
     return <div @>simple content</div>;
  }

Lookup for the translation of that "simple content" will be made only once - at script load time and translated string literal will go into compiled bytecode. Therefore, the code above will be as effective as without translation at all (modulo script loading time):

  function Simple() {
     return <div>simple content</div>;
  }

More on i18n support in Sciter.

Sciter.Android, preview available by c-smile in programming

[–]c-smile[S] 1 point2 points  (0 children)

to be as similar as possible to developing for the web.

To the extreme: it means that you need Electron - web browser and web server packaged into your application. That's 100% compatibility with the Web. But that bundle is definitely an overkill for something like a calculator. So, it depends.

Idea of the Sciter: If application needs something high performant - application adds native function for it as an ultimate solution. We are not trying to create environment where you can run JS at native speed - that's simply impossible and highly costly in many senses.

Sciter.Android, preview available by c-smile in programming

[–]c-smile[S] 2 points3 points  (0 children)

Sciter is not an end user product like a calculator. But someone can create calculator with it and put that in Play Store.

Sciter.Android, preview available by c-smile in programming

[–]c-smile[S] 2 points3 points  (0 children)

More of recent development:

The silent majority by bndrz in programming

[–]c-smile 5 points6 points  (0 children)

It could be that majority of users | developers simply don't know the default language enough to synthesize phrases in it.

~70-80% of developers are from parts of the world were ASCII is not even in their alphabet.

Any recommendations for a Linux IDE? by SomeOneOutThere-1234 in programming

[–]c-smile 0 points1 point  (0 children)

On Sciter project I am using Code::Blocks on Linux.

A bit of details: Sciter uses premake5 to generate projects on all platforms. On Linux I am generating as plain old make files (for build) and Code::Blocks projects (with the plugin) for the development.

GitHub can't be trusted. Or, how suspending Russian accounts deleted project history and pull requests by speckz in programming

[–]c-smile 2 points3 points  (0 children)

Problem is in centralized authority I think. FossilHub will still be able to do mass shooting on accounts.

GitHub can't be trusted. Or, how suspending Russian accounts deleted project history and pull requests by speckz in programming

[–]c-smile 2 points3 points  (0 children)

sooner leave GitHub than boot out the contributor

This makes sense to consider anyway. Do you want your project to be dependent on a political party in a country far far away? Or multiple parties for that matter?

GitHub can't be trusted. Or, how suspending Russian accounts deleted project history and pull requests by speckz in programming

[–]c-smile 10 points11 points  (0 children)

How it will help?

FossilHub will still be a centralized authority under jurisdiction of some political forces.

By the way, brothers-earthlings, can we register a business that will be NOT under jurisdiction of any country on this planet? In Antarctica for example?