Why do we need both Base.view and Base.@view?

We don’t. You could use view for everything. However, if you have code that already using normal indexing syntax, it’s much easier to put @view on it than to change the syntax entirely. Also, if the indexing uses end then it’s much simpler to use @view than try to write it with view. Example:

julia> a = rand(5, 5)
5×5 Matrix{Float64}:
 0.472674   0.983691   0.689607  0.920273   0.179599
 0.0837699  0.141811   0.184759  0.572521   0.387751
 0.184719   0.761248   0.581414  0.0863993  0.24077
 0.213946   0.0351995  0.295844  0.790204   0.514396
 0.334912   0.415638   0.688737  0.31583    0.180898

julia> @view a[2:end, 1:end-1]
4×4 view(::Matrix{Float64}, 2:5, 1:4) with eltype Float64:
 0.0837699  0.141811   0.184759  0.572521
 0.184719   0.761248   0.581414  0.0863993
 0.213946   0.0351995  0.295844  0.790204
 0.334912   0.415638   0.688737  0.31583

julia> view(a, 2:size(a, 1), 1:size(a, 2)-1)
4×4 view(::Matrix{Float64}, 2:5, 1:4) with eltype Float64:
 0.0837699  0.141811   0.184759  0.572521
 0.184719   0.761248   0.581414  0.0863993
 0.213946   0.0351995  0.295844  0.790204
 0.334912   0.415638   0.688737  0.31583
13 Likes