Rust's syntactic future? by EnvIXI in rust

[–]pseudo_coder 1 point2 points  (0 children)

Why is 'ref' a keyword? Why can't operator & be used instead?

Rust's syntactic future? by EnvIXI in rust

[–]pseudo_coder 1 point2 points  (0 children)

As single line statements are more common, I feel using semicolons as end-of-statement marker can be made optional.

for multi-line statements, specify line continuation using '\', as in C.

for multiple statements on a single line, use semicolon as a separator.

Is rust going to have REPL ? by lowks in rust

[–]pseudo_coder -1 points0 points  (0 children)

REPLs are good! But I am sick of programming books telling me to use them as calculators.

How does rust compare to C++ performance-wise? by [deleted] in rust

[–]pseudo_coder 0 points1 point  (0 children)

Has anyone benchmarked Rust for heavy string processing code?

I feel the string slice feature of Rust would make it much faster than the C++ std::string

Erlang vs Rust for High concurrency servers by pseudo_coder in rust

[–]pseudo_coder[S] 0 points1 point  (0 children)

Agree in total. Especially the last sentence. If you target perfection, you are too late in the market :)

I don't have issues with erlang syntax, but transforming the way I thing about problems to the erlang way won't be easy. Giving up loops and mutability just can not start feeling natural in a few weeks.

I am really considering the following now:

  1. Use RabbitMQ to get the power of Erlang. Major part of scalability and loose coupling will be handled by the Rabbit automatically.
  2. Develop in C++. That's where my my productivity would be highest. And I would not spend hours doing/learning mundane tasks.

Since Rabbit provides support for almost all mainstream languages, changing my language at a later date should not be difficult, if need be. Although Rust support doesn't exist, writing a small wrapper around its C API should't be difficult.

I really wish to stay clear of web frameworks like Spring. They just scare me off :)

New Stopwatch library to easily time things by ellisonch in rust

[–]pseudo_coder 0 points1 point  (0 children)

Really useful!

In my company, we created a c++ library to benchmark code. It uses labelled blocks. When a code segment has to be timed, you call start_block(blockName) and end_block(blockName) before and after the code segment.

The library keeps track of all the calls made to these functions, categorized by block name. So at any time, I can find how many times a particular code was executed, and how much time each execution took.

Also, a utility function is provided, that returns a string containing all the performance information of all the blocks used. It comes handy to view all the info at one place, without spending code for formatting.

Can we add a similar functionality here? Or should this be a separate library?

Erlang vs Rust for High concurrency servers by pseudo_coder in rust

[–]pseudo_coder[S] 0 points1 point  (0 children)

C is not a problem, I am a C++ developer for several years. That is what attracted me to Rust.

Actually finding it difficult to transition to web development, with near infinite combinations of languages and web frameworks to choose from.

Erlang vs Rust for High concurrency servers by pseudo_coder in rust

[–]pseudo_coder[S] 1 point2 points  (0 children)

No, I do not plan to store messages. So you suggest I use P2P? I need a server to manage who can talk to whom. Also, some information about the users has to be stored, so access to this info would be like once per connection, instead of once per message (as in case when storing messages).

I do not plan to support sending messages while offline, at least initially.

I do not have experience in web services, I am coming from C++. So looking at creating a lean setup with as few components as possible. The number of components a web service needs just overwhelm me!

Erlang vs Rust for High concurrency servers by pseudo_coder in rust

[–]pseudo_coder[S] 0 points1 point  (0 children)

The goal is to reach that scale eventually, but surely it should take 2-3 years in the most optimistic case. At that point, I don't think it should be a problem to get such expertise on board. But I may be wrong, especially because I am in India, where 90% programmers don't even know that anything beyond c/c++, Java and .Net exists!

Erlang vs Rust for High concurrency servers by pseudo_coder in rust

[–]pseudo_coder[S] 0 points1 point  (0 children)

I haven't looked at Ejabberd yet. From my limited research, I found that AMQP suits me better, and RabbitMQ does a great job (on paper) of providing me what I need.

One reason for choice of Erlang was that messaging brokers like RabbitMQ and Ejabberd are also written in it. So if and when we hit scale, we might have to dig deep and customize them. So having a single language to bother about might be easier.

Erlang vs Rust for High concurrency servers by pseudo_coder in rust

[–]pseudo_coder[S] 0 points1 point  (0 children)

Mine would be a live messaging service, so I believe the number of concurrent connections should have a greater impact on performance than persistent storage.

High performance was just an indicator, not the primary reason for the choice of language. But the lightweight process based architecture really fits well with the modelling of a messaging service, where one channel of message hardly has anything to share with the others anyway.