Re: DCV has a new release.

2024-05-20 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 20 May 2024 at 11:47:25 UTC, Ferhat Kurtulmuş wrote:
I've been working on DCV for some years. Recently, DCV has 
started to be used by some projects, such as etichetta[1]. Even 
though it's still far from perfect, I think DCV deserves a new 
version. Existing unit tests pass. New ones are also necessary.


Great!

With your help etichetta would never have been able to use the AI.

I hope DCV will continue evolving. :)

Andrea


Etichetta v0.1.3 is here! (with AI)

2024-05-12 Thread Andrea Fontana via Digitalmars-d-announce
Hello! I’m excited to announce the release of a new application 
called “Etichetta”.


“Etichetta” is a straightforward program that allows you to label 
images for AI training. I’ve always found existing programs to be 
quite cumbersome, so I created one myself. Among its various 
features is the ability to use a YOLO model to simplify the 
labeling process by providing suggestions. 


The project utilizes gtkd for the interface and onnx runtime for 
AI (without any modifications, thanks to importc!).


Special thanks to Ferhat Kurtulmuş for assisting with the 
onnx-related aspects.


There’s a setup available for Windows and an AppImage that runs 
on any Linux distribution. It seems to work on macOS through 
docker + xquartz, for the brave ones!


GitHub: https://github.com/trikko/etichetta
Some super-short how-to videos: 
https://github.com/trikko/etichetta/blob/main/HOWTO.md


Andrea Fontana


Re: Serverino 0.7.0

2024-04-14 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 15 April 2024 at 01:04:40 UTC, aberba wrote:


Link to code sample?


https://github.com/trikko/serverino/tree/master/examples/06_websocket_noise_stream

Andrea


Serverino 0.7.0

2024-04-13 Thread Andrea Fontana via Digitalmars-d-announce

 Hey Serverino enthusiasts! 

Get ready to elevate your server game with the latest Serverino 
0.7.0 release! ✨


What’s new in this update? 

WebSockets are here! Now you can enjoy real-time bi-directional 
communication.


Some example I've posted on twitter:
https://twitter.com/twittatore/status/1775969115322147165
https://twitter.com/twittatore/status/1776613077053481078
https://twitter.com/twittatore/status/1774827657512841363


Have fun!
Andrea


Re: Upcoming ACCU 2024 Talk: How DLang Improves my Modern C++ and Vice Versa

2024-04-09 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 8 April 2024 at 01:38:20 UTC, Mike Shah wrote:
I'll be talking more about D (and modern C++) at the ACCU 2024 
conference in Bristol (Abstract below -- talk is on April 19, 
2024).


+1


Re: Beta 2.108.0

2024-03-21 Thread Andrea Fontana via Digitalmars-d-announce

On Thursday, 21 March 2024 at 03:19:16 UTC, Salih Dincer wrote:

On Thursday, 21 March 2024 at 02:14:36 UTC, WebFreak001 wrote:

On Saturday, 2 March 2024 at 17:40:29 UTC, Iain Buclaw wrote:
.. since they drastically make things easier (hexstrings) or 
even possible in the first place (magic initializer thingies) 
for library code and generated code.


I cannot say the same thing. It is thought-provoking that even 
the toHex() function, which should be in std.conv, was not 
included and we had to write it ourselves.


SDB@79


This?

```
import std;

void main()
{
int number = 32409;
auto hex = format("%X", number);
writeln(hex);
}
```

or:

```
auto toHex(N)(N number) if (isIntegral!N) { return 
"%X".format(number); }

...
auto hex = 3432.toHex();
...

```



Re: DConf Online Livestream Link

2024-03-18 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 18 March 2024 at 11:11:03 UTC, Nick Treleaven wrote:

On Sunday, 10 March 2024 at 16:07:23 UTC, Mike Parker wrote:
The countdown is on! I'll kick off the DConf Online Livestream 
at 14:55 UTC on March 16. You can find it here:


https://www.youtube.com/live/8GV_TuYk3lk

And if you haven't seen the details yet, take a look here:
https://dconf.org/2024/online/index.html

See you there!


This was great, interesting selection of talks.

BTW each link to slides is giving me a 404. Luckily the live 
stream video is still up to rewind :-)


https://github.com/dlang/dconf.org/tree/master/2024/online/slides

Andrea


Re: Is D programming friendly for beginners?

2024-03-12 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 12 March 2024 at 19:12:03 UTC, H. S. Teoh wrote:
I don't know how CS programs are carried out these days, but 
back when I was in university, the choice of language is 
largely irrelevant, because the whole point of a programming 
course isn't to teach you a specific language, but to teach you 
the *principles* that underlie programming in general. There 
are really only a small handful of different paradigms that you 
need to learn; once you learned the principles behind them, 
they can be applied to any language out there.  You wouldn't 
need anyone to teach you a new language then; you could just 
learn it yourself by applying these same principles.


The rest, as they say, is just details. ;-)


T


I agree.

Andrea


Re:  Announcing Serverino 0.6.0! 

2024-03-10 Thread Andrea Fontana via Digitalmars-d-announce

Thank you! Inline replies >>>

On Sunday, 10 March 2024 at 21:04:05 UTC, aberba wrote:


1) I'm not sure I like concat (~=)
 style used on `Output output` and how it can determine the 
order routes are invoked. I would expect that to be explicitly 
defined by Dev using a catch-all route or else the sever 
returns 404 by default. That's going to prevent the chances of 
invoking the wrong route especially when it does something 
important/dangerous/unexpected.


Serverino works with priorities, that's the order the handlers 
are called! You're checks on handlers can easily filter request.





2) instead of doing:

```d
if (request.method != Request.Method.Get)
output.status = 405;
```

to determine the request method, why not use a UDA similar to 
`@route` ...like `@method(Request.Method.post)`? The use of UDA 
is so much cleaner and easier to deal with.




This works as well, indeed:
@route!(r => r.method == Request.Method.Post)



3) would be nice to have an `output.json()` function which both 
sets the response header and also calls `output.write()`


Just add content type and you're done!

4. I can't build anything significant in any http server 
library without support for middleware. Preferably support for 
multiple middlewares functions. A middleware would be a 
function that runs after the @onServerInit but BEFORE any route 
handler. It will be used to intercept all incoming requests for 
things like authentication, rate limiting, CORS, etc. 
Preferably provide a way to pass data to the target route e.g. 
user session, user permission, etc...like 
output.locals.set("userId", 123). The route will then be able 
to access this data.


Just use a high priority handler, check the tips on website, for 
example user auth.


That's a very clean way to add a layer of Auth, logging and so 
on...



All in all, everything else looks good. I would prefer 
something like:


```d
void hello (Request req, Response res) {
res.write("hello");
}
```
...but `Output` is also fine... just a small nitpick.


output.write() works as well.

Andrea



 Announcing Serverino 0.6.0! 

2024-03-07 Thread Andrea Fontana via Digitalmars-d-announce
Performance has been boosted once again, and those pesky little 
bugs? Squashed! Plus, there are fresh examples to try out and 
even a sleek new logo to admire!


Ready to dive in? Just spin up a new project using the provided 
template:


```
dub init -t serverino my_wonderful_project
cd my_wonderful_project
dub
```

And voilà! Your hello world will be up and running in **a couple 
of seconds**! 



Have fun!
Andrea Fontana

(I know some of you are already on board, but how many are 
sailing in secret? Come out of the shadows and let me know! Your 
feedback is the wind in serverino's sails)


Repository: https://github.com/trikko/serverino
Docs: https://trikko.github.io/serverino
Examples: https://github.com/trikko/serverino/tree/master/examples
Tips: https://github.com/trikko/serverino/wiki/


Re: SecureD 3.0 has been released!

2024-03-07 Thread Andrea Fontana via Digitalmars-d-announce

On Wednesday, 6 March 2024 at 07:47:04 UTC, Adam Wilson wrote:
SecureD 3.0 has been released. This version was set in motion 
by a Cedric Picard, a D community member with Cryptography 
experience, reaching out and suggesting a number of 
improvements to the Symmetric and KDF API's. This resulted in 
an API for symmetric encryption that improves correctness and 
security without significantly increasing developer workload. 
Also improved is the encryption envelope that contains 
symmetrically encrypted data.


Algorithm Changes:
- Removed: SHA2-224, AES-OFB
- Added: SHA3-224/256/384/512

And I even remembered to update the examples in the README.

Future work will focus on using the Operating System provided 
cryptography where available.


Check it out here: https://code.dlang.org/packages/secured


Well done Adam!

I only miss the docs :)

Andrea


Re: First Beta 2.106.0

2023-11-04 Thread Andrea Fontana via Digitalmars-d-announce

On Thursday, 2 November 2023 at 00:57:23 UTC, Iain Buclaw wrote:
Glad to announce the first beta for the 2.106.0 release, ♥ to 
the 33 contributors.


http://dlang.org/download.html#dmd_beta
http://dlang.org/changelog/2.106.0.html

As usual please report any bugs at
https://issues.dlang.org

-Iain
on behalf of the Dlang Core Team


Static AA init, finally! Great!

Andrea


Re: Blog post: How we are using D to develop Aspect from the ground up

2023-10-24 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 23 October 2023 at 19:02:46 UTC, Sönke Ludwig wrote:
I've written up an article that showcases how we use D in 
production and how that benefits us in unique ways.


Nice article. I agree with you about the pros and cons of 
language!


Andrea



Re: tshare/1.0 a fast way to share file using transfer.sh

2023-10-12 Thread Andrea Fontana via Digitalmars-d-announce

On Wednesday, 11 October 2023 at 14:30:50 UTC, kinke wrote:
On Saturday, 7 October 2023 at 22:40:58 UTC, Andrea Fontana 
wrote:

Question:
- Is there a way to compile curl statically with ldc for 
windows? If I try (using -static), it throws a runtime error.


Yes; IIRC, you need to link `curl_a.lib` *and* add `curl.exp` 
(as Phobos tries to find the exported functions in the .exe 
itself) to the linker cmdline too (both files in the LDC lib 
dir).


You're right!

On dub this works:

```
dflags "-link-defaultlib-shared=false" platform="ldc"
dflags "-static" platform="windows"
lflags "curl_a.lib" "crypt32.lib" "wldap32.lib" "curl.exp" 
platform="windows"

```

Thank you,
Andrea


Re: tshare/1.0 a fast way to share file using transfer.sh

2023-10-07 Thread Andrea Fontana via Digitalmars-d-announce
On Wednesday, 4 October 2023 at 23:02:39 UTC, Andrea Fontana 
wrote:
I've just released a simple tool for sharing files (similar to 
WeTransfer) directly from the terminal.



News:
- Added support for encryption (if gpg is available)
- Added binaries built by github
- Improved UI

Question:
- Is there a way to compile curl statically with ldc for windows? 
If I try (using -static), it throws a runtime error.


Andrea




tshare/1.0 a fast way to share file using transfer.sh

2023-10-04 Thread Andrea Fontana via Digitalmars-d-announce
I've just released a simple tool for sharing files (similar to 
WeTransfer) directly from the terminal.


Usage is incredibly straightforward:

Run ```dub build tshare``` to build the tool.
Use ```tshare /your/file``` to share your file, which will 
generate a public link.


For additional options, you can explore by running tshare -h.

On GitHub: https://github.com/trikko/tshare

Best regards,
Andrea


Re: LDC 1.31.0

2023-02-23 Thread Andrea Fontana via Digitalmars-d-announce

On Saturday, 11 February 2023 at 13:47:54 UTC, kinke wrote:

Glad to announce LDC 1.31.0. Major changes:

* Based on D 2.101.2.
  * ImportC: The C preprocessor isn't invoked yet.
* mac/iOS arm64: Linking with `-g` is working again without 
unaligned pointer warnings/errors.
* *Preliminary* support for LLVM 15. Thanks @jamesragray for 
helping out!

* Initial ABI support for 64-bit RISC-V. Thanks @Ast-x64!

Full release log and downloads: 
https://github.com/ldc-developers/ldc/releases/tag/v1.31.0


Thanks to all contributors & sponsors!


Build for raspberry pi + debian bullseye:
https://github.com/trikko/ldc2-rpi-build/releases/tag/v1.31.0

Andrea Fontana


Re: Centroid tracking using DCV

2023-02-16 Thread Andrea Fontana via Digitalmars-d-announce
On Wednesday, 15 February 2023 at 17:32:33 UTC, Ferhat Kurtulmuş 
wrote:

I heard you are not having fun enough with d today.

Do you know you can do things like this with dlang now? After 
some fiddling with it, my last commits made this possible.


how it looks like: https://www.youtube.com/watch?v=ACC_-TDAtqc
source code: 
https://github.com/aferust/oclcv/tree/main/examples/centroidtracking

DCV: https://github.com/libmir/dcv

Sorry for the potato-quality video. My art director is on 
vacation.


I am cheating a little with OpenCL since things are not fast 
enough at the moment.


Hope you like it.

Enjoy!


Nice!


Re: LDC 1.31.0-beta1

2023-02-03 Thread Andrea Fontana via Digitalmars-d-announce

On Friday, 27 January 2023 at 20:35:01 UTC, kinke wrote:

Glad to announce the first beta for LDC 1.31. Major changes:

* Based on D 2.101.2.
  * ImportC: The C preprocessor isn't invoked yet.
* mac/iOS arm64: Linking with `-g` is working again without 
unaligned pointer warnings/errors.
* *Preliminary* support for LLVM 15. Thanks @jamesragray for 
helping out!

* Initial ABI support for 64-bit RISC-V. Thanks @Ast-x64!

Full release log and downloads: 
https://github.com/ldc-developers/ldc/releases/tag/v1.31.0-beta1


Please help test, and thanks to all contributors & sponsors!


Nice! Can we have a build for linux-arm (rpi)? The last one is 
oold :)


Andrea


Re: Serverino 0.4.0

2023-02-01 Thread Andrea Fontana via Digitalmars-d-announce
On Wednesday, 1 February 2023 at 20:01:13 UTC, Andrea Fontana 
wrote:
do you have any plans to do some benchmarks or if you did, 
please share the place to check it?



Here some results from may, but serverino went over a major arch 
rework after that, so I'm not sure they are still valid.


https://github.com/tchaloupka/httpbench

If you want to do some benchmarks your welcome!

Andrea


Re: Serverino 0.4.0

2023-02-01 Thread Andrea Fontana via Digitalmars-d-announce
On Wednesday, 1 February 2023 at 20:01:13 UTC, Andrea Fontana 
wrote:
do you have any plans to do some benchmarks or if you did, 
please share the place to check it?



Here some results from may, but serverino went over a major arch 
rework after that, so I'm not sure they are still valid.


https://github.com/tchaloupka/httpbench

If you want to do some benchmarks your welcome!

Andrea


Re: Serverino 0.4.0

2023-02-01 Thread Andrea Fontana via Digitalmars-d-announce

On Wednesday, 1 February 2023 at 19:49:40 UTC, psyscout wrote:
On Wednesday, 1 February 2023 at 17:36:07 UTC, Andrea Fontana 
wrote:

Hi! I've just release a new version of serverino, my pure-D...



First of all, thanks for your effort!

For the second, I have a couple of simple web services that are 
require small, simple and fast webapp. So I'm wondering, do you 
have any plans to do some benchmarks or if you did, please 
share the place to check it?


Someone already did it (with a previous version!).

Anyway it's fast enough for real world usage if you're not 
running a million webpage website on it 


The company I work for uses it for many small simple and fast 
webapps!


In most cases the bottle neck is not serverino itself, but the 
code you're putting over it.


It works with a daemon and responders, not fibers. So it could be 
not efficient for long blocking operation. Let's say you want to 
replace PHP with a better and faster language, that's a good 
choice :)


It's really fast to setup for development and I suggest to put it 
under nginx if exposed into the wild (easy, explained on github 
page)


Give it a try!
Andrea



Serverino 0.4.0

2023-02-01 Thread Andrea Fontana via Digitalmars-d-announce
Hi! I've just release a new version of serverino, my pure-D 
webserver without 3rd party dependencies, super-fast to compile.


This version is featuring a basic & easy way to add routing using 
UDAs.


A big thank you to Ferhat Kurtulmuş that create a pull request 
for this :)


Just create a ready-to-go serverino using the project template:
```dub init -t serverino your_server```

And then test the new feature:
```d
import serverino;

mixin ServerinoMain;

@endpoint @route!"/hello/world" // also: @route!(request => 
request.uri == "/hello/world")

void your_request(const Request r, Output o)
{
   o ~= "Hello world!";
}

@endpoint @route!(request => r.get.has("item"))
void another_request(const Request r, Output o)
{
   o ~= "Item " ~ r.get.read("item");
}

@endpoint @priority(-1)
void this_is_a_fallback(const Request r, Output o)
{
   o ~= r.dump();
}

```

More info and docs: https://github.com/trikko/serverino




Re: Serverino 0.3.0 - now with windows support

2022-10-28 Thread Andrea Fontana via Digitalmars-d-announce

On Friday, 28 October 2022 at 09:25:11 UTC, Imperatorn wrote:
On Friday, 28 October 2022 at 07:42:26 UTC, Andrea Fontana 
wrote:

On Thursday, 27 October 2022 at 19:46:47 UTC, Imperatorn wrote:

Nice, sometimes you just need some quick and dirty http


That's exactly one of the use cases :)


I'm on Windows 10 and your three-liner just worked, thanks


Good to know. I have no windows machine, but unit-tests passed on 
github :)

Anyway if you see something strange, keep me posted on github!

Andrea


Re: Serverino 0.3.0 - now with windows support

2022-10-28 Thread Andrea Fontana via Digitalmars-d-announce

On Thursday, 27 October 2022 at 19:46:47 UTC, Imperatorn wrote:

Nice, sometimes you just need some quick and dirty http


That's exactly one of the use cases :)


Re: parserino 0.2.0

2022-10-23 Thread Andrea Fontana via Digitalmars-d-announce

On Saturday, 22 October 2022 at 22:14:26 UTC, Adam D Ruppe wrote:

On Saturday, 22 October 2022 at 21:58:54 UTC, Enjoys Math wrote:

Nice!  So it's D's answer to Python's BeautifulSoup.


D has had a html tag soup parser since 2009 in my dom.d.

The parserino might be more html5 compliant specifically 
though, as mine was written before html5 was a thing. It's been 
updated with it but still an independent parser (capable of 
reading in-the-wild html as well as things like xml and even 
php tags) instead of following their specific algorithm.


Ah-ah! Adam is worried 
Just kidding, he helped me to compile parserino on Windows, so 
thanks Adam!


Re: parserino 0.2.0

2022-10-20 Thread Andrea Fontana via Digitalmars-d-announce

On Thursday, 20 October 2022 at 13:24:27 UTC, psyscout wrote:
Wow, it uses builtin browser. Cool! I have a coming project, 
will try it out. Thank You for your effort!


You're welcome :)


parserino 0.2.0

2022-10-19 Thread Andrea Fontana via Digitalmars-d-announce

Hello!

Finally I released the public version of parserino, a html5 
parser for linux, macos and windows.


Link:
https://github.com/trikko/parserino


Serverino 0.3.0 - now with windows support

2022-10-16 Thread Andrea Fontana via Digitalmars-d-announce

Hello there.

I've just released a new version of serverino, a simple and 
ready-to-go http server with zero external dependencies (pure D!).


I changed a lot of things under the hood from the last version 
and tests are welcome.


It works on linux, macos and windows. I use only linux, so I 
didn't test so much on other platforms.


I started the project since we need a fast and easy way to setup 
a server for services, small websites or simply to do some tests 
on the browser and this is its main focus (but don't worry: it 
can handle several thousands of requests for seconds)


To start a new website just write:

```
dub init test_serverino -t serverino
cd test_serverino
dub

```

And you're done.

More info here: https://github.com/trikko/serverino

Andrea






Re: HTTP frameworks benchmark focused on D libraries

2022-05-31 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 30 May 2022 at 20:57:02 UTC, tchaloupka wrote:

On Sunday, 29 May 2022 at 06:22:43 UTC, Andrea Fontana wrote:

On Thursday, 26 May 2022 at 07:49:23 UTC, tchaloupka wrote:

I see there is a test where numbers are identical to arsd 
ones, is it a typo or a coincidence?

Andrea


Hi Andrea,
it was just a coincidence, straight out copy of the tool 
results.
But as I've found some bugs calculating percentiles from `hey` 
properly, I've updated the results after the fix.


I've also added results for `geario` (thanks #zoujiaqing).
For `serverino`, I've added variant that uses 16 worker 
subprocesses in the pool, that should lead to less blocking and 
worse per request times in the test environment.


Tom


Thank's again! Benchmark are always welcome :)


Re: HTTP frameworks benchmark focused on D libraries

2022-05-29 Thread Andrea Fontana via Digitalmars-d-announce

On Thursday, 26 May 2022 at 07:49:23 UTC, tchaloupka wrote:

Hi,
as there are two more HTTP server implementations:

* 
[Serverino](https://forum.dlang.org/thread/bqsatbwjtoobpbzxd...@forum.dlang.org)


Thank you! Since it's just a young library that results sounds 
promising.


I'm just working on the next version, focusing on performance 
enhancement and windows support :)



I see there is a test where numbers are identical to arsd ones, 
is it a typo or a coincidence?

Andrea


Re: Release: serverino - please destroy it.

2022-05-15 Thread Andrea Fontana via Digitalmars-d-announce

On Sunday, 15 May 2022 at 06:37:08 UTC, frame wrote:

On Saturday, 14 May 2022 at 23:23:47 UTC, Andrea Fontana wrote:


Which kind of socket exception could be triggered by a client?

Andrea


It doesn't matter if triggered by a client or not, you need to 
deal with the possibility. A closed/destroyed socket is an 
invalid resource.


I recently had the scenario on Windows where a client crashed 
and the socket wasn't closed properly somehow. Now the server 
adds the socket to the set to see an update - boom! "Socket 
operation on non-socket" error.


Also accepting sockets can throw, for eg. by a stupid network 
time out error - not only on Windows. Other socket operations 
are no exceptions either.


`isAlive` is fine for properly shutdowned/closed sockets by you 
or peer. But it doesn't protect you from faulting ones.


Ok, added some checks on .select, .accept, .bind, .listen.
Thank you.

Andrea



Re: Release: serverino - please destroy it.

2022-05-14 Thread Andrea Fontana via Digitalmars-d-announce

On Saturday, 14 May 2022 at 20:44:54 UTC, frame wrote:
Take care of socket exceptions - especially if you want to make 
a port to Windows.


You should always expect one. It's not enough to test 
`Socket.isAlive` - a client socket may be faulty and any 
illegal socket operation throws and kills your loop. Even if 
`isAlive` works as expected, it may changes the status before 
you have add the socket to the set. You don't want your server 
to crash if a client misbehaves.


Which kind of socket exception could be triggered by a client?

Andrea


Re: Release: serverino - please destroy it.

2022-05-12 Thread Andrea Fontana via Digitalmars-d-announce

On Thursday, 12 May 2022 at 11:46:05 UTC, Guillaume Piolat wrote:

On Thursday, 12 May 2022 at 11:33:07 UTC, Andrea Fontana wrote:


Does dmd/rdmd work? Serverino uses std.net.curl just for 
running its unittests, so maybe that bug is not blocking.


Well tbh, the simple fact that I would have to use WSL is a 
blocker for me.

AFAIK vibe or cgi.d do not require that.


Yay. I need a Windows machine (or someone with it!) to rewrite 
some POSIX parts.


For example the part that send/receive the file descriptor (of a 
socket) from the master process to the worker (windows has its 
own API for this)


Re: Release: serverino - please destroy it.

2022-05-12 Thread Andrea Fontana via Digitalmars-d-announce

On Thursday, 12 May 2022 at 10:26:28 UTC, Guillaume Piolat wrote:

On Sunday, 8 May 2022 at 21:45:28 UTC, Andrea Fontana wrote:


If you can test it on windows with WSL, that would be 
appreciated a lot!




I tried to test servrino on WSL, but dub doesn't run on WSL.
=> https://github.com/dlang/dub/issues/2249


Hey thanks for your support!

Too bad dub doesn't work with wsl, it sounds like a lost 
opportunity.


Does dmd/rdmd work? Serverino uses std.net.curl just for running 
its unittests, so maybe that bug is not blocking.


Andrea


Re: Release: serverino - please destroy it.

2022-05-11 Thread Andrea Fontana via Digitalmars-d-announce

On Wednesday, 11 May 2022 at 06:50:37 UTC, Orfeo wrote:

well done Andrea!

(forum begins to be too crowded with Italians :) )


---
Orfeo


We all miss the good old bearophile!
I think the most active italian in this forum.

Andrea


Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 10 May 2022 at 21:24:46 UTC, Paolo Invernizzi wrote:


Here I am ... Milanese: https://www.deepglance.com/about

/Paolo


Ok it's me getting old!

Andrea




Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 10 May 2022 at 20:13:45 UTC, Paolo Invernizzi wrote:
Sinceramente non ricordo di averlo scritto, ma alla mia eta ... 
probabilmente dimentico qualcosa ... comunque piacere! E' bello 
vedere altri italiani apprezzare questo magnifico linguaggio!


(Frankly speaking, I don't remember to have written that, but 
hey, I'm getting old ... probably  I'm forgetting something ... 
anyway nice to meet you! It's great to see Italians here 
enjoying this great programming language!)


I wonder if you're making a fool of me. Or maybe it's me who is 
getting old.
I'm pretty sure that there's a user here with a really Italian 
name who was born somewhere in South America.


Andrea


Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 10 May 2022 at 19:50:08 UTC, Paolo Invernizzi wrote:


Concordo ... (I agree!)

:-P


Wait, you have always said you're not Italian. Have you changed 
your mind?


Andrea




Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 10 May 2022 at 18:33:18 UTC, Sebastiaan Koppe wrote:

On Tuesday, 10 May 2022 at 10:49:06 UTC, Andrea Fontana wrote:
On Tuesday, 10 May 2022 at 08:32:15 UTC, Sebastiaan Koppe 
wrote:
The difference is that with the route uda you can *only* map 
routes 1:1 exhaustively. With your approach it is up to the 
programmer to avoid errors. It is also hard to reason about 
the flow of requests through all those functions, and you 
have to look at the body of them to determine what will 
happen.


Sorry I don't follow you


It is simple, since all your handler are effectively chained, 
any error in any one of them can cause later ones to fail or 
misbehave. This decreases locality and increases the things you 
have to reason about.


Not sure. What if your uda (regex) match is too permissive? Is 
that different?


My code evaluates workers in order, just like yours, no?

Maybe I can enable some log if set on config, to track what's 
happening. That could help you to debug if something goes wrong.




There are other benefits to uda tagged endpoints too, for 
example they are easier to nest, or to programmatically 
generate them. In vibe-d I added the default option of 
generating OPTION handlers for every regular endpoint. This is 
required for CORS.



@endpoint void func(...){
   if(req.method == Method.OPTION){
   // THIS RUN FOR EVERY ENDPOINT
   }
}




In any case if you want to use a different routing strategy 
it's quite easy. I really don't like libraries that force you 
to use their own style/way.


That is good.


Andrea




Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce
On Tuesday, 10 May 2022 at 16:47:13 UTC, Ola Fosheim Grøstad 
wrote:

On Tuesday, 10 May 2022 at 16:05:11 UTC, Andrea Fontana wrote:
Oh, italian is full of suffixes. -ello means a slightly 
different thing. It's small but sounds like a bit pejorative.


Oh, and I loved the sound of it… suggests immaturity, perhaps?

(I love the -ello and -ella endings. «Bambinella» is one of my 
favourite words, turns out it is a fruit too!)


Maybe bambinetto is more about immaturity. Bambinuccio is cute. 
Bambinaccio is bad. Bambinone is big (an adult that behave like a 
child). -ello doesn't sound good with bambino, but it's very 
similar to -etto.


Good luck :)



Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce
On Tuesday, 10 May 2022 at 15:35:35 UTC, Ola Fosheim Grøstad 
wrote:

On Tuesday, 10 May 2022 at 15:27:48 UTC, Andrea Fontana wrote:
Indeed the "-ino" suffix in "serverino" stands for "small" in 
italian. :)


Bambino > bambinello? So, the embedded-version could be 
«serverinello»? :O)


Oh, italian is full of suffixes. -ello means a slightly different 
thing. It's small but sounds like a bit pejorative.


-ino in bambino is not (anymore) a suffix, anyway.


Andrea


Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce
On Tuesday, 10 May 2022 at 15:16:22 UTC, Ola Fosheim Grøstad 
wrote:

On Tuesday, 10 May 2022 at 15:00:06 UTC, Andrea Fontana wrote:
I work in the R and every single time I even have to write a 
small api or a simple html interface to control some strange 
machine I think "omg, I have to set nginx agaain".


Good point, there are more application areas than regular 
websites. Embedded remote applications could be another 
application area where you want something simple with HTTPS 
(monitoring webcams, sensors, solar panels, supervising farming 
houses or whatever).


Indeed the "-ino" suffix in "serverino" stands for "small" in 
italian. :)


Andrea


Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 10 May 2022 at 15:01:43 UTC, Adam Ruppe wrote:

On Monday, 9 May 2022 at 19:20:27 UTC, Andrea Fontana wrote:
Thank you. Looking forward to getting feedback, bug reports 
and help :)


BTW I'm curious, what made you not want to use my cgi.d which 
has similar capabilities?


I was really tempted to start from that!
But it's difficult to fork and edit a 11kloc project like that :)

I had yet developed fastcgi and scgi code in the past so I've 
reused some code and it didn't take so much time to get to 
serverino.


Andrea




Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce
On Tuesday, 10 May 2022 at 13:15:38 UTC, Ola Fosheim Grøstad 
wrote:

On Tuesday, 10 May 2022 at 12:52:01 UTC, Andrea Fontana wrote:
I'm running a whole website in D using fastcgi and we have no 
problem at all, it's blazing fast. But it's not so easy to 
setup as serverino :)


Easy setup is probably the number one reason people land on a 
specific web-tech, so it is the best initial angle, I agree.


(By version 3.x you know what the practical weak spots are and 
can rethink the bottom layer.)


Right. But it's not just marketing.

I work in the R and every single time I even have to write a 
small api or a simple html interface to control some strange 
machine I think "omg, I have to set nginx agaain". It's 
pretty annoying especially if you're working on shared aws 
machine. (I know, docker & c. Exist, but they take a lot to setup 
and they are heavy for some simple api). I'm going to love 
serverino in the next months :)


Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 10 May 2022 at 13:34:27 UTC, Adam D Ruppe wrote:

On Monday, 9 May 2022 at 20:37:50 UTC, Andrea Fontana wrote:

The same goes for cgi/fastcgi/scgi and so on.


Well, cgi does one process per request, so there is no worker 
pool (it is the original "serverless" lol).


fastcgi is interesting because the Apache module for it will 
actually start and stop worker processes as-needed. I don't 
think the the nginx impl does that though.


Some daemons can manage this by themselves (once again: check  
php-fpm  "dynamic" setting).


Serverino can do it as well. You can set in configuration the max 
and min number of workers. It's easy:


```
@onServerInit auto setup()
{
ServerinoConfig sc = ServerinoConfig.create();
sc.setMinWorkers(5);
sc.setMaxWorkers(100);
return sc;
}
```

If all workers are busy the daemon will launch a new one. You 
might be interested in

setMaxWorkerLifetime() and  sc.setMaxWorkerIdling() too!

But the nicest thing about all these application models is if 
you write it in the right way, you can swap out the approach, 
either transparently adding the i/o event waits or just adding 
additional servers without touching the application code. 
That's a lot harder to do when you expect shared state etc. 
like other things encourage.


I would mention that if something goes wrong and a process crash 
or get caught in an infinite loop, it's not a problem. Process is 
killed and wake up again without pull all the server down.


Andrea




Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce
On Tuesday, 10 May 2022 at 12:31:23 UTC, Ola Fosheim Grøstad 
wrote:

On Tuesday, 10 May 2022 at 10:49:06 UTC, Andrea Fontana wrote:

And you can still handle 700k/views per hour with 20 workers!


Requests tend to come in bursts from the same client, thanks to 
clunky javascript APIs and clutters of resources (and careless 
web developers). For a typical D user ease-of-use is probably 
more important at this point, though, so good luck with your 
project!


In my opnioni IRL that's not a big problem as it can seem.

Again: that's just how nginx and apache handle php/cgi/fcgi/scgi 
requests.
Wikipedia runs wikimedia software. Written in php. Running on 
apache with php-fpm (and cache!).


And I'm not suggesting to run wikipedia on serverino, *for now*.

If you try to open a lot of wikipedia pages at the same time in a 
burst, they will be served (probably using keep-alive connection) 
not in parallel: you're queued. And the 99.9% of users will never 
notice this. Is it a problem?


If you need much control, you can use an http accelerator and/or 
you can use a reverse proxy (like nginx) to control bursts et 
similia.


I'm running a whole website in D using fastcgi and we have no 
problem at all, it's blazing fast. But it's not so easy to setup 
as serverino :)


Andrea




Re: Release: serverino - please destroy it.

2022-05-10 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 10 May 2022 at 08:32:15 UTC, Sebastiaan Koppe wrote:

On Monday, 9 May 2022 at 20:37:50 UTC, Andrea Fontana wrote:

On Monday, 9 May 2022 at 20:08:38 UTC, Sebastiaan Koppe wrote:
As an example, how many requests per second can you manage if 
all requests have to wait 100 msecs?


For non critical workload you will probably still hit good 
enough performance though.


Firstly, it depends on how many workers you have.

Then you should consider that a lot of (most?) websites use 
php-fpm, that works using the same approach (but php is much 
slower than D). The same goes for cgi/fastcgi/scgi and so on.


Let's say you have just 20 workers. 100msecs for each request 
(a lot of time for my standards, I would say). That means 
20*10 = 200 webpages/s = 720k pages/h. I don't think your 
website has so much traffic...


And I hope not every request will take 100msecs!


100msecs is on the upper end for sure, but if you add a 
database, external service call, etc. it is not uncommon to 
reach that.


And you can still handle 700k/views per hour with 20 workers!

The point however, is that the architecture breaks down because 
it is unable to do work concurrently. Every requests blocks a 
worker from start to finish.


Unless it is CPU heavy the system will be under utilized. That 
is not necessarily bad though. The simplicity has something 
going for it, but it is definitely a tradeoff that you should 
consider highlighting.


Every server has its own target. BTW, I'm not developing 
serverino to use it as a building block of a CDN.


In real-life projects, I think you can use it without any problem 
for not-huge projects.


You can also put it under a reverse proxy (f.e. nginx), to handle 
just the requests you need to write in D.


The difference is that with the route uda you can *only* map 
routes 1:1 exhaustively. With your approach it is up to the 
programmer to avoid errors. It is also hard to reason about the 
flow of requests through all those functions, and you have to 
look at the body of them to determine what will happen.


Sorry I don't follow you: I don't know which framework you're 
using, but if you're using UDA with matches (something like: 
@matchUri("/main") void renderMain(...) { ... }) you still have 
to check all the functions if a request is not handled correctly. 
Or am I missing something?


Using my approach if you want to check which functions escape 
from routing you can just add a catch-all endpoint with low 
priority.


```
@priority(-1000) @endpoint
void wtf(Request r, Output o)
{
  fatal("Request NOT HANDLED: ", r.dump());
}
```

And if a request doesn't match your UDA constraint, how do you 
debug what's wrong with it? I think it's easier to add a 
checkpoint/log on the first lines of your functions body to guess 
why the function is skipped.


In any case if you want to use a different routing strategy it's 
quite easy. I really don't like libraries that force you to use 
their own style/way.


So you can even drop my UDAs and write the app like this. It 
still works:


```
mixin ServerinoMain;

void entry(Request r, Output o)
{
// Use your routing strategy here
// ...
// YourRouter router;
// router.do(r, "/hello/world", );
// router.do(r, "/bla", );
}
```

Andrea


Re: Release: serverino - please destroy it.

2022-05-09 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 9 May 2022 at 20:08:38 UTC, Sebastiaan Koppe wrote:

On Sunday, 8 May 2022 at 21:32:42 UTC, Andrea Fontana wrote:
Every request is processed by a worker running in an isolated 
process, no fibers/threads, sorry (or thanks?)


I did some tests and the performance sounds good: on a local 
machine it can handle more than 100_000 reqs/sec for a simple 
page containing just "hello world!".Of course that's not a 
good benchmark, if you can help me with other benchmarks it 
would be much appreciated (a big thanks to Tomáš Chaloupka who 
did some tests!)


Typically server applications are IO heavy. I expect your 
isolated-process approach to break down with that kind of work.


I know. We all know :) Benchmarks are just benchmarks. They are 
useful to understand how much overhead your server adds to the 
whole project. These benchmarks are made in the local machine, 
with almost no connection overhead.


Not every application is IO heavy, anyway.

As an example, how many requests per second can you manage if 
all requests have to wait 100 msecs?


For non critical workload you will probably still hit good 
enough performance though.


Firstly, it depends on how many workers you have.
Then you should consider that a lot of (most?) websites use 
php-fpm, that works using the same approach (but php is much 
slower than D). The same goes for cgi/fastcgi/scgi and so on.


Let's say you have just 20 workers. 100msecs for each request (a 
lot of time for my standards, I would say). That means 20*10 = 
200 webpages/s = 720k pages/h. I don't think your website has so 
much traffic...


And I hope not every request will take 100msecs!



Instead of using a lot of different UDAs to set routing rules, 
you can simply write them in your endpoint's body and exit 
from it to pass to the next endpoint.


My experience is that exhaustive matching is easier to reason 
about at larger scale.


Yes, but exactly the same thing can be done without uda.

```
@endpoint void my_end(Request r, Output o)
{
 if (r.uri == "/asd") // or whatever you want: regex, or 
checking another field

return false; //
}
```

This is just like:

```
@matchuda(uri, "/asd") void my_end() { ... }
```

What's the difference? The first one is much more flexible, IMHO.


Please help me testing it, I'm looking forward to receiving 
your shiny new issues on github.


I noticed it has zero unittests, that is probably a good place 
to start.


Of course! They will come for sure. :)

Andrea



Re: Release: serverino - please destroy it.

2022-05-09 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 9 May 2022 at 19:09:40 UTC, Guillaume Piolat wrote:

On Sunday, 8 May 2022 at 21:32:42 UTC, Andrea Fontana wrote:

Hello!

I've just released serverino. It's a small & ready-to-go 
http/https server.


Dub package: https://code.dlang.org/packages/serverino

Andrea


Looks very useful, congratulations!


Thank you. Looking forward to getting feedback, bug reports and 
help :)


Andrea


Re: Release: serverino - please destroy it.

2022-05-08 Thread Andrea Fontana via Digitalmars-d-announce

On Sunday, 8 May 2022 at 22:09:37 UTC, Ali Çehreli wrote:
Congratulations! :) Looking forward to watching your 
presentation at DConf... ;)


I wish I was able to speak publicly in English in front of an 
audience :)




On 5/8/22 14:32, Andrea Fontana wrote:

> Every request is processed by a worker running in an isolated
process,
> no fibers/threads, sorry (or thanks?)

That effectively uses multiple GCs. I always suspected that 
approach would provide better latency.


I think it depends on what your server is doing, anyway.



> sending opened file descriptors between processes thru sockets


I sent a pull request (merged!) for druntime to make this work on 
macOS too!




Sweet!

Ali





Re: Release: serverino - please destroy it.

2022-05-08 Thread Andrea Fontana via Digitalmars-d-announce

On Sunday, 8 May 2022 at 21:32:42 UTC, Andrea Fontana wrote:

[...]
Andrea


Whoops, I forgot a couple of things. This was tested on linux 
only and it should work fine on other posix systems (macOS 
included!).


I don't have windows, but I think you need WSL to run it, since 
I'm using a lot of strange posix tricks to keep performace at a 
good level (like sending opened file descriptors between 
processes thru sockets).


If you can test it on windows with WSL, that would be appreciated 
a lot!


Andrea





Release: serverino - please destroy it.

2022-05-08 Thread Andrea Fontana via Digitalmars-d-announce

Hello!

I've just released serverino. It's a small & ready-to-go 
http/https server.


Every request is processed by a worker running in an isolated 
process, no fibers/threads, sorry (or thanks?)


I did some tests and the performance sounds good: on a local 
machine it can handle more than 100_000 reqs/sec for a simple 
page containing just "hello world!".Of course that's not a good 
benchmark, if you can help me with other benchmarks it would be 
much appreciated (a big thanks to Tomáš Chaloupka who did some 
tests!)


I'm trying to keep it simple and easy to compile. It has no 
external deps in its base configuration and only one external 
library (libretls) is required if you need/want to enable https.


For your first project you need just three lines of code as you 
can see here:

https://github.com/trikko/serverino/

I didn't implement a traditional router for uris as probably many 
of you expected. I use a different approach. Check out this 
example: 
https://github.com/trikko/serverino/#defining-more-than-one-endpoint


This allows you to do some interesting things giving higher or 
lower priority to each endpoint (for example you can force 
something to always running first like redirect, logging, checks 
on login...)


Instead of using a lot of different UDAs to set routing rules, 
you can simply write them in your endpoint's body and exit from 
it to pass to the next endpoint.


Please help me testing it, I'm looking forward to receiving your 
shiny new issues on github.


Dub package: https://code.dlang.org/packages/serverino

Andrea





Re: GCC 12.1 Released (D v2.100-rc.1)

2022-05-08 Thread Andrea Fontana via Digitalmars-d-announce

On Friday, 6 May 2022 at 11:57:47 UTC, Iain Buclaw wrote:

Hi,

I am proud to announce another major GCC release, 12.1.
[...]
Regards,
Iain.


Great!



Re: mysql-native v3.2.0 - the safe update

2022-04-27 Thread Andrea Fontana via Digitalmars-d-announce
On Saturday, 23 April 2022 at 05:12:30 UTC, Steven Schveighoffer 
wrote:
This is a huge huge update. I've never done anything like this 
before, but I think it works as a drop-in replacement, while 
allowing you to migrate any piece you wish from unsafe code to 
safe code. Please let me know if there are *any* problems you 
find with this.


Well done Steven!

Note this does *not* build with dip1000, because the two 
underlying libraries (Phobos sockets and vibe.d) do not build 
as safe with dip1000.


Dip1000 is marked as "superseded". I don't understand what the 
plan is.


Andrea






Re: Added copy constructors to "Programming in D"

2022-01-13 Thread Andrea Fontana via Digitalmars-d-announce

On Saturday, 8 January 2022 at 13:23:52 UTC, Imperatorn wrote:

On Saturday, 8 January 2022 at 02:07:10 UTC, Ali Çehreli wrote:

1) After about three years, I finally added copy constructors:


http://ddili.org/ders/d.en/special_functions.html#ix_special_functions.copy%20constructor

[...]


Splendid!

Will the physical book also be updated?

Thanks!


I don't think it is possible. You have to buy a new copy when 
published. /s


Re: D Language Foundation Monthly Meeting Summary (September 24, 2021)

2021-10-19 Thread Andrea Fontana via Digitalmars-d-announce

On Wednesday, 6 October 2021 at 06:23:01 UTC, WebFreak001 wrote:

On Friday, 1 October 2021 at 12:32:20 UTC, Mike Parker wrote:

[...]
new slogan
[...]


want to generate controversial heat?

Do it in D (DIID)

(careful with there being a trademark for DiiD though)


You mean:

Just D it


Re: (Oh My) Gentool 0.4.0 released

2021-06-07 Thread Andrea Fontana via Digitalmars-d-announce

On Sunday, 6 June 2021 at 10:03:11 UTC, evilrat wrote:

## (oh my) gentool v0.4 is now out.

It is my fancy tool to generate extern(C++) stuff quicker, it 
takes regular compiler flags that you usually pass to clang and 
translates C/C++ code to D.


This release has one new feature: support pragma mangle on 
aggregates (class, struct, etc...).


Also a lot of work was put into template support, but it is 
still has lots of unhandled cases, so do not expect it will 
translate STL or Boost without need of manual fixes.


Source
https://github.com/Superbelko/ohmygentool

Windows binaries
https://github.com/Superbelko/ohmygentool/releases/tag/v0.4.0


Nice work. Is there a docker somewhere in order to test it?


Re: D + raylib = BlobEditor

2020-11-04 Thread Andrea Fontana via Digitalmars-d-announce
On Wednesday, 4 November 2020 at 07:45:46 UTC, Ferhat Kurtulmuş 
wrote:
looks so funny. As if an alien material is trying to grow and 
eat worlds.


Yes. But it's so relaxing, isn't it?


D + raylib = BlobEditor

2020-11-02 Thread Andrea Fontana via Digitalmars-d-announce

Hello.

I've just published a small toy/demo project.

I use D and raylib to create and render a blob in real time.

Here a video: https://www.youtube.com/watch?v=RIVDdXV6D-A
Here the source: https://github.com/trikko/BlobEditor

It runs fine on my 7yo laptop.

Andrea


Re: bindbc-sfml 0.1.0

2020-11-02 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 2 November 2020 at 11:01:53 UTC, Mike Parker wrote:
I've finally gotten around to finishing up the port of 
DerelictSFML2 to BindBC:


http://bindbc-sfml.dub.pm/


+1

Great job Mike!



Re: MetaCall Polyglot is now available form D

2020-08-14 Thread Andrea Fontana via Digitalmars-d-announce
On Tuesday, 4 August 2020 at 22:25:19 UTC, Vicente Eduardo Ferrer 
Garcia wrote:

[...]
If someone is interested in the D port you can find the source 
here: https://github.com/metacall/dlang-port



Nice! Maybe you can use a bit of syntax sugar for D. Check this 
example:

https://run.dlang.io/is/TKkmbe

Andrea



Re: Origins of the D Programming Language now published by ACM!

2020-06-26 Thread Andrea Fontana via Digitalmars-d-announce

On Saturday, 20 June 2020 at 22:12:21 UTC, Walter Bright wrote:

On 6/20/2020 2:59 PM, Bill Baxter wrote:
Whoa! Page 23 -- a wild Bill Baxter appears! That was 
unexpected.  :-D

--bb


So many contributors - we tried hard to credit where things 
came from.


Nice paper.

It would be nice to have a graphical timeline with most important 
additions/dips :)


Andrea


Re: Earcut polygon triangulation

2020-02-25 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 24 February 2020 at 20:28:20 UTC, Ben Jones wrote:

On Monday, 24 February 2020 at 19:15:13 UTC, JN wrote:

On Sunday, 23 February 2020 at 16:20:09 UTC, Ahmet Sait wrote:
Out of curiosity, why would you need to triangulate polygons 
instead of using stencil buffer? I'm assuming you're using 
OpenGL (or something similar) since you talked about your 
hobby game. Any advantage of triangulating shapes? 
(anti-aliasing maybe?)


Triangulation goes beyond rendering. I imagine this library 
might be useful when making a level editor for a DOOM-like 
2.5D engine.


It's very poorly documented, but I wrote a delaunay refinement 
triangulator: https://github.com/benjones/dtriangulate .  It's 
mostly a reimplementation of Shewchuk's Triangle which is 
probably the most common delaunay triangulator.


Both of these libraries would have been useful a year ago when I 
was writing my 3d printable vases generator in D :)


Re: The good old CGI

2020-02-17 Thread Andrea Fontana via Digitalmars-d-announce

On Saturday, 15 February 2020 at 22:06:42 UTC, Tier wrote:
It might not change the world, but I'm going to try it 
regardless. So thank you!


You're welcome :)

P.S. I know you made an scgi client. Do you plan on making a 
fcgi one too?


I don't like fastcgi protocol that much. I think scgi is 
equivalent but it is much easier to parse :)


Andrea




The good old CGI

2020-02-14 Thread Andrea Fontana via Digitalmars-d-announce
I've just released [1] a simple single-file-library you can use 
to build cgi-enabled app with d.


Not a big innovation, so I don't expect a lot of interest about 
it.
Anyway it's small and light, so it's a fast (not so efficient) 
way to run web-based scripts.


Check the basic example [2] and the docs [3].

Andrea Fontana

[1] https://code.dlang.org/packages/dcgi
[2] https://github.com/2night/dcgi
[3] https://dcgi.dpldocs.info/dcgi.html


Re: Release D 2.090.0

2020-01-07 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 7 January 2020 at 11:12:09 UTC, JN wrote:

Loving the JSON getter :)



Did you give jsonwrap[1] a try?


[1] https://code.dlang.org/packages/jsonwrap


Re: code.dlang.org downtime

2019-12-18 Thread Andrea Fontana via Digitalmars-d-announce

On Wednesday, 18 December 2019 at 09:29:50 UTC, John Colvin wrote:


This is still down for me, regardless of using the IP or 
address. I don't think it's just me either: 
https://stats.uptimerobot.com/6mQX4Crw2L/783838659


https://downforeveryoneorjustme.com/code.dlang.org

Connection timeout here.



Re: code.dlang.org downtime

2019-12-18 Thread Andrea Fontana via Digitalmars-d-announce
On Wednesday, 18 December 2019 at 11:03:04 UTC, Andrea Fontana 
wrote:
On Wednesday, 18 December 2019 at 09:29:50 UTC, John Colvin 
wrote:


This is still down for me, regardless of using the IP or 
address. I don't think it's just me either: 
https://stats.uptimerobot.com/6mQX4Crw2L/783838659


https://downforeveryoneorjustme.com/code.dlang.org

Connection timeout here.


Just said. Up now.


Re: wiki tutorial: D on esp32/esp8266(llvm-xtensa+ldc) and how to get started

2019-11-26 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 26 November 2019 at 08:57:49 UTC, dangbinghoo wrote:

hi,

I just added a simple tutorial to running D betterC on the 
popular ESP32/esp8266 IoT chip.


referenced with the Rust community's Rust on ESP32.

https://wiki.dlang.org/D_on_esp32/esp8266(llvm-xtensa%2Bldc)_and_how_to_get_started

As esp32 IDF is using newlib as it's libc, the druntime and 
phobos just simply won't build.


But betterC seems working, I didn't do with a very strong 
test(actually I don't know if there's betterC test case 
exists), so, just for fun with your own risk!



And, Can we do some work to support druntime building against 
with newlib? If this is true, many MCU would have(newlib 
supports many MCUs) a `real D` running on it.


---
Binghoo Dang


That's great!


Re: Release D 2.089.0

2019-11-08 Thread Andrea Fontana via Digitalmars-d-announce
On Thursday, 7 November 2019 at 16:37:56 UTC, Andrea Fontana 
wrote:

On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote:

Glad to announce D 2.089.0, ♥ to the 44 contributors.

This release comes with corrected extern(C) mangling in mixin 
templates, atomicFetchAdd and atomicFetchSub in core.atomic, 
support for link driver arguments, better support of LDC in 
dub, and plenty of other bug fixes and improvements.


http://dlang.org/download.html
http://dlang.org/changelog/2.089.0.html

-Martin


My code hit a regression on 2.089.




https://issues.dlang.org/show_bug.cgi?id=20368


Re: Release D 2.089.0

2019-11-07 Thread Andrea Fontana via Digitalmars-d-announce

On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote:

Glad to announce D 2.089.0, ♥ to the 44 contributors.

This release comes with corrected extern(C) mangling in mixin 
templates, atomicFetchAdd and atomicFetchSub in core.atomic, 
support for link driver arguments, better support of LDC in 
dub, and plenty of other bug fixes and improvements.


http://dlang.org/download.html
http://dlang.org/changelog/2.089.0.html

-Martin


My code hit a regression on 2.089.

This worked fine, before dmd 2.089 (reduced):

mixin Bug!"asd";

enum test;

template Bug(string n)
{
   int main()
   {
 import std;
 foreach(name;  __traits(allMembers,  __traits(parent, 
main)))
static if (hasUDA!(__traits(getMember, 
__traits(parent, main), name), test))

   return 0;

 return 0;
   }
}



Re: rapidxml for D has been ported.

2019-10-08 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 8 October 2019 at 08:56:26 UTC, zoujiaqing wrote:

[...]


So finally we have a working xml parser!


Re: Telegram group for DLang

2019-09-09 Thread Andrea Fontana via Digitalmars-d-announce
On Thursday, 5 September 2019 at 08:13:14 UTC, Ernesto 
Castellotti wrote:

Hi everyone,

I created a group on Telegram for DLang users, currently it is 
composed of about 10 people from the Italian community.


It is open to anyone interested in discussing DLang on 
Telegram, the official language is English


Link: t.me/DLangGroup

Fell free to join!


"Italian community"? Does it exists?

Andrea


Re: optional 1.0.0 beta with "or/frontOr/Throw" range utilities

2019-07-31 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 30 July 2019 at 10:04:03 UTC, aliak wrote:

On Tuesday, 30 July 2019 at 04:18:28 UTC, Les De Ridder wrote:

On Monday, 29 July 2019 at 22:17:20 UTC, aliak wrote:

[...]

* dispatch() has been renamed to oc(); "optional chain"


Why not 'chain()' or 'optionalChain()'?


Only because chain is in range and optionalChain is too long 路‍♂️.


I would have voted for "optChain()"


Re: neomimalloc [D wrapper for mimalloc] - v0.0.3

2019-07-05 Thread Andrea Fontana via Digitalmars-d-announce

On Friday, 5 July 2019 at 09:57:58 UTC, Ernesto Castellotti wrote:
I am happy to announce the first preliminary version of 
neomimalloc!


Nice project Ernesto!

It sounds funny that Windows is the only platform where this 
Microsoft project doesn't run!


And I'm happy Dlang is spreading in Italy too!

Andrea


Re: Release D 2.086.0

2019-05-08 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 7 May 2019 at 17:29:34 UTC, Daniel N wrote:

On Tuesday, 7 May 2019 at 15:13:05 UTC, Andrea Fontana wrote:


import std;
void main()
{
  std.file.write("/tmp/test", "hello");
}

How should I fix this?


import std;
import file = std.file;
void main()
{
  file.write("/tmp/test", "hello");
}


It sounds strange to me I can't use anymore full package syntax 
due to "import std"


Re: Release D 2.086.0

2019-05-07 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 6 May 2019 at 09:52:32 UTC, Aldo wrote:

On Sunday, 5 May 2019 at 11:53:22 UTC, Martin Nowak wrote:

Glad to announce D 2.086.0, ♥ to the 51 contributors.

This release comes with copy constructors, a lowmem dmd 
switch, private member access for introspection traits, import 
std, dub init templates, and a single RTT resolution of dub 
dependencies.


http://dlang.org/download.html 
http://dlang.org/changelog/2.086.0.html


-Martin


Awesome! I really like the dub linker change and traits change.

Thanks.


Try this:

import std;
void main()
{
  std.file.write("/tmp/test", "hello");
}

How should I fix this?


Re: DPP on the D Blog

2019-04-19 Thread Andrea Fontana via Digitalmars-d-announce

On Friday, 19 April 2019 at 09:04:50 UTC, Atila Neves wrote:

On Tuesday, 9 April 2019 at 21:11:28 UTC, DanielG wrote:
re: the difficulties of interfacing D with certain types of 
C/C++ code ...


Has anybody looked into something like a JavaCpp[1] approach 
for D?


Instead of trying to get D to speak directly with C++, or 
translating C/C++ headers to D, why not use special annotated 
D code to generate a middleman .cpp file, which then exports a 
D-friendly interface? Then all the dirty work gets handled by 
a C++ compiler.


Wouldn't that be an order of a magnitude easier to implement?

[1]: https://github.com/bytedeco/javacpp


I've considered this, and am still considering it, despite not 
having heard of javacpp before. Thanks for the link, I'll take 
a look.


Also SWIG (for d too) does something like this.


Re: New and Unofficial OpenCV binding for D programming language

2019-04-10 Thread Andrea Fontana via Digitalmars-d-announce

On Tuesday, 9 April 2019 at 17:22:12 UTC, Ferhat Kurtulmuş wrote:
Since I could build the library on Windows 10 in addition to 
Ubuntu, I have decided to put it on code.dlang.org: 
https://code.dlang.org/packages/opencvd.


It sounds interesting. I think you should make those examples 
compilable with dub!


Andrea


Re: Compiler benchmarker for D, C, C++, Go, Rust with more to come

2019-03-18 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 18 March 2019 at 10:05:40 UTC, Jacob Carlborg wrote:

On 2019-03-17 21:09, Per Nordlöw wrote:


I thought that already is the case...


No, the official binaries are built with DMD as the host 
compiler.



Is v2.0xx compiled with v2.0xx-1 or with v2.0xx itself?

Andrea


Re: Sublime Text Syntax Definition Rewrite

2019-03-13 Thread Andrea Fontana via Digitalmars-d-announce
On Wednesday, 13 March 2019 at 10:22:15 UTC, Benjamin Schaaf 
wrote:

On Friday, 1 March 2019 at 03:44:09 UTC, Benjamin Schaaf wrote:
On Thursday, 28 February 2019 at 11:33:13 UTC, Andrea Fontana 
wrote:

When the next stable will be released?


Hopefully soon™, we don't want to commit to any deadline 
though.


Good news: Sublime Text 3.2 has just been released, including 
all the aforementioned improvements for D. The full list of 
changes can be seen here: 
https://www.sublimetext.com/blog/articles/sublime-text-3-point-2


Just downloaded and tested on ubuntu.
Sublime + lsp plugin + dls work fine here. It run smoothly also 
for big projects apparently. Nice job!


Re: Regionprops implementation for D

2019-03-11 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 11 March 2019 at 09:29:16 UTC, Ferhat Kurtulmuş wrote:
I am trying to learn dlang and decided to develop a regionprops 
library in pure d (https://github.com/aferust/regionpropsford). 
I borrowed some code and translated into d for performing 
routines like connected component labeling and convexhull. The 
library does not have any dependency except dlang standard 
library phobos. In theory, the library can be used with any 
image processing library allowing access to raw image data 
pointer. I have recently found out that dcv is dead. So, the 
library uses its own data type (Mat2D!T). Although it has been 
tested with dlib, you can test it with other libraries such as 
dcv. I admit that many code were written clumsily, however my 
test showed that it is fast and safe enough so far.


Nice work Ferhat! Some suggestions:
- Add it to code.dlang.org (I can't find it)
- Add a buildable example on your library code base.
- Publish some pictures on github page to make the result clear :)


Re: I've just released Vasaro

2018-12-07 Thread Andrea Fontana via Digitalmars-d-announce

On Friday, 7 December 2018 at 15:03:38 UTC, Joakim wrote:

Nice, when does the version with genetic algorithms come out? ;)

https://www.economist.com/technology-quarterly/2015/09/03/wonderful-widgets

JK, of course, demo looks good.


Trust me or not, this is a planned feature.

Andrea


Re: I've just released Vasaro

2018-12-07 Thread Andrea Fontana via Digitalmars-d-announce

On Friday, 7 December 2018 at 13:32:10 UTC, bauss wrote:
This is a very impressive project and I'll follow it just to 
see where it goes.


I have zero to no experience with 3d printing so I can't really 
relate much to it.


Thank you!

If you eventually start with 3d printing you'll notice that there 
are a lot of vases  to print. People loves them (for many 
reasons). However it's not that easy to model a nice (artistic) 
vase: it requires a good knowledge of 3d editors and also if you 
have some pratice with them, you can have a hard time to make 
models printable.


Vasaro let you create nice vases in just a few minutes and it 
makes a lot of users happy. :)




Re: I've just released Vasaro

2018-12-07 Thread Andrea Fontana via Digitalmars-d-announce

On Friday, 7 December 2018 at 01:17:02 UTC, Adam D. Ruppe wrote:
On Thursday, 6 December 2018 at 20:45:07 UTC, Andrea Fontana 
wrote:
A special thanks to Adam Ruppe and his SimpleDisplay library I 
used on earlier versions :)


why you go gtk in the end?


I replaced simpledisplay with sdl. Gtk doesn't support opengl2 so 
I needed a way to display the rendering window.


Simpledisplay works fine for me (and it works better than sdl for 
mouse input) but it requires X11 on macOS if i'm right: macOS' 
users don't like X11 (and this force users to install a big 
dependency)


If it was only for linux+win, simpledisplay would be the choice!

Andrea


Re: I've just released Vasaro

2018-12-07 Thread Andrea Fontana via Digitalmars-d-announce

On Friday, 7 December 2018 at 07:22:18 UTC, JN wrote:

Looks nice. I'll give it a go when I plug my 3d printer.


Waiting for your feedback.


Why use derelict-sdl if you use gtkd already?


Good question. Gtk doesn't support opengl2.
Why do I use OpenGL2?
- I don't know ogl3
- I just need basic 3d features
- It works everywhere (also on VM I use to test it)

Andrea


Re: I've just released Vasaro

2018-12-06 Thread Andrea Fontana via Digitalmars-d-announce

On Thursday, 6 December 2018 at 21:03:49 UTC, kinke wrote:
On Thursday, 6 December 2018 at 20:45:07 UTC, Andrea Fontana 
wrote:

[...]


Pretty cool, thx for sharing! I watched the demo and had an 
extremely superficial glance at the code too; seems to make D 
look good, as it deserves, so thanks for that as well. :)


Thank you!

I forgot to ask you all to upvote on reddit ;)

Andrea


I've just released Vasaro

2018-12-06 Thread Andrea Fontana via Digitalmars-d-announce

Hi!

I've just released the first version of vasaro.
It's a simple program I wrote to create 3d printable vases.

It's written in D (of course). It uses derelict-gl, derelict-sdl 
and gtkd.


It should work on linux, macOS and Windows.

A special thanks to Adam Ruppe and his SimpleDisplay library I 
used on earlier versions :)


A demo video:
https://www.youtube.com/watch?v=HkYo8WCW9jM

On reddit: 
https://www.reddit.com/r/3Dprinting/comments/a3qykj/ive_just_released_vasaro_the_easytouse_software/


On github:
https://github.com/trikko/vasaro/


Feel free to test it!

Andrea


Re: LDC 1.13.0-beta2

2018-11-23 Thread Andrea Fontana via Digitalmars-d-announce

On Wednesday, 21 November 2018 at 10:43:55 UTC, kinke wrote:

Glad to announce the second beta for LDC 1.13:

* Based on D 2.083.0+ (yesterday's DMD stable).
* The Windows packages are now fully self-sufficient, i.e., a 
Visual Studio/C++ Build Tools installation isn't required 
anymore.

* Substantial debug info improvements.
* New command-line option `-fvisibility=hidden` to hide 
functions/globals not marked as export, to reduce the size of 
shared libraries.


Full release log and downloads: 
https://github.com/ldc-developers/ldc/releases/tag/v1.13.0-beta2


Thanks to all contributors!


Nice! It seems that docker image is not updated since 1.9.0 (but 
it is tagged as "automated build"). Could you please update that 
image?


https://hub.docker.com/r/dlanguage/ldc/

Andrea


Re: BindBC -- The successor to Derelict

2018-10-21 Thread Andrea Fontana via Digitalmars-d-announce

On Friday, 19 October 2018 at 17:34:10 UTC, Mike Parker wrote:

[...]


Well done!


Re: printed v0.0.3: a low-level API to generate self-contained PDF/SVG

2018-10-02 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 1 October 2018 at 09:34:34 UTC, Guillaume Piolat wrote:
printed is a low-level API to generate self-contained PDF 
1.4/SVG 1.1 documents hopefully suitable for print.


Currently it does not provide any "layout" option, you are just 
provided a sort of 2D Canvas API which can then render to 
either SVG or PDF.


No line-breaking, paragraphs, ligature, vertical glyphs, or any 
type of layout are provided, they would have to be implemented 
on top of it.


The most saliant feature is that you are able to embed a 
TrueType/OpenType font inside the generated PDF, instead of 
being restricted to the default fonts of PDF.


It includes an OpenType parser, font matching algorithms and a 
FontRegistry which deals with "finding whatever font are 
installed".


http://code.dlang.org/packages/printed


Nice!


Re: Arrogant - HTML5 dom with CSS selectors

2018-06-13 Thread Andrea Fontana via Digitalmars-d-announce
On Wednesday, 13 June 2018 at 18:06:02 UTC, Nick Sabalausky 
(Abscissa) wrote:
Does this mean that it requires the raw HTML input to already 
be fully conformant HTML5 or simply that it supports and 
outputs valid HTML5?


The second one. If you parse invalid html it tries to fix it and 
output valid html5.


And that it can parse correctly any valid html5 syntax. Or at 
least it should!


Andrea



Arrogant - HTML5 dom with CSS selectors

2018-06-13 Thread Andrea Fontana via Digitalmars-d-announce
On behalf of the company I work for [1] today I released a new 
library: arrogant.


It is a fully conformant HTML5 dom library with CSS selectors.

It wraps Modest library [2] by Alexander Borisov that is a quite 
bigger library/framework.


As pointed out promptly by rikkimax [3] it doesn't rely on 
dynamic loading of modest but it links it during building. So you 
need to compile modest (not a big effort, is a plain C library 
without external dependencies) as prerequisite (check readme on 
github).


It is in its early days so any help / pull request / opened issue 
/ benchmark / suggestion are welcome.


Developed and tested on Linux. Should work fine on OSX. Never 
tried on windows.


GitHub: https://github.com/2night/arrogant/
Documentation: https://arrogant.dpldocs.info/index.html
Dub: https://arrogant.dub.pm

[1] http://lab.2night.it
[2] https://github.com/lexborisov/Modest
[3] https://github.com/2night/arrogant/issues/1

Andrea Fontana


Re: DasBetterC: Converting make.c to D

2018-06-11 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 11 June 2018 at 14:21:20 UTC, Mike Parker wrote:
Walter's latest post on -betterC is now on the blog. Here, he 
shows step-by-step an example of using -betterC to convert a 
real-world program, one small enough to describe in a blog 
post, from C to D.


The blog:
https://dlang.org/blog/2018/06/11/dasbetterc-converting-make-c-to-d/

Reddit:
https://www.reddit.com/r/programming/comments/8q9u5t/dasbetterc_converting_makec_to_d/


It seems that blog page is returned correctly by server but 
status is 404.


Andrea


Re: DasBetterC: Converting make.c to D

2018-06-11 Thread Andrea Fontana via Digitalmars-d-announce

On Monday, 11 June 2018 at 14:21:20 UTC, Mike Parker wrote:
Walter's latest post on -betterC is now on the blog. Here, he 
shows step-by-step an example of using -betterC to convert a 
real-world program, one small enough to describe in a blog 
post, from C to D.


The blog:
https://dlang.org/blog/2018/06/11/dasbetterc-converting-make-c-to-d/

Reddit:
https://www.reddit.com/r/programming/comments/8q9u5t/dasbetterc_converting_makec_to_d/


Link to "completed conversion" doesn't work.
https://github.com/DigitalMars/Compiler/blob/master/dm/src/make/make.c

Andrea


Re: D Meetup in Grenoble (FR) - Your presence required

2018-06-01 Thread Andrea Fontana via Digitalmars-d-announce

On Friday, 1 June 2018 at 13:20:20 UTC, Guillaume Piolat wrote:

[...]
Then chances you are already aware of a secret D barbecue 
meeting in the valley, next Thursday 7th of June.

[...]


It never happens in Italy. Not fair. :)


Re: Reserved 1.0.0

2018-05-16 Thread Andrea Fontana via Digitalmars-d-announce

On Wednesday, 16 May 2018 at 10:04:12 UTC, ANtlord wrote:

On Wednesday, 16 May 2018 at 08:38:05 UTC, Andrea Fontana wrote:
I released another small library on behalf of the company I 
work for (http://lab.2night.it). It is called "reserved", and 
it's a small library you can use to run your D 
webpages/service.


It is focused on simplicity (no dependencies) and fast setup. 
It use scgi to interface itself with nginx/apache/etc through 
unix sockets.


More info: http://code.dlang.org/packages/reserved

Comments are welcome.

Andrea Fontana


Good work! Unnfortunely documentation doesn't work for me
```
$ curl http://reserved.dpldocs.info/
The project build failed. copy/paste this link to adam so he 
can fix the bug.

```


Yes I see. I've sent a message to adam. Anyway doc generation 
works in local using his program.


git clone https://github.com/adamdruppe/adrdox.git
make
./doc2 -i /your/path/to/Reserved/source

Andrea




Reserved 1.0.0

2018-05-16 Thread Andrea Fontana via Digitalmars-d-announce
I released another small library on behalf of the company I work 
for (http://lab.2night.it). It is called "reserved", and it's a 
small library you can use to run your D webpages/service.


It is focused on simplicity (no dependencies) and fast setup. It 
use scgi to interface itself with nginx/apache/etc through unix 
sockets.


More info: http://code.dlang.org/packages/reserved

Comments are welcome.

Andrea Fontana



Re: mofile - gettext library for D

2018-05-10 Thread Andrea Fontana via Digitalmars-d-announce

On Thursday, 10 May 2018 at 10:57:25 UTC, FreeSlave wrote:
It was a real concern for me that there's no gettext-compatible 
package for D (at least I could not find one in dub registry), 
because it's kind of standard. So I made it myself.


mofile is similar to GNU gettext, but gettext and ngettext 
functions are implemented as member functions of MoFile struct.


This package features only .mo file parsing and getting 
translated messages (with support for plural forms). No 
bindtextdomain present (so no globals)


To produce .mo files you still use standard utilities like 
xgettext, msginit, msgmerge and msgfmt.


dub package: https://code.dlang.org/packages/mofile
github repo: https://github.com/FreeSlave/mofile


Good news!


  1   2   >