Hacker Newsnew | past | comments | ask | show | jobs | submit | gregoryc_'s commentslogin

People can be very rust-centric, but compilation of Rust (or Crystal) can take forever. The fast compilation of this "language" makes running scripts be like a scripting language, like Perl.

Will it be hard for me to find people who want to go in this direction?

I hope not.

This could handle all of your problems, and if you change your mindset a little bit to be willing to use this and to contribute to this project, all of your major programming difficulties might be solved. (And lets be honest, performance ALWAYS matters. Running a script in 5 hours vs 15 hours DOES matter, maybe not to your employer, but to you, it should.)

Thank you.


I have named this project and I have made a github for it.

I am looking for people to have a discussion about the direction of this.

After that, code formatting and things like that can be fixed.

What functions would you like to add to make this language even better?

String handling is a big problem for C. I handled that.

It would be nice to have 1) backticks like ruby or bash 2) blocks like ruby or crystal

So one could do something like Thread.new {

........

} in C

3) Maybe I can add list comprehensions? That would be cool. 4) I want to have good gsub variants

These are 4 things we have yet to implement.

What other methods would you guys like?

The source code is one file of 437 lines of Crystal code.

It is not hard to fork or modify.

There are no classes or anything complicated.



Depends on the functions used. memcpy is better than strcpy


I’m sure you meant something more along the lines of “strncpy is better than strcpy”.


Nah, strncpy is pretty bad and doesn't do something anyone really expects to want.

(strncpy doesn't 0-terminate when it hit max length, nor stop when it sees its first 0 in the source buffer; it acts almost entirely like memcpy except that it writes zeroes to the full length of the destination upon seeing a zero in the source. This is allegedly useful for populating fixed-sized buffers in historical Unix, and can plausibly be useful for writing out tar headers, but in practice very little code in the wild does anything observably different if you #define strncpy memcpy.)


memcpy is better than strncpy and strcpy ;)


The simplest solution is a preprocessor. The original founders of C made one, probably because they needed it. But adding another lightweight one is simple. C++ has bloat. Compilation time can be slow.

I realize that this is radical, but if people could work with me on this, this could solve all your problems, no really, it could solve all your problems. And if it can't solve all your problems yet, then modify it to

https://cboard.cprogramming.com/c-programming/181160-hi-i-ha...

There is no need for another language. Just use this

Gregory


Is your thing on GitHub?



I just made a github.


Check out https://cboard.cprogramming.com/c-programming/181160-hi-i-ha...

I posted this less than 24 hours ago.

This might be what you want, and there's no overhead at all.

It might actually speed up your code. 15x faster regex

I just made this. I'm looking for contributors :)


Has anyone checked out this?

You can use C, but with better syntax.

https://cboard.cprogramming.com/c-programming/181160-hi-i-ha...

I'm looking for contributors. :)


Just some advice, I think you'll struggle to gain traction without putting the source onto Github, as that is generally how people contribute :)



I currently use #define true 1 and #define false 0

Do you think I should remove that?


I'm happy to see that this went semi-viral. I got 2400 views in a few hours :)


Yes, I am aware that the style of the crystal script is not perfect yet.

That's a TODO


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: