veer66

joined 2 years ago
 

Is there a programming language specifically designed for interacting with SQL databases that avoids the need for Object-Relational Mappers (ORMs) to solve impedance mismatch from the start?

If such a language exists, would it be a viable alternative to PHP or Go for a web backend project?

 

Removing last will break my library.

#[macro_export]
macro_rules! list {
    () => {
	None
    };
    [ $x:expr, $( $y:expr ),* ] => {
	{
	    let mut first = cons($x, &None);
	    let mut last = &mut first;
	    $(
		let yet_another = cons($y, &None);
		if let Some(ref mut last_inner) = last {
		    let last_mut = Rc::get_mut(last_inner).unwrap();
		    last_mut.cdr = yet_another;
		    last = &mut last_mut.cdr;
		}
	    )*
	    first
	}
    }
}

This macro works as I expected because it can pass these tests.

    #[test]
    fn dolist() {
        let mut v = vec![];
        dolist!((i &cons(10, &list![20, 30, 40])) {
            v.push(i.car);
        });
        assert_eq!(v, vec![10, 20, 30, 40]);
    }

    #[test]
    fn turn_list_to_vec() {
        assert_eq!(list_to_vec(&list![1, 2, 3]), vec![1, 2, 3]);
    }

    #[test]
    fn count_elements() {
        assert_eq!(list_len(&list![10, 20, 30]), 3);
    }

However I got the warning "value assigned to last is never read."

How can I avoid this warning?

P.S. Full code

 

I want to demo my program on the web.

 

How did they implement allocate a new cons cell?

 

Will they keep patching old version of PHP?

[–] veer66@lemmy.one 1 points 2 years ago

Such files are relatively easy to create and read, as they are basically shell scripts.

I agree. I lean towards writing in Bash script instead of learning yet another special-purpose language. Nonetheless, the RPM spec doesn't seem to pose any additional difficulty.

[–] veer66@lemmy.one 1 points 2 years ago

The immutability and configuration of Nix seems so appealing but at this point I’m really comfortable with Arch and it does everything I need in a pretty sane way so idk if I’d switch anytime soon.

Back in 2018, I had the experience of using NixOS. At that time, I noticed that the Nix language had a striking resemblance to Haskell, which stirred up feelings of anxiety within me.

[–] veer66@lemmy.one 1 points 2 years ago

One is that it’s a shell script,

Using Bash sounds convincing to me.

[–] veer66@lemmy.one 2 points 2 years ago (3 children)

Do you also dislike openSUSE and openMandriva?

 

I anticipate that my application might encounter an issue that requires debugging or fixing using nREPL, but I'm concerned about the potential performance impact of using nREPL.

view more: ‹ prev next ›